-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
58 lines (50 loc) · 1.68 KB
/
app.js
File metadata and controls
58 lines (50 loc) · 1.68 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
const intro = document.querySelector('.intro');
const logo = document.querySelector('.logo-header');
const logoSpan = document.querySelectorAll('.logo');
const transitionel = document.getElementById('transition');
const anchors = document.querySelectorAll('a');
window.addEventListener('DOMContentLoaded', ()=>{
setTimeout(()=>{
logoSpan.forEach((span, idx)=>{
setTimeout(()=>{
span.classList.add('active');
}, (idx + 1) * 400);
});
setTimeout(()=>{
logoSpan.forEach((span, idx)=>{
setTimeout(()=>{
span.classList.remove('active');
span.classList.add('fade');
}, (idx + 1) * 50);
});
}, 2000);
setTimeout(()=>{
intro.style.top = '-100vh';
}, 2300);
});
});
window.addEventListener('load', ()=>{
setTimeout(()=>{
transitionel.classList.remove('is-active');
}, 500);
for(let i = 0; i < anchors.length; i++){
const anchor = anchors[i];
anchor.addEventListener('click', e =>{
e.preventDefault();
let target = e.target.href;
transitionel.classList.add('is-active');
setTimeout(()=>{
window.location.href = target;
}, 500);
})
}
});
window.addEventListener( "pageshow", function ( event ) {
var historyTraversal = event.persisted ||
( typeof window.performance != "undefined" &&
window.performance.navigation.type === 2 );
if ( historyTraversal ) {
// Handle page restore.
window.location.reload();
}
});