/
githubmirror
/
anime
Обзор
Документация
Войти
/
githubmirror
/
anime
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
tests/playground/onscroll/assets/function-based-values.js
23 строки
680 B
Julian Garnier
4.2.0-beta.0
26 авг 2025, 18:50
26 авг 2025, 18:50
36c932c
Код
Авторство
О чём код?
import { utils, animate, onScroll, stagger, } from '../../../../dist/modules/index.js'; const isLandscapeMedia = matchMedia('(orientation: landscape)'); utils.$('.section').forEach($section => { animate($section.querySelectorAll('.card'), { rotate: [stagger(utils.random(-1, 1, 2)), stagger(15)], transformOrigin: ['75% 75%', '75% 75%'], ease: 'inOut(2)', autoplay: onScroll({ axis: () => isLandscapeMedia.matches ? 'x' : 'y', enter: () => isLandscapeMedia.matches ? 'max-=25vw start+=25vw' : 'max start', leave: () => isLandscapeMedia.matches ? 'min+=25vw end-=25vw' : 'min end', sync: .5, debug: true, }), }); });