anim8-core
Version:
Custom JavaScript animation library with modular effects
18 lines (14 loc) • 396 B
JavaScript
// src/effects/rotate.js
import { animate } from '../core/animate.js';
import { easeOutExpo } from '../easings/easeOutExpo.js';
import { resolveElement } from '../utils/resolveElement.js';
export function rotate(target) {
const el = resolveElement(target);
if (!el) return;
animate(el, {
rotate: [0, 360],
}, {
duration: 1000,
easing: easeOutExpo,
});
}