-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscript.js
114 lines (100 loc) · 2.07 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
const hash = document.querySelector(".top-container");
const l1 = document.querySelector(".l1");
const l2 = document.querySelector(".l2");
const l3 = document.querySelector(".l3");
const l4 = document.querySelector(".l4");
// Encryption animation work.
var startstop = 1;
const alphabet = [
"a",
"b",
"c",
"d",
"e",
"f",
"g",
"h",
"i",
"j",
"k",
"l",
"m",
"n",
"o",
"p",
"q",
"r",
"s",
"t",
"u",
"v",
"w",
"x",
"y",
"z",
1,
2,
3,
4,
5,
6,
7,
8,
9,
];
function animation() {
for (i = 0; i < 5; i++) {
let randomIndex1 = Math.floor(Math.random() * alphabet.length);
let randomIndex2 = Math.floor(Math.random() * alphabet.length);
let randomIndex3 = Math.floor(Math.random() * alphabet.length);
let randomIndex4 = Math.floor(Math.random() * alphabet.length);
let a = alphabet[randomIndex1];
let b = alphabet[randomIndex2];
let c = alphabet[randomIndex3];
let d = alphabet[randomIndex4];
l1.innerHTML = `${a}`;
l2.innerHTML = `${b}`;
l3.innerHTML = `${c}`;
l4.innerHTML = `${d}`;
}
if (startstop == 0) {
console.log("Thanks for playing :)");
} else {
requestAnimationFrame(animation);
}
}
hash.addEventListener("mouseover", function () {
startstop = 0;
window.cancelAnimationFrame;
(async () => await new Promise(resolve => setTimeout(resolve, 10)))();
l1.innerHTML = `H`;
l2.innerHTML = `a`;
l3.innerHTML = `s`;
l4.innerHTML = `h`;
});
window.onload = animation();
// Description cycle work.
const description = document.querySelector(".description");
const descriptions = [
"communities.",
"DAOs.",
"NFT owners.",
"token holders.",
"friends.",
"bag shillers.",
"speculatoooors.",
"artists.",
];
let descIndex = 0;
let intervalId = setInterval(function () {
if (descIndex <= 6) {
descIndex += 1;
} else if (descIndex == 7) {
descIndex = 0;
}
description.innerHTML = `${descriptions[descIndex]}`;
}, 1500);
description.addEventListener("mouseover", function () {
clearInterval(intervalId);
description.innerHTML = `you.`;
});