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,70 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from "../../utils";
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
href: string;
|
|
8
|
+
cta: string;
|
|
9
|
+
class?: string;
|
|
10
|
+
icon?: import("svelte").Snippet;
|
|
11
|
+
background?: import("svelte").Snippet;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
let {
|
|
15
|
+
name,
|
|
16
|
+
description: desc,
|
|
17
|
+
href,
|
|
18
|
+
cta,
|
|
19
|
+
class: className = "",
|
|
20
|
+
icon,
|
|
21
|
+
background,
|
|
22
|
+
}: Props = $props();
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<div
|
|
26
|
+
class={cn(
|
|
27
|
+
"group relative col-span-3 flex flex-col justify-end overflow-hidden rounded-xl",
|
|
28
|
+
"bg-white [box-shadow:0_0_0_1px_rgba(0,0,0,.03),0_2px_4px_rgba(0,0,0,.05),0_12px_24px_rgba(0,0,0,.05)]",
|
|
29
|
+
"transform-gpu dark:bg-black dark:[box-shadow:0_-20px_80px_-20px_#ffffff1f_inset] dark:[border:1px_solid_rgba(255,255,255,.1)]",
|
|
30
|
+
className
|
|
31
|
+
)}
|
|
32
|
+
>
|
|
33
|
+
{#if background}
|
|
34
|
+
{@render background()}
|
|
35
|
+
{/if}
|
|
36
|
+
|
|
37
|
+
<div
|
|
38
|
+
class="pointer-events-none z-10 flex transform-gpu flex-col gap-1 p-6 transition-all duration-300 group-hover:-translate-y-10"
|
|
39
|
+
>
|
|
40
|
+
{#if icon}
|
|
41
|
+
<div
|
|
42
|
+
class="size-12 origin-left transform-gpu text-neutral-700 transition-all duration-300 ease-in-out group-hover:scale-75"
|
|
43
|
+
>
|
|
44
|
+
{@render icon()}
|
|
45
|
+
</div>
|
|
46
|
+
{:else}
|
|
47
|
+
<div
|
|
48
|
+
class="size-12 origin-left transform-gpu text-neutral-700 transition-all duration-300 ease-in-out group-hover:scale-75"
|
|
49
|
+
></div>
|
|
50
|
+
{/if}
|
|
51
|
+
<h3 class="text-xl font-semibold text-neutral-700 dark:text-neutral-300">
|
|
52
|
+
{name}
|
|
53
|
+
</h3>
|
|
54
|
+
<p class="max-w-lg text-neutral-400">{desc}</p>
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
<div
|
|
58
|
+
class="pointer-events-none absolute bottom-0 flex w-full translate-y-10 transform-gpu flex-row items-center p-4 opacity-0 transition-all duration-300 group-hover:translate-y-0 group-hover:opacity-100"
|
|
59
|
+
>
|
|
60
|
+
<a
|
|
61
|
+
{href}
|
|
62
|
+
class="pointer-events-auto inline-flex items-center rounded-md px-3 py-1.5 text-sm font-medium text-neutral-700 transition-colors hover:bg-neutral-100 dark:text-neutral-200 dark:hover:bg-neutral-800"
|
|
63
|
+
>
|
|
64
|
+
{cta} →
|
|
65
|
+
</a>
|
|
66
|
+
</div>
|
|
67
|
+
<div
|
|
68
|
+
class="pointer-events-none absolute inset-0 transform-gpu transition-all duration-300 group-hover:bg-black/[.03] group-hover:dark:bg-neutral-800/10"
|
|
69
|
+
></div>
|
|
70
|
+
</div>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
href: string;
|
|
5
|
+
cta: string;
|
|
6
|
+
class?: string;
|
|
7
|
+
icon?: import("svelte").Snippet;
|
|
8
|
+
background?: import("svelte").Snippet;
|
|
9
|
+
}
|
|
10
|
+
declare const BentoGridCard: import("svelte").Component<Props, {}, "">;
|
|
11
|
+
type BentoGridCard = ReturnType<typeof BentoGridCard>;
|
|
12
|
+
export default BentoGridCard;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from "../../utils";
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
class?: string;
|
|
6
|
+
header?: import("svelte").Snippet;
|
|
7
|
+
icon?: import("svelte").Snippet;
|
|
8
|
+
title?: import("svelte").Snippet;
|
|
9
|
+
description?: import("svelte").Snippet;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
let { class: className = "", header, icon, title, description }: Props = $props();
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<div
|
|
16
|
+
class={cn(
|
|
17
|
+
"group/bento shadow-input row-span-1 flex flex-col justify-between space-y-4 rounded-xl border border-transparent bg-white p-4 transition duration-200 hover:shadow-xl dark:border-white/[0.2] dark:bg-black dark:shadow-none",
|
|
18
|
+
className
|
|
19
|
+
)}
|
|
20
|
+
>
|
|
21
|
+
{#if header}
|
|
22
|
+
{@render header()}
|
|
23
|
+
{/if}
|
|
24
|
+
<div class="transition duration-200 group-hover/bento:translate-x-2">
|
|
25
|
+
{#if icon}
|
|
26
|
+
{@render icon()}
|
|
27
|
+
{/if}
|
|
28
|
+
{#if title}
|
|
29
|
+
<div class="my-2 font-sans font-bold text-neutral-600 dark:text-neutral-200">
|
|
30
|
+
{@render title()}
|
|
31
|
+
</div>
|
|
32
|
+
{/if}
|
|
33
|
+
{#if description}
|
|
34
|
+
<div class="font-sans text-xs font-normal text-neutral-600 dark:text-neutral-300">
|
|
35
|
+
{@render description()}
|
|
36
|
+
</div>
|
|
37
|
+
{/if}
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
class?: string;
|
|
3
|
+
header?: import("svelte").Snippet;
|
|
4
|
+
icon?: import("svelte").Snippet;
|
|
5
|
+
title?: import("svelte").Snippet;
|
|
6
|
+
description?: import("svelte").Snippet;
|
|
7
|
+
}
|
|
8
|
+
declare const BentoGridItem: import("svelte").Component<Props, {}, "">;
|
|
9
|
+
type BentoGridItem = ReturnType<typeof BentoGridItem>;
|
|
10
|
+
export default BentoGridItem;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Bento Grid
|
|
2
|
+
|
|
3
|
+
Bento-style grid layout for organizing features and content cards.
|
|
4
|
+
|
|
5
|
+
## Components
|
|
6
|
+
|
|
7
|
+
- **BentoGrid** — Grid container with responsive columns.
|
|
8
|
+
- **BentoGridItem** — Slot-based item with header, icon, title, and description snippets.
|
|
9
|
+
- **BentoGridCard** — Props-based card with name, description, CTA link, optional icon and background.
|
|
10
|
+
|
|
11
|
+
## Props
|
|
12
|
+
|
|
13
|
+
### BentoGrid
|
|
14
|
+
|
|
15
|
+
| Prop | Type | Default | Description |
|
|
16
|
+
| ------- | -------- | ------- | ------------------------ |
|
|
17
|
+
| `class` | `string` | `''` | Additional grid classes |
|
|
18
|
+
|
|
19
|
+
### BentoGridItem
|
|
20
|
+
|
|
21
|
+
| Prop | Type | Default | Description |
|
|
22
|
+
| ------------- | --------- | ------- | ------------------ |
|
|
23
|
+
| `class` | `string` | `''` | Additional classes |
|
|
24
|
+
| `header` | `Snippet` | — | Header area slot |
|
|
25
|
+
| `icon` | `Snippet` | — | Icon slot |
|
|
26
|
+
| `title` | `Snippet` | — | Title slot |
|
|
27
|
+
| `description` | `Snippet` | — | Description slot |
|
|
28
|
+
|
|
29
|
+
### BentoGridCard
|
|
30
|
+
|
|
31
|
+
| Prop | Type | Default | Description |
|
|
32
|
+
| ------------- | --------- | ------- | ------------------------ |
|
|
33
|
+
| `name` | `string` | — | Card title |
|
|
34
|
+
| `description` | `string` | — | Card description |
|
|
35
|
+
| `href` | `string` | — | CTA link URL |
|
|
36
|
+
| `cta` | `string` | — | CTA button text |
|
|
37
|
+
| `class` | `string` | `''` | Additional classes |
|
|
38
|
+
| `icon` | `Snippet` | — | Icon snippet |
|
|
39
|
+
| `background` | `Snippet` | — | Background overlay slot |
|
|
40
|
+
|
|
41
|
+
## Usage
|
|
42
|
+
|
|
43
|
+
```svelte
|
|
44
|
+
<BentoGrid>
|
|
45
|
+
<BentoGridItem class="md:col-span-2">
|
|
46
|
+
{#snippet header()}<div class="h-full bg-gradient-to-br from-blue-500 to-cyan-500 rounded-xl" />{/snippet}
|
|
47
|
+
{#snippet title()}Feature{/snippet}
|
|
48
|
+
{#snippet description()}Description here.{/snippet}
|
|
49
|
+
</BentoGridItem>
|
|
50
|
+
</BentoGrid>
|
|
51
|
+
```
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
export interface FallingStarsBgProps {
|
|
3
|
+
/** Star color as hex string */
|
|
4
|
+
color?: string;
|
|
5
|
+
/** Number of stars */
|
|
6
|
+
count?: number;
|
|
7
|
+
/** Additional CSS classes */
|
|
8
|
+
class?: string;
|
|
9
|
+
}
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<script lang="ts">
|
|
13
|
+
import { cn } from "../../utils";
|
|
14
|
+
import { onMount } from "svelte";
|
|
15
|
+
|
|
16
|
+
interface Star {
|
|
17
|
+
x: number;
|
|
18
|
+
y: number;
|
|
19
|
+
z: number;
|
|
20
|
+
speed: number;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
let { color = "#FFF", count = 200, class: className = "" }: FallingStarsBgProps = $props();
|
|
24
|
+
|
|
25
|
+
let canvas: HTMLCanvasElement;
|
|
26
|
+
let perspective = 0;
|
|
27
|
+
let stars: Star[] = [];
|
|
28
|
+
let ctx: CanvasRenderingContext2D | null = null;
|
|
29
|
+
let dpr = 1;
|
|
30
|
+
let rafId = 0;
|
|
31
|
+
|
|
32
|
+
function hexToRgb(hex: string) {
|
|
33
|
+
let h = (hex || "#000").replace(/^#/, "");
|
|
34
|
+
if (h.length === 3) {
|
|
35
|
+
h = h
|
|
36
|
+
.split("")
|
|
37
|
+
.map((c) => c + c)
|
|
38
|
+
.join("");
|
|
39
|
+
}
|
|
40
|
+
const bigint = parseInt(h, 16) || 0;
|
|
41
|
+
return {
|
|
42
|
+
r: (bigint >> 16) & 255,
|
|
43
|
+
g: (bigint >> 8) & 255,
|
|
44
|
+
b: bigint & 255,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
let cachedRgb = $derived(hexToRgb(color));
|
|
49
|
+
|
|
50
|
+
function resizeCanvas() {
|
|
51
|
+
if (!canvas) return;
|
|
52
|
+
|
|
53
|
+
dpr = window.devicePixelRatio || 1;
|
|
54
|
+
const width = Math.max(1, Math.floor(canvas.clientWidth));
|
|
55
|
+
const height = Math.max(1, Math.floor(canvas.clientHeight));
|
|
56
|
+
|
|
57
|
+
canvas.width = Math.floor(width * dpr);
|
|
58
|
+
canvas.height = Math.floor(height * dpr);
|
|
59
|
+
canvas.style.width = `${width}px`;
|
|
60
|
+
canvas.style.height = `${height}px`;
|
|
61
|
+
|
|
62
|
+
ctx = canvas.getContext("2d");
|
|
63
|
+
if (ctx) {
|
|
64
|
+
ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
perspective = width / 2;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function drawStar(star: Star, width: number, height: number) {
|
|
71
|
+
if (!ctx) return;
|
|
72
|
+
|
|
73
|
+
const scale = perspective / (perspective + star.z);
|
|
74
|
+
const x2d = width / 2 + star.x * scale;
|
|
75
|
+
const y2d = height / 2 + star.y * scale;
|
|
76
|
+
const size = Math.max(scale * 3, 0.5);
|
|
77
|
+
|
|
78
|
+
const prevScale = perspective / (perspective + star.z + star.speed * 15);
|
|
79
|
+
const xPrev = width / 2 + star.x * prevScale;
|
|
80
|
+
const yPrev = height / 2 + star.y * prevScale;
|
|
81
|
+
|
|
82
|
+
const rgb = cachedRgb;
|
|
83
|
+
|
|
84
|
+
// Layered strokes from wide+faint to narrow+brighter to fake blur
|
|
85
|
+
const layerAlphas = [0.08, 0.14, 0.22];
|
|
86
|
+
for (let i = 0; i < layerAlphas.length; i++) {
|
|
87
|
+
ctx.beginPath();
|
|
88
|
+
ctx.strokeStyle = `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${layerAlphas[i]})`;
|
|
89
|
+
ctx.lineWidth = size * (1.4 + i * 1.2);
|
|
90
|
+
ctx.moveTo(x2d, y2d);
|
|
91
|
+
ctx.lineTo(xPrev, yPrev);
|
|
92
|
+
ctx.stroke();
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// Sharp center line
|
|
96
|
+
ctx.beginPath();
|
|
97
|
+
ctx.strokeStyle = `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, 0.6)`;
|
|
98
|
+
ctx.lineWidth = Math.max(1, size);
|
|
99
|
+
ctx.moveTo(x2d, y2d);
|
|
100
|
+
ctx.lineTo(xPrev, yPrev);
|
|
101
|
+
ctx.stroke();
|
|
102
|
+
|
|
103
|
+
// Dot
|
|
104
|
+
ctx.beginPath();
|
|
105
|
+
ctx.fillStyle = `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, 1)`;
|
|
106
|
+
ctx.arc(x2d, y2d, Math.max(0.5, size / 4), 0, Math.PI * 2);
|
|
107
|
+
ctx.fill();
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function loop() {
|
|
111
|
+
if (!canvas) return;
|
|
112
|
+
if (!ctx) ctx = canvas.getContext("2d");
|
|
113
|
+
if (!ctx) return;
|
|
114
|
+
|
|
115
|
+
const width = canvas.clientWidth;
|
|
116
|
+
const height = canvas.clientHeight;
|
|
117
|
+
|
|
118
|
+
ctx.clearRect(0, 0, width, height);
|
|
119
|
+
|
|
120
|
+
for (let i = 0; i < stars.length; i++) {
|
|
121
|
+
const star = stars[i];
|
|
122
|
+
drawStar(star, width, height);
|
|
123
|
+
|
|
124
|
+
star.z -= star.speed;
|
|
125
|
+
|
|
126
|
+
if (star.z <= 0) {
|
|
127
|
+
star.z = width || 1;
|
|
128
|
+
star.x = (Math.random() - 0.5) * 2 * width;
|
|
129
|
+
star.y = (Math.random() - 0.5) * 2 * height;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
rafId = requestAnimationFrame(loop);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
onMount(() => {
|
|
137
|
+
resizeCanvas();
|
|
138
|
+
|
|
139
|
+
const cssWidth = canvas.clientWidth;
|
|
140
|
+
const cssHeight = canvas.clientHeight;
|
|
141
|
+
stars = [];
|
|
142
|
+
for (let i = 0; i < count; i++) {
|
|
143
|
+
stars.push({
|
|
144
|
+
x: (Math.random() - 0.5) * 2 * cssWidth,
|
|
145
|
+
y: (Math.random() - 0.5) * 2 * cssHeight,
|
|
146
|
+
z: Math.random() * (cssWidth || 1),
|
|
147
|
+
speed: Math.random() * 5 + 2,
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
rafId = requestAnimationFrame(loop);
|
|
152
|
+
|
|
153
|
+
const resizeObserver = new ResizeObserver(() => resizeCanvas());
|
|
154
|
+
resizeObserver.observe(canvas);
|
|
155
|
+
|
|
156
|
+
return () => {
|
|
157
|
+
if (rafId) cancelAnimationFrame(rafId);
|
|
158
|
+
resizeObserver.disconnect();
|
|
159
|
+
};
|
|
160
|
+
});
|
|
161
|
+
</script>
|
|
162
|
+
|
|
163
|
+
<canvas bind:this={canvas} class={cn("absolute inset-0 h-full w-full", className)}></canvas>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface FallingStarsBgProps {
|
|
2
|
+
/** Star color as hex string */
|
|
3
|
+
color?: string;
|
|
4
|
+
/** Number of stars */
|
|
5
|
+
count?: number;
|
|
6
|
+
/** Additional CSS classes */
|
|
7
|
+
class?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const FallingStarsBg: import("svelte").Component<FallingStarsBgProps, {}, "">;
|
|
10
|
+
type FallingStarsBg = ReturnType<typeof FallingStarsBg>;
|
|
11
|
+
export default FallingStarsBg;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { render, cleanup } from "@testing-library/svelte";
|
|
2
|
+
import { afterEach, beforeEach, describe, it, expect, vi } from "vitest";
|
|
3
|
+
import FallingStarsBg from "./FallingStarsBg.svelte";
|
|
4
|
+
describe("FallingStarsBg", () => {
|
|
5
|
+
beforeEach(() => {
|
|
6
|
+
// Mock ResizeObserver (not available in jsdom) - must be a class
|
|
7
|
+
global.ResizeObserver = class {
|
|
8
|
+
observe = vi.fn();
|
|
9
|
+
unobserve = vi.fn();
|
|
10
|
+
disconnect = vi.fn();
|
|
11
|
+
};
|
|
12
|
+
});
|
|
13
|
+
afterEach(cleanup);
|
|
14
|
+
it("renders a canvas element", () => {
|
|
15
|
+
const { container } = render(FallingStarsBg);
|
|
16
|
+
const canvas = container.querySelector("canvas");
|
|
17
|
+
expect(canvas).toBeInTheDocument();
|
|
18
|
+
});
|
|
19
|
+
it("canvas has absolute positioning class", () => {
|
|
20
|
+
const { container } = render(FallingStarsBg);
|
|
21
|
+
const canvas = container.querySelector("canvas");
|
|
22
|
+
expect(canvas?.className).toContain("absolute");
|
|
23
|
+
});
|
|
24
|
+
it("canvas has inset-0 class", () => {
|
|
25
|
+
const { container } = render(FallingStarsBg);
|
|
26
|
+
const canvas = container.querySelector("canvas");
|
|
27
|
+
expect(canvas?.className).toContain("inset-0");
|
|
28
|
+
});
|
|
29
|
+
it("canvas has full width and height classes", () => {
|
|
30
|
+
const { container } = render(FallingStarsBg);
|
|
31
|
+
const canvas = container.querySelector("canvas");
|
|
32
|
+
expect(canvas?.className).toContain("h-full");
|
|
33
|
+
expect(canvas?.className).toContain("w-full");
|
|
34
|
+
});
|
|
35
|
+
it("applies custom class names", () => {
|
|
36
|
+
const { container } = render(FallingStarsBg, {
|
|
37
|
+
props: { class: "my-stars" },
|
|
38
|
+
});
|
|
39
|
+
const canvas = container.querySelector("canvas");
|
|
40
|
+
expect(canvas?.className).toContain("my-stars");
|
|
41
|
+
});
|
|
42
|
+
it("preserves base classes when custom class is added", () => {
|
|
43
|
+
const { container } = render(FallingStarsBg, { props: { class: "extra" } });
|
|
44
|
+
const canvas = container.querySelector("canvas");
|
|
45
|
+
expect(canvas?.className).toContain("absolute");
|
|
46
|
+
expect(canvas?.className).toContain("inset-0");
|
|
47
|
+
expect(canvas?.className).toContain("h-full");
|
|
48
|
+
expect(canvas?.className).toContain("w-full");
|
|
49
|
+
});
|
|
50
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# FallingStarsBg
|
|
2
|
+
|
|
3
|
+
Canvas-based 3D starfield background with perspective projection, motion trails, and glow effects.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
| Prop | Type | Default | Description |
|
|
8
|
+
|---------|----------|----------|-----------------------|
|
|
9
|
+
| `color` | `string` | `"#FFF"` | Star color (hex) |
|
|
10
|
+
| `count` | `number` | `200` | Number of stars |
|
|
11
|
+
| `class` | `string` | `""` | Additional CSS classes |
|
|
12
|
+
|
|
13
|
+
## Implementation Notes
|
|
14
|
+
|
|
15
|
+
- Canvas rendering with `requestAnimationFrame` loop — no CSS/SVG animations.
|
|
16
|
+
- 3D perspective: stars move toward camera with depth-based scaling (`perspective / (perspective + z)`).
|
|
17
|
+
- Motion trails: lines drawn from previous to current projected position.
|
|
18
|
+
- Glow layers: multiple strokes with decreasing opacity (`[0.08, 0.14, 0.22]`) plus a sharp center line and dot.
|
|
19
|
+
- HiDPI: uses `devicePixelRatio` for crisp rendering on Retina displays.
|
|
20
|
+
- Uses `ResizeObserver` instead of window resize listener for better responsiveness.
|
|
21
|
+
- `$derived` used for cached RGB conversion so it updates reactively when `color` prop changes.
|
|
22
|
+
- Cleanup: animation frame and resize observer are cleaned up on unmount via `onMount` return.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as FallingStarsBg } from "./FallingStarsBg.svelte";
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# StarsBackground
|
|
2
|
+
|
|
3
|
+
Animated starfield background with parallax mouse tracking.
|
|
4
|
+
|
|
5
|
+
## Implementation Notes
|
|
6
|
+
|
|
7
|
+
- **Motion library**: Replaced `motion-v` with CSS animations and manual spring physics
|
|
8
|
+
- **Stars**: Generated using box-shadow technique (1000 + 400 + 200 stars across 3 layers)
|
|
9
|
+
- **Parallax**: Mouse movement creates depth effect via spring interpolation
|
|
10
|
+
|
|
11
|
+
## Props
|
|
12
|
+
|
|
13
|
+
| Prop | Type | Default | Description |
|
|
14
|
+
|------|------|---------|-------------|
|
|
15
|
+
| `factor` | `number` | `0.05` | Parallax factor for mouse movement |
|
|
16
|
+
| `speed` | `number` | `50` | Base animation speed in seconds |
|
|
17
|
+
| `stiffness` | `number` | `50` | Spring stiffness for parallax |
|
|
18
|
+
| `damping` | `number` | `20` | Spring damping for parallax |
|
|
19
|
+
| `starColor` | `string` | `#fff` | Color of the stars |
|
|
20
|
+
| `class` | `string` | - | Additional CSS classes |
|
|
21
|
+
| `children` | `Snippet` | - | Content to render over stars |
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
```svelte
|
|
26
|
+
<script>
|
|
27
|
+
import { StarsBackground } from '$lib/fancy-ui/bg-stars';
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<StarsBackground class="h-screen">
|
|
31
|
+
<div class="relative z-10 flex items-center justify-center h-full">
|
|
32
|
+
<h1 class="text-4xl text-white">Hello Stars</h1>
|
|
33
|
+
</div>
|
|
34
|
+
</StarsBackground>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Svelte-specific Details
|
|
38
|
+
|
|
39
|
+
- Spring transition options (`stiffness`, `damping`) are separate props instead of a config object
|
|
40
|
+
- Uses CSS `@keyframes` instead of motion-v for the scroll animation
|
|
41
|
+
- Manual spring physics implementation via `requestAnimationFrame`
|