-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
214 lines (197 loc) · 5.18 KB
/
app.js
File metadata and controls
214 lines (197 loc) · 5.18 KB
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
const navMenuOne = document.getElementById("menu_icon_one");
const navMenuTwo = document.getElementById("menu_icon_two");
const menu_icon = document.getElementById("menu_icon");
const element = document.getElementById("element");
const showingSkill = document.getElementById("Skills_content_show");
const header = document.getElementById("header");
let flg = 0;
menu_icon.addEventListener("click", () => {
if (flg == 0) {
header.style.left = "0%";
navMenuOne.style.display = "none";
navMenuTwo.style.display = "block";
flg = 1;
} else {
header.style.left = "-100%";
flg = 0;
navMenuOne.style.display = "block";
navMenuTwo.style.display = "none";
}
});
Shery.mouseFollower({
//Parameters are optional.
skew: true,
ease: "cubic-bezier(0.23, 1, 0.320, 1)",
duration: 1,
});
Shery.makeMagnet("header ul li" /* Element to target.*/, {
//Parameters are optional.
ease: "cubic-bezier(0.23, 1, 0.320, 1)",
duration: 0.9,
});
Shery.makeMagnet("svg" /* Element to target.*/, {
//Parameters are optional.
ease: "cubic-bezier(0.23, 1, 0.320, 1)",
duration: 0.9,
});
Shery.makeMagnet(".s_icons ul li" /* Element to target.*/, {
//Parameters are optional.
ease: "cubic-bezier(0.23, 1, 0.320, 1)",
duration: 0.9,
});
Shery.makeMagnet(".menu_icon" /* Element to target.*/, {
//Parameters are optional.
ease: "cubic-bezier(0.23, 1, 0.320, 1)",
duration: 0.9,
});
Shery.makeMagnet(".name" /* Element to target.*/, {
//Parameters are optional.
ease: "cubic-bezier(0.23, 1, 0.320, 1)",
duration: 0.9,
});
Shery.textAnimate(".name" /* Element to target.*/, {
//Parameters are optional.
style: 1,
y: 10,
delay: 0.1,
duration: 2,
ease: "cubic-bezier(0.23, 1, 0.320, 1)",
multiplier: 0.1,
});
document.addEventListener("DOMContentLoaded", () => {
async function fetchData(type = "skills") {
try {
const response = await fetch("skills.json"); // Await the fetch call
const data = await response.json(); // Await the json parsing
return data;
} catch (error) {
console.error("Error fetching data:", error);
return []; // Return an empty array in case of error
}
}
// Call fetchData function to start fetching data
fetchData().then((result) => {
const formattedData = result
.map(
(skill) =>
`<ul><li><p>${skill.name}</p>: <img src="${skill.icon}" alt="${skill.name} icon"></li></ul>`
)
.join("");
showingSkill.innerHTML = formattedData;
console.log(result);
});
});
Shery.hoverWithMediaCircle(".img", {
images: [
"https://images.pexels.com/photos/45244/fire-match-flame-sulfur-45244.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1",
"image2.jpg",
"image3.jpg",
] /*OR*/,
});
const tabs = document.querySelectorAll("[data-tab-target]");
const contentItems = document.querySelectorAll("[data-tab-content]");
tabs.forEach((tab) => {
tab.addEventListener("click", () => {
const target = document.querySelector(tab.dataset.tabTarget);
contentItems.forEach((content) => {
// Changed variable name to contentItems
content.classList.remove("active"); // Removed the dot before "active"
});
target.classList.add("active");
});
});
const swiper = new Swiper(".swiper", {
loop: true,
// Navigation arrows
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev",
},
});
gsap.from("#about .about_me_eff", {
scale: 0,
opacity: 0,
duration: 3, // Extended duration to 3 seconds
ease: "power3.out",
stagger: 0.2,
scrollTrigger: {
// markers: true,
trigger: ".about_me_eff",
scroller: "body",
scrub: 1.2,
},
});
gsap.from("#Skills_content .Skills_content_titlle", {
scale: 0,
opacity: 0,
duration: 3, // Extended duration to 3 seconds
ease: "power3.out",
stagger: 0.2,
scrollTrigger: {
// markers: true,
trigger: "#Skills_content .Skills_content_titlle",
scroller: "body",
scrub: 1.2,
},
});
gsap.from("#Qualifications .Qualifications_tittle", {
scale: 0,
opacity: 0,
duration: 3, // Extended duration to 3 seconds
ease: "power3.out",
stagger: 0.2,
scrollTrigger: {
// markers: true,
trigger: "#Qualifications .Qualifications_tittle",
scroller: "body",
scrub: 1.2,
},
});
gsap.from("#project .project_title", {
scale: 0,
opacity: 0,
duration: 3, // Extended duration to 3 seconds
ease: "power3.out",
stagger: 0.2,
scrollTrigger: {
// markers: true,
trigger: "#project .project_title",
scroller: "body",
scrub: 1.2,
},
});
gsap.from("#Contact .Contact_title", {
scale: 0,
opacity: 0,
duration: 3, // Extended duration to 3 seconds
ease: "power3.out",
stagger: 0.2,
scrollTrigger: {
// markers: true,
trigger: "#Contact .Contact_title",
scroller: "body",
scrub: 1.2,
},
});
gsap.from(".image.scroll-container .scroll-content", {
scale: 0,
opacity: 0,
duration: 3,
ease: "power3.out",
stagger: 0.2,
css: {
transform: "translateX(-217px)",
},
scrollTrigger: {
// markers: true,
trigger: ".image.scroll-container", // Adjust the trigger selector
scroller: "body",
scrub: 1.2,
},
});
function scrollToTop() {
window.scrollTo({
top: 0,
behavior: "smooth",
});
}