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 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { render, cleanup } from "@testing-library/svelte";
|
|
2
|
+
import { afterEach, describe, it, expect } from "vitest";
|
|
3
|
+
import GlowBorder from "./GlowBorder.svelte";
|
|
4
|
+
describe("GlowBorder", () => {
|
|
5
|
+
afterEach(cleanup);
|
|
6
|
+
it("renders a div element", () => {
|
|
7
|
+
const { container } = render(GlowBorder);
|
|
8
|
+
const div = container.querySelector(".animate-glow");
|
|
9
|
+
expect(div).toBeInTheDocument();
|
|
10
|
+
});
|
|
11
|
+
it("has pointer-events-none class", () => {
|
|
12
|
+
const { container } = render(GlowBorder);
|
|
13
|
+
const div = container.firstElementChild;
|
|
14
|
+
expect(div?.className).toContain("pointer-events-none");
|
|
15
|
+
});
|
|
16
|
+
it("has absolute and inset-0 classes", () => {
|
|
17
|
+
const { container } = render(GlowBorder);
|
|
18
|
+
const div = container.firstElementChild;
|
|
19
|
+
expect(div?.className).toContain("absolute");
|
|
20
|
+
expect(div?.className).toContain("inset-0");
|
|
21
|
+
});
|
|
22
|
+
it("includes border-radius in inline style", () => {
|
|
23
|
+
const { container } = render(GlowBorder, { props: { borderRadius: 20 } });
|
|
24
|
+
const div = container.firstElementChild;
|
|
25
|
+
const style = div.getAttribute("style") ?? "";
|
|
26
|
+
expect(style).toContain("border-radius");
|
|
27
|
+
});
|
|
28
|
+
it("includes duration CSS var in style", () => {
|
|
29
|
+
const { container } = render(GlowBorder, { props: { duration: 5 } });
|
|
30
|
+
const div = container.firstElementChild;
|
|
31
|
+
const style = div.getAttribute("style") ?? "";
|
|
32
|
+
expect(style).toContain("--glow-duration: 5s");
|
|
33
|
+
});
|
|
34
|
+
it("includes border-width CSS var in style", () => {
|
|
35
|
+
const { container } = render(GlowBorder, { props: { borderWidth: 4 } });
|
|
36
|
+
const div = container.firstElementChild;
|
|
37
|
+
const style = div.getAttribute("style") ?? "";
|
|
38
|
+
expect(style).toContain("--glow-border-width: 4px");
|
|
39
|
+
});
|
|
40
|
+
it("includes border-radius CSS var in style", () => {
|
|
41
|
+
const { container } = render(GlowBorder, { props: { borderRadius: 16 } });
|
|
42
|
+
const div = container.firstElementChild;
|
|
43
|
+
const style = div.getAttribute("style") ?? "";
|
|
44
|
+
expect(style).toContain("--glow-border-radius: 16px");
|
|
45
|
+
});
|
|
46
|
+
it("applies custom class names", () => {
|
|
47
|
+
const { container } = render(GlowBorder, { props: { class: "my-glow" } });
|
|
48
|
+
const div = container.firstElementChild;
|
|
49
|
+
expect(div?.className).toContain("my-glow");
|
|
50
|
+
});
|
|
51
|
+
it("preserves base classes when custom class is added", () => {
|
|
52
|
+
const { container } = render(GlowBorder, { props: { class: "extra" } });
|
|
53
|
+
const div = container.firstElementChild;
|
|
54
|
+
expect(div?.className).toContain("pointer-events-none");
|
|
55
|
+
expect(div?.className).toContain("absolute");
|
|
56
|
+
});
|
|
57
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# GlowBorder
|
|
2
|
+
|
|
3
|
+
An animated glowing border effect using CSS masks and gradients.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```svelte
|
|
8
|
+
<script>
|
|
9
|
+
import { GlowBorder } from '$lib/fancy-ui/glow-border';
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<div class="relative rounded-xl bg-card p-6">
|
|
13
|
+
<p>Content goes here</p>
|
|
14
|
+
<GlowBorder color="#00ffff" />
|
|
15
|
+
</div>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Props
|
|
19
|
+
|
|
20
|
+
| Prop | Type | Default | Description |
|
|
21
|
+
|------|------|---------|-------------|
|
|
22
|
+
| `class` | `string` | `''` | Additional CSS classes |
|
|
23
|
+
| `color` | `string \| string[]` | `'#FFF'` | Glow color(s) - single or array for gradient |
|
|
24
|
+
| `borderRadius` | `number` | `10` | Border radius in pixels |
|
|
25
|
+
| `borderWidth` | `number` | `2` | Border thickness in pixels |
|
|
26
|
+
| `duration` | `number` | `10` | Animation duration in seconds |
|
|
27
|
+
|
|
28
|
+
## Examples
|
|
29
|
+
|
|
30
|
+
### Single Color
|
|
31
|
+
```svelte
|
|
32
|
+
<GlowBorder color="#00ffff" />
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Multi-Color Gradient
|
|
36
|
+
```svelte
|
|
37
|
+
<GlowBorder color={['#3b82f6', '#8b5cf6', '#ec4899']} />
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Custom Thickness
|
|
41
|
+
```svelte
|
|
42
|
+
<GlowBorder borderWidth={4} color="#ff00ff" />
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Requirements
|
|
46
|
+
|
|
47
|
+
- Parent element must have `position: relative`
|
|
48
|
+
- Works best on dark backgrounds
|
|
49
|
+
|
|
50
|
+
## Implementation Notes
|
|
51
|
+
|
|
52
|
+
- Animation defined in component's scoped styles
|
|
53
|
+
- Respects `prefers-reduced-motion` for accessibility
|
|
54
|
+
- Uses CSS mask-composite for the border effect
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as GlowBorder } from "./GlowBorder.svelte";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as GlowBorder } from "./GlowBorder.svelte";
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from "../../utils";
|
|
3
|
+
import { onMount } from "svelte";
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
blur?: number;
|
|
7
|
+
inactiveZone?: number;
|
|
8
|
+
proximity?: number;
|
|
9
|
+
spread?: number;
|
|
10
|
+
variant?: "default" | "white";
|
|
11
|
+
glow?: boolean;
|
|
12
|
+
class?: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
movementDuration?: number;
|
|
15
|
+
borderWidth?: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
let {
|
|
19
|
+
blur = 0,
|
|
20
|
+
inactiveZone = 0.7,
|
|
21
|
+
proximity = 0,
|
|
22
|
+
spread = 20,
|
|
23
|
+
variant = "default",
|
|
24
|
+
glow = false,
|
|
25
|
+
class: className = "",
|
|
26
|
+
disabled = true,
|
|
27
|
+
movementDuration = 2,
|
|
28
|
+
borderWidth = 1,
|
|
29
|
+
}: Props = $props();
|
|
30
|
+
|
|
31
|
+
let containerRef: HTMLDivElement;
|
|
32
|
+
let lastPosition = { x: 0, y: 0 };
|
|
33
|
+
let animationFrameId = 0;
|
|
34
|
+
let angleAnimationFrameId = 0;
|
|
35
|
+
let currentAngle = 0;
|
|
36
|
+
let targetAngle = 0;
|
|
37
|
+
let animating = false;
|
|
38
|
+
|
|
39
|
+
let containerStyle = $derived(
|
|
40
|
+
[
|
|
41
|
+
`--blur: ${blur}px`,
|
|
42
|
+
`--spread: ${spread}`,
|
|
43
|
+
`--start: 0`,
|
|
44
|
+
`--active: 0`,
|
|
45
|
+
`--glowingeffect-border-width: ${borderWidth}px`,
|
|
46
|
+
`--repeating-conic-gradient-times: 5`,
|
|
47
|
+
`--gradient: ${
|
|
48
|
+
variant === "white"
|
|
49
|
+
? `repeating-conic-gradient(from 236.84deg at 50% 50%, var(--black), var(--black) calc(25% / var(--repeating-conic-gradient-times)))`
|
|
50
|
+
: `radial-gradient(circle, #dd7bbb 10%, #dd7bbb00 20%), radial-gradient(circle at 40% 40%, #d79f1e 5%, #d79f1e00 15%), radial-gradient(circle at 60% 60%, #5a922c 10%, #5a922c00 20%), radial-gradient(circle at 40% 60%, #4c7894 10%, #4c789400 20%), repeating-conic-gradient(from 236.84deg at 50% 50%, #dd7bbb 0%, #d79f1e calc(25% / var(--repeating-conic-gradient-times)), #5a922c calc(50% / var(--repeating-conic-gradient-times)), #4c7894 calc(75% / var(--repeating-conic-gradient-times)), #dd7bbb calc(100% / var(--repeating-conic-gradient-times)))`
|
|
51
|
+
}`,
|
|
52
|
+
].join(";")
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
function handleMove(e?: { x: number; y: number }) {
|
|
56
|
+
if (!containerRef) return;
|
|
57
|
+
|
|
58
|
+
if (animationFrameId) {
|
|
59
|
+
cancelAnimationFrame(animationFrameId);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
animationFrameId = requestAnimationFrame(() => {
|
|
63
|
+
if (!containerRef) return;
|
|
64
|
+
|
|
65
|
+
const { left, top, width, height } = containerRef.getBoundingClientRect();
|
|
66
|
+
const mouseX = e?.x ?? lastPosition.x;
|
|
67
|
+
const mouseY = e?.y ?? lastPosition.y;
|
|
68
|
+
|
|
69
|
+
if (e) {
|
|
70
|
+
lastPosition = { x: mouseX, y: mouseY };
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const center = [left + width * 0.5, top + height * 0.5];
|
|
74
|
+
const distanceFromCenter = Math.hypot(mouseX - center[0], mouseY - center[1]);
|
|
75
|
+
const inactiveRadius = 0.5 * Math.min(width, height) * inactiveZone;
|
|
76
|
+
|
|
77
|
+
if (distanceFromCenter < inactiveRadius) {
|
|
78
|
+
containerRef.style.setProperty("--active", "0");
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const isActive =
|
|
83
|
+
mouseX > left - proximity &&
|
|
84
|
+
mouseX < left + width + proximity &&
|
|
85
|
+
mouseY > top - proximity &&
|
|
86
|
+
mouseY < top + height + proximity;
|
|
87
|
+
|
|
88
|
+
containerRef.style.setProperty("--active", isActive ? "1" : "0");
|
|
89
|
+
|
|
90
|
+
if (!isActive) return;
|
|
91
|
+
|
|
92
|
+
const rawTarget = (180 * Math.atan2(mouseY - center[1], mouseX - center[0])) / Math.PI + 90;
|
|
93
|
+
|
|
94
|
+
// Shortest-path angle difference
|
|
95
|
+
const angleDiff = ((rawTarget - currentAngle + 180) % 360) - 180;
|
|
96
|
+
targetAngle = currentAngle + angleDiff;
|
|
97
|
+
|
|
98
|
+
if (!animating) {
|
|
99
|
+
animating = true;
|
|
100
|
+
animateAngle();
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function animateAngle() {
|
|
106
|
+
// Lerp speed inversely proportional to movementDuration
|
|
107
|
+
const speed = 0.08 / Math.max(movementDuration, 0.1);
|
|
108
|
+
currentAngle = currentAngle + (targetAngle - currentAngle) * speed;
|
|
109
|
+
|
|
110
|
+
if (containerRef) {
|
|
111
|
+
containerRef.style.setProperty("--start", String(currentAngle));
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if (Math.abs(targetAngle - currentAngle) > 0.1) {
|
|
115
|
+
angleAnimationFrameId = requestAnimationFrame(animateAngle);
|
|
116
|
+
} else {
|
|
117
|
+
currentAngle = targetAngle;
|
|
118
|
+
if (containerRef) {
|
|
119
|
+
containerRef.style.setProperty("--start", String(currentAngle));
|
|
120
|
+
}
|
|
121
|
+
animating = false;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function handlePointerMove(e: PointerEvent) {
|
|
126
|
+
handleMove(e);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function handleScroll() {
|
|
130
|
+
handleMove();
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
onMount(() => {
|
|
134
|
+
if (disabled) return;
|
|
135
|
+
|
|
136
|
+
window.addEventListener("scroll", handleScroll, { passive: true });
|
|
137
|
+
document.body.addEventListener("pointermove", handlePointerMove, { passive: true });
|
|
138
|
+
|
|
139
|
+
return () => {
|
|
140
|
+
if (animationFrameId) cancelAnimationFrame(animationFrameId);
|
|
141
|
+
if (angleAnimationFrameId) cancelAnimationFrame(angleAnimationFrameId);
|
|
142
|
+
window.removeEventListener("scroll", handleScroll);
|
|
143
|
+
document.body.removeEventListener("pointermove", handlePointerMove);
|
|
144
|
+
};
|
|
145
|
+
});
|
|
146
|
+
</script>
|
|
147
|
+
|
|
148
|
+
<div
|
|
149
|
+
class={cn(
|
|
150
|
+
"pointer-events-none absolute -inset-px hidden rounded-[inherit] border opacity-0 transition-opacity",
|
|
151
|
+
glow && "opacity-100",
|
|
152
|
+
variant === "white" && "border-white",
|
|
153
|
+
disabled && "!block"
|
|
154
|
+
)}
|
|
155
|
+
aria-hidden="true"
|
|
156
|
+
></div>
|
|
157
|
+
<div
|
|
158
|
+
bind:this={containerRef}
|
|
159
|
+
style={containerStyle}
|
|
160
|
+
class={cn(
|
|
161
|
+
"pointer-events-none absolute inset-0 rounded-[inherit] opacity-100 transition-opacity",
|
|
162
|
+
glow && "opacity-100",
|
|
163
|
+
blur > 0 && "blur-[var(--blur)]",
|
|
164
|
+
className,
|
|
165
|
+
disabled && "!hidden"
|
|
166
|
+
)}
|
|
167
|
+
aria-hidden="true"
|
|
168
|
+
>
|
|
169
|
+
<div
|
|
170
|
+
class={cn(
|
|
171
|
+
"glow",
|
|
172
|
+
"rounded-[inherit]",
|
|
173
|
+
"after:absolute after:inset-[calc(-1*var(--glowingeffect-border-width))] after:rounded-[inherit] after:content-['']",
|
|
174
|
+
"after:[border:var(--glowingeffect-border-width)_solid_transparent]",
|
|
175
|
+
"after:[background-attachment:fixed] after:[background:var(--gradient)]",
|
|
176
|
+
"after:opacity-[var(--active)] after:transition-opacity after:duration-300",
|
|
177
|
+
"after:[mask-clip:padding-box,border-box]",
|
|
178
|
+
"after:[mask-composite:intersect]",
|
|
179
|
+
"after:[mask-image:linear-gradient(#0000,#0000),conic-gradient(from_calc((var(--start)-var(--spread))*1deg),#00000000_0deg,#fff,#00000000_calc(var(--spread)*2deg))]"
|
|
180
|
+
)}
|
|
181
|
+
></div>
|
|
182
|
+
</div>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
blur?: number;
|
|
3
|
+
inactiveZone?: number;
|
|
4
|
+
proximity?: number;
|
|
5
|
+
spread?: number;
|
|
6
|
+
variant?: "default" | "white";
|
|
7
|
+
glow?: boolean;
|
|
8
|
+
class?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
movementDuration?: number;
|
|
11
|
+
borderWidth?: number;
|
|
12
|
+
}
|
|
13
|
+
declare const GlowingEffect: import("svelte").Component<Props, {}, "">;
|
|
14
|
+
type GlowingEffect = ReturnType<typeof GlowingEffect>;
|
|
15
|
+
export default GlowingEffect;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { render, cleanup } from "@testing-library/svelte";
|
|
2
|
+
import { afterEach, describe, it, expect } from "vitest";
|
|
3
|
+
import GlowingEffect from "./GlowingEffect.svelte";
|
|
4
|
+
describe("GlowingEffect", () => {
|
|
5
|
+
afterEach(cleanup);
|
|
6
|
+
it("renders without errors", () => {
|
|
7
|
+
const { container } = render(GlowingEffect);
|
|
8
|
+
expect(container.firstElementChild).toBeInTheDocument();
|
|
9
|
+
});
|
|
10
|
+
it("applies custom class", () => {
|
|
11
|
+
const { container } = render(GlowingEffect, {
|
|
12
|
+
props: { class: "my-glow" },
|
|
13
|
+
});
|
|
14
|
+
const divs = container.querySelectorAll("div");
|
|
15
|
+
const hasClass = Array.from(divs).some((div) => div.className.includes("my-glow"));
|
|
16
|
+
expect(hasClass).toBe(true);
|
|
17
|
+
});
|
|
18
|
+
it("sets default CSS custom properties", () => {
|
|
19
|
+
const { container } = render(GlowingEffect);
|
|
20
|
+
const styledDiv = container.querySelector("[style]");
|
|
21
|
+
const style = styledDiv?.getAttribute("style") ?? "";
|
|
22
|
+
expect(style).toContain("--blur: 0px");
|
|
23
|
+
expect(style).toContain("--spread: 20");
|
|
24
|
+
expect(style).toContain("--glowingeffect-border-width: 1px");
|
|
25
|
+
});
|
|
26
|
+
it("hides container when disabled (default)", () => {
|
|
27
|
+
const { container } = render(GlowingEffect);
|
|
28
|
+
const styledDiv = container.querySelector("[style]");
|
|
29
|
+
expect(styledDiv?.className).toContain("!hidden");
|
|
30
|
+
});
|
|
31
|
+
it("shows border div when disabled", () => {
|
|
32
|
+
const { container } = render(GlowingEffect);
|
|
33
|
+
const firstDiv = container.firstElementChild;
|
|
34
|
+
expect(firstDiv?.className).toContain("!block");
|
|
35
|
+
});
|
|
36
|
+
it("white variant gets border-white", () => {
|
|
37
|
+
const { container } = render(GlowingEffect, {
|
|
38
|
+
props: { variant: "white" },
|
|
39
|
+
});
|
|
40
|
+
const firstDiv = container.firstElementChild;
|
|
41
|
+
expect(firstDiv?.className).toContain("border-white");
|
|
42
|
+
});
|
|
43
|
+
it("default variant does not get border-white", () => {
|
|
44
|
+
const { container } = render(GlowingEffect, {
|
|
45
|
+
props: { variant: "default" },
|
|
46
|
+
});
|
|
47
|
+
const firstDiv = container.firstElementChild;
|
|
48
|
+
expect(firstDiv?.className).not.toContain("border-white");
|
|
49
|
+
});
|
|
50
|
+
it("applies custom blur value", () => {
|
|
51
|
+
const { container } = render(GlowingEffect, { props: { blur: 10 } });
|
|
52
|
+
const styledDiv = container.querySelector("[style]");
|
|
53
|
+
const style = styledDiv?.getAttribute("style") ?? "";
|
|
54
|
+
expect(style).toContain("--blur: 10px");
|
|
55
|
+
});
|
|
56
|
+
it("applies custom spread value", () => {
|
|
57
|
+
const { container } = render(GlowingEffect, { props: { spread: 50 } });
|
|
58
|
+
const styledDiv = container.querySelector("[style]");
|
|
59
|
+
const style = styledDiv?.getAttribute("style") ?? "";
|
|
60
|
+
expect(style).toContain("--spread: 50");
|
|
61
|
+
});
|
|
62
|
+
it("applies custom borderWidth value", () => {
|
|
63
|
+
const { container } = render(GlowingEffect, { props: { borderWidth: 3 } });
|
|
64
|
+
const styledDiv = container.querySelector("[style]");
|
|
65
|
+
const style = styledDiv?.getAttribute("style") ?? "";
|
|
66
|
+
expect(style).toContain("--glowingeffect-border-width: 3px");
|
|
67
|
+
});
|
|
68
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# GlowingEffect
|
|
2
|
+
|
|
3
|
+
Mouse-proximity based glowing border effect with animated conic gradient.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
| Prop | Type | Default | Description |
|
|
8
|
+
|------|------|---------|-------------|
|
|
9
|
+
| `blur` | `number` | `0` | Blur amount for the glow |
|
|
10
|
+
| `inactiveZone` | `number` | `0.7` | Inner zone radius ratio where glow deactivates |
|
|
11
|
+
| `proximity` | `number` | `0` | Extra proximity distance to activate glow |
|
|
12
|
+
| `spread` | `number` | `20` | Spread angle of the conic gradient |
|
|
13
|
+
| `variant` | `'default' \| 'white'` | `'default'` | Color variant |
|
|
14
|
+
| `glow` | `boolean` | `false` | Force glow visible |
|
|
15
|
+
| `disabled` | `boolean` | `true` | Disable mouse tracking |
|
|
16
|
+
| `movementDuration` | `number` | `2` | Animation speed |
|
|
17
|
+
| `borderWidth` | `number` | `1` | Border width in pixels |
|
|
18
|
+
| `class` | `string` | `''` | Additional CSS classes |
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
Place inside a relatively positioned container with `rounded-*` classes:
|
|
23
|
+
|
|
24
|
+
```svelte
|
|
25
|
+
<div class="relative rounded-xl p-4 bg-card">
|
|
26
|
+
<GlowingEffect spread={40} glow disabled={false} />
|
|
27
|
+
<p>Content here</p>
|
|
28
|
+
</div>
|
|
29
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as GlowingEffect } from "./GlowingEffect.svelte";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as GlowingEffect } from "./GlowingEffect.svelte";
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
import type { HTMLButtonAttributes } from "svelte/elements";
|
|
4
|
+
|
|
5
|
+
type BaseProps = {
|
|
6
|
+
/** Gradient colors for the conic-gradient border */
|
|
7
|
+
colors?: string[];
|
|
8
|
+
/** Animation duration in milliseconds */
|
|
9
|
+
duration?: number;
|
|
10
|
+
/** Border width in pixels */
|
|
11
|
+
borderWidth?: number;
|
|
12
|
+
/** Border radius in pixels */
|
|
13
|
+
borderRadius?: number;
|
|
14
|
+
/** Blur amount for the gradient in pixels */
|
|
15
|
+
blur?: number;
|
|
16
|
+
/** Background color of the button content area */
|
|
17
|
+
bgColor?: string;
|
|
18
|
+
/** Custom CSS class */
|
|
19
|
+
class?: string;
|
|
20
|
+
/** Button content */
|
|
21
|
+
children?: Snippet;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type GradientButtonProps = BaseProps & Omit<HTMLButtonAttributes, keyof BaseProps>;
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<script lang="ts">
|
|
28
|
+
import { cn } from "../../utils.js";
|
|
29
|
+
|
|
30
|
+
let {
|
|
31
|
+
class: className,
|
|
32
|
+
colors = [
|
|
33
|
+
"#FF0000",
|
|
34
|
+
"#FFA500",
|
|
35
|
+
"#FFFF00",
|
|
36
|
+
"#008000",
|
|
37
|
+
"#0000FF",
|
|
38
|
+
"#4B0082",
|
|
39
|
+
"#EE82EE",
|
|
40
|
+
"#FF0000",
|
|
41
|
+
],
|
|
42
|
+
duration = 2500,
|
|
43
|
+
borderWidth = 2,
|
|
44
|
+
borderRadius = 8,
|
|
45
|
+
blur = 4,
|
|
46
|
+
bgColor = "#000",
|
|
47
|
+
children,
|
|
48
|
+
...restProps
|
|
49
|
+
}: GradientButtonProps = $props();
|
|
50
|
+
|
|
51
|
+
const styleVars = $derived(
|
|
52
|
+
`--gb-colors: ${colors.join(", ")}; --gb-duration: ${duration}ms; --gb-border-width: ${borderWidth}px; --gb-border-radius: ${borderRadius}px; --gb-blur: ${blur}px; --gb-bg-color: ${bgColor}`
|
|
53
|
+
);
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<button
|
|
57
|
+
class={cn(
|
|
58
|
+
"gradient-button relative flex min-h-10 min-w-28 cursor-pointer items-center justify-center overflow-hidden",
|
|
59
|
+
className
|
|
60
|
+
)}
|
|
61
|
+
style={styleVars}
|
|
62
|
+
{...restProps}
|
|
63
|
+
>
|
|
64
|
+
<!-- Rotating conic-gradient pseudo-element -->
|
|
65
|
+
<span class="gradient-border" aria-hidden="true"></span>
|
|
66
|
+
|
|
67
|
+
<!-- Content area -->
|
|
68
|
+
<span class="gradient-content inline-flex size-full items-center justify-center px-4 py-2">
|
|
69
|
+
{@render children?.()}
|
|
70
|
+
</span>
|
|
71
|
+
</button>
|
|
72
|
+
|
|
73
|
+
<style>
|
|
74
|
+
.gradient-button {
|
|
75
|
+
padding: var(--gb-border-width);
|
|
76
|
+
border-radius: var(--gb-border-radius);
|
|
77
|
+
isolation: isolate;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.gradient-border {
|
|
81
|
+
content: "";
|
|
82
|
+
position: absolute;
|
|
83
|
+
inset: -200%;
|
|
84
|
+
z-index: -1;
|
|
85
|
+
background: conic-gradient(var(--gb-colors));
|
|
86
|
+
animation: rotate-gradient var(--gb-duration) linear infinite;
|
|
87
|
+
filter: blur(var(--gb-blur));
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.gradient-content {
|
|
91
|
+
border-radius: var(--gb-border-radius);
|
|
92
|
+
background-color: var(--gb-bg-color);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
@keyframes rotate-gradient {
|
|
96
|
+
0% {
|
|
97
|
+
transform: rotate(0deg);
|
|
98
|
+
}
|
|
99
|
+
100% {
|
|
100
|
+
transform: rotate(360deg);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
</style>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
import type { HTMLButtonAttributes } from "svelte/elements";
|
|
3
|
+
type BaseProps = {
|
|
4
|
+
/** Gradient colors for the conic-gradient border */
|
|
5
|
+
colors?: string[];
|
|
6
|
+
/** Animation duration in milliseconds */
|
|
7
|
+
duration?: number;
|
|
8
|
+
/** Border width in pixels */
|
|
9
|
+
borderWidth?: number;
|
|
10
|
+
/** Border radius in pixels */
|
|
11
|
+
borderRadius?: number;
|
|
12
|
+
/** Blur amount for the gradient in pixels */
|
|
13
|
+
blur?: number;
|
|
14
|
+
/** Background color of the button content area */
|
|
15
|
+
bgColor?: string;
|
|
16
|
+
/** Custom CSS class */
|
|
17
|
+
class?: string;
|
|
18
|
+
/** Button content */
|
|
19
|
+
children?: Snippet;
|
|
20
|
+
};
|
|
21
|
+
export type GradientButtonProps = BaseProps & Omit<HTMLButtonAttributes, keyof BaseProps>;
|
|
22
|
+
declare const GradientButton: import("svelte").Component<GradientButtonProps, {}, "">;
|
|
23
|
+
type GradientButton = ReturnType<typeof GradientButton>;
|
|
24
|
+
export default GradientButton;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { render, screen, cleanup } from "@testing-library/svelte";
|
|
2
|
+
import { afterEach, describe, it, expect } from "vitest";
|
|
3
|
+
import GradientButton from "./GradientButton.svelte";
|
|
4
|
+
describe("GradientButton", () => {
|
|
5
|
+
afterEach(cleanup);
|
|
6
|
+
it("renders a button element", () => {
|
|
7
|
+
render(GradientButton);
|
|
8
|
+
expect(screen.getByRole("button")).toBeInTheDocument();
|
|
9
|
+
});
|
|
10
|
+
it("applies default CSS custom properties", () => {
|
|
11
|
+
render(GradientButton);
|
|
12
|
+
const button = screen.getByRole("button");
|
|
13
|
+
const style = button.getAttribute("style") ?? "";
|
|
14
|
+
expect(style).toContain("--gb-duration: 2500ms");
|
|
15
|
+
expect(style).toContain("--gb-border-width: 2px");
|
|
16
|
+
expect(style).toContain("--gb-border-radius: 8px");
|
|
17
|
+
expect(style).toContain("--gb-blur: 4px");
|
|
18
|
+
expect(style).toContain("--gb-bg-color: #000");
|
|
19
|
+
});
|
|
20
|
+
it("applies custom colors", () => {
|
|
21
|
+
render(GradientButton, { props: { colors: ["#ff0000", "#00ff00"] } });
|
|
22
|
+
const button = screen.getByRole("button");
|
|
23
|
+
expect(button.getAttribute("style")).toContain("--gb-colors: #ff0000, #00ff00");
|
|
24
|
+
});
|
|
25
|
+
it("applies custom duration", () => {
|
|
26
|
+
render(GradientButton, { props: { duration: 5000 } });
|
|
27
|
+
const button = screen.getByRole("button");
|
|
28
|
+
expect(button.getAttribute("style")).toContain("--gb-duration: 5000ms");
|
|
29
|
+
});
|
|
30
|
+
it("applies custom borderWidth", () => {
|
|
31
|
+
render(GradientButton, { props: { borderWidth: 4 } });
|
|
32
|
+
const button = screen.getByRole("button");
|
|
33
|
+
expect(button.getAttribute("style")).toContain("--gb-border-width: 4px");
|
|
34
|
+
});
|
|
35
|
+
it("applies custom class names", () => {
|
|
36
|
+
render(GradientButton, { props: { class: "my-gradient" } });
|
|
37
|
+
const button = screen.getByRole("button");
|
|
38
|
+
expect(button.className).toContain("my-gradient");
|
|
39
|
+
});
|
|
40
|
+
it("preserves base classes when custom class is added", () => {
|
|
41
|
+
render(GradientButton, { props: { class: "extra" } });
|
|
42
|
+
const button = screen.getByRole("button");
|
|
43
|
+
expect(button.className).toContain("gradient-button");
|
|
44
|
+
expect(button.className).toContain("overflow-hidden");
|
|
45
|
+
});
|
|
46
|
+
it("contains gradient-border span", () => {
|
|
47
|
+
render(GradientButton);
|
|
48
|
+
const button = screen.getByRole("button");
|
|
49
|
+
const border = button.querySelector(".gradient-border");
|
|
50
|
+
expect(border).toBeInTheDocument();
|
|
51
|
+
expect(border).toHaveAttribute("aria-hidden", "true");
|
|
52
|
+
});
|
|
53
|
+
it("contains gradient-content span", () => {
|
|
54
|
+
render(GradientButton);
|
|
55
|
+
const button = screen.getByRole("button");
|
|
56
|
+
const content = button.querySelector(".gradient-content");
|
|
57
|
+
expect(content).toBeInTheDocument();
|
|
58
|
+
});
|
|
59
|
+
it("forwards native button attributes", () => {
|
|
60
|
+
render(GradientButton, { props: { disabled: true, type: "submit" } });
|
|
61
|
+
const button = screen.getByRole("button");
|
|
62
|
+
expect(button).toBeDisabled();
|
|
63
|
+
expect(button).toHaveAttribute("type", "submit");
|
|
64
|
+
});
|
|
65
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# GradientButton
|
|
2
|
+
|
|
3
|
+
## Implementation Details
|
|
4
|
+
|
|
5
|
+
- Uses a real `<span>` element instead of `::before` pseudo-element for the rotating gradient (avoids scoped style issues with pseudo-elements in Svelte)
|
|
6
|
+
- CSS variables set via inline `style` attribute instead of Vue's `v-bind()` in `<style>`
|
|
7
|
+
- Props use `$props()` with Svelte 5 syntax
|
|
8
|
+
- Uses `{@render children?.()}` for slot content
|
|
9
|
+
- Spreads `...restProps` for native button attributes
|
|
10
|
+
- `aria-hidden="true"` on the decorative gradient span
|