Skip to content

Commit 2f8dfad

Browse files
committed
Theme Changes
1 parent a32c186 commit 2f8dfad

File tree

5 files changed

+34
-8
lines changed

5 files changed

+34
-8
lines changed

src/components/Navbar/index.jsx

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import { useState } from "react";
1+
import { useEffect, useState } from "react";
22
import { Hamburger } from "lucide-react";
33

44
import "./style.css";
55

66
export function Navbar() {
77
const [active, setActive] = useState(false);
8+
const [navTop, setNavTop] = useState(true);
89

910
const links = [
1011
{
@@ -41,8 +42,28 @@ export function Navbar() {
4142
},
4243
];
4344

45+
useEffect(() => {
46+
const handleScroll = () => {
47+
const rootElement = document.getElementById("root");
48+
setNavTop(rootElement.scrollTop === 0);
49+
};
50+
51+
const rootElement = document.getElementById("root");
52+
rootElement.addEventListener("scroll", handleScroll);
53+
handleScroll();
54+
55+
return () => {
56+
rootElement.removeEventListener("scroll", handleScroll);
57+
};
58+
}, []);
59+
4460
return (<>
45-
<div className="navbar">
61+
<div
62+
className={[
63+
"navbar",
64+
navTop ? "nav-top" : "",
65+
].join(" ")}
66+
>
4667
<div
4768
onClick={() => setActive(!active)}
4869
className={[

src/components/Navbar/style.css

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,13 @@
3131
opacity: 0.3;
3232
}
3333

34+
.nav-top .nav-links,
3435
.nav-links:hover {
3536
opacity: 1;
3637
}
3738

3839
.nav-link {
39-
color: white;
40+
color: var(--color-gradient);
4041
text-decoration: none;
4142
cursor: pointer;
4243
position: relative;
@@ -52,7 +53,7 @@
5253
display: block;
5354
width: 0.125rem;
5455
height: 1rem;
55-
background: white;
56+
background: var(--color-gradient);
5657
transition: width 0.3s ease-in-out;
5758
}
5859

src/components/Section/style.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636

3737
.section-name {
3838
background: var(--gradient);
39+
color: var(--color-gradient);
3940
display: flex;
4041
padding: 1rem 2rem;
4142
border-radius: 1rem;
@@ -48,7 +49,7 @@
4849
.section-description {
4950
font-size: 1.5rem;
5051
text-align: left;
51-
color: var(--text-secondary);
52+
color: var(--color-text);
5253
line-height: 1.5;
5354
font-weight: 200;
5455
display: flex;

src/styles/index.css

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
box-sizing: border-box;
99
cursor: inherit;
1010
background: transparent;
11-
color: var(--color-white);
11+
color: var(--color-text);
1212
user-select: none;
1313
-webkit-user-select: none;
1414
transition:
@@ -36,8 +36,9 @@ html, body, #root {
3636
height: 100%;
3737
cursor: default;
3838
background-color: var(--color-background);
39-
color: var(--color-white);
39+
color: var(--color-text);
4040
overflow-y: auto;
41+
transition: none;
4142
font-family:
4243
"Lexend",
4344
"JetBrains Mono",

src/styles/variables.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
--color-success: #4CAF50;
1212
--color-warning: #FF9800;
1313

14-
--color-background: #111111;
14+
--color-background: #E0E0E0;
15+
--color-text: #111111;
16+
--color-gradient: #FFFFFF;
1517

1618
--gradient: linear-gradient(
1719
to bottom right,

0 commit comments

Comments
 (0)