-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
38 lines (35 loc) · 1.18 KB
/
test.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
let shaders = document.querySelectorAll("hs-shader");
for (const shader of shaders) {
shader.on("stop",function(percent){
//let targetDisplay = document.querySelector(`.shDisp[target="#${shader.id}"]`);
//targetDisplay.innerHTML = `${shader.id} stopped at: ${percent}%`;
console.log(percent);
});
shader.on("drag",function(percent){
//let targetDisplay = document.querySelector(`.shDisp[target="#${shader.id}"]`);
//targetDisplay.innerHTML = `${shader.id} stopped at: ${percent}%`;
console.log(percent);
});
}
let test2Shader = document.querySelector("#test2");
let animPercent = 0;
test2Shader.setPercent(30);
/*
test2Shader.classList.add("animating");
let interval = setInterval(() => {
test2Shader.setPercent( animPercent );
animPercent++;
if( animPercent > 100 ){
clearInterval(interval);
animPercent = 100;
let interval2 = setInterval(() => {
test2Shader.setPercent( animPercent );
animPercent--;
if( animPercent < 50 ){
clearInterval(interval2);
test2Shader.classList.remove("animating");
}
}, 20);
}
}, 15);
*/