theme-shokax-anime
![npm](https://img.shields.io/npm/dm/theme-shokax-anime)
anime.js for hexo-theme-shokaX
inspired by anime
Usage
Import
<script src="https://www.unpkg.com/theme-shokax-anime@latest/anime.shokax.min.js"></script>
Basic usage
anime({
targets: document.getElementById("imgs"),
duration: 1000,
easing: "linear",
delay: 0,
begin: function () {
},
update: function () {
},
complete: function () {
},
opacity: 1,
}).play();
Timeline
anime().timeline().add({
targets: particules,
duration: anime.random(1200, 1800),
easing: "easeOutExpo",
update: renderParticule,
x: function (p) {
return p.endPos.x;
},
y: function (p) {
return p.endPos.y;
},
radius: 0.1,
})
.add({
targets: circle,
duration: anime.random(1200, 1800),
easing: "easeOutExpo",
update: renderParticule,
radius: anime.random(80, 160),
lineWidth: 0,
alpha: {
value: 0,
easing: "linear",
duration: anime.random(600, 800),
},
}).play();
More Examples
anime({
targets: { x: 1, y: 2 },
duration: Infinity,
x: [10, 20],
x: [
{ value: 10, duration: 200 },
{ value: 20, duration: 400 },
],
y: function (item) {
return item.x;
},
x: {
value: 20,
duration: 200,
easing: "linear",
},
}).play();
Default Options
const defaultOptions = {
targets: null,
duration: Infinity,
easing: "linear",
delay: 0,
begin: null,
update: null,
complete: null,
};