forked from Anchal33/ACM-Chapter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
119 lines (103 loc) · 3.52 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
$(document).ready(function () {
/* For the sticky navigation */
$(".section-about").waypoint(
function (direction) {
if (direction == "down") {
$("nav").removeClass("hidden");
$("nav").addClass("sticky");
} else {
$("nav").addClass("hidden");
$("nav").removeClass("sticky");
}
},
{
offset: "60px;",
}
);
//Mobile Responsive
$(".mobile-nav-icon").click(function () {
var nav = $(".js-main-nav");
var icon = $(".mobile-nav-icon i");
if (icon.hasClass("ion-navicon-round")) {
icon.addClass("ion-close-round");
icon.removeClass("ion-navicon-round");
} else {
icon.addClass("ion-navicon-round");
icon.removeClass("ion-close-round");
}
nav.slideToggle(200);
});
$(".past").click(function () {
$(".upCarousel div:first").removeClass("show");
$(".pastCarousel div:first").removeClass("hide");
$(".pastCarousel div:first").addClass("show");
$(".upCarousel div:first").addClass("hide");
$(".past h3").addClass("borderdown");
$(".up h3").removeClass("borderdown");
});
$(".up").click(function () {
$(".pastCarousel div:first").removeClass("show");
$(".pastCarousel div:first").addClass("hide");
$(".upCarousel div:first").removeClass("hide");
$(".upCarousel div:first").addClass("show");
$(".up h3").addClass("borderdown");
$(".past h3").removeClass("borderdown");
});
});
//Events counter
const counters = document.querySelectorAll(".counter");
counters.forEach(function (counter) {
var observer = new IntersectionObserver(
function (entries) {
// isIntersecting is true when element and viewport are overlapping
// isIntersecting is false when element and viewport don't overlap
if (entries[0].isIntersecting === true) {
const updateCount = () => {
const target = +counter.getAttribute("data-target");
const count = +counter.innerText;
const inc = 2;
if (count < target) {
counter.innerText = count + inc;
setTimeout(updateCount, 20);
} else {
count.innerText = target;
}
};
updateCount();
}
},
{ threshold: [0.1] }
);
observer.observe(counter)
});
const toggelButton = document.querySelector('button');
toggelButton.addEventListener("click", () => {
document.querySelector('.navigation__icon').classList.toggle('active');
const nav = document.querySelector('nav');
if (toggelButton.getAttribute('aria-expanded') == "false") {
const nav = document.querySelector('nav');
if (!nav.classList.contains('sticky')) {
nav.style.backgroundColor = "rgba(0,0,0,1)";
}
}
else if (!nav.classList.contains('sticky')) {
nav.style.backgroundColor = "transparent";
}
<<<<<<< HEAD
});
=======
});
const tl = gsap.timeline({defaults:{ease:"power1.out"}});
<<<<<<< HEAD
tl.to('.hero-text-box',{opacity:1, duration:0.4});
tl.fromTo('.logo',{scale:0},{scale:1.2, duration:1});
tl.fromTo('.heading',{opacity:0},{opacity:1, duration:2});
tl.fromTo('.fa-chevron-down',{opacity:0},{opacity:1, duration:1},"-=1");
>>>>>>> 5d42d0b5e1ea0ee2b0beef6e05a0942d7110aa75
=======
tl.fromTo('.scene-logo',{scale:0},{scale:1.2,delay:0,duration:2});
tl.to('.scene-h1>span',{opacity:1,y:0,duration:1});
tl.to('.scene-wrapper',{height:0,opacity:0,duration:1,delay:1});
tl.to('.blue-div',{opacity:0,height:0,delay:1},"-=1");
tl.to('.scene-wrapper',{y:-1000,opacity:0,duration:1,delay:1});
>>>>>>> 4d10746308726ef065de37011eb6663f421a74f1