fancy-ui-svelte 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +198 -0
- package/dist/fancy-ui/_template/Component.svelte +110 -0
- package/dist/fancy-ui/_template/Component.svelte.d.ts +16 -0
- package/dist/fancy-ui/_template/README.md +279 -0
- package/dist/fancy-ui/_template/index.d.ts +13 -0
- package/dist/fancy-ui/_template/index.js +27 -0
- package/dist/fancy-ui/_template/types.d.ts +53 -0
- package/dist/fancy-ui/_template/types.js +12 -0
- package/dist/fancy-ui/animated-beam/AnimatedBeam.svelte +166 -0
- package/dist/fancy-ui/animated-beam/AnimatedBeam.svelte.d.ts +4 -0
- package/dist/fancy-ui/animated-beam/AnimatedBeam.test.d.ts +1 -0
- package/dist/fancy-ui/animated-beam/AnimatedBeam.test.js +49 -0
- package/dist/fancy-ui/animated-beam/README.md +38 -0
- package/dist/fancy-ui/animated-beam/index.d.ts +2 -0
- package/dist/fancy-ui/animated-beam/index.js +1 -0
- package/dist/fancy-ui/animated-beam/types.d.ts +19 -0
- package/dist/fancy-ui/animated-beam/types.js +1 -0
- package/dist/fancy-ui/animated-testimonials/AnimatedTestimonials.svelte +196 -0
- package/dist/fancy-ui/animated-testimonials/AnimatedTestimonials.svelte.d.ts +29 -0
- package/dist/fancy-ui/animated-testimonials/AnimatedTestimonials.test.d.ts +1 -0
- package/dist/fancy-ui/animated-testimonials/AnimatedTestimonials.test.js +92 -0
- package/dist/fancy-ui/animated-testimonials/index.d.ts +2 -0
- package/dist/fancy-ui/animated-testimonials/index.js +1 -0
- package/dist/fancy-ui/animated-tooltip/AnimatedTooltip.svelte +97 -0
- package/dist/fancy-ui/animated-tooltip/AnimatedTooltip.svelte.d.ts +15 -0
- package/dist/fancy-ui/animated-tooltip/AnimatedTooltip.test.d.ts +1 -0
- package/dist/fancy-ui/animated-tooltip/AnimatedTooltip.test.js +67 -0
- package/dist/fancy-ui/animated-tooltip/index.d.ts +2 -0
- package/dist/fancy-ui/animated-tooltip/index.js +1 -0
- package/dist/fancy-ui/apple-card-carousel/AppleCard.svelte +226 -0
- package/dist/fancy-ui/apple-card-carousel/AppleCard.svelte.d.ts +27 -0
- package/dist/fancy-ui/apple-card-carousel/AppleCardCarousel.svelte +49 -0
- package/dist/fancy-ui/apple-card-carousel/AppleCardCarousel.svelte.d.ts +11 -0
- package/dist/fancy-ui/apple-card-carousel/AppleCardCarousel.test.d.ts +1 -0
- package/dist/fancy-ui/apple-card-carousel/AppleCardCarousel.test.js +85 -0
- package/dist/fancy-ui/apple-card-carousel/index.d.ts +3 -0
- package/dist/fancy-ui/apple-card-carousel/index.js +2 -0
- package/dist/fancy-ui/bento-grid/BentoGrid.svelte +21 -0
- package/dist/fancy-ui/bento-grid/BentoGrid.svelte.d.ts +7 -0
- package/dist/fancy-ui/bento-grid/BentoGridCard.svelte +70 -0
- package/dist/fancy-ui/bento-grid/BentoGridCard.svelte.d.ts +12 -0
- package/dist/fancy-ui/bento-grid/BentoGridItem.svelte +39 -0
- package/dist/fancy-ui/bento-grid/BentoGridItem.svelte.d.ts +10 -0
- package/dist/fancy-ui/bento-grid/README.md +51 -0
- package/dist/fancy-ui/bento-grid/index.d.ts +3 -0
- package/dist/fancy-ui/bento-grid/index.js +3 -0
- package/dist/fancy-ui/bg-falling-stars/FallingStarsBg.svelte +163 -0
- package/dist/fancy-ui/bg-falling-stars/FallingStarsBg.svelte.d.ts +11 -0
- package/dist/fancy-ui/bg-falling-stars/FallingStarsBg.test.d.ts +1 -0
- package/dist/fancy-ui/bg-falling-stars/FallingStarsBg.test.js +50 -0
- package/dist/fancy-ui/bg-falling-stars/README.md +22 -0
- package/dist/fancy-ui/bg-falling-stars/index.d.ts +2 -0
- package/dist/fancy-ui/bg-falling-stars/index.js +1 -0
- package/dist/fancy-ui/bg-stars/README.md +41 -0
- package/dist/fancy-ui/bg-stars/StarsBackground.svelte +205 -0
- package/dist/fancy-ui/bg-stars/StarsBackground.svelte.d.ts +33 -0
- package/dist/fancy-ui/bg-stars/StarsBackground.test.d.ts +1 -0
- package/dist/fancy-ui/bg-stars/StarsBackground.test.js +46 -0
- package/dist/fancy-ui/bg-stars/index.d.ts +1 -0
- package/dist/fancy-ui/bg-stars/index.js +1 -0
- package/dist/fancy-ui/blur-reveal/BlurReveal.svelte +126 -0
- package/dist/fancy-ui/blur-reveal/BlurReveal.svelte.d.ts +18 -0
- package/dist/fancy-ui/blur-reveal/BlurReveal.test.d.ts +1 -0
- package/dist/fancy-ui/blur-reveal/BlurReveal.test.js +47 -0
- package/dist/fancy-ui/blur-reveal/README.md +41 -0
- package/dist/fancy-ui/blur-reveal/index.d.ts +2 -0
- package/dist/fancy-ui/blur-reveal/index.js +2 -0
- package/dist/fancy-ui/book/Book.svelte +89 -0
- package/dist/fancy-ui/book/Book.svelte.d.ts +15 -0
- package/dist/fancy-ui/book/Book.test.d.ts +1 -0
- package/dist/fancy-ui/book/Book.test.js +47 -0
- package/dist/fancy-ui/book/BookDescription.svelte +17 -0
- package/dist/fancy-ui/book/BookDescription.svelte.d.ts +8 -0
- package/dist/fancy-ui/book/BookHeader.svelte +17 -0
- package/dist/fancy-ui/book/BookHeader.svelte.d.ts +8 -0
- package/dist/fancy-ui/book/BookTitle.svelte +17 -0
- package/dist/fancy-ui/book/BookTitle.svelte.d.ts +8 -0
- package/dist/fancy-ui/book/README.md +34 -0
- package/dist/fancy-ui/book/index.d.ts +128 -0
- package/dist/fancy-ui/book/index.js +46 -0
- package/dist/fancy-ui/border-beam/BorderBeam.svelte +85 -0
- package/dist/fancy-ui/border-beam/BorderBeam.svelte.d.ts +27 -0
- package/dist/fancy-ui/border-beam/BorderBeam.test.d.ts +1 -0
- package/dist/fancy-ui/border-beam/BorderBeam.test.js +64 -0
- package/dist/fancy-ui/border-beam/index.d.ts +2 -0
- package/dist/fancy-ui/border-beam/index.js +2 -0
- package/dist/fancy-ui/box-reveal/BoxReveal.svelte +73 -0
- package/dist/fancy-ui/box-reveal/BoxReveal.svelte.d.ts +24 -0
- package/dist/fancy-ui/box-reveal/BoxReveal.test.d.ts +1 -0
- package/dist/fancy-ui/box-reveal/BoxReveal.test.js +66 -0
- package/dist/fancy-ui/box-reveal/README.md +24 -0
- package/dist/fancy-ui/box-reveal/index.d.ts +2 -0
- package/dist/fancy-ui/box-reveal/index.js +2 -0
- package/dist/fancy-ui/card-3d/CardBody.svelte +16 -0
- package/dist/fancy-ui/card-3d/CardBody.svelte.d.ts +7 -0
- package/dist/fancy-ui/card-3d/CardContainer.svelte +53 -0
- package/dist/fancy-ui/card-3d/CardContainer.svelte.d.ts +8 -0
- package/dist/fancy-ui/card-3d/CardItem.svelte +49 -0
- package/dist/fancy-ui/card-3d/CardItem.svelte.d.ts +14 -0
- package/dist/fancy-ui/card-3d/README.md +52 -0
- package/dist/fancy-ui/card-3d/index.d.ts +3 -0
- package/dist/fancy-ui/card-3d/index.js +3 -0
- package/dist/fancy-ui/card-spotlight/CardSpotlight.svelte +59 -0
- package/dist/fancy-ui/card-spotlight/CardSpotlight.svelte.d.ts +11 -0
- package/dist/fancy-ui/card-spotlight/README.md +24 -0
- package/dist/fancy-ui/card-spotlight/index.d.ts +1 -0
- package/dist/fancy-ui/card-spotlight/index.js +1 -0
- package/dist/fancy-ui/colourful-text/ColourfulText.svelte +78 -0
- package/dist/fancy-ui/colourful-text/ColourfulText.svelte.d.ts +22 -0
- package/dist/fancy-ui/colourful-text/ColourfulText.test.d.ts +1 -0
- package/dist/fancy-ui/colourful-text/ColourfulText.test.js +53 -0
- package/dist/fancy-ui/colourful-text/README.md +21 -0
- package/dist/fancy-ui/colourful-text/index.d.ts +2 -0
- package/dist/fancy-ui/colourful-text/index.js +2 -0
- package/dist/fancy-ui/compare/Compare.svelte +304 -0
- package/dist/fancy-ui/compare/Compare.svelte.d.ts +25 -0
- package/dist/fancy-ui/compare/Compare.test.d.ts +1 -0
- package/dist/fancy-ui/compare/Compare.test.js +57 -0
- package/dist/fancy-ui/compare/README.md +97 -0
- package/dist/fancy-ui/compare/StarField.svelte +108 -0
- package/dist/fancy-ui/compare/StarField.svelte.d.ts +7 -0
- package/dist/fancy-ui/compare/index.d.ts +2 -0
- package/dist/fancy-ui/compare/index.js +2 -0
- package/dist/fancy-ui/confetti/Confetti.svelte +60 -0
- package/dist/fancy-ui/confetti/Confetti.svelte.d.ts +14 -0
- package/dist/fancy-ui/confetti/Confetti.test.d.ts +1 -0
- package/dist/fancy-ui/confetti/Confetti.test.js +39 -0
- package/dist/fancy-ui/confetti/ConfettiButton.svelte +41 -0
- package/dist/fancy-ui/confetti/ConfettiButton.svelte.d.ts +9 -0
- package/dist/fancy-ui/confetti/README.md +22 -0
- package/dist/fancy-ui/confetti/index.d.ts +2 -0
- package/dist/fancy-ui/confetti/index.js +2 -0
- package/dist/fancy-ui/container-scroll/ContainerScroll.svelte +82 -0
- package/dist/fancy-ui/container-scroll/ContainerScroll.svelte.d.ts +9 -0
- package/dist/fancy-ui/container-scroll/ContainerScroll.test.d.ts +1 -0
- package/dist/fancy-ui/container-scroll/ContainerScroll.test.js +34 -0
- package/dist/fancy-ui/container-scroll/README.md +28 -0
- package/dist/fancy-ui/container-scroll/index.d.ts +1 -0
- package/dist/fancy-ui/container-scroll/index.js +1 -0
- package/dist/fancy-ui/container-text-flip/ContainerTextFlip.svelte +78 -0
- package/dist/fancy-ui/container-text-flip/ContainerTextFlip.svelte.d.ts +10 -0
- package/dist/fancy-ui/container-text-flip/ContainerTextFlip.test.d.ts +1 -0
- package/dist/fancy-ui/container-text-flip/ContainerTextFlip.test.js +46 -0
- package/dist/fancy-ui/container-text-flip/README.md +22 -0
- package/dist/fancy-ui/container-text-flip/index.d.ts +1 -0
- package/dist/fancy-ui/container-text-flip/index.js +1 -0
- package/dist/fancy-ui/direction-aware-hover/DirectionAwareHover.svelte +232 -0
- package/dist/fancy-ui/direction-aware-hover/DirectionAwareHover.svelte.d.ts +11 -0
- package/dist/fancy-ui/direction-aware-hover/DirectionAwareHover.test.d.ts +1 -0
- package/dist/fancy-ui/direction-aware-hover/DirectionAwareHover.test.js +78 -0
- package/dist/fancy-ui/direction-aware-hover/README.md +47 -0
- package/dist/fancy-ui/direction-aware-hover/index.d.ts +1 -0
- package/dist/fancy-ui/direction-aware-hover/index.js +1 -0
- package/dist/fancy-ui/displacement-text/DisplacementText.svelte +224 -0
- package/dist/fancy-ui/displacement-text/DisplacementText.svelte.d.ts +19 -0
- package/dist/fancy-ui/displacement-text/DisplacementText.test.d.ts +1 -0
- package/dist/fancy-ui/displacement-text/DisplacementText.test.js +144 -0
- package/dist/fancy-ui/displacement-text/index.d.ts +2 -0
- package/dist/fancy-ui/displacement-text/index.js +1 -0
- package/dist/fancy-ui/dock/Dock.svelte +87 -0
- package/dist/fancy-ui/dock/Dock.svelte.d.ts +12 -0
- package/dist/fancy-ui/dock/Dock.test.d.ts +1 -0
- package/dist/fancy-ui/dock/Dock.test.js +51 -0
- package/dist/fancy-ui/dock/DockIcon.svelte +50 -0
- package/dist/fancy-ui/dock/DockIcon.svelte.d.ts +7 -0
- package/dist/fancy-ui/dock/DockSeparator.svelte +21 -0
- package/dist/fancy-ui/dock/DockSeparator.svelte.d.ts +6 -0
- package/dist/fancy-ui/dock/README.md +57 -0
- package/dist/fancy-ui/dock/index.d.ts +4 -0
- package/dist/fancy-ui/dock/index.js +4 -0
- package/dist/fancy-ui/dock/types.d.ts +14 -0
- package/dist/fancy-ui/dock/types.js +1 -0
- package/dist/fancy-ui/flickering-grid/FlickeringGrid.svelte +154 -0
- package/dist/fancy-ui/flickering-grid/FlickeringGrid.svelte.d.ts +27 -0
- package/dist/fancy-ui/flickering-grid/FlickeringGrid.test.d.ts +1 -0
- package/dist/fancy-ui/flickering-grid/FlickeringGrid.test.js +34 -0
- package/dist/fancy-ui/flickering-grid/README.md +24 -0
- package/dist/fancy-ui/flickering-grid/index.d.ts +2 -0
- package/dist/fancy-ui/flickering-grid/index.js +2 -0
- package/dist/fancy-ui/flip-card/FlipCard.svelte +48 -0
- package/dist/fancy-ui/flip-card/FlipCard.svelte.d.ts +10 -0
- package/dist/fancy-ui/flip-card/FlipCard.test.d.ts +1 -0
- package/dist/fancy-ui/flip-card/FlipCard.test.js +36 -0
- package/dist/fancy-ui/flip-card/README.md +26 -0
- package/dist/fancy-ui/flip-card/index.d.ts +1 -0
- package/dist/fancy-ui/flip-card/index.js +1 -0
- package/dist/fancy-ui/flip-words/FlipWords.svelte +135 -0
- package/dist/fancy-ui/flip-words/FlipWords.svelte.d.ts +18 -0
- package/dist/fancy-ui/flip-words/FlipWords.test.d.ts +1 -0
- package/dist/fancy-ui/flip-words/FlipWords.test.js +50 -0
- package/dist/fancy-ui/flip-words/README.md +17 -0
- package/dist/fancy-ui/flip-words/index.d.ts +2 -0
- package/dist/fancy-ui/flip-words/index.js +2 -0
- package/dist/fancy-ui/fluid-cursor/FluidCursor.svelte +1378 -0
- package/dist/fancy-ui/fluid-cursor/FluidCursor.svelte.d.ts +25 -0
- package/dist/fancy-ui/fluid-cursor/FluidCursor.test.d.ts +1 -0
- package/dist/fancy-ui/fluid-cursor/FluidCursor.test.js +41 -0
- package/dist/fancy-ui/fluid-cursor/README.md +34 -0
- package/dist/fancy-ui/fluid-cursor/index.d.ts +1 -0
- package/dist/fancy-ui/fluid-cursor/index.js +1 -0
- package/dist/fancy-ui/focus/Focus.svelte +177 -0
- package/dist/fancy-ui/focus/Focus.svelte.d.ts +12 -0
- package/dist/fancy-ui/focus/Focus.test.d.ts +1 -0
- package/dist/fancy-ui/focus/Focus.test.js +48 -0
- package/dist/fancy-ui/focus/README.md +21 -0
- package/dist/fancy-ui/focus/index.d.ts +1 -0
- package/dist/fancy-ui/focus/index.js +1 -0
- package/dist/fancy-ui/glare-card/GlareCard.svelte +133 -0
- package/dist/fancy-ui/glare-card/GlareCard.svelte.d.ts +8 -0
- package/dist/fancy-ui/glare-card/GlareCard.test.d.ts +1 -0
- package/dist/fancy-ui/glare-card/GlareCard.test.js +40 -0
- package/dist/fancy-ui/glare-card/README.md +24 -0
- package/dist/fancy-ui/glare-card/index.d.ts +1 -0
- package/dist/fancy-ui/glare-card/index.js +1 -0
- package/dist/fancy-ui/glow-border/GlowBorder.svelte +67 -0
- package/dist/fancy-ui/glow-border/GlowBorder.svelte.d.ts +10 -0
- package/dist/fancy-ui/glow-border/GlowBorder.test.d.ts +1 -0
- package/dist/fancy-ui/glow-border/GlowBorder.test.js +57 -0
- package/dist/fancy-ui/glow-border/README.md +54 -0
- package/dist/fancy-ui/glow-border/index.d.ts +1 -0
- package/dist/fancy-ui/glow-border/index.js +1 -0
- package/dist/fancy-ui/glowing-effect/GlowingEffect.svelte +182 -0
- package/dist/fancy-ui/glowing-effect/GlowingEffect.svelte.d.ts +15 -0
- package/dist/fancy-ui/glowing-effect/GlowingEffect.test.d.ts +1 -0
- package/dist/fancy-ui/glowing-effect/GlowingEffect.test.js +68 -0
- package/dist/fancy-ui/glowing-effect/README.md +29 -0
- package/dist/fancy-ui/glowing-effect/index.d.ts +1 -0
- package/dist/fancy-ui/glowing-effect/index.js +1 -0
- package/dist/fancy-ui/gradient-button/GradientButton.svelte +103 -0
- package/dist/fancy-ui/gradient-button/GradientButton.svelte.d.ts +24 -0
- package/dist/fancy-ui/gradient-button/GradientButton.test.d.ts +1 -0
- package/dist/fancy-ui/gradient-button/GradientButton.test.js +65 -0
- package/dist/fancy-ui/gradient-button/README.md +10 -0
- package/dist/fancy-ui/gradient-button/index.d.ts +2 -0
- package/dist/fancy-ui/gradient-button/index.js +2 -0
- package/dist/fancy-ui/hyper-text/HyperText.svelte +112 -0
- package/dist/fancy-ui/hyper-text/HyperText.svelte.d.ts +20 -0
- package/dist/fancy-ui/hyper-text/HyperText.test.d.ts +1 -0
- package/dist/fancy-ui/hyper-text/HyperText.test.js +39 -0
- package/dist/fancy-ui/hyper-text/README.md +19 -0
- package/dist/fancy-ui/hyper-text/index.d.ts +2 -0
- package/dist/fancy-ui/hyper-text/index.js +2 -0
- package/dist/fancy-ui/image-trail-cursor/ImageTrailCursor.svelte +89 -0
- package/dist/fancy-ui/image-trail-cursor/ImageTrailCursor.svelte.d.ts +9 -0
- package/dist/fancy-ui/image-trail-cursor/ImageTrailCursor.test.d.ts +1 -0
- package/dist/fancy-ui/image-trail-cursor/ImageTrailCursor.test.js +60 -0
- package/dist/fancy-ui/image-trail-cursor/README.md +36 -0
- package/dist/fancy-ui/image-trail-cursor/index.d.ts +3 -0
- package/dist/fancy-ui/image-trail-cursor/index.js +1 -0
- package/dist/fancy-ui/image-trail-cursor/trail-variants.d.ts +107 -0
- package/dist/fancy-ui/image-trail-cursor/trail-variants.js +703 -0
- package/dist/fancy-ui/index.d.ts +52 -0
- package/dist/fancy-ui/index.js +64 -0
- package/dist/fancy-ui/interactive-grid-pattern/InteractiveGridPattern.svelte +71 -0
- package/dist/fancy-ui/interactive-grid-pattern/InteractiveGridPattern.svelte.d.ts +15 -0
- package/dist/fancy-ui/interactive-grid-pattern/InteractiveGridPattern.test.d.ts +1 -0
- package/dist/fancy-ui/interactive-grid-pattern/InteractiveGridPattern.test.js +47 -0
- package/dist/fancy-ui/interactive-grid-pattern/README.md +30 -0
- package/dist/fancy-ui/interactive-grid-pattern/index.d.ts +2 -0
- package/dist/fancy-ui/interactive-grid-pattern/index.js +2 -0
- package/dist/fancy-ui/interactive-hover-button/InteractiveHoverButton.svelte +75 -0
- package/dist/fancy-ui/interactive-hover-button/InteractiveHoverButton.svelte.d.ts +14 -0
- package/dist/fancy-ui/interactive-hover-button/InteractiveHoverButton.test.d.ts +1 -0
- package/dist/fancy-ui/interactive-hover-button/InteractiveHoverButton.test.js +64 -0
- package/dist/fancy-ui/interactive-hover-button/README.md +28 -0
- package/dist/fancy-ui/interactive-hover-button/index.d.ts +2 -0
- package/dist/fancy-ui/interactive-hover-button/index.js +2 -0
- package/dist/fancy-ui/letter-pullup/LetterPullup.svelte +58 -0
- package/dist/fancy-ui/letter-pullup/LetterPullup.svelte.d.ts +17 -0
- package/dist/fancy-ui/letter-pullup/LetterPullup.test.d.ts +1 -0
- package/dist/fancy-ui/letter-pullup/LetterPullup.test.js +49 -0
- package/dist/fancy-ui/letter-pullup/README.md +18 -0
- package/dist/fancy-ui/letter-pullup/index.d.ts +2 -0
- package/dist/fancy-ui/letter-pullup/index.js +2 -0
- package/dist/fancy-ui/line-hover-link/LineHoverLink.svelte +450 -0
- package/dist/fancy-ui/line-hover-link/LineHoverLink.svelte.d.ts +35 -0
- package/dist/fancy-ui/line-hover-link/LineHoverLink.test.d.ts +1 -0
- package/dist/fancy-ui/line-hover-link/LineHoverLink.test.js +55 -0
- package/dist/fancy-ui/line-hover-link/index.d.ts +2 -0
- package/dist/fancy-ui/line-hover-link/index.js +1 -0
- package/dist/fancy-ui/line-shadow-text/LineShadowText.svelte +63 -0
- package/dist/fancy-ui/line-shadow-text/LineShadowText.svelte.d.ts +9 -0
- package/dist/fancy-ui/line-shadow-text/LineShadowText.test.d.ts +1 -0
- package/dist/fancy-ui/line-shadow-text/LineShadowText.test.js +59 -0
- package/dist/fancy-ui/line-shadow-text/README.md +12 -0
- package/dist/fancy-ui/line-shadow-text/index.d.ts +2 -0
- package/dist/fancy-ui/line-shadow-text/index.js +1 -0
- package/dist/fancy-ui/liquid-glass/LiquidGlass.svelte +204 -0
- package/dist/fancy-ui/liquid-glass/LiquidGlass.svelte.d.ts +23 -0
- package/dist/fancy-ui/liquid-glass/LiquidGlass.test.d.ts +1 -0
- package/dist/fancy-ui/liquid-glass/LiquidGlass.test.js +48 -0
- package/dist/fancy-ui/liquid-glass/README.md +34 -0
- package/dist/fancy-ui/liquid-glass/index.d.ts +1 -0
- package/dist/fancy-ui/liquid-glass/index.js +1 -0
- package/dist/fancy-ui/logo-cloud/AnimatedLogoCloud.svelte +61 -0
- package/dist/fancy-ui/logo-cloud/AnimatedLogoCloud.svelte.d.ts +15 -0
- package/dist/fancy-ui/logo-cloud/AnimatedLogoCloud.test.d.ts +1 -0
- package/dist/fancy-ui/logo-cloud/AnimatedLogoCloud.test.js +59 -0
- package/dist/fancy-ui/logo-cloud/IconLogoCloud.svelte +31 -0
- package/dist/fancy-ui/logo-cloud/IconLogoCloud.svelte.d.ts +11 -0
- package/dist/fancy-ui/logo-cloud/README.md +41 -0
- package/dist/fancy-ui/logo-cloud/StaticLogoCloud.svelte +31 -0
- package/dist/fancy-ui/logo-cloud/StaticLogoCloud.svelte.d.ts +11 -0
- package/dist/fancy-ui/logo-cloud/index.d.ts +4 -0
- package/dist/fancy-ui/logo-cloud/index.js +4 -0
- package/dist/fancy-ui/marquee/Marquee.svelte +70 -0
- package/dist/fancy-ui/marquee/Marquee.svelte.d.ts +11 -0
- package/dist/fancy-ui/marquee/Marquee.test.d.ts +1 -0
- package/dist/fancy-ui/marquee/Marquee.test.js +46 -0
- package/dist/fancy-ui/marquee/ReviewCard.svelte +25 -0
- package/dist/fancy-ui/marquee/ReviewCard.svelte.d.ts +9 -0
- package/dist/fancy-ui/marquee/index.d.ts +2 -0
- package/dist/fancy-ui/marquee/index.js +2 -0
- package/dist/fancy-ui/meteors/Meteors.svelte +59 -0
- package/dist/fancy-ui/meteors/Meteors.svelte.d.ts +15 -0
- package/dist/fancy-ui/meteors/Meteors.test.d.ts +1 -0
- package/dist/fancy-ui/meteors/Meteors.test.js +48 -0
- package/dist/fancy-ui/meteors/README.md +18 -0
- package/dist/fancy-ui/meteors/index.d.ts +2 -0
- package/dist/fancy-ui/meteors/index.js +2 -0
- package/dist/fancy-ui/neon-border/NeonBorder.svelte +135 -0
- package/dist/fancy-ui/neon-border/NeonBorder.svelte.d.ts +24 -0
- package/dist/fancy-ui/neon-border/NeonBorder.test.d.ts +1 -0
- package/dist/fancy-ui/neon-border/NeonBorder.test.js +80 -0
- package/dist/fancy-ui/neon-border/README.md +27 -0
- package/dist/fancy-ui/neon-border/index.d.ts +2 -0
- package/dist/fancy-ui/neon-border/index.js +2 -0
- package/dist/fancy-ui/number-ticker/NumberTicker.svelte +126 -0
- package/dist/fancy-ui/number-ticker/NumberTicker.svelte.d.ts +24 -0
- package/dist/fancy-ui/number-ticker/NumberTicker.test.d.ts +1 -0
- package/dist/fancy-ui/number-ticker/NumberTicker.test.js +64 -0
- package/dist/fancy-ui/number-ticker/README.md +22 -0
- package/dist/fancy-ui/number-ticker/index.d.ts +2 -0
- package/dist/fancy-ui/number-ticker/index.js +2 -0
- package/dist/fancy-ui/rainbow-button/RainbowButton.svelte +96 -0
- package/dist/fancy-ui/rainbow-button/RainbowButton.svelte.d.ts +18 -0
- package/dist/fancy-ui/rainbow-button/RainbowButton.test.d.ts +1 -0
- package/dist/fancy-ui/rainbow-button/RainbowButton.test.js +51 -0
- package/dist/fancy-ui/rainbow-button/index.d.ts +2 -0
- package/dist/fancy-ui/rainbow-button/index.js +2 -0
- package/dist/fancy-ui/registry.d.ts +72 -0
- package/dist/fancy-ui/registry.js +643 -0
- package/dist/fancy-ui/ripple/README.md +16 -0
- package/dist/fancy-ui/ripple/Ripple.svelte +64 -0
- package/dist/fancy-ui/ripple/Ripple.svelte.d.ts +13 -0
- package/dist/fancy-ui/ripple/Ripple.test.d.ts +1 -0
- package/dist/fancy-ui/ripple/Ripple.test.js +81 -0
- package/dist/fancy-ui/ripple/index.d.ts +1 -0
- package/dist/fancy-ui/ripple/index.js +1 -0
- package/dist/fancy-ui/ripple-button/RippleButton.svelte +111 -0
- package/dist/fancy-ui/ripple-button/RippleButton.svelte.d.ts +15 -0
- package/dist/fancy-ui/ripple-button/RippleButton.test.d.ts +1 -0
- package/dist/fancy-ui/ripple-button/RippleButton.test.js +44 -0
- package/dist/fancy-ui/ripple-button/index.d.ts +2 -0
- package/dist/fancy-ui/ripple-button/index.js +2 -0
- package/dist/fancy-ui/shimmer-button/README.md +10 -0
- package/dist/fancy-ui/shimmer-button/ShimmerButton.svelte +115 -0
- package/dist/fancy-ui/shimmer-button/ShimmerButton.svelte.d.ts +22 -0
- package/dist/fancy-ui/shimmer-button/ShimmerButton.test.d.ts +1 -0
- package/dist/fancy-ui/shimmer-button/ShimmerButton.test.js +69 -0
- package/dist/fancy-ui/shimmer-button/index.d.ts +2 -0
- package/dist/fancy-ui/shimmer-button/index.js +2 -0
- package/dist/fancy-ui/smooth-cursor/README.md +23 -0
- package/dist/fancy-ui/smooth-cursor/SmoothCursor.svelte +224 -0
- package/dist/fancy-ui/smooth-cursor/SmoothCursor.svelte.d.ts +20 -0
- package/dist/fancy-ui/smooth-cursor/index.d.ts +2 -0
- package/dist/fancy-ui/smooth-cursor/index.js +1 -0
- package/dist/fancy-ui/sparkles/README.md +15 -0
- package/dist/fancy-ui/sparkles/Sparkles.svelte +123 -0
- package/dist/fancy-ui/sparkles/Sparkles.svelte.d.ts +12 -0
- package/dist/fancy-ui/sparkles/Sparkles.test.d.ts +1 -0
- package/dist/fancy-ui/sparkles/Sparkles.test.js +66 -0
- package/dist/fancy-ui/sparkles/index.d.ts +1 -0
- package/dist/fancy-ui/sparkles/index.js +1 -0
- package/dist/fancy-ui/sparkles-text/README.md +19 -0
- package/dist/fancy-ui/sparkles-text/SparklesText.svelte +112 -0
- package/dist/fancy-ui/sparkles-text/SparklesText.svelte.d.ts +22 -0
- package/dist/fancy-ui/sparkles-text/SparklesText.test.d.ts +1 -0
- package/dist/fancy-ui/sparkles-text/SparklesText.test.js +54 -0
- package/dist/fancy-ui/sparkles-text/index.d.ts +2 -0
- package/dist/fancy-ui/sparkles-text/index.js +2 -0
- package/dist/fancy-ui/tailwind.css +3 -0
- package/dist/fancy-ui/text-generate-effect/README.md +14 -0
- package/dist/fancy-ui/text-generate-effect/TextGenerateEffect.svelte +66 -0
- package/dist/fancy-ui/text-generate-effect/TextGenerateEffect.svelte.d.ts +11 -0
- package/dist/fancy-ui/text-generate-effect/TextGenerateEffect.test.d.ts +1 -0
- package/dist/fancy-ui/text-generate-effect/TextGenerateEffect.test.js +73 -0
- package/dist/fancy-ui/text-generate-effect/index.d.ts +2 -0
- package/dist/fancy-ui/text-generate-effect/index.js +1 -0
- package/dist/fancy-ui/text-reveal-card/README.md +36 -0
- package/dist/fancy-ui/text-reveal-card/TextRevealCard.svelte +112 -0
- package/dist/fancy-ui/text-reveal-card/TextRevealCard.svelte.d.ts +12 -0
- package/dist/fancy-ui/text-reveal-card/TextRevealCard.test.d.ts +1 -0
- package/dist/fancy-ui/text-reveal-card/TextRevealCard.test.js +34 -0
- package/dist/fancy-ui/text-reveal-card/TextRevealStars.svelte +76 -0
- package/dist/fancy-ui/text-reveal-card/TextRevealStars.svelte.d.ts +7 -0
- package/dist/fancy-ui/text-reveal-card/index.d.ts +2 -0
- package/dist/fancy-ui/text-reveal-card/index.js +2 -0
- package/dist/fancy-ui/timeline/README.md +56 -0
- package/dist/fancy-ui/timeline/Timeline.svelte +141 -0
- package/dist/fancy-ui/timeline/Timeline.svelte.d.ts +20 -0
- package/dist/fancy-ui/timeline/Timeline.test.d.ts +1 -0
- package/dist/fancy-ui/timeline/Timeline.test.js +63 -0
- package/dist/fancy-ui/timeline/index.d.ts +2 -0
- package/dist/fancy-ui/timeline/index.js +2 -0
- package/dist/fancy-ui/tracing-beam/README.md +24 -0
- package/dist/fancy-ui/tracing-beam/TracingBeam.svelte +156 -0
- package/dist/fancy-ui/tracing-beam/TracingBeam.svelte.d.ts +8 -0
- package/dist/fancy-ui/tracing-beam/TracingBeam.test.d.ts +1 -0
- package/dist/fancy-ui/tracing-beam/TracingBeam.test.js +61 -0
- package/dist/fancy-ui/tracing-beam/index.d.ts +1 -0
- package/dist/fancy-ui/tracing-beam/index.js +1 -0
- package/dist/types.d.ts +87 -0
- package/dist/types.js +6 -0
- package/dist/utils.d.ts +12 -0
- package/dist/utils.js +5 -0
- package/package.json +105 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
/**
|
|
3
|
+
* HyperText - Character scramble effect
|
|
4
|
+
*
|
|
5
|
+
* Displays text that scrambles through random characters on hover (or on load),
|
|
6
|
+
* then resolves back to the original text. Each character is individually animated
|
|
7
|
+
* with a staggered reveal.
|
|
8
|
+
*/
|
|
9
|
+
export interface HyperTextProps {
|
|
10
|
+
/** Text to display and scramble */
|
|
11
|
+
text: string;
|
|
12
|
+
/** Total animation duration in ms */
|
|
13
|
+
duration?: number;
|
|
14
|
+
/** Whether to animate on initial load */
|
|
15
|
+
animateOnLoad?: boolean;
|
|
16
|
+
/** Additional CSS classes */
|
|
17
|
+
class?: string;
|
|
18
|
+
}
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<script lang="ts">
|
|
22
|
+
import { cn } from "../../utils.js";
|
|
23
|
+
import { onMount } from "svelte";
|
|
24
|
+
|
|
25
|
+
let { text, duration = 800, animateOnLoad = false, class: className }: HyperTextProps = $props();
|
|
26
|
+
|
|
27
|
+
const ALPHABETS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
28
|
+
|
|
29
|
+
let displayChars = $derived(text.split(""));
|
|
30
|
+
let displayText = $state<string[]>([]);
|
|
31
|
+
let intervalId: ReturnType<typeof setInterval> | null = null;
|
|
32
|
+
let iterations = 0;
|
|
33
|
+
|
|
34
|
+
// Sync displayText when text prop changes
|
|
35
|
+
$effect(() => {
|
|
36
|
+
displayText = displayChars;
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
function getRandomLetter(): string {
|
|
40
|
+
return ALPHABETS[Math.floor(Math.random() * ALPHABETS.length)];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function startAnimation() {
|
|
44
|
+
stopAnimation();
|
|
45
|
+
iterations = 0;
|
|
46
|
+
const intervalMs = duration / (text.length * 10);
|
|
47
|
+
|
|
48
|
+
intervalId = setInterval(() => {
|
|
49
|
+
if (iterations < text.length) {
|
|
50
|
+
displayText = displayText.map((l, i) =>
|
|
51
|
+
l === " " ? l : i <= iterations ? text[i] : getRandomLetter()
|
|
52
|
+
);
|
|
53
|
+
iterations += 0.1;
|
|
54
|
+
} else {
|
|
55
|
+
stopAnimation();
|
|
56
|
+
displayText = text.split("");
|
|
57
|
+
}
|
|
58
|
+
}, intervalMs);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function stopAnimation() {
|
|
62
|
+
if (intervalId) {
|
|
63
|
+
clearInterval(intervalId);
|
|
64
|
+
intervalId = null;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function triggerAnimation() {
|
|
69
|
+
iterations = 0;
|
|
70
|
+
startAnimation();
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
onMount(() => {
|
|
74
|
+
if (animateOnLoad) {
|
|
75
|
+
triggerAnimation();
|
|
76
|
+
}
|
|
77
|
+
return stopAnimation;
|
|
78
|
+
});
|
|
79
|
+
</script>
|
|
80
|
+
|
|
81
|
+
<div
|
|
82
|
+
class={cn("hyper-text flex scale-100 cursor-default overflow-hidden py-2", className)}
|
|
83
|
+
onmouseenter={triggerAnimation}
|
|
84
|
+
role="presentation"
|
|
85
|
+
>
|
|
86
|
+
<div class="flex">
|
|
87
|
+
{#each displayText as letter, i (i)}
|
|
88
|
+
<span
|
|
89
|
+
class={cn("hyper-text-char inline-block font-mono", letter === " " ? "w-3" : "")}
|
|
90
|
+
style="animation:hyperFadeIn 0.3s ease forwards;animation-delay:{i *
|
|
91
|
+
(duration / (text.length * 10))}ms;opacity:0"
|
|
92
|
+
>
|
|
93
|
+
{letter.toUpperCase()}
|
|
94
|
+
</span>
|
|
95
|
+
{/each}
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
<style>
|
|
100
|
+
:global {
|
|
101
|
+
@keyframes hyperFadeIn {
|
|
102
|
+
0% {
|
|
103
|
+
opacity: 0;
|
|
104
|
+
transform: translateY(-10px);
|
|
105
|
+
}
|
|
106
|
+
100% {
|
|
107
|
+
opacity: 1;
|
|
108
|
+
transform: translateY(0);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HyperText - Character scramble effect
|
|
3
|
+
*
|
|
4
|
+
* Displays text that scrambles through random characters on hover (or on load),
|
|
5
|
+
* then resolves back to the original text. Each character is individually animated
|
|
6
|
+
* with a staggered reveal.
|
|
7
|
+
*/
|
|
8
|
+
export interface HyperTextProps {
|
|
9
|
+
/** Text to display and scramble */
|
|
10
|
+
text: string;
|
|
11
|
+
/** Total animation duration in ms */
|
|
12
|
+
duration?: number;
|
|
13
|
+
/** Whether to animate on initial load */
|
|
14
|
+
animateOnLoad?: boolean;
|
|
15
|
+
/** Additional CSS classes */
|
|
16
|
+
class?: string;
|
|
17
|
+
}
|
|
18
|
+
declare const HyperText: import("svelte").Component<HyperTextProps, {}, "">;
|
|
19
|
+
type HyperText = ReturnType<typeof HyperText>;
|
|
20
|
+
export default HyperText;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { render, cleanup } from "@testing-library/svelte";
|
|
2
|
+
import { afterEach, describe, it, expect } from "vitest";
|
|
3
|
+
import HyperText from "./HyperText.svelte";
|
|
4
|
+
describe("HyperText", () => {
|
|
5
|
+
afterEach(cleanup);
|
|
6
|
+
it("renders one span per character", () => {
|
|
7
|
+
const { container } = render(HyperText, { props: { text: "Hello" } });
|
|
8
|
+
const chars = container.querySelectorAll(".hyper-text-char");
|
|
9
|
+
expect(chars.length).toBe(5);
|
|
10
|
+
});
|
|
11
|
+
it("displays text in uppercase", () => {
|
|
12
|
+
const { container } = render(HyperText, { props: { text: "abc" } });
|
|
13
|
+
const wrapper = container.querySelector(".hyper-text");
|
|
14
|
+
// Text content may be scrambled or resolved, but should exist
|
|
15
|
+
expect(wrapper?.textContent?.trim().length).toBeGreaterThan(0);
|
|
16
|
+
});
|
|
17
|
+
it("applies custom class names", () => {
|
|
18
|
+
const { container } = render(HyperText, {
|
|
19
|
+
props: { text: "Test", class: "my-hyper" },
|
|
20
|
+
});
|
|
21
|
+
const wrapper = container.querySelector(".hyper-text");
|
|
22
|
+
expect(wrapper?.className).toContain("my-hyper");
|
|
23
|
+
});
|
|
24
|
+
it("applies animation styles to each character", () => {
|
|
25
|
+
const { container } = render(HyperText, { props: { text: "Hi" } });
|
|
26
|
+
const chars = container.querySelectorAll(".hyper-text-char");
|
|
27
|
+
chars.forEach((char) => {
|
|
28
|
+
const style = char.getAttribute("style") ?? "";
|
|
29
|
+
expect(style).toContain("animation");
|
|
30
|
+
expect(style).toContain("hyperFadeIn");
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
it("renders spaces with w-3 class", () => {
|
|
34
|
+
const { container } = render(HyperText, { props: { text: "A B" } });
|
|
35
|
+
const chars = container.querySelectorAll(".hyper-text-char");
|
|
36
|
+
expect(chars.length).toBe(3);
|
|
37
|
+
expect(chars[1].className).toContain("w-3");
|
|
38
|
+
});
|
|
39
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# HyperText
|
|
2
|
+
|
|
3
|
+
Character scramble effect. Displays text that scrambles through random uppercase characters on hover, then resolves back to the original text with staggered reveal.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
| Prop | Type | Default | Description |
|
|
8
|
+
| --------------- | --------- | ------- | ---------------------------------- |
|
|
9
|
+
| `text` | `string` | required| Text to display and scramble |
|
|
10
|
+
| `duration` | `number` | `800` | Total animation duration (ms) |
|
|
11
|
+
| `animateOnLoad` | `boolean` | `false` | Whether to animate on initial load |
|
|
12
|
+
| `class` | `string` | `''` | Additional CSS classes |
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
```svelte
|
|
17
|
+
<HyperText text="Hover me!" />
|
|
18
|
+
<HyperText text="Auto animate" animateOnLoad />
|
|
19
|
+
```
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { VariantType } from "./trail-variants.js";
|
|
3
|
+
|
|
4
|
+
export interface ImageTrailCursorProps {
|
|
5
|
+
images?: string[];
|
|
6
|
+
variant?: VariantType;
|
|
7
|
+
class?: string;
|
|
8
|
+
}
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<script lang="ts">
|
|
12
|
+
import { onMount } from "svelte";
|
|
13
|
+
import { cn } from "../../utils.js";
|
|
14
|
+
import { variantMap, type ImageTrailVariant } from "./trail-variants.js";
|
|
15
|
+
|
|
16
|
+
let { images = [], variant = "type1", class: className = "" }: ImageTrailCursorProps = $props();
|
|
17
|
+
|
|
18
|
+
let containerRef: HTMLDivElement;
|
|
19
|
+
let currentInstance: ImageTrailVariant | null = null;
|
|
20
|
+
let mounted = false;
|
|
21
|
+
|
|
22
|
+
function resetImageStyles() {
|
|
23
|
+
if (!containerRef) return;
|
|
24
|
+
const imgEls = containerRef.querySelectorAll<HTMLDivElement>(".content__img");
|
|
25
|
+
for (const el of imgEls) {
|
|
26
|
+
el.style.cssText = "";
|
|
27
|
+
const inner = el.querySelector<HTMLDivElement>(".content__img-inner");
|
|
28
|
+
if (inner) {
|
|
29
|
+
// Preserve background-image set by Svelte, only clear GSAP residue
|
|
30
|
+
const bgImage = inner.style.backgroundImage;
|
|
31
|
+
inner.style.cssText = "";
|
|
32
|
+
if (bgImage) inner.style.backgroundImage = bgImage;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function initializeVariant() {
|
|
38
|
+
if (!containerRef) return;
|
|
39
|
+
|
|
40
|
+
if (currentInstance) {
|
|
41
|
+
currentInstance.destroy();
|
|
42
|
+
currentInstance = null;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
resetImageStyles();
|
|
46
|
+
|
|
47
|
+
const Variant = variantMap[variant] || variantMap.type1;
|
|
48
|
+
currentInstance = new Variant(containerRef);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
onMount(() => {
|
|
52
|
+
initializeVariant();
|
|
53
|
+
mounted = true;
|
|
54
|
+
|
|
55
|
+
return () => {
|
|
56
|
+
if (currentInstance) {
|
|
57
|
+
currentInstance.destroy();
|
|
58
|
+
currentInstance = null;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
$effect(() => {
|
|
64
|
+
// Track the variant prop
|
|
65
|
+
variant;
|
|
66
|
+
|
|
67
|
+
// Skip the first run (onMount handles initial setup)
|
|
68
|
+
if (!mounted) return;
|
|
69
|
+
|
|
70
|
+
initializeVariant();
|
|
71
|
+
});
|
|
72
|
+
</script>
|
|
73
|
+
|
|
74
|
+
<div
|
|
75
|
+
bind:this={containerRef}
|
|
76
|
+
class={cn("relative z-[100] h-full w-full overflow-visible rounded-lg bg-transparent", className)}
|
|
77
|
+
style="touch-action: none;"
|
|
78
|
+
>
|
|
79
|
+
{#each images as image, i (variant + i)}
|
|
80
|
+
<div
|
|
81
|
+
class="content__img absolute top-0 left-0 aspect-[1.1] w-[120px] overflow-hidden rounded-[10px] opacity-0 [will-change:transform,filter] sm:w-[190px] sm:rounded-[15px]"
|
|
82
|
+
>
|
|
83
|
+
<div
|
|
84
|
+
class="content__img-inner absolute top-[-10px] left-[-10px] h-[calc(100%+20px)] w-[calc(100%+20px)] bg-cover bg-center"
|
|
85
|
+
style="background-image: url({image})"
|
|
86
|
+
></div>
|
|
87
|
+
</div>
|
|
88
|
+
{/each}
|
|
89
|
+
</div>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { VariantType } from "./trail-variants.js";
|
|
2
|
+
export interface ImageTrailCursorProps {
|
|
3
|
+
images?: string[];
|
|
4
|
+
variant?: VariantType;
|
|
5
|
+
class?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const ImageTrailCursor: import("svelte").Component<ImageTrailCursorProps, {}, "">;
|
|
8
|
+
type ImageTrailCursor = ReturnType<typeof ImageTrailCursor>;
|
|
9
|
+
export default ImageTrailCursor;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { render, cleanup } from "@testing-library/svelte";
|
|
2
|
+
import { afterEach, describe, it, expect } from "vitest";
|
|
3
|
+
import ImageTrailCursor from "./ImageTrailCursor.svelte";
|
|
4
|
+
describe("ImageTrailCursor", () => {
|
|
5
|
+
afterEach(cleanup);
|
|
6
|
+
it("renders a container div", () => {
|
|
7
|
+
const { container } = render(ImageTrailCursor);
|
|
8
|
+
const div = container.firstElementChild;
|
|
9
|
+
expect(div).toBeInTheDocument();
|
|
10
|
+
});
|
|
11
|
+
it("renders one content__img per image", () => {
|
|
12
|
+
const { container } = render(ImageTrailCursor, {
|
|
13
|
+
props: { images: ["/a.jpg", "/b.jpg", "/c.jpg"] },
|
|
14
|
+
});
|
|
15
|
+
const imgs = container.querySelectorAll(".content__img");
|
|
16
|
+
expect(imgs.length).toBe(3);
|
|
17
|
+
});
|
|
18
|
+
it("renders content__img-inner with background-image", () => {
|
|
19
|
+
const { container } = render(ImageTrailCursor, {
|
|
20
|
+
props: { images: ["/test.jpg"] },
|
|
21
|
+
});
|
|
22
|
+
const inner = container.querySelector(".content__img-inner");
|
|
23
|
+
expect(inner).toBeInTheDocument();
|
|
24
|
+
expect(inner?.style.backgroundImage).toContain("/test.jpg");
|
|
25
|
+
});
|
|
26
|
+
it("renders empty when no images provided", () => {
|
|
27
|
+
const { container } = render(ImageTrailCursor, { props: { images: [] } });
|
|
28
|
+
const imgs = container.querySelectorAll(".content__img");
|
|
29
|
+
expect(imgs.length).toBe(0);
|
|
30
|
+
});
|
|
31
|
+
it("applies custom class names", () => {
|
|
32
|
+
const { container } = render(ImageTrailCursor, {
|
|
33
|
+
props: { class: "my-trail" },
|
|
34
|
+
});
|
|
35
|
+
const div = container.firstElementChild;
|
|
36
|
+
expect(div?.className).toContain("my-trail");
|
|
37
|
+
});
|
|
38
|
+
it("preserves base classes", () => {
|
|
39
|
+
const { container } = render(ImageTrailCursor, {
|
|
40
|
+
props: { class: "extra" },
|
|
41
|
+
});
|
|
42
|
+
const div = container.firstElementChild;
|
|
43
|
+
expect(div?.className).toContain("relative");
|
|
44
|
+
});
|
|
45
|
+
it("sets touch-action: none on the container", () => {
|
|
46
|
+
const { container } = render(ImageTrailCursor);
|
|
47
|
+
const div = container.firstElementChild;
|
|
48
|
+
expect(div?.getAttribute("style")).toContain("touch-action: none");
|
|
49
|
+
});
|
|
50
|
+
it("uses responsive image classes (mobile-first + sm breakpoint)", () => {
|
|
51
|
+
const { container } = render(ImageTrailCursor, {
|
|
52
|
+
props: { images: ["/a.jpg"] },
|
|
53
|
+
});
|
|
54
|
+
const img = container.querySelector(".content__img");
|
|
55
|
+
expect(img?.className).toContain("w-[120px]");
|
|
56
|
+
expect(img?.className).toContain("rounded-[10px]");
|
|
57
|
+
expect(img?.className).toContain("sm:w-[190px]");
|
|
58
|
+
expect(img?.className).toContain("sm:rounded-[15px]");
|
|
59
|
+
});
|
|
60
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# ImageTrailCursor
|
|
2
|
+
|
|
3
|
+
Cursor-following image trail effect with 8 animation variants. Images appear at the cursor position as you move the mouse, each variant providing a distinct visual style.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
| Prop | Type | Default | Description |
|
|
8
|
+
|------|------|---------|-------------|
|
|
9
|
+
| `images` | `string[]` | `[]` | Array of image URLs for the trail |
|
|
10
|
+
| `variant` | `VariantType` | `'type1'` | Animation variant (`type1` through `type8`) |
|
|
11
|
+
| `class` | `string` | `''` | Additional CSS classes for the container |
|
|
12
|
+
|
|
13
|
+
## Variants
|
|
14
|
+
|
|
15
|
+
| Variant | Description |
|
|
16
|
+
|---------|-------------|
|
|
17
|
+
| `type1` | Basic fade & scale trail |
|
|
18
|
+
| `type2` | Scale-up with brightness burst |
|
|
19
|
+
| `type3` | Float-up exit with random x drift |
|
|
20
|
+
| `type4` | Momentum-based drift with brightness/contrast |
|
|
21
|
+
| `type5` | Rotation + momentum fling |
|
|
22
|
+
| `type6` | Speed-reactive size, blur, grayscale |
|
|
23
|
+
| `type7` | Stacking trail with visible queue |
|
|
24
|
+
| `type8` | 3D perspective based on cursor position |
|
|
25
|
+
|
|
26
|
+
## Dependencies
|
|
27
|
+
|
|
28
|
+
- **GSAP** (`gsap`) — Required for animation timelines. First GSAP dependency in the project.
|
|
29
|
+
|
|
30
|
+
## Implementation Notes
|
|
31
|
+
|
|
32
|
+
- Extracted a `BaseVariant` abstract class to eliminate ~800 lines of duplicated constructor/render/destroy boilerplate across the 8 variant classes.
|
|
33
|
+
- Added proper `destroy()` methods (missing in vendor): cancels RAF, removes event listeners, kills GSAP tweens, cleans up `ImageItem` resize listeners.
|
|
34
|
+
- Fixed `VariantType` to include `type8` (vendor TypeScript type stopped at `type7` but code had 8 variants).
|
|
35
|
+
- Properly typed `variantMap` as `Record<VariantType, ...>` instead of `{ [key: string]: any }`.
|
|
36
|
+
- The Svelte component resets inline styles before re-initializing on variant switch to prevent GSAP style residue.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ImageTrailCursor } from "./ImageTrailCursor.svelte";
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
export type VariantType = "type1" | "type2" | "type3" | "type4" | "type5" | "type6" | "type7" | "type8";
|
|
2
|
+
export interface ImageTrailVariant {
|
|
3
|
+
destroy(): void;
|
|
4
|
+
}
|
|
5
|
+
export declare class ImageItem {
|
|
6
|
+
DOM: {
|
|
7
|
+
el: HTMLDivElement;
|
|
8
|
+
inner: HTMLDivElement | null;
|
|
9
|
+
};
|
|
10
|
+
defaultStyle: gsap.TweenVars;
|
|
11
|
+
rect: DOMRect | null;
|
|
12
|
+
private resizeHandler;
|
|
13
|
+
constructor(DOM_el: HTMLDivElement);
|
|
14
|
+
private initEvents;
|
|
15
|
+
private getRect;
|
|
16
|
+
destroy(): void;
|
|
17
|
+
}
|
|
18
|
+
declare abstract class BaseVariant implements ImageTrailVariant {
|
|
19
|
+
protected container: HTMLDivElement;
|
|
20
|
+
protected DOM: {
|
|
21
|
+
el: HTMLDivElement;
|
|
22
|
+
};
|
|
23
|
+
protected images: ImageItem[];
|
|
24
|
+
protected imagesTotal: number;
|
|
25
|
+
protected imgPosition: number;
|
|
26
|
+
protected zIndexVal: number;
|
|
27
|
+
protected activeImagesCount: number;
|
|
28
|
+
protected isIdle: boolean;
|
|
29
|
+
protected mousePos: {
|
|
30
|
+
x: number;
|
|
31
|
+
y: number;
|
|
32
|
+
};
|
|
33
|
+
protected lastMousePos: {
|
|
34
|
+
x: number;
|
|
35
|
+
y: number;
|
|
36
|
+
};
|
|
37
|
+
protected cacheMousePos: {
|
|
38
|
+
x: number;
|
|
39
|
+
y: number;
|
|
40
|
+
};
|
|
41
|
+
protected touchActive: boolean;
|
|
42
|
+
private positionHistory;
|
|
43
|
+
private static readonly HISTORY_MAX_AGE;
|
|
44
|
+
private static readonly HISTORY_MAX_LEN;
|
|
45
|
+
private rafId;
|
|
46
|
+
private rafStarted;
|
|
47
|
+
private destroyed;
|
|
48
|
+
private handlePointerMove;
|
|
49
|
+
private initRender;
|
|
50
|
+
private handleTouchStart;
|
|
51
|
+
private handleTouchEnd;
|
|
52
|
+
constructor(container: HTMLDivElement);
|
|
53
|
+
private startRafLoop;
|
|
54
|
+
private pushPositionHistory;
|
|
55
|
+
protected getTouchVelocity(): {
|
|
56
|
+
dx: number;
|
|
57
|
+
dy: number;
|
|
58
|
+
};
|
|
59
|
+
protected get threshold(): number;
|
|
60
|
+
protected render(): void;
|
|
61
|
+
protected updateCache(): void;
|
|
62
|
+
protected abstract showNextImage(): void;
|
|
63
|
+
protected onImageActivated(): void;
|
|
64
|
+
protected onImageDeactivated(): void;
|
|
65
|
+
destroy(): void;
|
|
66
|
+
}
|
|
67
|
+
export declare class ImageTrailVariant1 extends BaseVariant {
|
|
68
|
+
protected showNextImage(): void;
|
|
69
|
+
}
|
|
70
|
+
export declare class ImageTrailVariant2 extends BaseVariant {
|
|
71
|
+
protected showNextImage(): void;
|
|
72
|
+
}
|
|
73
|
+
export declare class ImageTrailVariant3 extends BaseVariant {
|
|
74
|
+
protected showNextImage(): void;
|
|
75
|
+
}
|
|
76
|
+
export declare class ImageTrailVariant4 extends BaseVariant {
|
|
77
|
+
protected showNextImage(): void;
|
|
78
|
+
}
|
|
79
|
+
export declare class ImageTrailVariant5 extends BaseVariant {
|
|
80
|
+
private lastAngle;
|
|
81
|
+
protected showNextImage(): void;
|
|
82
|
+
}
|
|
83
|
+
export declare class ImageTrailVariant6 extends BaseVariant {
|
|
84
|
+
protected updateCache(): void;
|
|
85
|
+
private mapSpeedToSize;
|
|
86
|
+
private mapSpeedToBrightness;
|
|
87
|
+
private mapSpeedToBlur;
|
|
88
|
+
private mapSpeedToGrayscale;
|
|
89
|
+
protected showNextImage(): void;
|
|
90
|
+
}
|
|
91
|
+
export declare class ImageTrailVariant7 extends BaseVariant {
|
|
92
|
+
private visibleImagesCount;
|
|
93
|
+
private visibleImagesTotal;
|
|
94
|
+
constructor(container: HTMLDivElement);
|
|
95
|
+
protected updateCache(): void;
|
|
96
|
+
protected showNextImage(): void;
|
|
97
|
+
}
|
|
98
|
+
export declare class ImageTrailVariant8 extends BaseVariant {
|
|
99
|
+
private rotation;
|
|
100
|
+
private cachedRotation;
|
|
101
|
+
private zValue;
|
|
102
|
+
private cachedZValue;
|
|
103
|
+
constructor(container: HTMLDivElement);
|
|
104
|
+
protected showNextImage(): void;
|
|
105
|
+
}
|
|
106
|
+
export declare const variantMap: Record<VariantType, new (container: HTMLDivElement) => ImageTrailVariant>;
|
|
107
|
+
export {};
|