stear/extra/Elements/loading1.js

56 lines
1.3 KiB
JavaScript
Raw Normal View History

2022-06-09 17:30:40 +02:00
import { class_, Stear, _ } from "../../main.js";
2022-06-09 16:36:21 +02:00
export class loading1 extends class_{
2022-06-09 16:49:03 +02:00
constructor(color){
2022-06-09 16:36:21 +02:00
super({ class: "box" }, [
2022-06-09 16:49:03 +02:00
_({ style: { backgroundColor: color}}),
_({ style: { backgroundColor: color}}),
_({ style: { backgroundColor: color}}),
2022-06-09 16:36:21 +02:00
]);
}
}
2022-06-09 16:49:03 +02:00
export const l1 = (color="black") => new loading1(color);
2022-06-09 16:36:21 +02:00
2022-06-09 17:33:54 +02:00
export default l1;
2022-06-09 16:36:21 +02:00
var animation = Stear.addAnimation({
"0%": { left: "4%", top: "4%" },
"8.33%": { left: "52%", top: "4%" },
"25%": { left: "52%", top: "4%" },
"33.33%": { left: "52%", top: "52%" },
"50%": { left: "52%", top: "52%" },
"58.33%": { left: "4%", top: "52%" },
"75%": { left: "4%", top: "52%" },
"83.33%": { left: "4%", top: "4%" },
"100%": { left: "4%", top: "4%" },
});
Stear.addGlobalStyleJSON({
display: "inline-block",
position: "relative",
width: "80px",
height: "80px",
}, ".box");
Stear.addGlobalStyleJSON({
position: "absolute",
height: "44%",
width: "44%",
borderRadius: "25%",
animation: `${animation} 6s linear infinite`,
}, ".box div");
Stear.addGlobalStyleJSON({
animationDelay: "0s"
}, ".box div:nth-child(1)");
Stear.addGlobalStyleJSON({
animationDelay: "-2s"
}, ".box div:nth-child(2)");
Stear.addGlobalStyleJSON({
animationDelay: "-4s"
}, ".box div:nth-child(3)");