import preview from "#.storybook/preview"; import { AnimationParams } from "animejs"; import { Component, createSignal } from "solid-js"; import { Anime } from "../../src/ts/components/common/anime/Anime"; const meta = preview.meta({ title: "Common/Anime/Anime", component: Anime as Component, parameters: { layout: "centered", }, tags: ["autodocs"], }); const box = { width: "100px", height: "100px", "background-color": "var(--main-color)", "border-radius": "8px", display: "flex", "align-items": "center", "justify-content": "center", color: "var(--bg-color)", "font-weight": "bold", }; export const FadeIn = meta.story({ render: () => ( } animate={{ opacity: 1, duration: 600 } as AnimationParams} >
Fade In
), }); export const SlideIn = meta.story({ render: () => ( } animate={{ opacity: 1, translateY: 0, duration: 500 } as AnimationParams} >
Slide In
), }); export const ReactiveAnimation = meta.story({ render: () => { const [expanded, setExpanded] = createSignal(false); return (
Click
); }, }); export const CustomElement = meta.story({ render: () => ( } animate={{ opacity: 1, translateX: 0, duration: 400 } as AnimationParams} style={{ display: "inline-block" }} > Rendered as a {""} ), });