-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathscript.js
386 lines (323 loc) · 13.3 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
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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
// Function to toggle between light and dark modes
// function toggleMode() {
// const body = document.body;
// body.classList.toggle('light-mode');
// body.classList.toggle('dark-mode');
// }
// You can also add a default mode based on user preference or time of day
// Uncomment and modify the following lines if needed
// const prefersDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches;
// if (prefersDarkMode) {
// toggleMode();
// }
// document.addEventListener('DOMContentLoaded', function () {
// const themeToggle = document.getElementById('themeToggle');
// const body = document.body;
// // Check if the user has a theme preference in localStorage
// const userPrefersDark = localStorage.getItem('dark-mode') === 'true';
// // Apply the initial theme based on user preference
// setTheme(userPrefersDark);
// // Toggle theme when the button is clicked
// themeToggle.addEventListener('click', function () {
// const isDarkMode = body.classList.toggle('dark-mode');
// // Save the user's preference to localStorage
// localStorage.setItem('dark-mode', isDarkMode);
// });
// function setTheme(isDarkMode) {
// if (isDarkMode) {
// body.classList.add('dark-mode');
// } else {
// body.classList.remove('dark-mode');
// }
// }
// });
document.addEventListener('DOMContentLoaded', function () {
const themeToggle = document.getElementById('themeToggle');
const themeIcon = document.getElementById('themeIcon');
const body = document.body;
// Check if the user has a theme preference in localStorage
const userPrefersDark = localStorage.getItem('dark-mode') === 'true';
// Apply the initial theme based on user preference
setTheme(userPrefersDark);
// Toggle theme when the button is clicked
themeToggle.addEventListener('click', function () {
const isDarkMode = body.classList.toggle('dark-mode');
// Save the user's preference to localStorage
localStorage.setItem('dark-mode', isDarkMode);
// Update the icon based on the selected theme
updateIcon(isDarkMode);
});
function setTheme(isDarkMode) {
if (isDarkMode) {
body.classList.add('dark-mode');
updateIcon(true);
} else {
body.classList.remove('dark-mode');
updateIcon(false);
}
}
function updateIcon(isDarkMode) {
themeIcon.src = isDarkMode ? 'sun-icon.png' : 'moon-icon.png';
themeIcon.alt = isDarkMode ? 'Sun Icon' : 'Moon Icon';
}
});
var crsr = document.querySelector("#cursor")
document.addEventListener("mousemove", function (dets) {
crsr.style.top = dets.y - 5 + "px"
crsr.style.left = dets.x - 5 + "px"
})
var Crsr = document.querySelector("#cursor-blur")
document.addEventListener("mousemove", function (dets) {
Crsr.style.top = dets.y - 100 + "px"
Crsr.style.left = dets.x - 100 + "px"
})
var navAll = document.querySelectorAll("#nav h4")
navAll.forEach(function (elem) {
elem.addEventListener("mouseenter", function () {
crsr.style.scale = 6
crsr.style.border = "0.1vh solid #fff"
crsr.style.backgroundColor = "transparent"
})
elem.addEventListener("mouseleave", function () {
crsr.style.scale = 1
crsr.style.border = "0.1vh solid rgb(255, 0, 81)"
crsr.style.backgroundColor = "rgb(255, 0, 81)"
})
})
gsap.to("#nav", {
backgroundColor: "#000",
duration: 1,
height: "90px",
scrollTrigger: {
trigger: "#nav",
scroller: "body",
// markers:true,
start: "top -10%",
end: "top -11%",
scrub: 2,
}
})
gsap.to("#main", {
backgroundColor: "#000",
scrollTrigger: {
trigger: "#main",
scroller: "body",
// markers: true,
start: "top -20%",
end: "top -80%",
scrub: 2,
}
})
if (window.matchMedia("(min-width: 1024px)").matches) {
// Apply GSAP animation only for screens larger than 768px
gsap.from("#aboutus .overlay-image, #aboutus #aboutusin", {
y: 80,
opacity: 0,
duration: 1,
scrollTrigger: {
trigger: "#aboutus",
scroller: "body",
start: "top 65%",
end: "top 55%",
scrub: 3
}
});
}
if (window.matchMedia("(min-width: 1024px)").matches) {
gsap.from("#page3 #col1, #page3 #col3", {
y: -100,
x: -100,
scrollTrigger: {
trigger: "#page3",
scroller: "body",
start: "top 40%",
end: "top 30%",
scrub: 5,
duration: 1
}
})
}
if (window.matchMedia("(min-width: 1024px)").matches) {
gsap.from("#page3 #col2, #page3 #col4", {
y: 100,
x: 100,
scrollTrigger: {
trigger: "#page3",
scroller: "body",
start: "top 40%",
end: "top 30%",
scrub: 5,
duration: 1
}
})
}
gsap.from("#page4 h1", {
y: 120,
scrollTrigger: {
trigger: "#page4",
scroller: "body",
start: "top 65%",
end: "top 75%",
scrub: 3,
}
})
// Shery.mouseFollower({
// //Parameters are optional.
// // debug: true,
// skew: true,
// ease: "cubic-bezier(0.23, 1, 0.320, 1)",
// duration: 1,
// });
Shery.makeMagnet("#nav img" /* Element to target.*/, {
//Parameters are optional.
debugger: true,
ease: "cubic-bezier(0.23, 1, 0.320, 1)",
duration: 1,
});
// Shery.makeMagnet("#main #page1 h1" /* Element to target.*/, {
// //Parameters are optional.
// ease: "cubic-bezier(0.23, 1, 0.320, 1)",
// duration: 1,
// });
// Shery.imageMasker(".arrow" /* Element to target.*/, {
// //Parameters are optional.
// debug:true,
// mouseFollower: true,
// text: "Scroll Down",
// ease: "cubic-bezier(0.23, 1, 0.320, 1)",
// duration: 1,
// });
Shery.imageMasker(".overlay-image" /* Element to target.*/, {
//Parameters are optional.
debug: true,
mouseFollower: true,
text: "Lagta hai fools pasand hai aapko",
ease: "cubic-bezier(0.23, 1, 0.320, 1)",
duration: 1,
});
Shery.imageMasker(".Para" /* Element to target.*/, {
//Parameters are optional.
debug: true,
mouseFollower: true,
text: "Advices from Senior",
ease: "cubic-bezier(0.23, 1, 0.320, 1)",
duration: 1,
});
Shery.imageMasker("#sansk-div" /* Element to target.*/, {
//Parameters are optional.
debug: true,
mouseFollower: true,
text: "Advices from Senior",
ease: "cubic-bezier(0.23, 1, 0.320, 1)",
duration: 1,
});
// parallax script
// class parallaxTiltEffect {
// constructor({element, tiltEffect}) {
// this.element = element;
// this.container = this.element.querySelector(".container");
// this.size = [300, 360];
// [this.w, this.h] = this.size;
// this.tiltEffect = tiltEffect;
// this.mouseOnComponent = false;
// this.handleMouseMove = this.handleMouseMove.bind(this);
// this.handleMouseEnter = this.handleMouseEnter.bind(this);
// this.handleMouseLeave = this.handleMouseLeave.bind(this);
// this.defaultStates = this.defaultStates.bind(this);
// this.setProperty = this.setProperty.bind(this);
// this.init = this.init.bind(this);
// this.init();
// }
// handleMouseMove(event) {
// const {offsetX, offsetY} = event;
// let X;
// let Y;
// if (this.tiltEffect === "reverse") {
// X = ((offsetX - (this.w/2)) / 3) / 3;
// Y = (-(offsetY - (this.h/2)) / 3) / 3;
// }
// else if (this.tiltEffect === "normal") {
// X = (-(offsetX - (this.w/2)) / 3) / 3;
// Y = ((offsetY - (this.h/2)) / 3) / 3;
// }
// this.setProperty('--rY', X.toFixed(2));
// this.setProperty('--rX', Y.toFixed(2));
// this.setProperty('--bY', (80 - (X/4).toFixed(2)) + '%');
// this.setProperty('--bX', (50 - (Y/4).toFixed(2)) + '%');
// }
// handleMouseEnter() {
// this.mouseOnComponent = true;
// this.container.classList.add("container--active");
// }
// handleMouseLeave() {
// this.mouseOnComponent = false;
// this.defaultStates();
// }
// defaultStates() {
// this.container.classList.remove("container--active");
// this.setProperty('--rY', 0);
// this.setProperty('--rX', 0);
// this.setProperty('--bY', '80%');
// this.setProperty('--bX', '50%');
// }
// setProperty(p, v) {
// return this.container.style.setProperty(p, v);
// }
// init() {
// this.element.addEventListener('mousemove', this.handleMouseMove);
// this.element.addEventListener('mouseenter', this.handleMouseEnter);
// this.element.addEventListener('mouseleave', this.handleMouseLeave);
// }
// }
// const $ = e => document.querySelector(e);
// const wrap1 = new parallaxTiltEffect({
// element: $('.wrap--1'),
// tiltEffect: 'reverse'
// });
// const wrap2 = new parallaxTiltEffect({
// element: $('.wrap--2'),
// tiltEffect: 'normal'
// });
// const wrap3 = new parallaxTiltEffect({
// element: $('.wrap--3'),
// tiltEffect: 'reverse'
// });
// script.js
$(document).ready(function () {
var paragraphs = [
"Try to learn & listen every topics as much as possible which has been taught in class. Along with that Regarding Branch change be Serious from starting and Understand the concepts well that's enough for it & Give your best in the exams.Listen to the proffs carefull one day before the exams. That's how you can also achieve a Department Change from Mech to CSE!<br/> -MAINAK JANA(CSE k22)-",
"As AI brings down the curtains from conventional coding, BIT introduces AIML. One thing I'd like to make my juniors clear about the branch is, it's top to down about mathematics. Statistics play an important role, and if you're into ML, you will love the curriculum. For those who still have doubts whether AI/ML holds up to its predecessor, toh Junies, thank god ki tumhe ECE nahi mila :)<br/>-PRIYANSHU PRIYAM(AIML k22)- ",
"In chemical engineering, there is a greater emphasis on subjects such as Thermodynamics, Heat Transfer, Fluid Mechanics, and Chemical Process Calculation. Most often, one has to rely on professor's notes or resources from platforms like YouTube for learning. The difficulty level is somewhat easier. The professors are decent, and they are not overly strict.<br/> -AKSHAY KUMAR(CHEM k22)-",
"In MNCs, there's plenty of time as there are no assignments or irrelevant subjects. This realization came during the second and third semesters, especially after physics lab and classes. Math seemed easy and less time-consuming compared to the challenges faced while writing practical reports and giving vivas. When it comes to computing subjects, consider starting with either C++ or Java.<br/> -HARSH RAJ(MnC k22)-",
"You may approach biotech branch in BIT Mesra through JEE as well as NEET. As a biotech student, this branch is pretty much chill compared to others and the profs and seniors are literally very supportive and genuine in behaviour. Overall if you have a good command on subject biology and have your interests in this subject, biotech is something that you'll cherish! <br/> -SOUMYA GOYAL(BIOTECH k22)-",
"Civil engineering revolves around the construction of structures, making it an ideal choice for those intrigued by the processes involved in building bridges, roads, buildings, dams, and more. Enthusiasts can pursue civil engineering to work with top core companies such as NHAI, L&T, JINDAL, etc. To excel in this field, a strong foundation in mathematics and physics is essential. <br/> -RITESH KUMAR(CIVIL k22)-",
"Electronics and Communication Engineering (ECE) holds a lot of promise for the future, giving you the flexibility to explore different technical and core areas. Sure, it's challenging, but it's not impossible to get through the four-year journey. With a good plan and approach, managing both the technical and core subjects each semester becomes doable. Just don't try to memorise. <br/> -KESHAV AGARWAL(ECE k22)-",
"Firstly, you should be familiar with basic coding concepts, such as C and R. You should have a grasp of the fundamentals of mathematics and statistics from the 11th and 12th grades. Seniors and professors are very supportive, so you can approach them at any time for notes, previous year questions, and study materials. Rest 80% of the work depends on you so All the Best! <br/> -APURVA MISHRA(QEDS k22)-",
"NOW YOU WILL READ SOME ADVICES FROM YOUR SENIORS ACROSS ALL THE BRANCHES. KAAFI SAARE DOUBTS REHTE HAI JAB AAP NAYE NAYE COLLEGE AATE HO, UMEED HAI ISSE PADHKAR DIL KO SANTUSHTI MILEGI, BAAKI AAP HUMEIN KABHI BHI WHATSAPP KAR SAKTE HAI :)<br/> ADITYA SRIVASTAVA(CSE k22)"
// Add more content as needed
];
var currentParagraph = 0;
function slideContent() {
$("#para .Para").slideUp(500, function () {
// Change the content of the paragraph
$(this).html(paragraphs[currentParagraph]);
// Increment the currentParagraph counter
currentParagraph++;
// Reset the counter to 0 if it exceeds the number of paragraphs
if (currentParagraph >= paragraphs.length) {
currentParagraph = 0;
}
// Slide down to reveal the updated content
$(this).slideDown(500);
});
}
// Set an interval to call the slideContent function every few seconds
setInterval(slideContent, 18000); // Change 3000 to the desired interval in milliseconds
});
document.getElementById('page1').addEventListener('click', function () {
// Scroll to the About Us section
window.scrollTo({
top: document.getElementById('scroller').offsetTop,
behavior: 'smooth'
});
});