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,205 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from "../../utils";
|
|
3
|
+
import { onMount } from "svelte";
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
/**
|
|
7
|
+
* Parallax factor for mouse movement (default: 0.05)
|
|
8
|
+
*/
|
|
9
|
+
factor?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Base animation speed in seconds (default: 50)
|
|
12
|
+
*/
|
|
13
|
+
speed?: number;
|
|
14
|
+
/**
|
|
15
|
+
* Spring stiffness for parallax (default: 50)
|
|
16
|
+
*/
|
|
17
|
+
stiffness?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Spring damping for parallax (default: 20)
|
|
20
|
+
*/
|
|
21
|
+
damping?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Color of the stars (default: #fff)
|
|
24
|
+
*/
|
|
25
|
+
starColor?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Additional CSS classes
|
|
28
|
+
*/
|
|
29
|
+
class?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Child content to render over the stars
|
|
32
|
+
*/
|
|
33
|
+
children?: import("svelte").Snippet;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
let {
|
|
37
|
+
factor = 0.05,
|
|
38
|
+
speed = 50,
|
|
39
|
+
stiffness = 50,
|
|
40
|
+
damping = 20,
|
|
41
|
+
starColor = "#fff",
|
|
42
|
+
class: className,
|
|
43
|
+
children,
|
|
44
|
+
}: Props = $props();
|
|
45
|
+
|
|
46
|
+
// Star box-shadows (generated on mount)
|
|
47
|
+
let boxShadow1 = $state("");
|
|
48
|
+
let boxShadow2 = $state("");
|
|
49
|
+
let boxShadow3 = $state("");
|
|
50
|
+
|
|
51
|
+
// Spring animation state
|
|
52
|
+
let springX = $state(0);
|
|
53
|
+
let springY = $state(0);
|
|
54
|
+
let targetX = 0;
|
|
55
|
+
let targetY = 0;
|
|
56
|
+
let velocityX = 0;
|
|
57
|
+
let velocityY = 0;
|
|
58
|
+
let animationFrame: number;
|
|
59
|
+
|
|
60
|
+
function generateStars(count: number, color: string): string {
|
|
61
|
+
const shadows: string[] = [];
|
|
62
|
+
for (let i = 0; i < count; i++) {
|
|
63
|
+
const x = Math.floor(Math.random() * 4000) - 2000;
|
|
64
|
+
const y = Math.floor(Math.random() * 4000) - 2000;
|
|
65
|
+
shadows.push(`${x}px ${y}px ${color}`);
|
|
66
|
+
}
|
|
67
|
+
return shadows.join(", ");
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function handleMouseMove(e: MouseEvent) {
|
|
71
|
+
const centerX = window.innerWidth / 2;
|
|
72
|
+
const centerY = window.innerHeight / 2;
|
|
73
|
+
targetX = -(e.clientX - centerX) * factor;
|
|
74
|
+
targetY = -(e.clientY - centerY) * factor;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function updateSpring() {
|
|
78
|
+
// Simple spring physics
|
|
79
|
+
const forceX = (targetX - springX) * (stiffness / 1000);
|
|
80
|
+
const forceY = (targetY - springY) * (stiffness / 1000);
|
|
81
|
+
|
|
82
|
+
velocityX = velocityX * (1 - damping / 100) + forceX;
|
|
83
|
+
velocityY = velocityY * (1 - damping / 100) + forceY;
|
|
84
|
+
|
|
85
|
+
springX += velocityX;
|
|
86
|
+
springY += velocityY;
|
|
87
|
+
|
|
88
|
+
animationFrame = requestAnimationFrame(updateSpring);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Regenerate stars when color changes
|
|
92
|
+
$effect(() => {
|
|
93
|
+
boxShadow1 = generateStars(1000, starColor);
|
|
94
|
+
boxShadow2 = generateStars(400, starColor);
|
|
95
|
+
boxShadow3 = generateStars(200, starColor);
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
onMount(() => {
|
|
99
|
+
// Start spring animation loop
|
|
100
|
+
animationFrame = requestAnimationFrame(updateSpring);
|
|
101
|
+
|
|
102
|
+
return () => {
|
|
103
|
+
cancelAnimationFrame(animationFrame);
|
|
104
|
+
};
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
// Derived CSS custom properties for animation durations
|
|
108
|
+
let layer1Duration = $derived(`${speed}s`);
|
|
109
|
+
let layer2Duration = $derived(`${speed * 2}s`);
|
|
110
|
+
let layer3Duration = $derived(`${speed * 3}s`);
|
|
111
|
+
</script>
|
|
112
|
+
|
|
113
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
114
|
+
<div
|
|
115
|
+
class={cn(
|
|
116
|
+
"relative size-full overflow-hidden bg-[radial-gradient(ellipse_at_bottom,_#262626_0%,_#000_100%)]",
|
|
117
|
+
className
|
|
118
|
+
)}
|
|
119
|
+
onmousemove={handleMouseMove}
|
|
120
|
+
>
|
|
121
|
+
<div class="stars-parallax" style:transform="translate({springX}px, {springY}px)">
|
|
122
|
+
<!-- Star Layer 1 (smallest, fastest) -->
|
|
123
|
+
<div class="star-layer" style:--duration={layer1Duration}>
|
|
124
|
+
<div
|
|
125
|
+
class="star-field"
|
|
126
|
+
style:width="1px"
|
|
127
|
+
style:height="1px"
|
|
128
|
+
style:box-shadow={boxShadow1}
|
|
129
|
+
></div>
|
|
130
|
+
<div
|
|
131
|
+
class="star-field top-[2000px]"
|
|
132
|
+
style:width="1px"
|
|
133
|
+
style:height="1px"
|
|
134
|
+
style:box-shadow={boxShadow1}
|
|
135
|
+
></div>
|
|
136
|
+
</div>
|
|
137
|
+
|
|
138
|
+
<!-- Star Layer 2 (medium) -->
|
|
139
|
+
<div class="star-layer" style:--duration={layer2Duration}>
|
|
140
|
+
<div
|
|
141
|
+
class="star-field"
|
|
142
|
+
style:width="2px"
|
|
143
|
+
style:height="2px"
|
|
144
|
+
style:box-shadow={boxShadow2}
|
|
145
|
+
></div>
|
|
146
|
+
<div
|
|
147
|
+
class="star-field top-[2000px]"
|
|
148
|
+
style:width="2px"
|
|
149
|
+
style:height="2px"
|
|
150
|
+
style:box-shadow={boxShadow2}
|
|
151
|
+
></div>
|
|
152
|
+
</div>
|
|
153
|
+
|
|
154
|
+
<!-- Star Layer 3 (largest, slowest) -->
|
|
155
|
+
<div class="star-layer" style:--duration={layer3Duration}>
|
|
156
|
+
<div
|
|
157
|
+
class="star-field"
|
|
158
|
+
style:width="3px"
|
|
159
|
+
style:height="3px"
|
|
160
|
+
style:box-shadow={boxShadow3}
|
|
161
|
+
></div>
|
|
162
|
+
<div
|
|
163
|
+
class="star-field top-[2000px]"
|
|
164
|
+
style:width="3px"
|
|
165
|
+
style:height="3px"
|
|
166
|
+
style:box-shadow={boxShadow3}
|
|
167
|
+
></div>
|
|
168
|
+
</div>
|
|
169
|
+
</div>
|
|
170
|
+
|
|
171
|
+
<!-- Slot for child content -->
|
|
172
|
+
{#if children}
|
|
173
|
+
{@render children()}
|
|
174
|
+
{/if}
|
|
175
|
+
</div>
|
|
176
|
+
|
|
177
|
+
<style>
|
|
178
|
+
.stars-parallax {
|
|
179
|
+
will-change: transform;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.star-layer {
|
|
183
|
+
position: absolute;
|
|
184
|
+
top: 0;
|
|
185
|
+
left: 0;
|
|
186
|
+
width: 100%;
|
|
187
|
+
height: 2000px;
|
|
188
|
+
animation: scroll-stars var(--duration, 50s) linear infinite;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.star-field {
|
|
192
|
+
position: absolute;
|
|
193
|
+
background: transparent;
|
|
194
|
+
border-radius: 50%;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
@keyframes scroll-stars {
|
|
198
|
+
from {
|
|
199
|
+
transform: translateY(0);
|
|
200
|
+
}
|
|
201
|
+
to {
|
|
202
|
+
transform: translateY(-2000px);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
</style>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
/**
|
|
3
|
+
* Parallax factor for mouse movement (default: 0.05)
|
|
4
|
+
*/
|
|
5
|
+
factor?: number;
|
|
6
|
+
/**
|
|
7
|
+
* Base animation speed in seconds (default: 50)
|
|
8
|
+
*/
|
|
9
|
+
speed?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Spring stiffness for parallax (default: 50)
|
|
12
|
+
*/
|
|
13
|
+
stiffness?: number;
|
|
14
|
+
/**
|
|
15
|
+
* Spring damping for parallax (default: 20)
|
|
16
|
+
*/
|
|
17
|
+
damping?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Color of the stars (default: #fff)
|
|
20
|
+
*/
|
|
21
|
+
starColor?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Additional CSS classes
|
|
24
|
+
*/
|
|
25
|
+
class?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Child content to render over the stars
|
|
28
|
+
*/
|
|
29
|
+
children?: import("svelte").Snippet;
|
|
30
|
+
}
|
|
31
|
+
declare const StarsBackground: import("svelte").Component<Props, {}, "">;
|
|
32
|
+
type StarsBackground = ReturnType<typeof StarsBackground>;
|
|
33
|
+
export default StarsBackground;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { render, cleanup } from "@testing-library/svelte";
|
|
2
|
+
import { afterEach, describe, it, expect } from "vitest";
|
|
3
|
+
import StarsBackground from "./StarsBackground.svelte";
|
|
4
|
+
describe("StarsBackground", () => {
|
|
5
|
+
afterEach(cleanup);
|
|
6
|
+
it("renders a container div", () => {
|
|
7
|
+
const { container } = render(StarsBackground);
|
|
8
|
+
const div = container.firstElementChild;
|
|
9
|
+
expect(div).toBeInTheDocument();
|
|
10
|
+
});
|
|
11
|
+
it("has overflow-hidden class", () => {
|
|
12
|
+
const { container } = render(StarsBackground);
|
|
13
|
+
const div = container.firstElementChild;
|
|
14
|
+
expect(div?.className).toContain("overflow-hidden");
|
|
15
|
+
});
|
|
16
|
+
it("renders three star layers", () => {
|
|
17
|
+
const { container } = render(StarsBackground);
|
|
18
|
+
const layers = container.querySelectorAll(".star-layer");
|
|
19
|
+
expect(layers.length).toBe(3);
|
|
20
|
+
});
|
|
21
|
+
it("renders six star fields (2 per layer)", () => {
|
|
22
|
+
const { container } = render(StarsBackground);
|
|
23
|
+
const fields = container.querySelectorAll(".star-field");
|
|
24
|
+
expect(fields.length).toBe(6);
|
|
25
|
+
});
|
|
26
|
+
it("applies custom class names", () => {
|
|
27
|
+
const { container } = render(StarsBackground, {
|
|
28
|
+
props: { class: "my-stars" },
|
|
29
|
+
});
|
|
30
|
+
const div = container.firstElementChild;
|
|
31
|
+
expect(div?.className).toContain("my-stars");
|
|
32
|
+
});
|
|
33
|
+
it("preserves base classes when custom class is added", () => {
|
|
34
|
+
const { container } = render(StarsBackground, {
|
|
35
|
+
props: { class: "extra" },
|
|
36
|
+
});
|
|
37
|
+
const div = container.firstElementChild;
|
|
38
|
+
expect(div?.className).toContain("overflow-hidden");
|
|
39
|
+
expect(div?.className).toContain("size-full");
|
|
40
|
+
});
|
|
41
|
+
it("has radial gradient background class", () => {
|
|
42
|
+
const { container } = render(StarsBackground);
|
|
43
|
+
const div = container.firstElementChild;
|
|
44
|
+
expect(div?.className).toContain("bg-[radial-gradient");
|
|
45
|
+
});
|
|
46
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as StarsBackground } from "./StarsBackground.svelte";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as StarsBackground } from "./StarsBackground.svelte";
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
|
|
4
|
+
export interface BlurRevealProps {
|
|
5
|
+
/** Animation duration in seconds */
|
|
6
|
+
duration?: number;
|
|
7
|
+
/** Stagger delay between children in seconds */
|
|
8
|
+
delay?: number;
|
|
9
|
+
/** Initial blur amount (CSS value) */
|
|
10
|
+
blur?: string;
|
|
11
|
+
/** Initial vertical offset in pixels */
|
|
12
|
+
yOffset?: number;
|
|
13
|
+
/** Additional CSS classes for the container */
|
|
14
|
+
class?: string;
|
|
15
|
+
/** Content to reveal */
|
|
16
|
+
children?: Snippet;
|
|
17
|
+
}
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<script lang="ts">
|
|
21
|
+
import { cn } from "../../utils.js";
|
|
22
|
+
import { onMount } from "svelte";
|
|
23
|
+
|
|
24
|
+
let {
|
|
25
|
+
duration = 1,
|
|
26
|
+
delay = 0.2,
|
|
27
|
+
blur = "20px",
|
|
28
|
+
yOffset = 20,
|
|
29
|
+
class: className,
|
|
30
|
+
children,
|
|
31
|
+
}: BlurRevealProps = $props();
|
|
32
|
+
|
|
33
|
+
let containerRef: HTMLDivElement;
|
|
34
|
+
let isInView = $state(false);
|
|
35
|
+
|
|
36
|
+
onMount(() => {
|
|
37
|
+
const observer = new IntersectionObserver(
|
|
38
|
+
(entries) => {
|
|
39
|
+
for (const entry of entries) {
|
|
40
|
+
if (entry.isIntersecting) {
|
|
41
|
+
isInView = true;
|
|
42
|
+
observer.disconnect();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
{ threshold: 0.1 }
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
observer.observe(containerRef);
|
|
50
|
+
|
|
51
|
+
return () => observer.disconnect();
|
|
52
|
+
});
|
|
53
|
+
</script>
|
|
54
|
+
|
|
55
|
+
<div
|
|
56
|
+
bind:this={containerRef}
|
|
57
|
+
class={cn(className)}
|
|
58
|
+
style:--blur-reveal-duration="{duration}s"
|
|
59
|
+
style:--blur-reveal-delay="{delay}s"
|
|
60
|
+
style:--blur-reveal-blur={blur}
|
|
61
|
+
style:--blur-reveal-y="{yOffset}px"
|
|
62
|
+
>
|
|
63
|
+
{#if children}
|
|
64
|
+
<div class="blur-reveal-wrapper" class:is-visible={isInView}>
|
|
65
|
+
{@render children()}
|
|
66
|
+
</div>
|
|
67
|
+
{/if}
|
|
68
|
+
</div>
|
|
69
|
+
|
|
70
|
+
<style>
|
|
71
|
+
.blur-reveal-wrapper > :global(*) {
|
|
72
|
+
opacity: 0;
|
|
73
|
+
filter: blur(var(--blur-reveal-blur, 20px));
|
|
74
|
+
transform: translateY(var(--blur-reveal-y, 20px));
|
|
75
|
+
transition:
|
|
76
|
+
opacity var(--blur-reveal-duration, 1s) ease-in-out,
|
|
77
|
+
filter var(--blur-reveal-duration, 1s) ease-in-out,
|
|
78
|
+
transform var(--blur-reveal-duration, 1s) ease-in-out;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.blur-reveal-wrapper.is-visible > :global(*) {
|
|
82
|
+
opacity: 1;
|
|
83
|
+
filter: blur(0px);
|
|
84
|
+
transform: translateY(0);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* Stagger delays for direct children */
|
|
88
|
+
.blur-reveal-wrapper.is-visible > :global(:nth-child(1)) {
|
|
89
|
+
transition-delay: calc(var(--blur-reveal-delay, 0.2s) * 0);
|
|
90
|
+
}
|
|
91
|
+
.blur-reveal-wrapper.is-visible > :global(:nth-child(2)) {
|
|
92
|
+
transition-delay: calc(var(--blur-reveal-delay, 0.2s) * 1);
|
|
93
|
+
}
|
|
94
|
+
.blur-reveal-wrapper.is-visible > :global(:nth-child(3)) {
|
|
95
|
+
transition-delay: calc(var(--blur-reveal-delay, 0.2s) * 2);
|
|
96
|
+
}
|
|
97
|
+
.blur-reveal-wrapper.is-visible > :global(:nth-child(4)) {
|
|
98
|
+
transition-delay: calc(var(--blur-reveal-delay, 0.2s) * 3);
|
|
99
|
+
}
|
|
100
|
+
.blur-reveal-wrapper.is-visible > :global(:nth-child(5)) {
|
|
101
|
+
transition-delay: calc(var(--blur-reveal-delay, 0.2s) * 4);
|
|
102
|
+
}
|
|
103
|
+
.blur-reveal-wrapper.is-visible > :global(:nth-child(6)) {
|
|
104
|
+
transition-delay: calc(var(--blur-reveal-delay, 0.2s) * 5);
|
|
105
|
+
}
|
|
106
|
+
.blur-reveal-wrapper.is-visible > :global(:nth-child(7)) {
|
|
107
|
+
transition-delay: calc(var(--blur-reveal-delay, 0.2s) * 6);
|
|
108
|
+
}
|
|
109
|
+
.blur-reveal-wrapper.is-visible > :global(:nth-child(8)) {
|
|
110
|
+
transition-delay: calc(var(--blur-reveal-delay, 0.2s) * 7);
|
|
111
|
+
}
|
|
112
|
+
.blur-reveal-wrapper.is-visible > :global(:nth-child(9)) {
|
|
113
|
+
transition-delay: calc(var(--blur-reveal-delay, 0.2s) * 8);
|
|
114
|
+
}
|
|
115
|
+
.blur-reveal-wrapper.is-visible > :global(:nth-child(10)) {
|
|
116
|
+
transition-delay: calc(var(--blur-reveal-delay, 0.2s) * 9);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/* Respect reduced motion */
|
|
120
|
+
@media (prefers-reduced-motion: reduce) {
|
|
121
|
+
.blur-reveal-wrapper > :global(*) {
|
|
122
|
+
transition-duration: 0.1s !important;
|
|
123
|
+
transition-delay: 0s !important;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
</style>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
export interface BlurRevealProps {
|
|
3
|
+
/** Animation duration in seconds */
|
|
4
|
+
duration?: number;
|
|
5
|
+
/** Stagger delay between children in seconds */
|
|
6
|
+
delay?: number;
|
|
7
|
+
/** Initial blur amount (CSS value) */
|
|
8
|
+
blur?: string;
|
|
9
|
+
/** Initial vertical offset in pixels */
|
|
10
|
+
yOffset?: number;
|
|
11
|
+
/** Additional CSS classes for the container */
|
|
12
|
+
class?: string;
|
|
13
|
+
/** Content to reveal */
|
|
14
|
+
children?: Snippet;
|
|
15
|
+
}
|
|
16
|
+
declare const BlurReveal: import("svelte").Component<BlurRevealProps, {}, "">;
|
|
17
|
+
type BlurReveal = ReturnType<typeof BlurReveal>;
|
|
18
|
+
export default BlurReveal;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { render, cleanup } from "@testing-library/svelte";
|
|
2
|
+
import { afterEach, beforeEach, describe, it, expect, vi } from "vitest";
|
|
3
|
+
import BlurReveal from "./BlurReveal.svelte";
|
|
4
|
+
describe("BlurReveal", () => {
|
|
5
|
+
beforeEach(() => {
|
|
6
|
+
// Mock IntersectionObserver (not available in jsdom) - must be a class
|
|
7
|
+
global.IntersectionObserver = class {
|
|
8
|
+
observe = vi.fn();
|
|
9
|
+
unobserve = vi.fn();
|
|
10
|
+
disconnect = vi.fn();
|
|
11
|
+
};
|
|
12
|
+
});
|
|
13
|
+
afterEach(cleanup);
|
|
14
|
+
it("renders a container div", () => {
|
|
15
|
+
const { container } = render(BlurReveal);
|
|
16
|
+
const div = container.firstElementChild;
|
|
17
|
+
expect(div).toBeInTheDocument();
|
|
18
|
+
});
|
|
19
|
+
it("sets default CSS custom properties", () => {
|
|
20
|
+
const { container } = render(BlurReveal);
|
|
21
|
+
const div = container.firstElementChild;
|
|
22
|
+
expect(div.style.getPropertyValue("--blur-reveal-duration")).toBe("1s");
|
|
23
|
+
expect(div.style.getPropertyValue("--blur-reveal-delay")).toBe("0.2s");
|
|
24
|
+
expect(div.style.getPropertyValue("--blur-reveal-blur")).toBe("20px");
|
|
25
|
+
expect(div.style.getPropertyValue("--blur-reveal-y")).toBe("20px");
|
|
26
|
+
});
|
|
27
|
+
it("sets CSS custom properties from props", () => {
|
|
28
|
+
const { container } = render(BlurReveal, {
|
|
29
|
+
props: { duration: 2, delay: 0.5, blur: "10px", yOffset: 30 },
|
|
30
|
+
});
|
|
31
|
+
const div = container.firstElementChild;
|
|
32
|
+
expect(div.style.getPropertyValue("--blur-reveal-duration")).toBe("2s");
|
|
33
|
+
expect(div.style.getPropertyValue("--blur-reveal-delay")).toBe("0.5s");
|
|
34
|
+
expect(div.style.getPropertyValue("--blur-reveal-blur")).toBe("10px");
|
|
35
|
+
expect(div.style.getPropertyValue("--blur-reveal-y")).toBe("30px");
|
|
36
|
+
});
|
|
37
|
+
it("applies custom class names", () => {
|
|
38
|
+
const { container } = render(BlurReveal, { props: { class: "my-reveal" } });
|
|
39
|
+
const div = container.firstElementChild;
|
|
40
|
+
expect(div?.className).toContain("my-reveal");
|
|
41
|
+
});
|
|
42
|
+
it("does not render blur-reveal-wrapper without children", () => {
|
|
43
|
+
const { container } = render(BlurReveal);
|
|
44
|
+
const wrapper = container.querySelector(".blur-reveal-wrapper");
|
|
45
|
+
expect(wrapper).not.toBeInTheDocument();
|
|
46
|
+
});
|
|
47
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# BlurReveal
|
|
2
|
+
|
|
3
|
+
A scroll-triggered reveal animation that transitions children from blurred and offset to clear and in-place, with staggered delays.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Scroll trigger**: Animates when the element enters the viewport via IntersectionObserver
|
|
8
|
+
- **Staggered children**: Each direct child animates sequentially with a configurable delay
|
|
9
|
+
- **Customizable blur**: Control blur amount, Y offset, duration, and stagger delay
|
|
10
|
+
- **Reduced motion**: Respects `prefers-reduced-motion`
|
|
11
|
+
|
|
12
|
+
## Props
|
|
13
|
+
|
|
14
|
+
| Prop | Type | Default | Description |
|
|
15
|
+
|------|------|---------|-------------|
|
|
16
|
+
| `duration` | `number` | `1` | Animation duration in seconds |
|
|
17
|
+
| `delay` | `number` | `0.2` | Stagger delay between children in seconds |
|
|
18
|
+
| `blur` | `string` | `'20px'` | Initial blur amount (CSS value) |
|
|
19
|
+
| `yOffset` | `number` | `20` | Initial vertical offset in pixels |
|
|
20
|
+
| `class` | `string` | `''` | Additional CSS classes for the container |
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
```svelte
|
|
25
|
+
<script>
|
|
26
|
+
import { BlurReveal } from '$lib/fancy-ui/blur-reveal';
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<BlurReveal>
|
|
30
|
+
<h1>This fades in first</h1>
|
|
31
|
+
<p>This fades in second</p>
|
|
32
|
+
<p>This fades in third</p>
|
|
33
|
+
</BlurReveal>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Implementation Notes
|
|
37
|
+
|
|
38
|
+
- Replaced `motion-v` with IntersectionObserver + CSS transitions
|
|
39
|
+
- The reference design iterates VNodes from `slots.default()` to wrap each in a `Motion` component; this Svelte version applies stagger via `:nth-child` CSS selectors on direct children
|
|
40
|
+
- Default `delay` changed from `2` to `0.2` — the original value was a multiplier used differently by motion-v
|
|
41
|
+
- Supports up to 10 staggered children via CSS; beyond that, extra children animate with the same delay as the 10th
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from "../../utils";
|
|
3
|
+
import {
|
|
4
|
+
BOOK_RADIUS_MAP as radiusMap,
|
|
5
|
+
BOOK_SIZE_MAP as sizeMap,
|
|
6
|
+
BOOK_COLOR_MAP as colorMap,
|
|
7
|
+
BOOK_SHADOW_SIZE_MAP as shadowSizeMap,
|
|
8
|
+
type BookRadius,
|
|
9
|
+
type BookSize,
|
|
10
|
+
type BookColor,
|
|
11
|
+
type BookShadowSize,
|
|
12
|
+
} from "./index.js";
|
|
13
|
+
import type { Snippet } from "svelte";
|
|
14
|
+
|
|
15
|
+
interface Props {
|
|
16
|
+
class?: string;
|
|
17
|
+
duration?: number;
|
|
18
|
+
color?: BookColor;
|
|
19
|
+
isStatic?: boolean;
|
|
20
|
+
size?: BookSize;
|
|
21
|
+
radius?: BookRadius;
|
|
22
|
+
shadowSize?: BookShadowSize;
|
|
23
|
+
children?: Snippet;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
let {
|
|
27
|
+
class: className = "",
|
|
28
|
+
duration = 1000,
|
|
29
|
+
color = "zinc",
|
|
30
|
+
isStatic = false,
|
|
31
|
+
size = "md",
|
|
32
|
+
radius = "md",
|
|
33
|
+
shadowSize = "lg",
|
|
34
|
+
children,
|
|
35
|
+
}: Props = $props();
|
|
36
|
+
|
|
37
|
+
let computedGradient = $derived(colorMap[color] || colorMap.zinc);
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<div
|
|
41
|
+
class={cn(
|
|
42
|
+
"group z-10 w-min [--shadowColor:#bbb] [perspective:800px] dark:[--shadowColor:#111]",
|
|
43
|
+
className
|
|
44
|
+
)}
|
|
45
|
+
>
|
|
46
|
+
<div
|
|
47
|
+
style="width: {sizeMap[size].width}; transition: transform {duration}ms ease"
|
|
48
|
+
class={cn(
|
|
49
|
+
"relative aspect-[3/4] [transform-style:preserve-3d]",
|
|
50
|
+
isStatic
|
|
51
|
+
? "[transform:rotateY(-30deg)]"
|
|
52
|
+
: "[transform:rotateY(0deg)] group-hover:[transform:rotateY(-30deg)]",
|
|
53
|
+
radiusMap[radius]
|
|
54
|
+
)}
|
|
55
|
+
>
|
|
56
|
+
<!-- Front face -->
|
|
57
|
+
<div
|
|
58
|
+
class="absolute inset-y-0 left-0 flex size-full flex-col justify-end overflow-hidden bg-gradient-to-tr p-6 text-white {computedGradient.from} {computedGradient.to} {radiusMap[
|
|
59
|
+
radius
|
|
60
|
+
]}"
|
|
61
|
+
style="transform: translateZ(25px); box-shadow: 5px 5px 20px var(--shadowColor);"
|
|
62
|
+
>
|
|
63
|
+
<div
|
|
64
|
+
class="absolute top-0 left-0 h-full"
|
|
65
|
+
style="min-width: 8.2%; background: linear-gradient(90deg, hsla(0, 0%, 100%, 0), hsla(0, 0%, 100%, 0) 12%, hsla(0, 0%, 100%, .25) 29.25%, hsla(0, 0%, 100%, 0) 50.5%, hsla(0, 0%, 100%, 0) 75.25%, hsla(0, 0%, 100%, .25) 91%, hsla(0, 0%, 100%, 0)), linear-gradient(90deg, rgba(0, 0, 0, .03), rgba(0, 0, 0, .1) 12%, transparent 30%, rgba(0, 0, 0, .02) 50%, rgba(0, 0, 0, .2) 73.5%, rgba(0, 0, 0, .5) 75.25%, rgba(0, 0, 0, .15) 85.25%, transparent); opacity: 0.2;"
|
|
66
|
+
></div>
|
|
67
|
+
<div class="pl-1">
|
|
68
|
+
{#if children}
|
|
69
|
+
{@render children()}
|
|
70
|
+
{/if}
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
|
|
74
|
+
<!-- Spine -->
|
|
75
|
+
<div
|
|
76
|
+
class="absolute left-0 bg-white"
|
|
77
|
+
style="top: 3px; bottom: 3px; width: 48px; transform: translateX({sizeMap[size]
|
|
78
|
+
.spineTranslation}) rotateY(90deg); background: linear-gradient(90deg, rgba(255,255,255,1) 50%, rgba(249,249,249,1) 50%);"
|
|
79
|
+
></div>
|
|
80
|
+
|
|
81
|
+
<!-- Back face -->
|
|
82
|
+
<div
|
|
83
|
+
class="absolute inset-y-0 left-0 flex size-full flex-col justify-end overflow-hidden bg-gradient-to-tr p-6 text-white {computedGradient.from} {computedGradient.to} {radiusMap[
|
|
84
|
+
radius
|
|
85
|
+
]}"
|
|
86
|
+
style="transform: translateZ(-25px); box-shadow: {shadowSizeMap[shadowSize]};"
|
|
87
|
+
></div>
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type BookRadius, type BookSize, type BookColor, type BookShadowSize } from "./index.js";
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
interface Props {
|
|
4
|
+
class?: string;
|
|
5
|
+
duration?: number;
|
|
6
|
+
color?: BookColor;
|
|
7
|
+
isStatic?: boolean;
|
|
8
|
+
size?: BookSize;
|
|
9
|
+
radius?: BookRadius;
|
|
10
|
+
shadowSize?: BookShadowSize;
|
|
11
|
+
children?: Snippet;
|
|
12
|
+
}
|
|
13
|
+
declare const Book: import("svelte").Component<Props, {}, "">;
|
|
14
|
+
type Book = ReturnType<typeof Book>;
|
|
15
|
+
export default Book;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|