Spaces:
Running
Running
Download bioai-platform/frontend/src/components/ui/Reveal.tsx from Samad14/bio-nexus-api: direct link, hf CLI and curl.
- Browser
- Download file 870 Bytes
-
https://huggingface.co/spaces/Samad14/bio-nexus-api/resolve/main/bioai-platform/frontend/src/components/ui/Reveal.tsx
- Command line
-
hf download hf://spaces/Samad14/bio-nexus-api/bioai-platform/frontend/src/components/ui/Reveal.tsx
-
curl -L -o Reveal.tsx https://huggingface.co/spaces/Samad14/bio-nexus-api/resolve/main/bioai-platform/frontend/src/components/ui/Reveal.tsx
870 Bytes
| 'use client'; | |
| import type { ReactNode } from 'react'; | |
| import { motion, useReducedMotion } from 'framer-motion'; | |
| /** | |
| * Entrance reveal for content below the fold. Fades + slides the child in the | |
| * first time it scrolls into view, then stays. Respects reduced motion. | |
| */ | |
| export function Reveal({ | |
| children, | |
| delay = 0, | |
| y = 28, | |
| once = true, | |
| className = '', | |
| }: { | |
| children: ReactNode; | |
| delay?: number; | |
| y?: number; | |
| once?: boolean; | |
| className?: string; | |
| }) { | |
| const reduceMotion = useReducedMotion(); | |
| return ( | |
| <motion.div | |
| className={className} | |
| initial={reduceMotion ? { opacity: 0 } : { opacity: 0, y }} | |
| whileInView={reduceMotion ? { opacity: 1 } : { opacity: 1, y: 0 }} | |
| viewport={{ once, margin: '-60px' }} | |
| transition={{ duration: 0.5, delay, ease: [0.25, 1, 0.5, 1] }} | |
| > | |
| {children} | |
| </motion.div> | |
| ); | |
| } | |