-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
161 lines (126 loc) · 4.68 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
const menu = document.querySelector(".menu");
const navbar = document.querySelector(".navbar ul");
menu.addEventListener('click', () => {
menu.classList.toggle('active');
navbar.classList.toggle('display');
});
const themeToggleButton = document.getElementById('theme-toggle');
const body = document.body;
const Info = document.querySelector('.info');
const icon = themeToggleButton.querySelector('i');
const nav = document.querySelector("nav");
const serviceBoxes = document.querySelectorAll(".service-box");
const road = document.querySelector("#roadmap");
const contact = document.querySelector(".contact-section");
const TextContainer = document.querySelector(".details-container p")
const roadmapItem = document.querySelectorAll(".roadmap-item ");
const ProjectsP = document.querySelectorAll(".project");
const form = document.querySelector("form");
const Input = document.querySelectorAll("form input");
const Textarea = document.querySelector("form textarea");
const footer = document.querySelector("footer");
const Status = document.querySelector('#Status h1 span a')
themeToggleButton.addEventListener('click', function () {
body.classList.toggle('dark-mode');
if (body.classList.contains('dark-mode')) {
// Dark mode styles
nav.style.backgroundColor = "black";
body.style.backgroundColor = 'black';
body.style.color = 'white';
Info.style.color = "white";
serviceBoxes.forEach(service => {
service.style.backgroundColor = "#121212";
service.style.color = "white";
});
TextContainer.forEach(text => {
text.style.color = "white";
});
form.style.backgroundColor = "#1e1e1e";
Input.forEach(input => {
input.style.backgroundColor = "#2a2a2a";
});
Textarea.style.backgroundColor = "#2a2a2a";
document.querySelector('#projects').style.backgroundColor = "#1e1e1e";
ProjectsP.forEach(project => {
project.style.backgroundColor = "#2a2a2a";
project.style.color = "white";
});
footer.style.backgroundColor = "#121212";
footer.style.color = "white";
roadmapItem.forEach(item => {
item.style.backgroundColor = "#121212";
item.style.color = "white";
});
Status.style.color = "white";
road.style.backgroundColor = "#1f1f1f";
contact.style.backgroundColor = "black";
icon.classList.remove('fa-moon');
icon.classList.add('fa-sun');
icon.style.color = "white"
}
else {
// Light mode styles
nav.style.backgroundColor = "white";
body.style.backgroundColor = 'white';
body.style.color = 'black';
Info.style.color = "black";
serviceBoxes.forEach(service => {
service.style.backgroundColor = "white";
service.style.color = "#121212";
});
TextContainer.forEach(text => {
text.style.color = "black";
});
form.style.backgroundColor = "#f0f0f0";
Input.forEach(input => {
input.style.backgroundColor = "white";
});
Textarea.style.backgroundColor = "white";
document.querySelector('#projects').style.backgroundColor = "white";
ProjectsP.forEach(project => {
project.style.backgroundColor = "#f0f0f0";
project.style.color = "black";
});
footer.style.backgroundColor = "white";
footer.style.color = "black";
roadmapItem.forEach(item => {
item.style.backgroundColor = "#";
item.style.color = "#333333";
});
Status.style.color = "blue";
road.style.backgroundColor = "white";
contact.style.backgroundColor = "white";
icon.classList.remove('fa-sun');
icon.classList.add('fa-moon');
icon.style.color = "#147818"
}
});
const yearElement = document.getElementById('current-year');
const today = new Date();
yearElement.textContent = today.getFullYear();
document.addEventListener("DOMContentLoaded", () => {
gsap.from("#about", {
transform: "translateX(-100%)",
y: -100,
opacity: 0,
duration: 0.6,
scrollTrigger: {
trigger: "#about",
start: "top 80%",
end: "top 30%",
scrub: 1,
}
});
gsap.from("#roadmap", {
transform: "translateX(-100%)",
y: -100,
opacity: 0,
duration: 0.6,
scrollTrigger: {
trigger: "#about",
start: "top 80%",
end: "top 30%",
scrub: 1,
}
});
});