wandering-eyes
loading-ui/wandering-eyesFreeComponent
@loading-ui publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by @loading-ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://loading-ui.com/r/wandering-eyes.jsonSource
1import { cn } from "@/lib/utils";23type WanderingEyesProps = React.ComponentProps<"span"> & {4 eyeScale?: number;5 gapScale?: number;6 pupilScale?: number;7 blinkScale?: number;8 travelScale?: number;9};1011function clamp(value: number, min: number, max: number) {12 return Math.min(Math.max(value, min), max);13}1415function WanderingEyes({16 className,17 style,18 eyeScale = 0.62,19 gapScale = 0.09,20 pupilScale = 0.32,21 blinkScale = 0.375,22 travelScale = 0.3125,23 ...props24}: WanderingEyesProps) {25 const safeEyeScale = clamp(eyeScale, 0.28, 0.7);26 const safeGapScale = clamp(gapScale, 0.04, 0.3);27 const safePupilScale = clamp(pupilScale, 0.12, 0.45);28 const safeBlinkScale = clamp(blinkScale, 0.15, 1);29 const safeTravelScale = clamp(travelScale, 0.08, 0.5);30 const eyesStyle = {31 ...style,32 "--loading-ui-wandering-eyes-eye": `${(safeEyeScale * 100).toFixed(2)}cqmin`,33 "--loading-ui-wandering-eyes-gap": `${(safeGapScale * 100).toFixed(2)}cqmin`,34 "--loading-ui-wandering-eyes-pupil-scale": `${safePupilScale}`,35 "--loading-ui-wandering-eyes-blink": `${safeBlinkScale}`,36 "--loading-ui-wandering-eyes-travel-scale": `${safeTravelScale}`,37 } as React.CSSProperties;3839 return (40 <>41 <style>{`42 @keyframes loading-ui-wandering-eyes-move {43 0%,44 10% {45 background-position: 0 0;46 }4748 13%,49 40% {50 background-position: calc(var(--loading-ui-wandering-eyes-eye) * var(--loading-ui-wandering-eyes-travel-scale) * -1) 0;51 }5253 43%,54 70% {55 background-position: calc(var(--loading-ui-wandering-eyes-eye) * var(--loading-ui-wandering-eyes-travel-scale)) 0;56 }5758 73%,59 90% {60 background-position: 0 calc(var(--loading-ui-wandering-eyes-eye) * var(--loading-ui-wandering-eyes-travel-scale));61 }6263 93%,64 100% {65 background-position: 0 0;66 }67 }6869 @keyframes loading-ui-wandering-eyes-blink {70 0%,71 10%,72 12%,73 20%,74 22%,75 40%,76 42%,77 60%,78 62%,79 70%,80 72%,81 90%,82 92%,83 98%,84 100% {85 height: var(--loading-ui-wandering-eyes-eye);86 }8788 11%,89 21%,90 41%,91 61%,92 71%,93 91%,94 99% {95// … truncated
Files it writes
More from @loading-ui
All 50 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordion-loaderaccordion-loader | @loading-ui | Components | Free | no deps | |
| analyzing-imageanalyzing-image | @loading-ui | Components | Free | 1 dep | |
| arcarc | @loading-ui | Components | Free | no deps | |
| barsbars | @loading-ui | Components | Free | no deps | |
| bobbing-dotsbobbing-dots | @loading-ui | Components | Free | 1 dep | |
| bouncing-dotsbouncing-dots | @loading-ui | Components | Free | no deps | |
| classicclassic | @loading-ui | Components | Free | no deps | |
| clock-ringclock-ring | @loading-ui | Components | Free | no deps |
