-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathscript.js
57 lines (44 loc) · 1.5 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
// (function () {
// let socials = document.querySelectorAll('.social div')
// socials.forEach(function (social, index) {
// social.style.animation = `moveIn .6s cubic-bezier(.51,.92,.24,1.15) forwards ${index / 7 + 0.2}s`
// })
// let rocketPieces = document.querySelectorAll('.rocket-body span')
// let rocket = document.querySelector('.rocket')
// let triggerStart = window.innerHeight / 5;
// let rocketOffsetTop = rocket.offsetTop;
// let thirdOffsetTop = rocketPieces[2].offsetTop;
// document.addEventListener('scroll', (e) => {
// if (window.scrollY > (rocketOffsetTop - triggerStart)) {
// rocketPieces[0].classList.add('active');
// rocketPieces[1].classList.add('active');
// } else {
// rocketPieces[0].classList.remove('active');
// rocketPieces[1].classList.remove('active');
// }
// if (window.scrollY > (thirdOffsetTop - triggerStart)) {
// rocketPieces[2].classList.add('active');
// } else {
// rocketPieces[2].classList.remove('active');
// }
// })
// }())
var nav=false;
var menu=document.querySelector('.menu')
var closebtn=document.querySelector('.close-btn')
var outside=document.querySelector('.outside')
function ToggleNav(){
console.log('function runned')
if(nav){
nav=false;
outside.style.width="0";
outside.style.padding="0";
menu.style.display="block"
}
else{
nav=true;
outside.style.width="100vw";
outside.style.padding=" 20vh 5vw";
menu.style.display="none"
}
}