-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
55 lines (46 loc) · 1.17 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
const h1 = document.querySelectorAll("#page6 h1");
const heroimg = document.querySelector("#heroimg");
const crsr = document.querySelector("#crsr");
const circle = document.querySelectorAll("#page6 .elem .circle");
let nav = document.querySelector("#navbar");
const scroll = new LocomotiveScroll({
el: document.querySelector("main"),
smooth: true,
});
function toggleMenu() {
const menuIcon = document.querySelector(".menu-icon");
menuIcon.classList.toggle("open");
}
const tl = gsap.timeline();
tl.from("nav", {
y: -50,
duration: 1,
opacity: 0,
scale: 0,
});
tl.from("#page1 h1", {
y: 100,
duration: 0.5,
opacity: 0,
scale: 0.8,
stagger: 0.1,
});
tl.from(heroimg,{
opacity:0,
scale:2,
})
// =====================================================================================
circle.forEach(function (elem, i) {
elem.addEventListener("click", () => {
removecircle();
removeh1()
elem.style.background = "black";
h1[i].style.display = "block"})
})
function removecircle() {
circle.forEach(function (elem, i) {
elem.style.backgroundColor = "white"})}
function removeh1(){
h1.forEach((elem,index)=>{
elem.style.display ='none';
})}