Skip to content

Instantly share code, notes, and snippets.

import anime from 'animejs'
const animatePerspective = () => {
const items = [...document.querySelectorAll('.js-animate-perspective')]
if (!items || typeof window.requestAnimationFrame === 'undefined') return
// Cache elements
const elements = {}
items.forEach(item => {
elements[item.id] = {