Commit f7ef1d50 authored by 姬鋆屾's avatar 姬鋆屾

tui

parent bf33927b
......@@ -1936,10 +1936,25 @@ class ShapeAnimComp {
class RollEventComp {
constructor(data) {
this.name = "RollEventComp";
let index = 0;
let set = setInterval(function () {
index += 0.004;
// let set = setInterval(function () {
// index += 0.004;
// data.cb(index);
// if (index >= 0.43) {
// document.getElementsByClassName("effect-box")[0]
// ? (document.getElementsByClassName(
// "effect-box"
// )[0].style.backgroundColor = `rgba(3, 18, 51, ${
// 0 ? 0 : 0.5 - index
// })`)
// : "";
// }
// if (index > 1) {
// clearInterval(set);
// }
// });
function fn() {
index += 0.015;
data.cb(index);
if (index >= 0.43) {
document.getElementsByClassName("effect-box")[0]
......@@ -1950,10 +1965,12 @@ class RollEventComp {
})`)
: "";
}
if (index > 1) {
clearInterval(set);
if (index < 1.1) {
window.requestAnimationFrame(fn);
}
});
}
window.requestAnimationFrame(fn);
// window.addEventListener("scroll", (event) => {
// const scrollTop = document.documentElement.scrollTop;
// const scrollHeight = document.documentElement.scrollHeight;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment