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,25 @@
|
|
|
1
|
+
interface ColorRGB {
|
|
2
|
+
r: number;
|
|
3
|
+
g: number;
|
|
4
|
+
b: number;
|
|
5
|
+
}
|
|
6
|
+
interface Props {
|
|
7
|
+
simResolution?: number;
|
|
8
|
+
dyeResolution?: number;
|
|
9
|
+
captureResolution?: number;
|
|
10
|
+
densityDissipation?: number;
|
|
11
|
+
velocityDissipation?: number;
|
|
12
|
+
pressure?: number;
|
|
13
|
+
pressureIterations?: number;
|
|
14
|
+
curl?: number;
|
|
15
|
+
splatRadius?: number;
|
|
16
|
+
splatForce?: number;
|
|
17
|
+
shading?: boolean;
|
|
18
|
+
colorUpdateSpeed?: number;
|
|
19
|
+
backColor?: ColorRGB;
|
|
20
|
+
transparent?: boolean;
|
|
21
|
+
class?: string;
|
|
22
|
+
}
|
|
23
|
+
declare const FluidCursor: import("svelte").Component<Props, {}, "">;
|
|
24
|
+
type FluidCursor = ReturnType<typeof FluidCursor>;
|
|
25
|
+
export default FluidCursor;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { render, cleanup } from "@testing-library/svelte";
|
|
2
|
+
import { afterEach, describe, it, expect } from "vitest";
|
|
3
|
+
import FluidCursor from "./FluidCursor.svelte";
|
|
4
|
+
describe("FluidCursor", () => {
|
|
5
|
+
afterEach(cleanup);
|
|
6
|
+
it("renders a container div", () => {
|
|
7
|
+
const { container } = render(FluidCursor);
|
|
8
|
+
const div = container.firstElementChild;
|
|
9
|
+
expect(div).toBeInTheDocument();
|
|
10
|
+
});
|
|
11
|
+
it("renders a canvas element", () => {
|
|
12
|
+
const { container } = render(FluidCursor);
|
|
13
|
+
const canvas = container.querySelector("canvas");
|
|
14
|
+
expect(canvas).toBeInTheDocument();
|
|
15
|
+
});
|
|
16
|
+
it('canvas has id="fluid"', () => {
|
|
17
|
+
const { container } = render(FluidCursor);
|
|
18
|
+
const canvas = container.querySelector("canvas#fluid");
|
|
19
|
+
expect(canvas).toBeInTheDocument();
|
|
20
|
+
});
|
|
21
|
+
it("container has pointer-events-none class", () => {
|
|
22
|
+
const { container } = render(FluidCursor);
|
|
23
|
+
const div = container.firstElementChild;
|
|
24
|
+
expect(div?.className).toContain("pointer-events-none");
|
|
25
|
+
});
|
|
26
|
+
it("container has fixed positioning class", () => {
|
|
27
|
+
const { container } = render(FluidCursor);
|
|
28
|
+
const div = container.firstElementChild;
|
|
29
|
+
expect(div?.className).toContain("fixed");
|
|
30
|
+
});
|
|
31
|
+
it("container has z-50 class", () => {
|
|
32
|
+
const { container } = render(FluidCursor);
|
|
33
|
+
const div = container.firstElementChild;
|
|
34
|
+
expect(div?.className).toContain("z-50");
|
|
35
|
+
});
|
|
36
|
+
it("applies custom class names", () => {
|
|
37
|
+
const { container } = render(FluidCursor, { props: { class: "my-fluid" } });
|
|
38
|
+
const div = container.firstElementChild;
|
|
39
|
+
expect(div?.className).toContain("my-fluid");
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# FluidCursor
|
|
2
|
+
|
|
3
|
+
A WebGL-based fluid simulation that follows the cursor, creating beautiful flowing color effects.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- WebGL2 fluid simulation with WebGL1 fallback
|
|
8
|
+
- Mouse and touch support
|
|
9
|
+
- Configurable simulation parameters
|
|
10
|
+
- Transparent background support
|
|
11
|
+
- Automatic canvas resizing
|
|
12
|
+
|
|
13
|
+
## Implementation Notes
|
|
14
|
+
|
|
15
|
+
### Svelte 5 Implementation
|
|
16
|
+
|
|
17
|
+
1. **Lifecycle**: Used `onMount` with cleanup return instead of Vue's `onMounted` + `watch`
|
|
18
|
+
2. **Refs**: Used `bind:this` for canvas reference instead of Vue's `ref()`
|
|
19
|
+
3. **Props**: Used Svelte 5 `$props()` syntax with defaults
|
|
20
|
+
4. **Cleanup**: Properly cancel animation frame and remove event listeners on unmount
|
|
21
|
+
|
|
22
|
+
### WebGL Implementation
|
|
23
|
+
|
|
24
|
+
The component implements a full Navier-Stokes fluid simulation with:
|
|
25
|
+
- Curl/vorticity computation
|
|
26
|
+
- Pressure solving with iterative Jacobi method
|
|
27
|
+
- Advection for both velocity and dye
|
|
28
|
+
- Gradient subtraction for incompressible flow
|
|
29
|
+
|
|
30
|
+
### Event Handling
|
|
31
|
+
|
|
32
|
+
- Window-level mouse/touch events for full-screen tracking
|
|
33
|
+
- First-move handlers to start animation only when user interacts
|
|
34
|
+
- Proper cleanup of all event listeners on component unmount
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as FluidCursor } from "./FluidCursor.svelte";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as FluidCursor } from "./FluidCursor.svelte";
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from "../../utils";
|
|
3
|
+
import { onMount, tick } from "svelte";
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
sentence?: string;
|
|
7
|
+
manualMode?: boolean;
|
|
8
|
+
blurAmount?: number;
|
|
9
|
+
borderColor?: string;
|
|
10
|
+
animationDuration?: number;
|
|
11
|
+
pauseBetweenAnimations?: number;
|
|
12
|
+
class?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
let {
|
|
16
|
+
sentence = "Fancy Focus",
|
|
17
|
+
manualMode = false,
|
|
18
|
+
blurAmount = 5,
|
|
19
|
+
borderColor = "green",
|
|
20
|
+
animationDuration = 0.5,
|
|
21
|
+
pauseBetweenAnimations = 1,
|
|
22
|
+
class: className = "",
|
|
23
|
+
}: Props = $props();
|
|
24
|
+
|
|
25
|
+
let words = $derived(sentence.split(" "));
|
|
26
|
+
let containerRef: HTMLDivElement;
|
|
27
|
+
let wordElements: HTMLSpanElement[] = $state([]);
|
|
28
|
+
let currentIndex = $state(0);
|
|
29
|
+
let focusRect = $state({ x: 0, y: 0, width: 0, height: 0 });
|
|
30
|
+
|
|
31
|
+
function updateFocusRect() {
|
|
32
|
+
const wordEl = wordElements[currentIndex];
|
|
33
|
+
if (!wordEl || !containerRef) return;
|
|
34
|
+
const parentRect = containerRef.getBoundingClientRect();
|
|
35
|
+
const wordRect = wordEl.getBoundingClientRect();
|
|
36
|
+
focusRect = {
|
|
37
|
+
x: wordRect.left - parentRect.left,
|
|
38
|
+
y: wordRect.top - parentRect.top,
|
|
39
|
+
width: wordRect.width,
|
|
40
|
+
height: wordRect.height,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function handleMouseEnter(index: number) {
|
|
45
|
+
if (manualMode) {
|
|
46
|
+
currentIndex = index;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function handleMouseLeave() {
|
|
51
|
+
if (manualMode) {
|
|
52
|
+
currentIndex = 0;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
$effect(() => {
|
|
57
|
+
// Track currentIndex to update rect
|
|
58
|
+
currentIndex;
|
|
59
|
+
tick().then(updateFocusRect);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
onMount(() => {
|
|
63
|
+
updateFocusRect();
|
|
64
|
+
|
|
65
|
+
if (!manualMode) {
|
|
66
|
+
const intervalMs = animationDuration * 1000 + pauseBetweenAnimations * 1000;
|
|
67
|
+
const id = setInterval(() => {
|
|
68
|
+
currentIndex = (currentIndex + 1) % words.length;
|
|
69
|
+
}, intervalMs);
|
|
70
|
+
return () => clearInterval(id);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
</script>
|
|
74
|
+
|
|
75
|
+
<div bind:this={containerRef} class={cn("focus-container", className)}>
|
|
76
|
+
{#each words as word, index}
|
|
77
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
78
|
+
<span
|
|
79
|
+
bind:this={wordElements[index]}
|
|
80
|
+
class="focus-word"
|
|
81
|
+
class:manual={manualMode}
|
|
82
|
+
class:active={index === currentIndex && !manualMode}
|
|
83
|
+
style="filter: {index === currentIndex
|
|
84
|
+
? 'blur(0px)'
|
|
85
|
+
: `blur(${blurAmount}px)`}; transition: filter {animationDuration}s ease; --border-color: {borderColor};"
|
|
86
|
+
onmouseenter={() => handleMouseEnter(index)}
|
|
87
|
+
onmouseleave={handleMouseLeave}
|
|
88
|
+
>
|
|
89
|
+
{word}
|
|
90
|
+
</span>
|
|
91
|
+
{/each}
|
|
92
|
+
|
|
93
|
+
<div
|
|
94
|
+
class="focus-frame"
|
|
95
|
+
style="transform: translate({focusRect.x}px, {focusRect.y}px); width: {focusRect.width}px; height: {focusRect.height}px; opacity: {currentIndex >=
|
|
96
|
+
0
|
|
97
|
+
? 1
|
|
98
|
+
: 0}; transition: all {animationDuration}s ease; --border-color: {borderColor};"
|
|
99
|
+
>
|
|
100
|
+
<span class="corner top-left"></span>
|
|
101
|
+
<span class="corner top-right"></span>
|
|
102
|
+
<span class="corner bottom-left"></span>
|
|
103
|
+
<span class="corner bottom-right"></span>
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
<style>
|
|
108
|
+
.focus-container {
|
|
109
|
+
position: relative;
|
|
110
|
+
display: flex;
|
|
111
|
+
gap: 1em;
|
|
112
|
+
justify-content: center;
|
|
113
|
+
align-items: center;
|
|
114
|
+
flex-wrap: wrap;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.focus-word {
|
|
118
|
+
position: relative;
|
|
119
|
+
font-size: 3rem;
|
|
120
|
+
font-weight: 900;
|
|
121
|
+
cursor: pointer;
|
|
122
|
+
transition:
|
|
123
|
+
filter 0.3s ease,
|
|
124
|
+
color 0.3s ease;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.focus-word.active {
|
|
128
|
+
filter: blur(0);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.focus-frame {
|
|
132
|
+
position: absolute;
|
|
133
|
+
top: 0;
|
|
134
|
+
left: 0;
|
|
135
|
+
pointer-events: none;
|
|
136
|
+
box-sizing: content-box;
|
|
137
|
+
border: none;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.corner {
|
|
141
|
+
position: absolute;
|
|
142
|
+
width: 1rem;
|
|
143
|
+
height: 1rem;
|
|
144
|
+
border: 3px solid var(--border-color, #fff);
|
|
145
|
+
filter: drop-shadow(0px 0px 4px var(--border-color, #fff));
|
|
146
|
+
border-radius: 3px;
|
|
147
|
+
transition: none;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.top-left {
|
|
151
|
+
top: -10px;
|
|
152
|
+
left: -10px;
|
|
153
|
+
border-right: none;
|
|
154
|
+
border-bottom: none;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.top-right {
|
|
158
|
+
top: -10px;
|
|
159
|
+
right: -10px;
|
|
160
|
+
border-left: none;
|
|
161
|
+
border-bottom: none;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.bottom-left {
|
|
165
|
+
bottom: -10px;
|
|
166
|
+
left: -10px;
|
|
167
|
+
border-right: none;
|
|
168
|
+
border-top: none;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.bottom-right {
|
|
172
|
+
bottom: -10px;
|
|
173
|
+
right: -10px;
|
|
174
|
+
border-left: none;
|
|
175
|
+
border-top: none;
|
|
176
|
+
}
|
|
177
|
+
</style>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
sentence?: string;
|
|
3
|
+
manualMode?: boolean;
|
|
4
|
+
blurAmount?: number;
|
|
5
|
+
borderColor?: string;
|
|
6
|
+
animationDuration?: number;
|
|
7
|
+
pauseBetweenAnimations?: number;
|
|
8
|
+
class?: string;
|
|
9
|
+
}
|
|
10
|
+
declare const Focus: import("svelte").Component<Props, {}, "">;
|
|
11
|
+
type Focus = ReturnType<typeof Focus>;
|
|
12
|
+
export default Focus;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { render, cleanup } from "@testing-library/svelte";
|
|
2
|
+
import { afterEach, describe, it, expect } from "vitest";
|
|
3
|
+
import Focus from "./Focus.svelte";
|
|
4
|
+
describe("Focus", () => {
|
|
5
|
+
afterEach(cleanup);
|
|
6
|
+
it("renders the component", () => {
|
|
7
|
+
const { container } = render(Focus);
|
|
8
|
+
const wrapper = container.querySelector(".focus-container");
|
|
9
|
+
expect(wrapper).toBeInTheDocument();
|
|
10
|
+
});
|
|
11
|
+
it("splits sentence into words", () => {
|
|
12
|
+
const { container } = render(Focus, {
|
|
13
|
+
props: { sentence: "Hello World Test" },
|
|
14
|
+
});
|
|
15
|
+
const words = container.querySelectorAll(".focus-word");
|
|
16
|
+
expect(words.length).toBe(3);
|
|
17
|
+
});
|
|
18
|
+
it("renders default sentence", () => {
|
|
19
|
+
const { container } = render(Focus);
|
|
20
|
+
const words = container.querySelectorAll(".focus-word");
|
|
21
|
+
expect(words.length).toBe(2); // "Fancy" "Focus"
|
|
22
|
+
});
|
|
23
|
+
it("renders focus frame with corners", () => {
|
|
24
|
+
const { container } = render(Focus);
|
|
25
|
+
const frame = container.querySelector(".focus-frame");
|
|
26
|
+
expect(frame).toBeInTheDocument();
|
|
27
|
+
const corners = container.querySelectorAll(".corner");
|
|
28
|
+
expect(corners.length).toBe(4);
|
|
29
|
+
});
|
|
30
|
+
it("applies custom border color", () => {
|
|
31
|
+
const { container } = render(Focus, { props: { borderColor: "red" } });
|
|
32
|
+
const word = container.querySelector(".focus-word");
|
|
33
|
+
expect(word.style.getPropertyValue("--border-color")).toBe("red");
|
|
34
|
+
});
|
|
35
|
+
it("applies custom class", () => {
|
|
36
|
+
const { container } = render(Focus, { props: { class: "my-focus" } });
|
|
37
|
+
const wrapper = container.querySelector(".focus-container");
|
|
38
|
+
expect(wrapper?.className).toContain("my-focus");
|
|
39
|
+
});
|
|
40
|
+
it("blurs non-active words", () => {
|
|
41
|
+
const { container } = render(Focus, {
|
|
42
|
+
props: { sentence: "A B", blurAmount: 8 },
|
|
43
|
+
});
|
|
44
|
+
const words = container.querySelectorAll(".focus-word");
|
|
45
|
+
// Second word should be blurred
|
|
46
|
+
expect(words[1].style.filter).toBe("blur(8px)");
|
|
47
|
+
});
|
|
48
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Focus
|
|
2
|
+
|
|
3
|
+
A text component that cycles through words, focusing on one at a time with a decorative frame. Non-focused words are blurred.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
| Prop | Type | Default | Description |
|
|
8
|
+
| ------------------------ | --------- | ---------------- | ------------------------------ |
|
|
9
|
+
| `sentence` | `string` | `"Fancy Focus"` | Sentence to split into words |
|
|
10
|
+
| `manualMode` | `boolean` | `false` | Focus on hover instead of auto |
|
|
11
|
+
| `blurAmount` | `number` | `5` | Blur amount for unfocused words (px) |
|
|
12
|
+
| `borderColor` | `string` | `"green"` | Corner bracket border color |
|
|
13
|
+
| `animationDuration` | `number` | `0.5` | Animation duration in seconds |
|
|
14
|
+
| `pauseBetweenAnimations` | `number` | `1` | Pause between words in seconds |
|
|
15
|
+
| `class` | `string` | `""` | Additional CSS classes |
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```svelte
|
|
20
|
+
<Focus sentence="Create stunning interfaces" borderColor="cyan" />
|
|
21
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Focus } from "./Focus.svelte";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Focus } from "./Focus.svelte";
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from "../../utils";
|
|
3
|
+
import type { Snippet } from "svelte";
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
class?: string;
|
|
7
|
+
children?: Snippet;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
let { class: className = "", children }: Props = $props();
|
|
11
|
+
|
|
12
|
+
let isPointerInside = $state(false);
|
|
13
|
+
let refElement: HTMLDivElement;
|
|
14
|
+
let timeoutId: ReturnType<typeof setTimeout> | undefined;
|
|
15
|
+
|
|
16
|
+
let glare = $state({ x: 50, y: 50 });
|
|
17
|
+
let background = $state({ x: 50, y: 50 });
|
|
18
|
+
let rotate = $state({ x: 0, y: 0 });
|
|
19
|
+
|
|
20
|
+
let cssVars = $derived(
|
|
21
|
+
`--m-x:${glare.x}%;--m-y:${glare.y}%;--r-x:${rotate.x}deg;--r-y:${rotate.y}deg;--bg-x:${background.x}%;--bg-y:${background.y}%;--duration:300ms;--foil-size:100%;--opacity:0;--radius:48px;--easing:ease;--transition:var(--duration) var(--easing);`
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
function handlePointerMove(event: PointerEvent) {
|
|
25
|
+
const rotateFactor = 0.4;
|
|
26
|
+
const rect = refElement?.getBoundingClientRect();
|
|
27
|
+
if (rect) {
|
|
28
|
+
const position = {
|
|
29
|
+
x: event.clientX - rect.left,
|
|
30
|
+
y: event.clientY - rect.top,
|
|
31
|
+
};
|
|
32
|
+
const percentage = {
|
|
33
|
+
x: (100 / rect.width) * position.x,
|
|
34
|
+
y: (100 / rect.height) * position.y,
|
|
35
|
+
};
|
|
36
|
+
const delta = {
|
|
37
|
+
x: percentage.x - 50,
|
|
38
|
+
y: percentage.y - 50,
|
|
39
|
+
};
|
|
40
|
+
background.x = 50 + percentage.x / 4 - 12.5;
|
|
41
|
+
background.y = 50 + percentage.y / 3 - 16.67;
|
|
42
|
+
rotate.x = -(delta.x / 3.5) * rotateFactor;
|
|
43
|
+
rotate.y = (delta.y / 2) * rotateFactor;
|
|
44
|
+
glare.x = percentage.x;
|
|
45
|
+
glare.y = percentage.y;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function handlePointerEnter() {
|
|
50
|
+
isPointerInside = true;
|
|
51
|
+
if (timeoutId) clearTimeout(timeoutId);
|
|
52
|
+
timeoutId = setTimeout(() => {
|
|
53
|
+
if (isPointerInside && refElement) {
|
|
54
|
+
refElement.style.setProperty("--duration", "0s");
|
|
55
|
+
}
|
|
56
|
+
}, 300);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function handlePointerLeave() {
|
|
60
|
+
isPointerInside = false;
|
|
61
|
+
if (timeoutId) clearTimeout(timeoutId);
|
|
62
|
+
if (refElement) {
|
|
63
|
+
refElement.style.removeProperty("--duration");
|
|
64
|
+
rotate = { x: 0, y: 0 };
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
</script>
|
|
68
|
+
|
|
69
|
+
<div
|
|
70
|
+
bind:this={refElement}
|
|
71
|
+
class="glare-container relative isolate [aspect-ratio:17/21] w-[320px] transition-transform delay-[var(--delay)] duration-[var(--duration)] ease-[var(--easing)] will-change-transform [contain:layout_style] [perspective:600px]"
|
|
72
|
+
style={cssVars}
|
|
73
|
+
onpointermove={handlePointerMove}
|
|
74
|
+
onpointerenter={handlePointerEnter}
|
|
75
|
+
onpointerleave={handlePointerLeave}
|
|
76
|
+
>
|
|
77
|
+
<div
|
|
78
|
+
class="grid h-full origin-center [transform:rotateY(var(--r-x))_rotateX(var(--r-y))] overflow-hidden rounded-lg border border-slate-800 transition-transform delay-[var(--delay)] duration-[var(--duration)] ease-[var(--easing)] will-change-transform hover:filter-none hover:[--duration:200ms] hover:[--easing:linear] hover:[--opacity:0.6]"
|
|
79
|
+
>
|
|
80
|
+
<div
|
|
81
|
+
class="grid size-full mix-blend-soft-light [clip-path:inset(0_0_0_0_round_var(--radius))] [grid-area:1/1]"
|
|
82
|
+
>
|
|
83
|
+
<div class={cn("size-full bg-slate-950", className)}>
|
|
84
|
+
{#if children}
|
|
85
|
+
{@render children()}
|
|
86
|
+
{/if}
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
<div
|
|
90
|
+
class="will-change-background grid size-full opacity-[var(--opacity)] mix-blend-soft-light transition-opacity delay-[var(--delay)] duration-[var(--duration)] ease-[var(--easing)] [background:radial-gradient(farthest-corner_circle_at_var(--m-x)_var(--m-y),_rgba(255,255,255,0.8)_10%,_rgba(255,255,255,0.65)_20%,_rgba(255,255,255,0)_90%)] [clip-path:inset(0_0_1px_0_round_var(--radius))] [grid-area:1/1]"
|
|
91
|
+
></div>
|
|
92
|
+
<div
|
|
93
|
+
class="glare-foil relative grid size-full opacity-[var(--opacity)] [background-blend-mode:hue_hue_hue_overlay] mix-blend-color-dodge transition-opacity will-change-[background] [background:var(--pattern),_var(--rainbow),_var(--diagonal),_var(--shade)] [clip-path:inset(0_0_1px_0_round_var(--radius))] [grid-area:1/1] after:bg-[inherit] after:[background-size:var(--foil-size),_200%_400%,_800%,_200%] after:[background-position:center,_0%_var(--bg-y),_calc(var(--bg-x)*_-1)_calc(var(--bg-y)*_-1),_var(--bg-x)_var(--bg-y)] after:[background-blend-mode:soft-light,_hue,_hard-light] after:mix-blend-exclusion after:content-[''] after:[grid-area:1/1]"
|
|
94
|
+
></div>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
|
|
98
|
+
<style>
|
|
99
|
+
.glare-foil {
|
|
100
|
+
--step: 5%;
|
|
101
|
+
--foil-svg: url("data:image/svg+xml,%3Csvg width='26' height='26' viewBox='0 0 26 26' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.99994 3.419C2.99994 3.419 21.6142 7.43646 22.7921 12.153C23.97 16.8695 3.41838 23.0306 3.41838 23.0306' stroke='white' stroke-width='5' stroke-miterlimit='3.86874' stroke-linecap='round' style='mix-blend-mode:darken'/%3E%3C/svg%3E");
|
|
102
|
+
--pattern: var(--foil-svg) center/100% no-repeat;
|
|
103
|
+
--rainbow: repeating-linear-gradient(
|
|
104
|
+
0deg,
|
|
105
|
+
rgb(255, 119, 115) calc(var(--step) * 1),
|
|
106
|
+
rgba(255, 237, 95, 1) calc(var(--step) * 2),
|
|
107
|
+
rgba(168, 255, 95, 1) calc(var(--step) * 3),
|
|
108
|
+
rgba(131, 255, 247, 1) calc(var(--step) * 4),
|
|
109
|
+
rgba(120, 148, 255, 1) calc(var(--step) * 5),
|
|
110
|
+
rgb(216, 117, 255) calc(var(--step) * 6),
|
|
111
|
+
rgb(255, 119, 115) calc(var(--step) * 7)
|
|
112
|
+
)
|
|
113
|
+
0% var(--bg-y) / 200% 700% no-repeat;
|
|
114
|
+
--diagonal: repeating-linear-gradient(
|
|
115
|
+
128deg,
|
|
116
|
+
#0e152e 0%,
|
|
117
|
+
hsl(180, 10%, 60%) 3.8%,
|
|
118
|
+
hsl(180, 10%, 60%) 4.5%,
|
|
119
|
+
hsl(180, 10%, 60%) 5.2%,
|
|
120
|
+
#0e152e 10%,
|
|
121
|
+
#0e152e 12%
|
|
122
|
+
)
|
|
123
|
+
var(--bg-x) var(--bg-y) / 300% no-repeat;
|
|
124
|
+
--shade: radial-gradient(
|
|
125
|
+
farthest-corner circle at var(--m-x) var(--m-y),
|
|
126
|
+
rgba(255, 255, 255, 0.1) 12%,
|
|
127
|
+
rgba(255, 255, 255, 0.15) 20%,
|
|
128
|
+
rgba(255, 255, 255, 0.25) 120%
|
|
129
|
+
)
|
|
130
|
+
var(--bg-x) var(--bg-y) / 300% no-repeat;
|
|
131
|
+
background-blend-mode: hue, hue, hue, overlay;
|
|
132
|
+
}
|
|
133
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { render, cleanup } from "@testing-library/svelte";
|
|
2
|
+
import { afterEach, describe, it, expect } from "vitest";
|
|
3
|
+
import GlareCard from "./GlareCard.svelte";
|
|
4
|
+
describe("GlareCard", () => {
|
|
5
|
+
afterEach(cleanup);
|
|
6
|
+
it("renders the component", () => {
|
|
7
|
+
const { container } = render(GlareCard);
|
|
8
|
+
const wrapper = container.querySelector(".glare-container");
|
|
9
|
+
expect(wrapper).toBeInTheDocument();
|
|
10
|
+
});
|
|
11
|
+
it("has perspective class", () => {
|
|
12
|
+
const { container } = render(GlareCard);
|
|
13
|
+
const wrapper = container.querySelector(".glare-container");
|
|
14
|
+
expect(wrapper?.className).toContain("[perspective:600px]");
|
|
15
|
+
});
|
|
16
|
+
it("has correct aspect ratio", () => {
|
|
17
|
+
const { container } = render(GlareCard);
|
|
18
|
+
const wrapper = container.querySelector(".glare-container");
|
|
19
|
+
expect(wrapper?.className).toContain("[aspect-ratio:17/21]");
|
|
20
|
+
});
|
|
21
|
+
it("sets CSS custom properties", () => {
|
|
22
|
+
const { container } = render(GlareCard);
|
|
23
|
+
const wrapper = container.querySelector(".glare-container");
|
|
24
|
+
const style = wrapper.getAttribute("style") ?? "";
|
|
25
|
+
expect(style).toContain("--m-x");
|
|
26
|
+
expect(style).toContain("50%");
|
|
27
|
+
expect(style).toContain("--r-x");
|
|
28
|
+
expect(style).toContain("0deg");
|
|
29
|
+
});
|
|
30
|
+
it("applies custom class", () => {
|
|
31
|
+
const { container } = render(GlareCard, { props: { class: "my-glare" } });
|
|
32
|
+
const content = container.querySelector(".my-glare");
|
|
33
|
+
expect(content).toBeInTheDocument();
|
|
34
|
+
});
|
|
35
|
+
it("renders foil layer", () => {
|
|
36
|
+
const { container } = render(GlareCard);
|
|
37
|
+
const foil = container.querySelector(".glare-foil");
|
|
38
|
+
expect(foil).toBeInTheDocument();
|
|
39
|
+
});
|
|
40
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# GlareCard
|
|
2
|
+
|
|
3
|
+
A holographic trading card effect with mouse-tracking glare, rainbow foil, and 3D rotation.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
| Prop | Type | Default | Description |
|
|
8
|
+
| ------- | -------- | ------- | ---------------------- |
|
|
9
|
+
| `class` | `string` | `""` | Additional CSS classes |
|
|
10
|
+
|
|
11
|
+
## Snippets
|
|
12
|
+
|
|
13
|
+
- `children` — Card content
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```svelte
|
|
18
|
+
<GlareCard>
|
|
19
|
+
<div class="flex flex-col items-center justify-center h-full p-6 text-white">
|
|
20
|
+
<h3 class="text-xl font-bold">Holographic</h3>
|
|
21
|
+
<p class="text-sm">Move your mouse around</p>
|
|
22
|
+
</div>
|
|
23
|
+
</GlareCard>
|
|
24
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as GlareCard } from "./GlareCard.svelte";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as GlareCard } from "./GlareCard.svelte";
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from "../../utils";
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
class?: string;
|
|
6
|
+
borderRadius?: number;
|
|
7
|
+
color?: string | string[];
|
|
8
|
+
borderWidth?: number;
|
|
9
|
+
duration?: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
let {
|
|
13
|
+
class: className = "",
|
|
14
|
+
borderRadius = 10,
|
|
15
|
+
color = "#FFF",
|
|
16
|
+
borderWidth = 2,
|
|
17
|
+
duration = 10,
|
|
18
|
+
}: Props = $props();
|
|
19
|
+
|
|
20
|
+
let colorString = $derived(Array.isArray(color) ? color.join(",") : color);
|
|
21
|
+
|
|
22
|
+
let styles = $derived(`
|
|
23
|
+
--glow-border-radius: ${borderRadius}px;
|
|
24
|
+
--glow-border-width: ${borderWidth}px;
|
|
25
|
+
--glow-duration: ${duration}s;
|
|
26
|
+
background-image: radial-gradient(transparent, transparent, ${colorString}, transparent, transparent);
|
|
27
|
+
background-size: 300% 300%;
|
|
28
|
+
mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
29
|
+
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
30
|
+
-webkit-mask-composite: xor;
|
|
31
|
+
mask-composite: exclude;
|
|
32
|
+
padding: var(--glow-border-width);
|
|
33
|
+
border-radius: var(--glow-border-radius);
|
|
34
|
+
`);
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<div
|
|
38
|
+
class={cn(
|
|
39
|
+
"animate-glow pointer-events-none absolute inset-0 size-full rounded-[inherit] will-change-[background-position]",
|
|
40
|
+
className
|
|
41
|
+
)}
|
|
42
|
+
style={styles}
|
|
43
|
+
></div>
|
|
44
|
+
|
|
45
|
+
<style>
|
|
46
|
+
@keyframes glow {
|
|
47
|
+
0% {
|
|
48
|
+
background-position: 0% 0%;
|
|
49
|
+
}
|
|
50
|
+
50% {
|
|
51
|
+
background-position: 100% 100%;
|
|
52
|
+
}
|
|
53
|
+
100% {
|
|
54
|
+
background-position: 0% 0%;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.animate-glow {
|
|
59
|
+
animation: glow var(--glow-duration) linear infinite;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@media (prefers-reduced-motion: reduce) {
|
|
63
|
+
.animate-glow {
|
|
64
|
+
animation: none;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
class?: string;
|
|
3
|
+
borderRadius?: number;
|
|
4
|
+
color?: string | string[];
|
|
5
|
+
borderWidth?: number;
|
|
6
|
+
duration?: number;
|
|
7
|
+
}
|
|
8
|
+
declare const GlowBorder: import("svelte").Component<Props, {}, "">;
|
|
9
|
+
type GlowBorder = ReturnType<typeof GlowBorder>;
|
|
10
|
+
export default GlowBorder;
|