Skip to content

Commit bdd2768

Browse files
desktop navbar added
1 parent bbcc524 commit bdd2768

File tree

7 files changed

+81
-5
lines changed

7 files changed

+81
-5
lines changed

components/navbar.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import Image from 'next/image';
2+
import Link from 'next/link';
3+
4+
const Navbar = () => {
5+
return (
6+
<div className="nav_container">
7+
<nav>
8+
<Image src="/nav_logo.png" alt="logo" width={240} height={36} />
9+
<div className="right_contents">
10+
<div className="nav_links">
11+
<Link href="/">Components</Link>
12+
</div>
13+
<div className="nav_links">
14+
<Link href="/">Documentation</Link>
15+
</div>
16+
<div className="nav_links">
17+
<Link href="/">About Us</Link>
18+
</div>
19+
</div>
20+
</nav>
21+
</div>
22+
);
23+
};
24+
25+
export default Navbar;

pages/_app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import '../styles/globals.css'
2+
import '../styles/components/navbar_style.css';
23

34
function MyApp({ Component, pageProps }) {
45
return <Component {...pageProps} />

pages/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
import Head from "next/head";
22

3+
import Navbar from "../components/navbar";
4+
35
export default function Home() {
46
return (
57
<div>
68
<Head>
7-
<title>Tailwind CSS Components</title>
8-
<meta name="description" content="Generated by create next app" />
9+
<title>Tailwind Bootstrap</title>
10+
<meta name="description" content="TailwindCSS ui component bootstrap" />
911
<link rel="icon" href="/favicon.ico" />
1012
</Head>
1113

1214
<div className=" bg-slate-100 min-h-screen">
13-
<nav className="flex justify-between items-center bg-teal-500 py-3 px-8">
14-
<div className="font-bold text-2xl">VK</div>
15-
</nav>
15+
<Navbar />
1616
</div>
1717
</div>
1818
);

public/nav_logo.png

12.5 KB
Loading

public/nav_logo_transparent.png

20.1 KB
Loading

styles/components/navbar_style.css

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
.nav_container {
2+
width: 100%;
3+
background: linear-gradient(
4+
90deg,
5+
rgb(2, 72, 248) 0%,
6+
hsla(217, 97%, 47%, 0.5) 30%,
7+
hsla(294, 98%, 50%, 0.5) 50%,
8+
rgb(226, 3, 251) 100%
9+
);
10+
padding: 16px 0 16px 0;
11+
color: white;
12+
}
13+
14+
nav {
15+
width: 75%;
16+
margin: 0 auto;
17+
display: flex;
18+
justify-content: space-between;
19+
align-items: center;
20+
}
21+
22+
.right_contents {
23+
display: flex;
24+
justify-content: end;
25+
align-items: center;
26+
gap: 72px;
27+
font-weight: bold;
28+
font-size: large;
29+
color: white;
30+
}
31+
32+
.nav_links {
33+
padding: 12px;
34+
}
35+
36+
.nav_links:hover,
37+
.nav_links:focus {
38+
/* text-decoration: underline;
39+
text-underline-offset: 8px;
40+
text-underline-position: above; */
41+
background-color: rgba(137, 43, 226, 0.501);
42+
border-radius: 8px;
43+
}

styles/globals.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
@tailwind base;
22
@tailwind components;
33
@tailwind utilities;
4+
5+
/* Google font family for poppins */
6+
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
7+
8+
* {
9+
font-family: 'Poppins', sans-serif;
10+
}

0 commit comments

Comments
 (0)