framer-animations

所属分类:其他
开发工具:TypeScript
文件大小:0KB
下载次数:0
上传日期:2024-03-19 19:14:09
上 传 者sh-1993
说明:  简单的编程“框架运动”动画
(Simple, programmatic `framer-motion` animations)

文件列表:
demo/
framer-animations/
media/
Justfile

# Framer Animations > Simple, programmatic `framer-motion` animations - Demos: https://moveread.github.io/framer-animations/ ## Loader/spinner > Fully controlled loader/spinner ![Loader in action](https://github.com/moveread/framer-animations/blob/master/media/loader.gif) ```jsx import { useLoader } from 'framer-animations' const { loader, animate } = useLoader() async function request() { animate('load') try { const r = await fetch() // ... animate('succeed') } catch { // ... animate('fail') } } return (
// ... {loader}
) ``` ## Slideshow/full-page carousel > Presence-based slideshow ![Slideshow in action](https://github.com/moveread/framer-animations/blob/master/media/slideshow.gif) ```jsx import { Slideshow } from 'framer-animations' const [page, setPage] = useState('home') const [dir, setDir] = useState('right') const elem = (() => { switch (page) { case 'home': return (
// ...
) case 'about': return (
// ...
) case '...': ... } })() return ( {elem} ) ``` ## Carousel > Fully controlled, swipable carousel with animation to skip multiple pages ![Carousel in action](https://github.com/moveread/framer-animations/blob/master/media/carousel.gif) ```jsx import { useCarousel } from 'framer-animations' const { carousel, goto, selected } = useCarousel({ numItems: 10, item: idx =>

Item {idx}

}) // or const { carousel, goto, selected } = useCarousel({ mode: 'eager': items: [

Item 1

, // ...

Item N

] }) return (
{carousel}

Page: {selected}

) ``` ## Previewed Carousel > Fully controlled, swipable carousel previewing the previous and next items ![Carousel in action](https://github.com/moveread/framer-animations/blob/master/media/previewed-carousel.gif)

近期下载者

相关文件


收藏者