-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhyperjump.js
31 lines (26 loc) · 887 Bytes
/
hyperjump.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
"use strict";
const banner = document.getElementsByClassName('banner')[0];
const blocks = document.getElementsByClassName('blocks');
const section = document.querySelector('section');
let time = 14000;
for(let i = 0; i < 10; i++) {
for(let j = 0; j < 10; j++) {
const block = document.createElement('div')
block.classList.add('blocks');
const up = 10 * j;
const left = 10 * i;
const bottom = 90 - 10 * j;
const right = 90 - 10 * i;
block.style.clipPath = `inset(${up}% ${left}% ${bottom}% ${right}%)`;
const duration = Math.random() * 5;
block.style.animationDuration = 2 + duration + 's';
block.style.animationDelay = duration + 's';
banner.append(block);
}
}
setTimeout(() => {
section.classList.add('active');
} , time);
setTimeout(() => {
location.reload();
}, time + 7000)