/
githubmirror
/
anime
Обзор
Документация
Войти
/
githubmirror
/
anime
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
tests/playground/layout/clone/index.js
20 строк
607 B
Julian Garnier
4.5.0
22 июн 2026, 17:32
22 июн 2026, 17:32
34f4179
Код
Авторство
О чём код?
import { createLayout, utils } from '../../../../dist/modules/index.js'; const layout = createLayout('.container', { properties: ['color'], duration: 1000 }); const moveCard = $card => { const $parent = $card.parentElement; const $nextParent = $parent.nextElementSibling || $parent.previousElementSibling; $parent.style.zIndex = '0'; $nextParent.style.zIndex = '1'; $nextParent.appendChild($card); } document.addEventListener('click', e => { const $card = /** @type {HTMLElement} */(e.target).closest('.card'); console.log($card); if ($card) layout.update(() => moveCard($card)); });