generated from bdsqqq/vite-vanillajs-tailwindcss
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.js
More file actions
44 lines (39 loc) · 650 Bytes
/
main.js
File metadata and controls
44 lines (39 loc) · 650 Bytes
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
import { animate } from "motion";
const wrapperElement = document.querySelector("#boxWrapper");
let width = wrapperElement.clientWidth;
let height = wrapperElement.clientHeight;
animate(
"#swordfish",
{ y: -height * 2.5 },
{
duration: 25,
easing: "linear",
repeat: Infinity,
}
);
animate(
"#pulse",
{
y: [-1, 1],
scale: 1.02,
},
{
duration: 1,
easing: "ease-in-out",
repeat: Infinity,
direction: "alternate",
}
);
animate(
"#smokesvg",
{
scale: 1.02,
rotate: [0.4, 0],
},
{
duration: 2,
easing: "ease-in-out",
repeat: Infinity,
direction: "alternate",
}
);