Last Minute Conf

This commit is contained in:
Jyotirmoy Bandyopadhayaya 2022-01-31 23:04:21 +05:30
parent 653dd08052
commit 1bfaabcccb
10 changed files with 145 additions and 131 deletions

1
frontend/.prettierignore Normal file
View File

@ -0,0 +1 @@
.next

5
frontend/.prettierrc Normal file
View File

@ -0,0 +1,5 @@
{
"tabWidth": 3,
"semi": false,
"singleQuote": true
}

View File

@ -1,3 +1,3 @@
module.exports = {
reactStrictMode: true,
reactStrictMode: true,
}

View File

@ -1,34 +1,37 @@
{
"name": "url-minify",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"next": "12.0.9",
"react": "17.0.2",
"react-dom": "17.0.2"
},
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/bravo68web/url-minify.git"
},
"keywords": [
"url-minify",
"short-link",
"generator",
"nextjs",
"frontend",
"api",
"rest"
],
"author": "BRAVO68WEB",
"bugs": {
"url": "https://github.com/bravo68web/url-minify/issues"
},
"homepage": "https://github.com/bravo68web/url-minify#readme"
"name": "url-minify",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"prettier": "prettier --write ."
},
"dependencies": {
"next": "12.0.9",
"react": "17.0.2",
"react-dom": "17.0.2"
},
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/bravo68web/url-minify.git"
},
"keywords": [
"url-minify",
"short-link",
"generator",
"nextjs",
"frontend",
"api",
"rest"
],
"author": "BRAVO68WEB",
"bugs": {
"url": "https://github.com/bravo68web/url-minify/issues"
},
"homepage": "https://github.com/bravo68web/url-minify#readme",
"devDependencies": {
"prettier": "2.5.1"
}
}

View File

@ -1,7 +1,7 @@
import '../styles/globals.css'
function MyApp({ Component, pageProps }) {
return <Component {...pageProps} />
return <Component {...pageProps} />
}
export default MyApp

View File

@ -1,5 +1,5 @@
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
export default function handler(req, res) {
res.status(200).json({ name: 'John Doe' })
res.status(200).json({ name: 'John Doe' })
}

View File

@ -1,33 +1,33 @@
import { useState } from "react";
import Head from "next/head";
import styles from "../styles/Home.module.css";
import { useState } from 'react'
import Head from 'next/head'
import styles from '../styles/Home.module.css'
export default function Home() {
const [shortUrl, setShortUrl] = useState(null);
const [longURL, setLongURL] = useState("");
return (
<div className={styles.container}>
<Head>
<title>URL MiniFy</title>
<link rel="icon" href="/favicon.ico" />
</Head>
const [shortUrl, setShortUrl] = useState(null)
const [longURL, setLongURL] = useState('')
return (
<div className={styles.container}>
<Head>
<title>URL MiniFy</title>
<link rel="icon" href="/favicon.ico" />
</Head>
<main className={styles.main}>
<h1 className={styles.title}>Welcome to URL MiniFy</h1>
<main className={styles.main}>
<h1 className={styles.title}>Welcome to URL MiniFy</h1>
<div className={styles.card}>
<h2>Paste the URL to be Shortened</h2>
<form className="input">
<input
name="longURL"
type="text"
value={longURL}
onChange={(evt) => setLongURL(evt.target.value)}
/>
<button type="submit">Minify</button>
</form>
</div>
</main>
</div>
);
<div className={styles.card}>
<h2>Paste the URL to be Shortened</h2>
<form className="input">
<input
name="longURL"
type="text"
value={longURL}
onChange={(evt) => setLongURL(evt.target.value)}
/>
<button type="submit">Minify</button>
</form>
</div>
</main>
</div>
)
}

View File

@ -1,116 +1,116 @@
.container {
padding: 0 2rem;
padding: 0 2rem;
}
.main {
min-height: 100vh;
padding: 4rem 0;
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
min-height: 100vh;
padding: 4rem 0;
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.footer {
display: flex;
flex: 1;
padding: 2rem 0;
border-top: 1px solid #eaeaea;
justify-content: center;
align-items: center;
display: flex;
flex: 1;
padding: 2rem 0;
border-top: 1px solid #eaeaea;
justify-content: center;
align-items: center;
}
.footer a {
display: flex;
justify-content: center;
align-items: center;
flex-grow: 1;
display: flex;
justify-content: center;
align-items: center;
flex-grow: 1;
}
.title a {
color: #0070f3;
text-decoration: none;
color: #0070f3;
text-decoration: none;
}
.title a:hover,
.title a:focus,
.title a:active {
text-decoration: underline;
text-decoration: underline;
}
.title {
margin: 0;
line-height: 1.15;
font-size: 4rem;
margin: 0;
line-height: 1.15;
font-size: 4rem;
}
.title,
.description {
text-align: center;
text-align: center;
}
.description {
margin: 4rem 0;
line-height: 1.5;
font-size: 1.5rem;
margin: 4rem 0;
line-height: 1.5;
font-size: 1.5rem;
}
.code {
background: #fafafa;
border-radius: 5px;
padding: 0.75rem;
font-size: 1.1rem;
font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono,
Bitstream Vera Sans Mono, Courier New, monospace;
background: #fafafa;
border-radius: 5px;
padding: 0.75rem;
font-size: 1.1rem;
font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono,
Bitstream Vera Sans Mono, Courier New, monospace;
}
.grid {
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
max-width: 800px;
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
max-width: 800px;
}
.card {
margin: 1rem;
padding: 1.5rem;
text-align: left;
color: inherit;
text-decoration: none;
border: 1px solid #eaeaea;
border-radius: 10px;
transition: color 0.15s ease, border-color 0.15s ease;
max-width: 300px;
margin: 1rem;
padding: 1.5rem;
text-align: left;
color: inherit;
text-decoration: none;
border: 1px solid #eaeaea;
border-radius: 10px;
transition: color 0.15s ease, border-color 0.15s ease;
max-width: 300px;
}
.card:hover,
.card:focus,
.card:active {
color: #0070f3;
border-color: #0070f3;
color: #0070f3;
border-color: #0070f3;
}
.card h2 {
margin: 0 0 1rem 0;
font-size: 1.5rem;
margin: 0 0 1rem 0;
font-size: 1.5rem;
}
.card p {
margin: 0;
font-size: 1.25rem;
line-height: 1.5;
margin: 0;
font-size: 1.25rem;
line-height: 1.5;
}
.logo {
height: 1em;
margin-left: 0.5rem;
height: 1em;
margin-left: 0.5rem;
}
@media (max-width: 600px) {
.grid {
width: 100%;
flex-direction: column;
}
.grid {
width: 100%;
flex-direction: column;
}
}

View File

@ -1,16 +1,16 @@
html,
body {
padding: 0;
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
padding: 0;
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
}
a {
color: inherit;
text-decoration: none;
color: inherit;
text-decoration: none;
}
* {
box-sizing: border-box;
box-sizing: border-box;
}

View File

@ -126,6 +126,11 @@ postcss@8.4.5:
picocolors "^1.0.0"
source-map-js "^1.0.1"
prettier@2.5.1:
version "2.5.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.5.1.tgz#fff75fa9d519c54cf0fce328c1017d94546bc56a"
integrity sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==
react-dom@17.0.2:
version "17.0.2"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.2.tgz#ecffb6845e3ad8dbfcdc498f0d0a939736502c23"