-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
46 lines (35 loc) · 1.17 KB
/
Copy pathscript.js
File metadata and controls
46 lines (35 loc) · 1.17 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
const tracker = document.getElementById('follower')
document.body.onpointermove = event =>{
const{clientX,clientY} = event
tracker.animate({
left:`${clientX}px`,
top:`${clientY}px`},{duration :300,fill:'forwards'});
}
const random =()=>{
}
////////////////////////////////////////////////////////////////////////////////////
const letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
let interval = null
const myinterval =setInterval(myGreeting,1000)
function myGreeting() {
let variable = ['html','css','js','python','react']
number = Math.floor(Math.random()*10/2)
text = document.getElementById(variable[number])
let iteration = 0;
clearInterval(interval);
interval = setInterval(() => {
text.innerText = text.innerText
.split("")
.map((letter, index) => {
if(index < iteration) {
return text.dataset.value[index];
}
return letters[Math.floor(Math.random() * 26)]
})
.join("");
if(iteration >= text.dataset.value.length){
clearInterval(interval);
}
iteration += 1 / 3;
}, 30);
}