Skip to content

Commit 06e3492

Browse files
committed
chore: Init
0 parents  commit 06e3492

19 files changed

+2824
-0
lines changed

.editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false

.gitignore

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# next.js
12+
/.next/
13+
/out/
14+
15+
# production
16+
/build
17+
18+
# misc
19+
.DS_Store
20+
*.pem
21+
22+
# debug
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
27+
# local env files
28+
.env.local
29+
.env.development.local
30+
.env.test.local
31+
.env.production.local
32+
33+
# vercel
34+
.vercel

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v12.13.0

.prettierrc.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
tabWidth: 2,
3+
singleQuote: true,
4+
trailingComma: 'all',
5+
};

README.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
2+
3+
## Getting Started
4+
5+
First, run the development server:
6+
7+
```bash
8+
npm run dev
9+
# or
10+
yarn dev
11+
```
12+
13+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
14+
15+
You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file.
16+
17+
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`.
18+
19+
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
20+
21+
## Learn More
22+
23+
To learn more about Next.js, take a look at the following resources:
24+
25+
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
26+
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
27+
28+
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
29+
30+
## Deploy on Vercel
31+
32+
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
33+
34+
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.

components/cards/CardFlatted.jsx

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import Image from 'next/image';
2+
3+
function CardFlatted({ props }) {
4+
return (
5+
<div className="card-grid">
6+
{props &&
7+
props.length &&
8+
props.map((prop, i) => {
9+
return (
10+
<a href={prop.url} className="card-flatted" key={i}>
11+
<div className="lg:flex sm:block">
12+
<div className="lg:w-1/12 w-100 contents">
13+
<Image
14+
src={prop.imageUrl}
15+
alt={prop.title}
16+
width="640"
17+
height="640"
18+
layout="intrinsic"
19+
/>
20+
</div>
21+
<div className="lg:w-11/12 w-100 p-3">
22+
<h5
23+
className="text-2xl"
24+
dangerouslySetInnerHTML={{ __html: prop.title }}
25+
></h5>
26+
<p
27+
className="py-3"
28+
dangerouslySetInnerHTML={{ __html: prop.description }}
29+
></p>
30+
<span className="block text-right text-gray-400 text-sm pt-3">
31+
{prop.published}
32+
</span>
33+
</div>
34+
</div>
35+
</a>
36+
);
37+
})}
38+
</div>
39+
);
40+
}
41+
42+
export default CardFlatted;

components/cards/CardRounded.jsx

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
function CardRounded({ props }) {
2+
return (
3+
<div className="card-grid">
4+
{props &&
5+
props.length &&
6+
props.map((prop, i) => {
7+
return (
8+
<a href={prop.url} className="card-rounded" key={i}>
9+
<h3
10+
className="text-4xl"
11+
dangerouslySetInnerHTML={{ __html: prop.title }}
12+
></h3>
13+
<p dangerouslySetInnerHTML={{ __html: prop.description }}></p>
14+
</a>
15+
);
16+
})}
17+
</div>
18+
);
19+
}
20+
21+
export default CardRounded;

jsconfig.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"compilerOptions": {
3+
"baseUrl": ".",
4+
"paths": {
5+
"~*": ["./*"],
6+
"@*": ["./*"],
7+
"~/*": ["./*"],
8+
"@/*": ["./*"],
9+
"~~/*": ["./*"],
10+
"@@/*": ["./*"],
11+
}
12+
},
13+
"exclude": ["node_modules", ".next", ".vercel", ".vscode", "dist"]
14+
}

next.config.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
images: {
3+
domains: ['picsum.photos'], // (https://picsum.photos/300/300)
4+
},
5+
};

package.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "nextjs-tailwindcss-website",
3+
"version": "0.1.0",
4+
"private": true,
5+
"scripts": {
6+
"dev": "next dev",
7+
"build": "next build",
8+
"start": "next start"
9+
},
10+
"dependencies": {
11+
"next": "10.1.3",
12+
"react": "17.0.2",
13+
"react-dom": "17.0.2"
14+
},
15+
"devDependencies": {
16+
"@tailwindcss/jit": "^0.1.18",
17+
"autoprefixer": "^10.2.5",
18+
"postcss": "^8.2.9",
19+
"tailwindcss": "^2.1.1"
20+
}
21+
}

pages/_app.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import "@styles/globals.css";
2+
import "tailwindcss/tailwind.css";
3+
4+
function MyApp({ Component, pageProps }) {
5+
return <Component {...pageProps} />;
6+
}
7+
8+
export default MyApp;

pages/api/hello.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
2+
3+
export default (req, res) => {
4+
res.status(200).json({ name: 'John Doe' })
5+
}

pages/index.js

+123
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
import Head from 'next/head';
2+
3+
/* components */
4+
import CardRounded from '@components/cards/CardRounded';
5+
import CardFlatted from '@components/cards/CardFlatted';
6+
7+
export default function Home() {
8+
const cardHomeRounded = [
9+
{
10+
title: 'Documentation &rarr;',
11+
description: 'Find in-depth information about Next.js features and API.',
12+
url: 'https://nextjs.org/docs',
13+
},
14+
{
15+
title: 'Learn &rarr;',
16+
description: 'Learn about Next.js in an interactive course with quizzes!',
17+
url: 'https://nextjs.org/learn',
18+
},
19+
{
20+
title: 'Examples &rarr;',
21+
description: 'Discover and deploy boilerplate example Next.js projects.',
22+
url: 'https://github.com/vercel/next.js/tree/master/examples',
23+
},
24+
{
25+
title: 'Deploy &rarr;',
26+
description:
27+
'Instantly deploy your Next.js site to a public URL with Vercel.',
28+
url:
29+
'https://vercel.com/new?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app',
30+
},
31+
{
32+
title: 'Community &rarr;',
33+
description:
34+
'Involved in community with contribute and Next.js community modules',
35+
url: 'https://github.com/vercel/next.js/discussions',
36+
},
37+
{
38+
title: 'Source Code &rarr;',
39+
description: 'Get Next.js open source on GitHub ',
40+
url: 'https://github.com/vercel/next.js',
41+
},
42+
];
43+
const cardHomeFlatted = [
44+
{
45+
title: 'Documentation &rarr;',
46+
description: 'Find in-depth information about Next.js features and API.',
47+
url: 'https://nextjs.org/docs',
48+
imageUrl: 'https://picsum.photos/300/300',
49+
published: '20/12/2000',
50+
},
51+
{
52+
title: 'Learn &rarr;',
53+
description: 'Learn about Next.js in an interactive course with quizzes!',
54+
url: 'https://nextjs.org/learn',
55+
imageUrl: 'https://picsum.photos/300/300',
56+
published: '20/12/2000',
57+
},
58+
{
59+
title: 'Examples &rarr;',
60+
description: 'Discover and deploy boilerplate example Next.js projects.',
61+
url: 'https://github.com/vercel/next.js/tree/master/examples',
62+
imageUrl: 'https://picsum.photos/300/300',
63+
published: '20/12/2000',
64+
},
65+
{
66+
title: 'Deploy &rarr;',
67+
description:
68+
'Instantly deploy your Next.js site to a public URL with Vercel.',
69+
url:
70+
'https://vercel.com/new?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app',
71+
imageUrl: 'https://picsum.photos/300/300',
72+
published: '20/12/2000',
73+
},
74+
{
75+
title: 'Community &rarr;',
76+
description:
77+
'Involved in community with contribute and Next.js community modules',
78+
url: 'https://github.com/vercel/next.js/discussions',
79+
imageUrl: 'https://picsum.photos/300/300',
80+
published: '20/12/2000',
81+
},
82+
{
83+
title: 'Source Code &rarr;',
84+
description: 'Get Next.js open source on GitHub ',
85+
url: 'https://github.com/vercel/next.js',
86+
imageUrl: 'https://picsum.photos/300/300',
87+
published: '20/12/2000',
88+
},
89+
];
90+
return (
91+
<>
92+
<Head>
93+
<title>Create Next App</title>
94+
<link rel="icon" href="/favicon.ico" />
95+
</Head>
96+
<main className="py-12">
97+
<div className="container mx-auto px-4 sm:px-2">
98+
<h1 className="text-7xl">
99+
Welcome to <a href="https://nextjs.org">Next.js!</a>
100+
</h1>
101+
102+
<p>
103+
Get started by editing <code className="">pages/index.js</code>
104+
</p>
105+
</div>
106+
<div className="container mx-auto px-4 sm:px-2">
107+
<CardRounded props={cardHomeRounded} />
108+
<CardFlatted props={cardHomeFlatted} />
109+
</div>
110+
</main>
111+
<footer className="footer">
112+
<a
113+
href="https://vercel.com?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
114+
target="_blank"
115+
rel="noopener noreferrer"
116+
>
117+
Powered by{' '}
118+
<img src="/vercel.svg" alt="Vercel Logo" className="w-28" />
119+
</a>
120+
</footer>
121+
</>
122+
);
123+
}

postcss.config.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
plugins: {
3+
"@tailwindcss/jit": {},
4+
tailwindcss: {},
5+
autoprefixer: {},
6+
},
7+
};

public/favicon.ico

14.7 KB
Binary file not shown.

public/vercel.svg

+4
Loading

styles/globals.css

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;
4+
5+
@layer base {
6+
html,
7+
body {
8+
padding: 0;
9+
margin: 0;
10+
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
11+
Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
12+
}
13+
}
14+
15+
@layer components {
16+
.footer {
17+
@apply flex justify-center align-middle py-4;
18+
}
19+
.card-grid {
20+
@apply grid grid-cols-1 sm:grid-cols-2 gap-4 py-20;
21+
}
22+
.card-rounded {
23+
@apply shadow-lg py-12 px-4 rounded-md;
24+
}
25+
.card-rounded:hover {
26+
@apply shadow-xl;
27+
}
28+
.card-flatted {
29+
@apply shadow-lg p-0 mb-2;
30+
}
31+
.card-flatted:hover {
32+
@apply shadow-xl;
33+
}
34+
}

0 commit comments

Comments
 (0)