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,66 @@
|
|
|
1
|
+
import { render, cleanup } from "@testing-library/svelte";
|
|
2
|
+
import { afterEach, describe, it, expect, vi } from "vitest";
|
|
3
|
+
import BoxReveal from "./BoxReveal.svelte";
|
|
4
|
+
// Mock IntersectionObserver as a class
|
|
5
|
+
class MockIntersectionObserver {
|
|
6
|
+
callback;
|
|
7
|
+
static instances = [];
|
|
8
|
+
constructor(callback) {
|
|
9
|
+
this.callback = callback;
|
|
10
|
+
MockIntersectionObserver.instances.push(this);
|
|
11
|
+
}
|
|
12
|
+
observe = vi.fn();
|
|
13
|
+
disconnect = vi.fn();
|
|
14
|
+
unobserve = vi.fn();
|
|
15
|
+
}
|
|
16
|
+
vi.stubGlobal("IntersectionObserver", MockIntersectionObserver);
|
|
17
|
+
describe("BoxReveal", () => {
|
|
18
|
+
afterEach(() => {
|
|
19
|
+
cleanup();
|
|
20
|
+
MockIntersectionObserver.instances = [];
|
|
21
|
+
});
|
|
22
|
+
it("renders the box-reveal container", () => {
|
|
23
|
+
const { container } = render(BoxReveal, {
|
|
24
|
+
props: { children: (() => { }) },
|
|
25
|
+
});
|
|
26
|
+
const wrapper = container.querySelector(".box-reveal");
|
|
27
|
+
expect(wrapper).toBeTruthy();
|
|
28
|
+
});
|
|
29
|
+
it("renders the overlay element", () => {
|
|
30
|
+
const { container } = render(BoxReveal, {
|
|
31
|
+
props: { children: (() => { }) },
|
|
32
|
+
});
|
|
33
|
+
const overlay = container.querySelector(".box-reveal-overlay");
|
|
34
|
+
expect(overlay).toBeTruthy();
|
|
35
|
+
});
|
|
36
|
+
it("renders overlay with z-20 class for stacking", () => {
|
|
37
|
+
const { container } = render(BoxReveal, {
|
|
38
|
+
props: { color: "#ff0000", children: (() => { }) },
|
|
39
|
+
});
|
|
40
|
+
const overlay = container.querySelector(".box-reveal-overlay");
|
|
41
|
+
expect(overlay?.className).toContain("z-20");
|
|
42
|
+
expect(overlay?.className).toContain("absolute");
|
|
43
|
+
});
|
|
44
|
+
it("applies custom class names", () => {
|
|
45
|
+
const { container } = render(BoxReveal, {
|
|
46
|
+
props: { class: "my-reveal", children: (() => { }) },
|
|
47
|
+
});
|
|
48
|
+
const wrapper = container.querySelector(".box-reveal");
|
|
49
|
+
expect(wrapper?.className).toContain("my-reveal");
|
|
50
|
+
});
|
|
51
|
+
it("observes element for intersection", () => {
|
|
52
|
+
render(BoxReveal, {
|
|
53
|
+
props: { children: (() => { }) },
|
|
54
|
+
});
|
|
55
|
+
const lastInstance = MockIntersectionObserver.instances.at(-1);
|
|
56
|
+
expect(lastInstance?.observe).toHaveBeenCalled();
|
|
57
|
+
});
|
|
58
|
+
it("content starts hidden (opacity 0)", () => {
|
|
59
|
+
const { container } = render(BoxReveal, {
|
|
60
|
+
props: { children: (() => { }) },
|
|
61
|
+
});
|
|
62
|
+
const content = container.querySelector(".box-reveal-content");
|
|
63
|
+
const style = content?.getAttribute("style") ?? "";
|
|
64
|
+
expect(style).toContain("opacity");
|
|
65
|
+
});
|
|
66
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# BoxReveal
|
|
2
|
+
|
|
3
|
+
Sliding box reveal animation. Content fades up while a colored box slides from left to right, revealing the content underneath. Triggers on viewport entry.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
| Prop | Type | Default | Description |
|
|
8
|
+
| ---------- | -------- | ---------- | ----------------------------------- |
|
|
9
|
+
| `color` | `string` | `'#5046e6'`| Color of the reveal box |
|
|
10
|
+
| `duration` | `number` | `0.5` | Animation duration (seconds) |
|
|
11
|
+
| `delay` | `number` | `0.25` | Delay before animation (seconds) |
|
|
12
|
+
| `class` | `string` | `''` | Additional CSS classes |
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
```svelte
|
|
17
|
+
<BoxReveal>
|
|
18
|
+
<h1>Revealed content</h1>
|
|
19
|
+
</BoxReveal>
|
|
20
|
+
|
|
21
|
+
<BoxReveal color="#ff6600" duration={0.8}>
|
|
22
|
+
<p>Custom color and speed</p>
|
|
23
|
+
</BoxReveal>
|
|
24
|
+
```
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from "../../utils";
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
class?: string;
|
|
6
|
+
children?: import("svelte").Snippet;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
let { class: className = "", children }: Props = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<div class={cn("h-96 w-96", className)} style="transform-style: preserve-3d">
|
|
13
|
+
{#if children}
|
|
14
|
+
{@render children()}
|
|
15
|
+
{/if}
|
|
16
|
+
</div>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { setContext } from "svelte";
|
|
3
|
+
import { cn } from "../../utils";
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
class?: string;
|
|
7
|
+
containerClass?: string;
|
|
8
|
+
children?: import("svelte").Snippet;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
let { class: className = "", containerClass = "", children }: Props = $props();
|
|
12
|
+
|
|
13
|
+
let containerRef: HTMLDivElement;
|
|
14
|
+
let isMouseEntered = $state(false);
|
|
15
|
+
|
|
16
|
+
setContext("card3d:mouseEntered", () => isMouseEntered);
|
|
17
|
+
|
|
18
|
+
function handleMouseMove(e: MouseEvent) {
|
|
19
|
+
if (!containerRef) return;
|
|
20
|
+
const { left, top, width, height } = containerRef.getBoundingClientRect();
|
|
21
|
+
const x = (e.clientX - left - width / 2) / 25;
|
|
22
|
+
const y = (e.clientY - top - height / 2) / 25;
|
|
23
|
+
containerRef.style.transform = `rotateY(${x}deg) rotateX(${y}deg)`;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function handleMouseEnter() {
|
|
27
|
+
isMouseEntered = true;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function handleMouseLeave() {
|
|
31
|
+
if (!containerRef) return;
|
|
32
|
+
isMouseEntered = false;
|
|
33
|
+
containerRef.style.transform = `rotateY(0deg) rotateX(0deg)`;
|
|
34
|
+
}
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<div class={cn("flex items-center justify-center p-2", containerClass)} style="perspective: 1000px">
|
|
38
|
+
<div
|
|
39
|
+
bind:this={containerRef}
|
|
40
|
+
class={cn(
|
|
41
|
+
"relative flex items-center justify-center transition-all duration-200 ease-linear",
|
|
42
|
+
className
|
|
43
|
+
)}
|
|
44
|
+
style="transform-style: preserve-3d"
|
|
45
|
+
onmouseenter={handleMouseEnter}
|
|
46
|
+
onmousemove={handleMouseMove}
|
|
47
|
+
onmouseleave={handleMouseLeave}
|
|
48
|
+
>
|
|
49
|
+
{#if children}
|
|
50
|
+
{@render children()}
|
|
51
|
+
{/if}
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
class?: string;
|
|
3
|
+
containerClass?: string;
|
|
4
|
+
children?: import("svelte").Snippet;
|
|
5
|
+
}
|
|
6
|
+
declare const CardContainer: import("svelte").Component<Props, {}, "">;
|
|
7
|
+
type CardContainer = ReturnType<typeof CardContainer>;
|
|
8
|
+
export default CardContainer;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { getContext } from "svelte";
|
|
3
|
+
import { cn } from "../../utils";
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
as?: string;
|
|
7
|
+
class?: string;
|
|
8
|
+
translateX?: number | string;
|
|
9
|
+
translateY?: number | string;
|
|
10
|
+
translateZ?: number | string;
|
|
11
|
+
rotateX?: number | string;
|
|
12
|
+
rotateY?: number | string;
|
|
13
|
+
rotateZ?: number | string;
|
|
14
|
+
children?: import("svelte").Snippet;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
let {
|
|
18
|
+
as = "div",
|
|
19
|
+
class: className = "",
|
|
20
|
+
translateX = 0,
|
|
21
|
+
translateY = 0,
|
|
22
|
+
translateZ = 0,
|
|
23
|
+
rotateX = 0,
|
|
24
|
+
rotateY = 0,
|
|
25
|
+
rotateZ = 0,
|
|
26
|
+
children,
|
|
27
|
+
}: Props = $props();
|
|
28
|
+
|
|
29
|
+
let ref: HTMLElement;
|
|
30
|
+
|
|
31
|
+
const getMouseEntered = getContext<() => boolean>("card3d:mouseEntered");
|
|
32
|
+
|
|
33
|
+
let transform = $derived(
|
|
34
|
+
getMouseEntered()
|
|
35
|
+
? `translateX(${translateX}px) translateY(${translateY}px) translateZ(${translateZ}px) rotateX(${rotateX}deg) rotateY(${rotateY}deg) rotateZ(${rotateZ}deg)`
|
|
36
|
+
: `translateX(0px) translateY(0px) translateZ(0px) rotateX(0deg) rotateY(0deg) rotateZ(0deg)`
|
|
37
|
+
);
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<svelte:element
|
|
41
|
+
this={as}
|
|
42
|
+
bind:this={ref}
|
|
43
|
+
class={cn("w-fit transition duration-500 ease-in-out", className)}
|
|
44
|
+
style="transform: {transform}"
|
|
45
|
+
>
|
|
46
|
+
{#if children}
|
|
47
|
+
{@render children()}
|
|
48
|
+
{/if}
|
|
49
|
+
</svelte:element>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
as?: string;
|
|
3
|
+
class?: string;
|
|
4
|
+
translateX?: number | string;
|
|
5
|
+
translateY?: number | string;
|
|
6
|
+
translateZ?: number | string;
|
|
7
|
+
rotateX?: number | string;
|
|
8
|
+
rotateY?: number | string;
|
|
9
|
+
rotateZ?: number | string;
|
|
10
|
+
children?: import("svelte").Snippet;
|
|
11
|
+
}
|
|
12
|
+
declare const CardItem: import("svelte").Component<Props, {}, "">;
|
|
13
|
+
type CardItem = ReturnType<typeof CardItem>;
|
|
14
|
+
export default CardItem;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Card 3D
|
|
2
|
+
|
|
3
|
+
Interactive 3D perspective card that tilts based on mouse position, with child elements that can float at different depth levels.
|
|
4
|
+
|
|
5
|
+
## Components
|
|
6
|
+
|
|
7
|
+
- **CardContainer** — Outer wrapper providing perspective and mouse tracking. Shares mouse state via Svelte context.
|
|
8
|
+
- **CardBody** — Inner container with `transform-style: preserve-3d`.
|
|
9
|
+
- **CardItem** — Individual element with configurable 3D transform on hover.
|
|
10
|
+
|
|
11
|
+
## Props
|
|
12
|
+
|
|
13
|
+
### CardContainer
|
|
14
|
+
|
|
15
|
+
| Prop | Type | Default | Description |
|
|
16
|
+
| ---------------- | -------- | ------- | ------------------------------ |
|
|
17
|
+
| `class` | `string` | `''` | Classes for the inner wrapper |
|
|
18
|
+
| `containerClass` | `string` | `''` | Classes for the outer wrapper |
|
|
19
|
+
|
|
20
|
+
### CardBody
|
|
21
|
+
|
|
22
|
+
| Prop | Type | Default | Description |
|
|
23
|
+
| ------- | -------- | ------- | ------------------------ |
|
|
24
|
+
| `class` | `string` | `''` | Classes for the body div |
|
|
25
|
+
|
|
26
|
+
### CardItem
|
|
27
|
+
|
|
28
|
+
| Prop | Type | Default | Description |
|
|
29
|
+
| ------------ | ------------------ | ------- | ------------------------------ |
|
|
30
|
+
| `as` | `string` | `'div'` | HTML element to render as |
|
|
31
|
+
| `class` | `string` | `''` | Additional classes |
|
|
32
|
+
| `translateX` | `number \| string` | `0` | X translation on hover (px) |
|
|
33
|
+
| `translateY` | `number \| string` | `0` | Y translation on hover (px) |
|
|
34
|
+
| `translateZ` | `number \| string` | `0` | Z translation (depth) on hover |
|
|
35
|
+
| `rotateX` | `number \| string` | `0` | X rotation on hover (deg) |
|
|
36
|
+
| `rotateY` | `number \| string` | `0` | Y rotation on hover (deg) |
|
|
37
|
+
| `rotateZ` | `number \| string` | `0` | Z rotation on hover (deg) |
|
|
38
|
+
|
|
39
|
+
## Usage
|
|
40
|
+
|
|
41
|
+
```svelte
|
|
42
|
+
<CardContainer>
|
|
43
|
+
<CardBody class="rounded-xl border bg-card p-6 w-[20rem]">
|
|
44
|
+
<CardItem translateZ={50} class="text-xl font-bold">
|
|
45
|
+
Title
|
|
46
|
+
</CardItem>
|
|
47
|
+
<CardItem translateZ={100}>
|
|
48
|
+
<img src="..." alt="..." class="rounded-xl" />
|
|
49
|
+
</CardItem>
|
|
50
|
+
</CardBody>
|
|
51
|
+
</CardContainer>
|
|
52
|
+
```
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from "../../utils";
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
class?: string;
|
|
6
|
+
slotClass?: string;
|
|
7
|
+
gradientSize?: number;
|
|
8
|
+
gradientColor?: string;
|
|
9
|
+
gradientOpacity?: number;
|
|
10
|
+
children?: import("svelte").Snippet;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let {
|
|
14
|
+
class: className = "",
|
|
15
|
+
slotClass = "",
|
|
16
|
+
gradientSize = 200,
|
|
17
|
+
gradientColor = "#262626",
|
|
18
|
+
gradientOpacity = 0.8,
|
|
19
|
+
children,
|
|
20
|
+
}: Props = $props();
|
|
21
|
+
|
|
22
|
+
let mouseX = $state(-gradientSize * 10);
|
|
23
|
+
let mouseY = $state(-gradientSize * 10);
|
|
24
|
+
|
|
25
|
+
function handleMouseMove(e: MouseEvent) {
|
|
26
|
+
const target = e.currentTarget as HTMLElement;
|
|
27
|
+
const rect = target.getBoundingClientRect();
|
|
28
|
+
mouseX = e.clientX - rect.left;
|
|
29
|
+
mouseY = e.clientY - rect.top;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function handleMouseLeave() {
|
|
33
|
+
mouseX = -gradientSize * 10;
|
|
34
|
+
mouseY = -gradientSize * 10;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
let backgroundStyle = $derived(
|
|
38
|
+
`radial-gradient(circle at ${mouseX}px ${mouseY}px, ${gradientColor} 0%, rgba(0, 0, 0, 0) 70%)`
|
|
39
|
+
);
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<div
|
|
43
|
+
class={cn(
|
|
44
|
+
"group relative flex size-full overflow-hidden rounded-xl border bg-neutral-100 text-black dark:bg-neutral-900 dark:text-white",
|
|
45
|
+
className
|
|
46
|
+
)}
|
|
47
|
+
onmousemove={handleMouseMove}
|
|
48
|
+
onmouseleave={handleMouseLeave}
|
|
49
|
+
>
|
|
50
|
+
<div class={cn("relative z-10", slotClass)}>
|
|
51
|
+
{#if children}
|
|
52
|
+
{@render children()}
|
|
53
|
+
{/if}
|
|
54
|
+
</div>
|
|
55
|
+
<div
|
|
56
|
+
class="pointer-events-none absolute inset-0 rounded-xl opacity-0 transition-opacity duration-300 group-hover:opacity-100"
|
|
57
|
+
style="background: {backgroundStyle}; opacity: {gradientOpacity}"
|
|
58
|
+
></div>
|
|
59
|
+
</div>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
class?: string;
|
|
3
|
+
slotClass?: string;
|
|
4
|
+
gradientSize?: number;
|
|
5
|
+
gradientColor?: string;
|
|
6
|
+
gradientOpacity?: number;
|
|
7
|
+
children?: import("svelte").Snippet;
|
|
8
|
+
}
|
|
9
|
+
declare const CardSpotlight: import("svelte").Component<Props, {}, "">;
|
|
10
|
+
type CardSpotlight = ReturnType<typeof CardSpotlight>;
|
|
11
|
+
export default CardSpotlight;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Card Spotlight
|
|
2
|
+
|
|
3
|
+
Card with a mouse-following radial gradient spotlight overlay that appears on hover.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
| Prop | Type | Default | Description |
|
|
8
|
+
| ----------------- | -------- | ----------- | ------------------------------------ |
|
|
9
|
+
| `class` | `string` | `''` | Classes for the outer container |
|
|
10
|
+
| `slotClass` | `string` | `''` | Classes for the content wrapper |
|
|
11
|
+
| `gradientSize` | `number` | `200` | Radius of the spotlight gradient |
|
|
12
|
+
| `gradientColor` | `string` | `'#262626'` | Color of the spotlight |
|
|
13
|
+
| `gradientOpacity` | `number` | `0.8` | Opacity of the gradient overlay |
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```svelte
|
|
18
|
+
<CardSpotlight class="h-64 w-80" gradientColor="#3b82f6">
|
|
19
|
+
<div class="p-6">
|
|
20
|
+
<h3 class="text-lg font-bold">Title</h3>
|
|
21
|
+
<p>Content here</p>
|
|
22
|
+
</div>
|
|
23
|
+
</CardSpotlight>
|
|
24
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CardSpotlight } from "./CardSpotlight.svelte";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CardSpotlight } from "./CardSpotlight.svelte";
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
/**
|
|
3
|
+
* ColourfulText - Per-character color animation
|
|
4
|
+
*
|
|
5
|
+
* Each character is individually animated with shuffled colors.
|
|
6
|
+
* Colors reshuffle every 5 seconds with staggered CSS transitions.
|
|
7
|
+
* Pure CSS implementation (no motion library dependency).
|
|
8
|
+
*/
|
|
9
|
+
export interface ColourfulTextProps {
|
|
10
|
+
/** Text to animate */
|
|
11
|
+
text: string;
|
|
12
|
+
/** Array of colors to cycle through */
|
|
13
|
+
colors?: string[];
|
|
14
|
+
/** Initial color before animation */
|
|
15
|
+
startColor?: string;
|
|
16
|
+
/** Transition duration in seconds for each character */
|
|
17
|
+
duration?: number;
|
|
18
|
+
/** Additional CSS classes */
|
|
19
|
+
class?: string;
|
|
20
|
+
}
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<script lang="ts">
|
|
24
|
+
import { cn } from "../../utils.js";
|
|
25
|
+
import { onMount } from "svelte";
|
|
26
|
+
|
|
27
|
+
let {
|
|
28
|
+
text,
|
|
29
|
+
colors = [
|
|
30
|
+
"rgb(131, 179, 32)",
|
|
31
|
+
"rgb(47, 195, 106)",
|
|
32
|
+
"rgb(42, 169, 210)",
|
|
33
|
+
"rgb(4, 112, 202)",
|
|
34
|
+
"rgb(107, 10, 255)",
|
|
35
|
+
"rgb(183, 0, 218)",
|
|
36
|
+
"rgb(218, 0, 171)",
|
|
37
|
+
"rgb(230, 64, 92)",
|
|
38
|
+
"rgb(232, 98, 63)",
|
|
39
|
+
"rgb(249, 129, 47)",
|
|
40
|
+
],
|
|
41
|
+
startColor = "rgb(255, 255, 255)",
|
|
42
|
+
duration = 0.5,
|
|
43
|
+
class: className,
|
|
44
|
+
}: ColourfulTextProps = $props();
|
|
45
|
+
|
|
46
|
+
let currentColors = $state<string[]>([]);
|
|
47
|
+
|
|
48
|
+
function shuffleColors() {
|
|
49
|
+
currentColors = [...colors].sort(() => 0.5 - Math.random());
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Initialize with shuffled colors
|
|
53
|
+
shuffleColors();
|
|
54
|
+
|
|
55
|
+
onMount(() => {
|
|
56
|
+
const intervalId = setInterval(() => {
|
|
57
|
+
if (document.visibilityState === "visible") {
|
|
58
|
+
shuffleColors();
|
|
59
|
+
}
|
|
60
|
+
}, 5000);
|
|
61
|
+
|
|
62
|
+
return () => clearInterval(intervalId);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
const chars = $derived(text.split(""));
|
|
66
|
+
</script>
|
|
67
|
+
|
|
68
|
+
<span class={cn("colourful-text inline-flex", className)}>
|
|
69
|
+
{#each chars as char, i (i)}
|
|
70
|
+
<span
|
|
71
|
+
class="colourful-char inline-block"
|
|
72
|
+
style="color:{currentColors[i % currentColors.length] ??
|
|
73
|
+
startColor};transition:color {duration}s ease {i * 0.05}s,opacity {duration}s ease {i *
|
|
74
|
+
0.05}s,transform {duration}s ease {i * 0.05}s,filter {duration}s ease {i * 0.05}s"
|
|
75
|
+
>{char === " " ? "\u00A0" : char}</span
|
|
76
|
+
>
|
|
77
|
+
{/each}
|
|
78
|
+
</span>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ColourfulText - Per-character color animation
|
|
3
|
+
*
|
|
4
|
+
* Each character is individually animated with shuffled colors.
|
|
5
|
+
* Colors reshuffle every 5 seconds with staggered CSS transitions.
|
|
6
|
+
* Pure CSS implementation (no motion library dependency).
|
|
7
|
+
*/
|
|
8
|
+
export interface ColourfulTextProps {
|
|
9
|
+
/** Text to animate */
|
|
10
|
+
text: string;
|
|
11
|
+
/** Array of colors to cycle through */
|
|
12
|
+
colors?: string[];
|
|
13
|
+
/** Initial color before animation */
|
|
14
|
+
startColor?: string;
|
|
15
|
+
/** Transition duration in seconds for each character */
|
|
16
|
+
duration?: number;
|
|
17
|
+
/** Additional CSS classes */
|
|
18
|
+
class?: string;
|
|
19
|
+
}
|
|
20
|
+
declare const ColourfulText: import("svelte").Component<ColourfulTextProps, {}, "">;
|
|
21
|
+
type ColourfulText = ReturnType<typeof ColourfulText>;
|
|
22
|
+
export default ColourfulText;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { render, cleanup } from "@testing-library/svelte";
|
|
2
|
+
import { afterEach, describe, it, expect } from "vitest";
|
|
3
|
+
import ColourfulText from "./ColourfulText.svelte";
|
|
4
|
+
describe("ColourfulText", () => {
|
|
5
|
+
afterEach(cleanup);
|
|
6
|
+
it("renders one span per character", () => {
|
|
7
|
+
const { container } = render(ColourfulText, { props: { text: "Hello" } });
|
|
8
|
+
const chars = container.querySelectorAll(".colourful-char");
|
|
9
|
+
expect(chars.length).toBe(5);
|
|
10
|
+
});
|
|
11
|
+
it("renders the correct text content", () => {
|
|
12
|
+
const { container } = render(ColourfulText, { props: { text: "ABC" } });
|
|
13
|
+
const wrapper = container.querySelector(".colourful-text");
|
|
14
|
+
expect(wrapper?.textContent).toBe("ABC");
|
|
15
|
+
});
|
|
16
|
+
it("renders spaces as non-breaking spaces", () => {
|
|
17
|
+
const { container } = render(ColourfulText, { props: { text: "A B" } });
|
|
18
|
+
const chars = container.querySelectorAll(".colourful-char");
|
|
19
|
+
expect(chars.length).toBe(3);
|
|
20
|
+
expect(chars[1].textContent).toBe("\u00A0");
|
|
21
|
+
});
|
|
22
|
+
it("applies color styles to each character", () => {
|
|
23
|
+
const { container } = render(ColourfulText, { props: { text: "Hi" } });
|
|
24
|
+
const chars = container.querySelectorAll(".colourful-char");
|
|
25
|
+
chars.forEach((char) => {
|
|
26
|
+
const style = char.getAttribute("style") ?? "";
|
|
27
|
+
expect(style).toContain("color:");
|
|
28
|
+
expect(style).toContain("transition:");
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
it("applies staggered transition delays", () => {
|
|
32
|
+
const { container } = render(ColourfulText, {
|
|
33
|
+
props: { text: "AB", duration: 0.5 },
|
|
34
|
+
});
|
|
35
|
+
const chars = container.querySelectorAll(".colourful-char");
|
|
36
|
+
const style0 = chars[0].getAttribute("style") ?? "";
|
|
37
|
+
const style1 = chars[1].getAttribute("style") ?? "";
|
|
38
|
+
expect(style0).toContain("0s");
|
|
39
|
+
expect(style1).toContain("0.05s");
|
|
40
|
+
});
|
|
41
|
+
it("applies custom class names", () => {
|
|
42
|
+
const { container } = render(ColourfulText, {
|
|
43
|
+
props: { text: "Hi", class: "my-colourful" },
|
|
44
|
+
});
|
|
45
|
+
const wrapper = container.querySelector(".colourful-text");
|
|
46
|
+
expect(wrapper?.className).toContain("my-colourful");
|
|
47
|
+
});
|
|
48
|
+
it("renders an empty wrapper for empty text", () => {
|
|
49
|
+
const { container } = render(ColourfulText, { props: { text: "" } });
|
|
50
|
+
const chars = container.querySelectorAll(".colourful-char");
|
|
51
|
+
expect(chars.length).toBe(0);
|
|
52
|
+
});
|
|
53
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# ColourfulText
|
|
2
|
+
|
|
3
|
+
Per-character color animation. Each character is individually animated with shuffled colors that reshuffle every 5 seconds. Pure CSS transitions — no motion library dependency.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
| Prop | Type | Default | Description |
|
|
8
|
+
| ------------ | ---------- | -------------------------- | ---------------------------------------- |
|
|
9
|
+
| `text` | `string` | **required** | Text to animate |
|
|
10
|
+
| `colors` | `string[]` | 10 rainbow colors | Array of colors to cycle through |
|
|
11
|
+
| `startColor` | `string` | `'rgb(255, 255, 255)'` | Initial color before animation |
|
|
12
|
+
| `duration` | `number` | `0.5` | Transition duration per character (secs) |
|
|
13
|
+
| `class` | `string` | `''` | Additional CSS classes |
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```svelte
|
|
18
|
+
<h1 class="text-4xl font-bold">
|
|
19
|
+
Make things <ColourfulText text="colourful" />
|
|
20
|
+
</h1>
|
|
21
|
+
```
|