@stfrigerio/sito-template 0.1.37 → 0.1.44
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/dist/components/organisms/Navbar/Navbar.d.ts.map +1 -1
- package/dist/index.esm.js +76 -18
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +76 -18
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/package.json +6 -3
- package/storybook-static/assets/3d/bar.glb +0 -0
- package/storybook-static/assets/3d/cube.glb +0 -0
- package/storybook-static/assets/3d/lens.glb +0 -0
- package/storybook-static/assets/ASCIIText.stories-BSKNvcoU.js +82 -0
- package/storybook-static/assets/AllAtoms.stories-BheGtT2x.js +109 -0
- package/storybook-static/assets/AnimatedContent.stories-DHs1c0dV.js +18 -0
- package/storybook-static/assets/AnimatedList-B3_lNwJZ.css +1 -0
- package/storybook-static/assets/AnimatedList.stories-DIfbjb22.js +26 -0
- package/storybook-static/assets/Antigravity.stories-BsyCq_d_.js +19 -0
- package/storybook-static/assets/ArrayInput.stories-Vhl_2MiN.js +232 -0
- package/storybook-static/assets/Aurora-JSo3CGBi.css +1 -0
- package/storybook-static/assets/Aurora.stories-C7vxHFyZ.js +97 -0
- package/storybook-static/assets/Beams-BaZopjLr.css +1 -0
- package/storybook-static/assets/Beams.stories-WmoAQdE2.js +122 -0
- package/storybook-static/assets/BlobCursor-sr9FxN5W.css +1 -0
- package/storybook-static/assets/BlobCursor.stories-Do76vl4q.js +24 -0
- package/storybook-static/assets/BlurText.stories-CIsxOJyQ.js +11 -0
- package/storybook-static/assets/{BooleansHeatmap.stories-2u4SThph.js → BooleansHeatmap.stories-DIdVIPVH.js} +8 -8
- package/storybook-static/assets/BorderGlow-BkXv9hP6.css +1 -0
- package/storybook-static/assets/BorderGlow.stories-B88w6QLt.js +15 -0
- package/storybook-static/assets/BubbleMenu-C856-Amm.css +1 -0
- package/storybook-static/assets/BubbleMenu.stories-CjsSE6cs.js +57 -0
- package/storybook-static/assets/{Button-VfdDKp2T.js → Button-C_YZ5gR4.js} +2 -2
- package/storybook-static/assets/Button.stories-Mw6nstnk.js +93 -0
- package/storybook-static/assets/Calendar-zTw0ddxb.css +1 -0
- package/storybook-static/assets/Calendar.stories-Dxshyi2I.js +470 -0
- package/storybook-static/assets/Camera-BM3HOhP6.js +1 -0
- package/storybook-static/assets/Card-BxyVZ-1r.css +1 -0
- package/storybook-static/assets/Card-C1evZ1rT.js +49 -0
- package/storybook-static/assets/Card.stories-Cd8o0lJL.js +127 -0
- package/storybook-static/assets/CardNav-DJBuAE3a.css +1 -0
- package/storybook-static/assets/CardNav.stories-CVCNllVh.js +55 -0
- package/storybook-static/assets/Carousel-DQYq51gd.css +1 -0
- package/storybook-static/assets/Carousel.stories-DXvKLxeO.js +58 -0
- package/storybook-static/assets/{Checkbox-BHwlDfRP.js → Checkbox-tM16vTif.js} +2 -2
- package/storybook-static/assets/{Checkbox.stories-DxTQrFgm.js → Checkbox.stories-dhEm8gbi.js} +2 -2
- package/storybook-static/assets/ChromaGrid-DuVAYWII.css +1 -0
- package/storybook-static/assets/ChromaGrid.stories-_N6hSynZ.js +59 -0
- package/storybook-static/assets/CircularGallery-Dw0kM5fT.css +1 -0
- package/storybook-static/assets/CircularGallery.stories-c7BEdmTm.js +95 -0
- package/storybook-static/assets/CircularText-DofQkQcn.css +1 -0
- package/storybook-static/assets/CircularText.stories-BCoG12vU.js +7 -0
- package/storybook-static/assets/ClickSpark.stories-BOypb8hM.js +12 -0
- package/storybook-static/assets/Color-AVL7NMMY-iZX0v-MX.js +1 -0
- package/storybook-static/assets/Color-YRkaOI4u.js +1 -0
- package/storybook-static/assets/ColorBends-BkbPScKk.css +1 -0
- package/storybook-static/assets/ColorBends.stories-DJVplB1e.js +103 -0
- package/storybook-static/assets/CountUp.stories-CZoxCmOS.js +11 -0
- package/storybook-static/assets/Counter-NM41Ofe9.css +1 -0
- package/storybook-static/assets/Counter.stories-CD2CN6Rs.js +15 -0
- package/storybook-static/assets/Crosshair.stories-pKH0CRjB.js +6 -0
- package/storybook-static/assets/Cubes-BbZLRUsz.css +1 -0
- package/storybook-static/assets/Cubes.stories-CG6EoDFk.js +1 -0
- package/storybook-static/assets/CurvedLoop-DyoDI-mm.css +1 -0
- package/storybook-static/assets/CurvedLoop.stories-2_6LGDBt.js +9 -0
- package/storybook-static/assets/DarkVeil-CeIthsg1.css +1 -0
- package/storybook-static/assets/DarkVeil.stories-NPy-IAdE.js +79 -0
- package/storybook-static/assets/DateInput-bEXupMbC.js +38 -0
- package/storybook-static/assets/{DateInput.stories-BGB5zJBm.js → DateInput.stories-Di9xlwl-.js} +2 -2
- package/storybook-static/assets/DecayCard-2Nc9J_8G.css +1 -0
- package/storybook-static/assets/DecayCard.stories-C_nLJJYv.js +8 -0
- package/storybook-static/assets/DecryptedText.stories-B3nmn_C5.js +15 -0
- package/storybook-static/assets/Dither-CDTFjgCl.css +1 -0
- package/storybook-static/assets/Dither.stories-DYFkOPEa.js +134 -0
- package/storybook-static/assets/Dock-DwLYexgF.css +1 -0
- package/storybook-static/assets/Dock.stories-D5xKRTwB.js +40 -0
- package/storybook-static/assets/{DocsRenderer-PQXLIZUC-q9kcQxfH.js → DocsRenderer-PQXLIZUC-qnjLy5zI.js} +8 -8
- package/storybook-static/assets/{EditFAB.stories-CmfJxWns.js → EditFAB.stories-D7WePUUN.js} +12 -42
- package/storybook-static/assets/EvilEye-QIF3Ik1Y.css +1 -0
- package/storybook-static/assets/EvilEye.stories-Cov9VutU.js +103 -0
- package/storybook-static/assets/FadeContent.stories-mHhk3715.js +14 -0
- package/storybook-static/assets/FaultyTerminal-D6zQXJ-g.css +1 -0
- package/storybook-static/assets/FaultyTerminal.stories-DjKOHL4-.js +224 -0
- package/storybook-static/assets/Fbo-CDZq1mNj.js +1 -0
- package/storybook-static/assets/FloatingLines-BPpNRsJk.css +1 -0
- package/storybook-static/assets/FloatingLines.stories-B_dxBmBz.js +187 -0
- package/storybook-static/assets/FlowingMenu-Cff-letA.css +1 -0
- package/storybook-static/assets/FlowingMenu.stories-DdUqXTFx.js +27 -0
- package/storybook-static/assets/FluidGlass.stories-C6FrnI3D.js +490 -0
- package/storybook-static/assets/Folder-BFuU52Ao.css +1 -0
- package/storybook-static/assets/Folder.stories-Zb5rwe3k.js +13 -0
- package/storybook-static/assets/FuzzyText.stories-CoZEjZrD.js +22 -0
- package/storybook-static/assets/Galaxy-Cj2Xx-fN.css +1 -0
- package/storybook-static/assets/Galaxy.stories-D8hfMx7x.js +184 -0
- package/storybook-static/assets/GhostCursor-CLKgvqwd.css +1 -0
- package/storybook-static/assets/GhostCursor.stories-DmAEHIj2.js +276 -0
- package/storybook-static/assets/GlareHover-D8gfoeb7.css +1 -0
- package/storybook-static/assets/GlareHover.stories-C2pGThOS.js +1 -0
- package/storybook-static/assets/GlassSurface-D51dj98P.css +1 -0
- package/storybook-static/assets/GlassSurface.stories-Dt29DAS0.js +43 -0
- package/storybook-static/assets/GlitchText-CsL0nL6_.css +1 -0
- package/storybook-static/assets/GlitchText.stories-sqo6Y5iu.js +8 -0
- package/storybook-static/assets/GooeyNav-8BBsSYWJ.css +1 -0
- package/storybook-static/assets/GooeyNav.stories-DxgFxo-U.js +24 -0
- package/storybook-static/assets/GradientBlinds-CBpfmlwu.css +1 -0
- package/storybook-static/assets/GradientBlinds.stories-BO3udAca.js +136 -0
- package/storybook-static/assets/GradientText-Bsx4jZeS.css +1 -0
- package/storybook-static/assets/GradientText.stories-DwqimEmN.js +11 -0
- package/storybook-static/assets/Grainient.stories-DrGFYn0A.js +113 -0
- package/storybook-static/assets/GridMotion-GSkrJvrd.css +1 -0
- package/storybook-static/assets/GridMotion.stories-Rbww9MSf.js +6 -0
- package/storybook-static/assets/ImageSlideshow-CrquLxbj.css +1 -0
- package/storybook-static/assets/ImageSlideshow.stories-BOxjGf7e.js +385 -0
- package/storybook-static/assets/Iridescence-DkXB1G15.css +1 -0
- package/storybook-static/assets/Iridescence.stories-CTQo8feH.js +47 -0
- package/storybook-static/assets/LaserFlow-YpDTX0s9.css +1 -0
- package/storybook-static/assets/LaserFlow.stories-DsHyOCT6.js +253 -0
- package/storybook-static/assets/LetterGlitch.stories-DYnbcxa2.js +1 -0
- package/storybook-static/assets/LightPillar-B1pSzH3x.css +1 -0
- package/storybook-static/assets/LightPillar.stories-C0oLGh9j.js +103 -0
- package/storybook-static/assets/LightRays.stories-y4A3LO7i.js +114 -0
- package/storybook-static/assets/Lightning-Duov5diw.css +1 -0
- package/storybook-static/assets/Lightning.stories-Bjuvt9ng.js +92 -0
- package/storybook-static/assets/LineWaves-CGZ5Tp0W.css +1 -0
- package/storybook-static/assets/LineWaves.stories-DXHfmcAY.js +132 -0
- package/storybook-static/assets/LiquidChrome-C8jkHJD4.css +1 -0
- package/storybook-static/assets/LiquidChrome.stories-BIJKsALp.js +60 -0
- package/storybook-static/assets/LiquidEther-BTKKmNQk.css +1 -0
- package/storybook-static/assets/LiquidEther.stories-Zn4y8_Dj.js +161 -0
- package/storybook-static/assets/LoadingSpinner-1jvNgxlI.css +1 -0
- package/storybook-static/assets/LoadingSpinner-T2OjcR-z.js +49 -0
- package/storybook-static/assets/LoadingSpinner.stories-YZPlVrIL.js +169 -0
- package/storybook-static/assets/MagicRings-B15iCWeD.css +1 -0
- package/storybook-static/assets/MagicRings.stories-B17cxZu8.js +81 -0
- package/storybook-static/assets/Magnet.stories-C6geVwXu.js +12 -0
- package/storybook-static/assets/MagnetLines-BMVF8tvL.css +1 -0
- package/storybook-static/assets/MagnetLines.stories-uCo-0xpG.js +1 -0
- package/storybook-static/assets/Masonry-JijTuZ6o.css +1 -0
- package/storybook-static/assets/Masonry.stories-BsaHuUl3.js +53 -0
- package/storybook-static/assets/Mesh-CwXV3WjE.js +7 -0
- package/storybook-static/assets/MetaBalls-Do7Vo_Ig.css +1 -0
- package/storybook-static/assets/MetaBalls.stories-CfS9YAYf.js +63 -0
- package/storybook-static/assets/MetallicPaint-rQ3s8Y0v.css +1 -0
- package/storybook-static/assets/MetallicPaint.stories-CPnRKq8Y.js +159 -0
- package/storybook-static/assets/MoodChart.stories-Bhzx-Mki.js +40 -0
- package/storybook-static/assets/MotionConfigContext-4uS6JRtS.js +1 -0
- package/storybook-static/assets/Navbar-BPWxCB-U.css +1 -0
- package/storybook-static/assets/Navbar.stories-CTJisFgI.js +325 -0
- package/storybook-static/assets/Noise-wMLTuki1.css +1 -0
- package/storybook-static/assets/Noise.stories-CV2ieqjl.js +9 -0
- package/storybook-static/assets/NumberStepper-0N2zZmLM.js +110 -0
- package/storybook-static/assets/NumberStepper-C_00aeJp.css +1 -0
- package/storybook-static/assets/NumberStepper.stories-DO0SaXet.js +436 -0
- package/storybook-static/assets/Orb-CS8T832d.css +1 -0
- package/storybook-static/assets/Orb.stories-BO2G-id7.js +177 -0
- package/storybook-static/assets/OrbitImages-DqsOGdeH.css +1 -0
- package/storybook-static/assets/OrbitImages.stories-Dd0Un1zc.js +26 -0
- package/storybook-static/assets/PieChart.stories-YSBHUrlk.js +199 -0
- package/storybook-static/assets/PixelBlast-xjKshbH4.css +1 -0
- package/storybook-static/assets/PixelBlast.stories-DLOdQdBC.js +211 -0
- package/storybook-static/assets/PixelCard-dyv8Jzsb.css +1 -0
- package/storybook-static/assets/PixelCard.stories-DL1EW33U.js +6 -0
- package/storybook-static/assets/PixelSnow-Mq8jFd6s.css +1 -0
- package/storybook-static/assets/PixelSnow.stories-40ms3GpO.js +155 -0
- package/storybook-static/assets/PixelTransition-4YlpcBIO.css +1 -0
- package/storybook-static/assets/PixelTransition.stories-Ce0j1LoP.js +27 -0
- package/storybook-static/assets/Plasma-hc6I4S4K.css +1 -0
- package/storybook-static/assets/Plasma.stories-C-qYly6i.js +78 -0
- package/storybook-static/assets/Prism-1A7MRUuH.css +1 -0
- package/storybook-static/assets/Prism.stories-BzLhe_ek.js +121 -0
- package/storybook-static/assets/PrismaticBurst-CJEX1JKp.css +1 -0
- package/storybook-static/assets/PrismaticBurst.stories-DODqjw3j.js +170 -0
- package/storybook-static/assets/ProfileCard-CO0Gk0e9.css +1 -0
- package/storybook-static/assets/ProfileCard.stories-DUyZIJ8A.js +15 -0
- package/storybook-static/assets/QuantifiableHabitsChart-Bam6n9X_.css +1 -0
- package/storybook-static/assets/QuantifiableHabitsChart.stories-DvgzevZP.js +105 -0
- package/storybook-static/assets/Radar-xwRKh0lP.css +1 -0
- package/storybook-static/assets/Radar.stories-2RPf1QSy.js +88 -0
- package/storybook-static/assets/Ribbons-CjSeVzzZ.css +1 -0
- package/storybook-static/assets/Ribbons.stories-RmoPiIi9.js +132 -0
- package/storybook-static/assets/RippleGrid-NvomE-YP.css +1 -0
- package/storybook-static/assets/RippleGrid.stories-Otw1g2CJ.js +113 -0
- package/storybook-static/assets/RotatingText-BGK56OzZ.css +1 -0
- package/storybook-static/assets/RotatingText.stories-NgYC0KMN.js +12 -0
- package/storybook-static/assets/ScrollFloat-CuaI6iDB.css +1 -0
- package/storybook-static/assets/ScrollFloat.stories-BFBCdW8h.js +12 -0
- package/storybook-static/assets/ScrollReveal-7GSimuFY.css +1 -0
- package/storybook-static/assets/ScrollReveal.stories-JKNxxGAh.js +13 -0
- package/storybook-static/assets/ScrollTrigger-D1XJUMov.js +15 -0
- package/storybook-static/assets/ScrollVelocity-BQllEnJm.css +1 -0
- package/storybook-static/assets/ScrollVelocity.stories-C8kmHqS4.js +9 -0
- package/storybook-static/assets/{SearchBar.stories-DmHIaDZB.js → SearchBar.stories-C7Ba5BXp.js} +30 -15
- package/storybook-static/assets/SearchableDropdown-C_6nW_fM.js +38 -0
- package/storybook-static/assets/{SearchableDropdown.stories-ByZj6lJu.js → SearchableDropdown.stories-Cr7zD259.js} +8 -8
- package/storybook-static/assets/SelectInput-Cq1kd98Q.js +31 -0
- package/storybook-static/assets/SelectInput.stories-BdpLeHVn.js +129 -0
- package/storybook-static/assets/ShapeBlur.stories-lRfZvgfc.js +131 -0
- package/storybook-static/assets/ShapeGrid-D5w-KuEm.css +1 -0
- package/storybook-static/assets/ShapeGrid.stories-CfjM9fjH.js +11 -0
- package/storybook-static/assets/ShinyText-D0_UmCBv.css +1 -0
- package/storybook-static/assets/ShinyText.stories-DKdXfhML.js +14 -0
- package/storybook-static/assets/Silk.stories-CjTLyn1c.js +62 -0
- package/storybook-static/assets/SleepChart-DBRb08s_.css +1 -0
- package/storybook-static/assets/SleepChart.stories-DJ12EHQj.js +58 -0
- package/storybook-static/assets/Slider-Bq7zObwV.css +1 -0
- package/storybook-static/assets/Slider-CjC8kTvA.js +32 -0
- package/storybook-static/assets/Slider.stories-8dOh6zEz.js +99 -0
- package/storybook-static/assets/SoftAurora-2A7ssVQp.css +1 -0
- package/storybook-static/assets/SoftAurora.stories-OVy3Uj5H.js +147 -0
- package/storybook-static/assets/SoundDemo.stories-BMnOeJoJ.js +3 -0
- package/storybook-static/assets/SplashCursor.stories-D-l4tdFh.js +244 -0
- package/storybook-static/assets/SpotlightCard-Bi63T6N0.css +1 -0
- package/storybook-static/assets/SpotlightCard.stories-CGzh2DPl.js +6 -0
- package/storybook-static/assets/Stack-CBKeDK5i.css +1 -0
- package/storybook-static/assets/Stack.stories-CGsiQ3oD.js +32 -0
- package/storybook-static/assets/StaggeredMenu-DjV6Ra1C.css +1 -0
- package/storybook-static/assets/StaggeredMenu.stories-Bq5nvfqE.js +45 -0
- package/storybook-static/assets/StarBorder-isNlSycS.css +1 -0
- package/storybook-static/assets/StarBorder.stories-CAGKcU-0.js +9 -0
- package/storybook-static/assets/SunburstChart.stories-ceDZ0sGS.js +285 -0
- package/storybook-static/assets/Table-DnhtoClE.css +1 -0
- package/storybook-static/assets/Table.stories-DNxjy4mw.js +227 -0
- package/storybook-static/assets/Tabs.stories-CujhnpzV.js +64 -0
- package/storybook-static/assets/TargetCursor-CWS-TuGF.css +1 -0
- package/storybook-static/assets/TargetCursor.stories-CjS6RpDB.js +9 -0
- package/storybook-static/assets/TextArea-DHBnvidn.js +28 -0
- package/storybook-static/assets/{TextArea.stories-CCqRRpwq.js → TextArea.stories-CCC4mZkh.js} +18 -8
- package/storybook-static/assets/TextCursor-DDqF-3pV.css +1 -0
- package/storybook-static/assets/TextCursor.stories-DbbUKuuf.js +11 -0
- package/storybook-static/assets/TextInput-BRLXZRi0.js +28 -0
- package/storybook-static/assets/{TextInput.stories-CtvOb60q.js → TextInput.stories-DzmoEdX3.js} +7 -7
- package/storybook-static/assets/TextPressure.stories-BjGjNHuq.js +47 -0
- package/storybook-static/assets/TextType-BYHLKnc2.css +1 -0
- package/storybook-static/assets/TextType.stories-BCEjz-Zi.js +19 -0
- package/storybook-static/assets/Texture-BkQWYNP2.js +1 -0
- package/storybook-static/assets/ThemeSwitcher.stories-0T7fY3d_.js +62 -0
- package/storybook-static/assets/Threads-C5ItmUMV.css +1 -0
- package/storybook-static/assets/Threads.stories-DDlSfgD5.js +121 -0
- package/storybook-static/assets/TimeInput.stories-CjV4ksEX.js +55 -0
- package/storybook-static/assets/Toggle-C26yCxt_.js +41 -0
- package/storybook-static/assets/Toggle.stories-D5LQoJpm.js +199 -0
- package/storybook-static/assets/ToggleButton-DJU3CV_i.css +1 -0
- package/storybook-static/assets/ToggleButton-DKVqKQxZ.js +32 -0
- package/storybook-static/assets/ToggleButton.stories-BfAEDMOR.js +163 -0
- package/storybook-static/assets/Triangle-64ffRKNB.js +1 -0
- package/storybook-static/assets/TrueFocus-C4c7GDsQ.css +1 -0
- package/storybook-static/assets/TrueFocus.stories-DA9Ysraz.js +12 -0
- package/storybook-static/assets/VariableProximity-E64p6UBv.css +1 -0
- package/storybook-static/assets/VariableProximity.stories-CN-Q4WDX.js +14 -0
- package/storybook-static/assets/Vec2-Cf1C3GIc.js +1 -0
- package/storybook-static/assets/Waves-C7txy_IO.css +1 -0
- package/storybook-static/assets/Waves.stories-W2IDhrZm.js +1 -0
- package/storybook-static/assets/axis-D3QohQNI.js +1 -0
- package/storybook-static/assets/check-Bh0K2zJt.js +6 -0
- package/storybook-static/assets/chevron-down-B26xHSrx.js +6 -0
- package/storybook-static/assets/chevron-right-4NIYYZ8p.js +6 -0
- package/storybook-static/assets/client-CyPtLppF.js +1 -0
- package/storybook-static/assets/createLucideIcon-wa-8tr0c.js +21 -0
- package/storybook-static/assets/demo/cs1.webp +0 -0
- package/storybook-static/assets/demo/cs2.webp +0 -0
- package/storybook-static/assets/demo/cs3.webp +0 -0
- package/storybook-static/assets/folder-OUDa6Ti7.js +6 -0
- package/storybook-static/assets/iconBase-fo9b9WAM.js +1 -0
- package/storybook-static/assets/{iframe-BUaP2gIF.js → iframe-2N7rjfXm.js} +192 -192
- package/storybook-static/assets/iframe-Df7_64QT.css +1 -0
- package/storybook-static/assets/{index-CBmvvqzc.js → index-BXmXrRij.js} +1 -1
- package/storybook-static/assets/index-C8pce-KX.js +15 -0
- package/storybook-static/assets/index-DaJY9FlE.js +24 -0
- package/storybook-static/assets/index-DcRHiSf7.js +128 -0
- package/storybook-static/assets/index-IKMS7NhW.js +9 -0
- package/storybook-static/assets/layout-grid-DMX9O4XB.js +6 -0
- package/storybook-static/assets/linear-dkJHgUri.js +1 -0
- package/storybook-static/assets/{monotone-BYG7Mesf.js → monotone-DHdPkfDP.js} +1 -1
- package/storybook-static/assets/proxy-qiKixXs8.js +1 -0
- package/storybook-static/assets/react-18-DajuY7cH.js +1 -0
- package/storybook-static/assets/react-three-fiber.esm-pSSy_32K.js +43 -0
- package/storybook-static/assets/search-DBjUUDRM.js +6 -0
- package/storybook-static/assets/sun-WV9AmUvz.js +11 -0
- package/storybook-static/assets/three.module--_vTUKhS.js +4057 -0
- package/storybook-static/assets/{transform-NloTqvdv.js → transform-BKmuZieF.js} +1 -1
- package/storybook-static/assets/use-animation-frame-DNrI5vnP.js +1 -0
- package/storybook-static/assets/use-in-view-Dn2glBsV.js +1 -0
- package/storybook-static/assets/use-motion-value-w2f8nz4L.js +1 -0
- package/storybook-static/assets/use-spring-CDOZMwuR.js +1 -0
- package/storybook-static/assets/use-transform-DZyAm4Sp.js +1 -0
- package/storybook-static/assets/useSound-BBLJ5Rjg.js +1 -0
- package/storybook-static/assets/users-0pBe6bxm.js +6 -0
- package/storybook-static/assets/x-k5o8Jl5E.js +6 -0
- package/storybook-static/iframe.html +7 -40
- package/storybook-static/index.json +1 -1
- package/storybook-static/project.json +1 -1
- package/storybook-static/sb-addons/chromatic-com-storybook-4/manager-bundle.js +1 -1
- package/storybook-static/sb-addons/docs-2/manager-bundle.js +2 -2
- package/storybook-static/sb-addons/links-3/manager-bundle.js +1 -1
- package/storybook-static/sb-addons/storybook-5/manager-bundle.js +1 -1
- package/storybook-static/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +3 -3
- package/storybook-static/assets/AllAtoms.stories-DBoQZmq-.js +0 -109
- package/storybook-static/assets/AnimationPlayer-UXJjBKtF.css +0 -1
- package/storybook-static/assets/AnimationPlayer.stories-yXQ8fqUT.js +0 -379
- package/storybook-static/assets/ArrayInput.stories-CRqKExgm.js +0 -221
- package/storybook-static/assets/Button.stories-BeeBKHoX.js +0 -117
- package/storybook-static/assets/Calendar-BTQfDDfP.css +0 -1
- package/storybook-static/assets/Calendar.stories-CKOG4XAn.js +0 -545
- package/storybook-static/assets/Card-Bc7TyfBx.css +0 -1
- package/storybook-static/assets/Card-D-kcaQHV.js +0 -49
- package/storybook-static/assets/Card.stories-CpcboxKs.js +0 -130
- package/storybook-static/assets/Color-AVL7NMMY-BzNNgCT5.js +0 -1
- package/storybook-static/assets/DateInput-Cu3PZYc0.js +0 -33
- package/storybook-static/assets/MoodChart.stories-V-wKOSu-.js +0 -40
- package/storybook-static/assets/Navbar-B8vEvGnB.css +0 -1
- package/storybook-static/assets/Navbar.stories-Dkf77idX.js +0 -235
- package/storybook-static/assets/NumberStepper-BVHPJutJ.css +0 -1
- package/storybook-static/assets/NumberStepper-BZGlrWCN.js +0 -30
- package/storybook-static/assets/NumberStepper.stories-NZw7r4Oh.js +0 -127
- package/storybook-static/assets/PieChart.stories-BkfNODjW.js +0 -199
- package/storybook-static/assets/QuantifiableHabitsChart-BEfzqND4.css +0 -1
- package/storybook-static/assets/QuantifiableHabitsChart.stories-Df6rcrdD.js +0 -105
- package/storybook-static/assets/SearchableDropdown-ByAXm1md.js +0 -38
- package/storybook-static/assets/SelectInput-D-AwfWVz.js +0 -31
- package/storybook-static/assets/SelectInput.stories-MyE-GqOw.js +0 -112
- package/storybook-static/assets/SleepChart-yGsG5RlQ.css +0 -1
- package/storybook-static/assets/SleepChart.stories-Dsz1U6F9.js +0 -58
- package/storybook-static/assets/SunburstChart.stories-CphfyDsR.js +0 -285
- package/storybook-static/assets/Tabs.stories-c24Ffu3K.js +0 -49
- package/storybook-static/assets/TextArea-B_sATPlw.js +0 -28
- package/storybook-static/assets/TextInput-ZGg8LTL_.js +0 -28
- package/storybook-static/assets/ThemeSwitcher.stories-BvkX1SDm.js +0 -62
- package/storybook-static/assets/TimeInput.stories-BchhRfKo.js +0 -50
- package/storybook-static/assets/Toggle-BQ2KHBDr.js +0 -39
- package/storybook-static/assets/Toggle.stories-BUSZc6m3.js +0 -194
- package/storybook-static/assets/ToggleButton-Dl6hvkJv.js +0 -32
- package/storybook-static/assets/ToggleButton-gfPoPxTQ.css +0 -1
- package/storybook-static/assets/ToggleButton.stories-BKN4zU3N.js +0 -143
- package/storybook-static/assets/iframe-BOc1hSA-.css +0 -1
- package/storybook-static/assets/index-5bdJXrkD.js +0 -1
- package/storybook-static/assets/index-CZs7_DA6.js +0 -9
- package/storybook-static/assets/linear-4t_RuQok.js +0 -1
- package/storybook-static/assets/proxy-9Y4F2rF8.js +0 -1
- package/storybook-static/assets/react-18-D4c-_GAk.js +0 -24
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import{r as G,j as O}from"./iframe-2N7rjfXm.js";import{u as me}from"./use-motion-value-w2f8nz4L.js";import{Y as he,H as de,K as ge,Q as oe,q as le,Z as $e,_ as ve,$ as be,s as Ve,N as ye,o as Ae,a0 as Se}from"./MotionConfigContext-4uS6JRtS.js";import{V as Me,c as je,a as Ee,b as _e,d as qe,S as Oe,H as Pe,v as Z,e as Ie,f as we,m as De}from"./proxy-qiKixXs8.js";import{u as Te}from"./use-transform-DZyAm4Sp.js";import"./preload-helper-C1FmrZbK.js";const Ce=(t,e,n)=>{const a=e-t;return((n-t)%a+a)%a+t};function ue(t,e){return he(t)?t[Ce(0,t.length,e)]:t}class Le{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,n){for(let a=0;a<this.animations.length;a++)this.animations[a][e]=n}attachTimeline(e){const n=this.animations.map(a=>a.attachTimeline(e));return()=>{n.forEach((a,s)=>{a&&a(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return x(this.animations,"duration")}get iterationDuration(){return x(this.animations,"iterationDuration")}runAll(e){this.animations.forEach(n=>n[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function x(t,e){let n=0;for(let a=0;a<t.length;a++){const s=t[a][e];s!==null&&s>n&&(n=s)}return n}class Ne extends Le{then(e,n){return this.finished.finally(e).then(()=>{})}}function Re(t,e){return t in e}class Ge extends Me{constructor(){super(...arguments),this.type="object"}readValueFromInstance(e,n){if(Re(n,e)){const a=e[n];if(typeof a=="string"||typeof a=="number")return a}}getBaseTargetFromProps(){}removeValueFromRenderState(e,n){delete n.output[e]}measureInstanceViewportBox(){return je()}build(e,n){Object.assign(e.output,n)}renderInstance(e,{output:n}){Object.assign(e,n)}sortInstanceNodePosition(){return 0}}function Q(t){return typeof t=="object"&&!Array.isArray(t)}function fe(t,e,n,a){return t==null?[]:typeof t=="string"&&Q(e)?de(t,n,a):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(s=>s!=null):[t]}function Ke(t,e,n){return t*(e+1)}function ee(t,e,n,a){return typeof e=="number"?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):e==="<"?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):a.get(e)??t}function Be(t,e,n){for(let a=0;a<t.length;a++){const s=t[a];s.at>e&&s.at<n&&(oe(t,s),a--)}}function Fe(t,e,n,a,s,i){Be(t,s,i);for(let r=0;r<e.length;r++)t.push({value:e[r],at:ge(s,i,a[r]),easing:ue(n,r)})}function We(t,e){for(let n=0;n<t.length;n++)t[n]=t[n]/(e+1)}function Ze(t,e){return t.at===e.at?t.value===null?1:e.value===null?-1:0:t.at-e.at}const He="easeInOut";function ze(t,{defaultTransition:e={},...n}={},a,s){const i=e.duration||.3,r=new Map,l=new Map,o={},f=new Map;let c=0,u=0,C=0;for(let P=0;P<t.length;P++){const b=t[P];if(typeof b=="string"){f.set(b,u);continue}else if(!Array.isArray(b)){f.set(b.name,ee(u,b.at,c,f));continue}let[V,$,g={}]=b;g.at!==void 0&&(u=ee(u,g.at,c,f));let v=0;const w=(S,I,M,E=0,d=0)=>{const p=ke(S),{delay:D=0,times:j=$e(p),type:h=e.type||"keyframes",repeat:m,repeatType:H,repeatDelay:K=0,...z}=I;let{ease:_=e.ease||"easeOut",duration:y}=I;const A=typeof D=="function"?D(E,d):D,q=p.length,J=Ee(h)?h:s==null?void 0:s[h||"keyframes"];if(q<=2&&J){let L=100;if(q===2&&Ue(p)){const N=p[1]-p[0];L=Math.abs(N)}const B={...e,...z};y!==void 0&&(B.duration=Ve(y));const F=ve(B,L,J);_=F.ease,y=F.duration}y??(y=i);const U=u+A;j.length===1&&j[0]===0&&(j[1]=1);const Y=j.length-p.length;if(Y>0&&be(j,Y),p.length===1&&p.unshift(null),m){y=Ke(y,m);const L=[...p],B=[...j];_=Array.isArray(_)?[..._]:[_];const F=[..._];for(let N=0;N<m;N++){p.push(...L);for(let R=0;R<L.length;R++)j.push(B[R]+(N+1)),_.push(R===0?"linear":ue(F,R-1))}We(j,m)}const X=U+y;Fe(M,p,_,j,U,X),v=Math.max(A+y,v),C=Math.max(X,C)};if(le(V)){const S=te(V,l);w($,g,ne("default",S))}else{const S=fe(V,$,a,o),I=S.length;for(let M=0;M<I;M++){$=$,g=g;const E=S[M],d=te(E,l);for(const p in $)w($[p],Qe(g,p),ne(p,d),M,I)}}c=u,u+=v}return l.forEach((P,b)=>{for(const V in P){const $=P[V];$.sort(Ze);const g=[],v=[],w=[];for(let E=0;E<$.length;E++){const{at:d,value:p,easing:D}=$[E];g.push(p),v.push(ye(0,C,d)),w.push(D||"easeOut")}v[0]!==0&&(v.unshift(0),g.unshift(g[0]),w.unshift(He)),v[v.length-1]!==1&&(v.push(1),g.push(null)),r.has(b)||r.set(b,{keyframes:{},transition:{}});const S=r.get(b);S.keyframes[V]=g;const{type:I,...M}=e;S.transition[V]={...M,duration:C,ease:w,times:v,...n}}}),r}function te(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function ne(t,e){return e[t]||(e[t]=[]),e[t]}function ke(t){return Array.isArray(t)?t:[t]}function Qe(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const Je=t=>typeof t=="number",Ue=t=>t.every(Je);function Ye(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=_e(t)&&!qe(t)?new Oe(e):new Pe(e);n.mount(t),Z.set(t,n)}function Xe(t){const e={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new Ge(e);n.mount(t),Z.set(t,n)}function xe(t,e){return le(t)||typeof t=="number"||typeof t=="string"&&!Q(e)}function ce(t,e,n,a){const s=[];if(xe(t,e))s.push(Ie(t,Q(e)&&e.default||e,n&&(n.default||n)));else{if(t==null)return s;const i=fe(t,e,a),r=i.length;for(let l=0;l<r;l++){const o=i[l],f=o instanceof Element?Ye:Xe;Z.has(o)||f(o);const c=Z.get(o),u={...n};"delay"in u&&typeof u.delay=="function"&&(u.delay=u.delay(l,r)),s.push(...we(c,{...e,transition:u},{}))}}return s}function et(t,e,n){const a=[],s=t.map(r=>{if(Array.isArray(r)&&typeof r[0]=="function"){const l=r[0],o=Ae(0);return o.on("change",l),r.length===1?[o,[0,1]]:r.length===2?[o,[0,1],r[1]]:[o,r[1],r[2]]}return r});return ze(s,e,n,{spring:Se}).forEach(({keyframes:r,transition:l},o)=>{a.push(...ce(o,r,l))}),a}function tt(t){return Array.isArray(t)&&t.some(Array.isArray)}function nt(t={}){const{scope:e,reduceMotion:n}=t;function a(s,i,r){let l=[],o;if(tt(s)){const{onComplete:c,...u}=i||{};typeof c=="function"&&(o=c),l=et(s,n!==void 0?{reduceMotion:n,...u}:u,e)}else{const{onComplete:c,...u}=r||{};typeof c=="function"&&(o=c),l=ce(s,i,n!==void 0?{reduceMotion:n,...u}:u,e)}const f=new Ne(l);return o&&f.finished.then(o),e&&(e.animations.push(f),f.finished.then(()=>{oe(e.animations,f)})),f}return a}const at=nt(),T={"orbit-container":"_orbit-container_tujj3_1","orbit-scaling-container":"_orbit-scaling-container_tujj3_7","orbit-rotation-wrapper":"_orbit-rotation-wrapper_tujj3_20","orbit-path-svg":"_orbit-path-svg_tujj3_27","orbit-item":"_orbit-item_tujj3_33","orbit-center-content":"_orbit-center-content_tujj3_39","orbit-image":"_orbit-image_tujj3_48"};function k(t,e,n,a){return`M ${t-n} ${e} A ${n} ${a} 0 1 0 ${t+n} ${e} A ${n} ${a} 0 1 0 ${t-n} ${e}`}function ae(t,e,n){return k(t,e,n,n)}function st(t,e,n){const a=n/2;return`M ${t-a} ${e-a} L ${t+a} ${e-a} L ${t+a} ${e+a} L ${t-a} ${e+a} Z`}function rt(t,e,n,a){const s=n/2,i=a/2;return`M ${t-s} ${e-i} L ${t+s} ${e-i} L ${t+s} ${e+i} L ${t-s} ${e+i} Z`}function it(t,e,n){const a=n*Math.sqrt(3)/2,s=n/2;return`M ${t} ${e-a/1.5} L ${t+s} ${e+a/3} L ${t-s} ${e+a/3} Z`}function ot(t,e,n,a,s){const i=Math.PI/s;let r="";for(let l=0;l<2*s;l++){const o=l%2===0?n:a,f=l*i-Math.PI/2,c=t+o*Math.cos(f),u=e+o*Math.sin(f);r+=l===0?`M ${c} ${u}`:` L ${c} ${u}`}return r+" Z"}function lt(t,e,n){const a=n/30;return`M ${t} ${e+12*a} C ${t-20*a} ${e-5*a}, ${t-12*a} ${e-18*a}, ${t} ${e-8*a} C ${t+12*a} ${e-18*a}, ${t+20*a} ${e-5*a}, ${t} ${e+12*a}`}function ut(t,e,n,a){const s=n/2,i=a/2;return`M ${t} ${e} C ${t+s*.5} ${e-i}, ${t+s} ${e-i}, ${t+s} ${e} C ${t+s} ${e+i}, ${t+s*.5} ${e+i}, ${t} ${e} C ${t-s*.5} ${e+i}, ${t-s} ${e+i}, ${t-s} ${e} C ${t-s} ${e-i}, ${t-s*.5} ${e-i}, ${t} ${e}`}function ft(t,e,n,a,s){const i=[],r=s*20,l=n/2;for(let o=0;o<=r;o++){const f=t-l+n*o/r,c=e+Math.sin(o/r*s*2*Math.PI)*a;i.push(o===0?`M ${f} ${c}`:`L ${f} ${c}`)}for(let o=r;o>=0;o--){const f=t-l+n*o/r,c=e-Math.sin(o/r*s*2*Math.PI)*a;i.push(`L ${f} ${c}`)}return i.join(" ")+" Z"}function ct({item:t,index:e,totalItems:n,path:a,itemSize:s,rotation:i,progress:r,fill:l}){const o=l?e/n*100:0,f=Te(r,c=>`${((c+o)%100+100)%100}%`);return O.jsx(De.div,{className:`${T["orbit-item"]}`,style:{width:s,height:s,offsetPath:`path("${a}")`,offsetRotate:"0deg",offsetAnchor:"center center",offsetDistance:f},children:O.jsx("div",{style:{transform:`rotate(${-i}deg)`},children:t})})}function pe({images:t=[],altPrefix:e="Orbiting image",shape:n="ellipse",customPath:a,baseWidth:s=1400,radiusX:i=700,radiusY:r=170,radius:l=300,starPoints:o=5,starInnerRatio:f=.5,rotation:c=-8,duration:u=40,itemSize:C=64,direction:P="normal",fill:b=!0,width:V=100,height:$=100,className:g="",showPath:v=!1,pathColor:w="rgba(0,0,0,0.1)",pathWidth:S=2,easing:I="linear",paused:M=!1,centerContent:E,responsive:d=!1}){const p=G.useRef(null),[D,j]=G.useState(1),h=s/2,m=s/2,H=G.useMemo(()=>{switch(n){case"circle":return ae(h,m,l);case"ellipse":return k(h,m,i,r);case"square":return st(h,m,l*2);case"rectangle":return rt(h,m,i*2,r*2);case"triangle":return it(h,m,l*2);case"star":return ot(h,m,l,l*f,o);case"heart":return lt(h,m,l*2);case"infinity":return ut(h,m,i*2,r*2);case"wave":return ft(h,m,i*2,r,3);case"custom":return a||ae(h,m,l);default:return k(h,m,i,r)}},[n,a,h,m,i,r,l,o,f]);G.useEffect(()=>{if(!d||!p.current)return;const A=()=>{p.current&&j(p.current.clientWidth/s)};A();const q=new ResizeObserver(A);return q.observe(p.current),()=>q.disconnect()},[d,s]);const K=me(0);G.useEffect(()=>{if(M)return;const A=at(K,P==="reverse"?-100:100,{duration:u,ease:I,repeat:1/0,repeatType:"loop"});return()=>A.stop()},[K,u,I,P,M]);const z=d?"100%":typeof V=="number"?V:"100%",_=d?"auto":typeof $=="number"?$:typeof V=="number"?V:"auto",y=t.map((A,q)=>O.jsx("img",{src:A,alt:`${e} ${q+1}`,draggable:!1,className:`${T["orbit-image"]}`},A));return O.jsxs("div",{ref:p,className:`${T["orbit-container"]} ${g}`,style:{width:z,height:_,aspectRatio:d?"1 / 1":void 0},"aria-hidden":"true",children:[O.jsx("div",{className:d?"orbit-scaling-container orbit-scaling-container--responsive":T["orbit-scaling-container"],style:{width:d?s:"100%",height:d?s:"100%",transform:d?`translate(-50%, -50%) scale(${D})`:void 0},children:O.jsxs("div",{className:`${T["orbit-rotation-wrapper"]}`,style:{transform:`rotate(${c}deg)`},children:[v&&O.jsx("svg",{width:"100%",height:"100%",viewBox:`0 0 ${s} ${s}`,className:`${T["orbit-path-svg"]}`,children:O.jsx("path",{d:H,fill:"none",stroke:w,strokeWidth:S/D})}),y.map((A,q)=>O.jsx(ct,{item:A,index:q,totalItems:y.length,path:H,itemSize:C,rotation:c,progress:K,fill:b},q))]})}),E&&O.jsx("div",{className:`${T["orbit-center-content"]}`,children:E})]})}pe.__docgenInfo={description:"",methods:[],displayName:"OrbitImages",props:{images:{defaultValue:{value:"[]",computed:!1},required:!1},altPrefix:{defaultValue:{value:"'Orbiting image'",computed:!1},required:!1},shape:{defaultValue:{value:"'ellipse'",computed:!1},required:!1},baseWidth:{defaultValue:{value:"1400",computed:!1},required:!1},radiusX:{defaultValue:{value:"700",computed:!1},required:!1},radiusY:{defaultValue:{value:"170",computed:!1},required:!1},radius:{defaultValue:{value:"300",computed:!1},required:!1},starPoints:{defaultValue:{value:"5",computed:!1},required:!1},starInnerRatio:{defaultValue:{value:"0.5",computed:!1},required:!1},rotation:{defaultValue:{value:"-8",computed:!1},required:!1},duration:{defaultValue:{value:"40",computed:!1},required:!1},itemSize:{defaultValue:{value:"64",computed:!1},required:!1},direction:{defaultValue:{value:"'normal'",computed:!1},required:!1},fill:{defaultValue:{value:"true",computed:!1},required:!1},width:{defaultValue:{value:"100",computed:!1},required:!1},height:{defaultValue:{value:"100",computed:!1},required:!1},className:{defaultValue:{value:"''",computed:!1},required:!1},showPath:{defaultValue:{value:"false",computed:!1},required:!1},pathColor:{defaultValue:{value:"'rgba(0,0,0,0.1)'",computed:!1},required:!1},pathWidth:{defaultValue:{value:"2",computed:!1},required:!1},easing:{defaultValue:{value:"'linear'",computed:!1},required:!1},paused:{defaultValue:{value:"false",computed:!1},required:!1},responsive:{defaultValue:{value:"false",computed:!1},required:!1}}};const vt={title:"ReactBits/Animations/OrbitImages",component:pe,parameters:{layout:"fullscreen"},tags:["autodocs"]},W={args:{images:["https://picsum.photos/seed/a/200/200","https://picsum.photos/seed/b/200/200","https://picsum.photos/seed/c/200/200","https://picsum.photos/seed/d/200/200","https://picsum.photos/seed/e/200/200","https://picsum.photos/seed/f/200/200"],altPrefix:"Orbiting image",shape:"ellipse",baseWidth:1400,radiusX:700,radiusY:170,radius:300,starPoints:5,starInnerRatio:.5,rotation:-8,duration:40,itemSize:64,direction:"normal",fill:!0,width:100,height:100,showPath:!1,pathColor:"rgba(0,0,0,0.1)",pathWidth:2,easing:"linear",paused:!1,responsive:!1}};var se,re,ie;W.parameters={...W.parameters,docs:{...(se=W.parameters)==null?void 0:se.docs,source:{originalSource:`{
|
|
2
|
+
args: {
|
|
3
|
+
images: ['https://picsum.photos/seed/a/200/200', 'https://picsum.photos/seed/b/200/200', 'https://picsum.photos/seed/c/200/200', 'https://picsum.photos/seed/d/200/200', 'https://picsum.photos/seed/e/200/200', 'https://picsum.photos/seed/f/200/200'],
|
|
4
|
+
altPrefix: 'Orbiting image',
|
|
5
|
+
shape: 'ellipse',
|
|
6
|
+
baseWidth: 1400,
|
|
7
|
+
radiusX: 700,
|
|
8
|
+
radiusY: 170,
|
|
9
|
+
radius: 300,
|
|
10
|
+
starPoints: 5,
|
|
11
|
+
starInnerRatio: 0.5,
|
|
12
|
+
rotation: -8,
|
|
13
|
+
duration: 40,
|
|
14
|
+
itemSize: 64,
|
|
15
|
+
direction: 'normal',
|
|
16
|
+
fill: true,
|
|
17
|
+
width: 100,
|
|
18
|
+
height: 100,
|
|
19
|
+
showPath: false,
|
|
20
|
+
pathColor: 'rgba(0,0,0,0.1)',
|
|
21
|
+
pathWidth: 2,
|
|
22
|
+
easing: 'linear',
|
|
23
|
+
paused: false,
|
|
24
|
+
responsive: false
|
|
25
|
+
}
|
|
26
|
+
}`,...(ie=(re=W.parameters)==null?void 0:re.docs)==null?void 0:ie.source}}};const bt=["Default"];export{W as Default,bt as __namedExportsOrder,vt as default};
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import{r as F,j as v}from"./iframe-2N7rjfXm.js";import{s as R,i as ue,c as me}from"./transform-BKmuZieF.js";import{a as de}from"./array-BKyUJesY.js";import{c as x}from"./path-CbwjOpE9.js";import{t as $,a as Q}from"./arc-DgcIQOLP.js";import"./preload-helper-C1FmrZbK.js";function pe(t,a){let l=0;if(a===void 0)for(let c of t)(c=+c)&&(l+=c);else{let c=-1;for(let f of t)(f=+a(f,++c,t))&&(l+=f)}return l}function ge(t,a){return a<t?-1:a>t?1:a>=t?0:NaN}function fe(t){return t}function ve(){var t=fe,a=ge,l=null,c=x(0),f=x($),w=x(0);function s(e){var r,i=(e=de(e)).length,d,T,C=0,S=new Array(i),u=new Array(i),_=+c.apply(this,arguments),h=Math.min($,Math.max(-$,f.apply(this,arguments)-_)),L,b=Math.min(Math.abs(h)/i,w.apply(this,arguments)),A=b*(h<0?-1:1),m;for(r=0;r<i;++r)(m=u[S[r]=r]=+t(e[r],r,e))>0&&(C+=m);for(a!=null?S.sort(function(n,o){return a(u[n],u[o])}):l!=null&&S.sort(function(n,o){return l(e[n],e[o])}),r=0,T=C?(h-i*A)/C:0;r<i;++r,_=L)d=S[r],m=u[d],L=_+(m>0?m*T:0)+A,u[d]={data:e[d],index:r,value:m,startAngle:_,endAngle:L,padAngle:b};return u}return s.value=function(e){return arguments.length?(t=typeof e=="function"?e:x(+e),s):t},s.sortValues=function(e){return arguments.length?(a=e,l=null,s):a},s.sort=function(e){return arguments.length?(l=e,a=null,s):l},s.startAngle=function(e){return arguments.length?(c=typeof e=="function"?e:x(+e),s):c},s.endAngle=function(e){return arguments.length?(f=typeof e=="function"?e:x(+e),s):f},s.padAngle=function(e){return arguments.length?(w=typeof e=="function"?e:x(+e),s):w},s}const he="_container_10542_1",be="_title_10542_7",ye="_chartContainer_10542_15",xe="_chart_10542_15",we="_legend_10542_26",Ce="_legendItem_10542_31",Se="_legendColor_10542_45",_e="_legendLabel_10542_52",Le="_legendValue_10542_59",Te="_tooltip_10542_65",p={container:he,title:be,chartContainer:ye,chart:xe,legend:we,legendItem:Ce,legendColor:Se,legendLabel:_e,legendValue:Le,tooltip:Te},g=["#6366f1","#8b5cf6","#06b6d4","#10b981","#f59e0b","#ef4444","#ec4899","#84cc16","#f97316","#3b82f6","#8b5cf6","#14b8a6","#f59e0b","#ef4444","#06b6d4","#10b981"],V=t=>{const a=me(t);if(!a)return"#ffffff";const l=a.rgb();return(.299*l.r+.587*l.g+.114*l.b)/255>.5?"#000000":"#ffffff"},ce=({data:t,width:a=400,height:l=400,title:c="Distribution",showLegend:f=!0,unit:w="items",centerLabel:s})=>{const e=F.useRef(null),r=Math.min(a,l)/2-20;return F.useEffect(()=>{if(!e.current||!t.length)return;const i=R(e.current);i.selectAll("*").remove();const d=i.append("g").attr("transform",`translate(${a/2},${l/2})`),T=ve().value(n=>n.value).sort(null),C=Q().innerRadius(r*.4).outerRadius(r).cornerRadius(4),S=Q().innerRadius(r*.7).outerRadius(r*.7),u=R("body").append("div").attr("class",p.tooltip).style("opacity",0).style("position","absolute"),_=T(t),h=pe(t,n=>n.value),L=d.selectAll(".arc").data(_).enter().append("g").attr("class","arc");L.append("path").attr("d",n=>C(n)).attr("fill",(n,o)=>n.data.color||g[o%g.length]).attr("stroke","var(--bg-primary)").attr("stroke-width",3).style("cursor","pointer").style("filter","drop-shadow(0 2px 8px rgba(0,0,0,0.15))").on("mouseover",function(n,o){const y=Q().innerRadius(r*.4).outerRadius(r*1.05).cornerRadius(4);R(this).transition().duration(200).attr("d",q=>y(q)).style("filter","drop-shadow(0 4px 12px rgba(0,0,0,0.25))"),u.transition().duration(200).style("opacity",1);const B=(o.data.value/h*100).toFixed(1);u.html(`
|
|
2
|
+
<div><strong>${o.data.name}</strong></div>
|
|
3
|
+
<div>Value: ${o.data.value.toLocaleString()}</div>
|
|
4
|
+
<div>${B}% of total</div>
|
|
5
|
+
`).style("left",n.pageX+10+"px").style("top",n.pageY-28+"px")}).on("mouseout",function(n,o){R(this).transition().duration(200).attr("d",y=>C(y)).style("filter","drop-shadow(0 2px 8px rgba(0,0,0,0.15))"),u.transition().duration(500).style("opacity",0)});const b=t.map((n,o)=>n.color||g[o%g.length]),A=b.length>=2?ue.gamma(2.2)(b[0],b[1])(.5):b[0]||"#ffffff",m=V(A);return d.append("text").attr("text-anchor","middle").attr("alignment-baseline","middle").attr("font-size","20px").attr("font-weight","bold").attr("fill",m).style("text-shadow",m==="#ffffff"?"0 1px 3px rgba(0,0,0,0.5)":"0 1px 3px rgba(255,255,255,0.5)").text(s||"Total"),d.append("text").attr("text-anchor","middle").attr("alignment-baseline","middle").attr("y",22).attr("font-size","16px").attr("font-weight","600").attr("fill",m).style("text-shadow",m==="#ffffff"?"0 1px 2px rgba(0,0,0,0.4)":"0 1px 2px rgba(255,255,255,0.4)").text(`${h.toLocaleString()} ${w}`),L.filter(n=>n.endAngle-n.startAngle>.2).append("text").attr("transform",n=>`translate(${S.centroid(n)})`).attr("text-anchor","middle").attr("alignment-baseline","middle").attr("font-size","13px").attr("fill",(n,o)=>{const y=n.data.color||g[o%g.length];return V(y)}).attr("font-weight","600").style("pointer-events","none").style("text-shadow",(n,o)=>{const y=n.data.color||g[o%g.length];return`0 1px 2px ${V(y)==="#ffffff"?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.4)"}`}).text(n=>{const o=n.data.value/h*100;return o>8?`${o.toFixed(0)}%`:""}),()=>{u.remove()}},[t,a,l,r,s,w]),v.jsxs("div",{className:p.container,children:[v.jsx("h3",{className:p.title,children:c}),v.jsxs("div",{className:p.chartContainer,children:[v.jsx("svg",{ref:e,width:a,height:l,className:p.chart}),f&&v.jsx("div",{className:p.legend,children:t.map((i,d)=>v.jsxs("div",{className:p.legendItem,children:[v.jsx("span",{className:p.legendColor,style:{backgroundColor:i.color||g[d%g.length]}}),v.jsx("span",{className:p.legendLabel,children:i.name}),v.jsx("span",{className:p.legendValue,children:i.value.toLocaleString()})]},i.name))})]})]})};ce.__docgenInfo={description:"",methods:[],displayName:"PieChart",props:{data:{required:!0,tsType:{name:"Array",elements:[{name:"PieDataPoint"}],raw:"PieDataPoint[]"},description:""},width:{required:!1,tsType:{name:"number"},description:"",defaultValue:{value:"400",computed:!1}},height:{required:!1,tsType:{name:"number"},description:"",defaultValue:{value:"400",computed:!1}},title:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"'Distribution'",computed:!1}},showLegend:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"true",computed:!1}},unit:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"'items'",computed:!1}},centerLabel:{required:!1,tsType:{name:"string"},description:""}}};const Me={title:"Organisms/Charts/PieChart",component:ce,parameters:{layout:"centered"},argTypes:{width:{control:{type:"number",min:300,max:700,step:50}},height:{control:{type:"number",min:300,max:700,step:50}},title:{control:{type:"text"}},showLegend:{control:{type:"boolean"}}}},D={args:{data:[{name:"Work",value:40,color:"#7c3aed"},{name:"Sleep",value:30,color:"#3b82f6"},{name:"Personal",value:20,color:"#10b981"},{name:"Exercise",value:10,color:"#f59e0b"}],width:400,height:400,title:"Daily Time Distribution",showLegend:!1}},P={args:{data:[{name:"Frontend Development",value:35,color:"#8b5cf6"},{name:"Backend Development",value:25,color:"#3b82f6"},{name:"Meetings",value:15,color:"#10b981"},{name:"Code Review",value:10,color:"#f59e0b"},{name:"Documentation",value:8,color:"#ec4899"},{name:"Testing",value:7,color:"#14b8a6"}],width:500,height:500,title:"Project Time Allocation",showLegend:!0}},j={args:{data:[{name:"Q1 2024",value:25e4},{name:"Q2 2024",value:3e5},{name:"Q3 2024",value:28e4},{name:"Q4 2024",value:32e4}],width:450,height:450,title:"Quarterly Revenue Distribution",showLegend:!0}},k={args:{data:[{name:"Company A",value:35,color:"#dc2626"},{name:"Company B",value:28,color:"#2563eb"},{name:"Company C",value:18,color:"#16a34a"},{name:"Company D",value:12,color:"#f59e0b"},{name:"Others",value:7,color:"#6b7280"}],width:500,height:500,title:"Market Share Analysis",showLegend:!0}},M={args:{data:[{name:"Housing",value:1500,color:"#dc2626"},{name:"Food",value:600,color:"#f59e0b"},{name:"Transportation",value:400,color:"#3b82f6"},{name:"Entertainment",value:300,color:"#8b5cf6"},{name:"Utilities",value:200,color:"#10b981"},{name:"Healthcare",value:250,color:"#ec4899"},{name:"Savings",value:750,color:"#059669"}],width:550,height:550,title:"Monthly Expense Breakdown",showLegend:!0}},N={args:{data:[{name:"Yes",value:73,color:"#10b981"},{name:"No",value:27,color:"#ef4444"}],width:350,height:350,title:"Survey Results",showLegend:!1}},E={args:{data:[{name:"JavaScript",value:25},{name:"Python",value:20},{name:"Java",value:15},{name:"TypeScript",value:12},{name:"C++",value:8},{name:"C#",value:6},{name:"Go",value:5},{name:"Rust",value:4},{name:"Swift",value:3},{name:"Kotlin",value:2}],width:600,height:600,title:"Programming Language Usage",showLegend:!0}};var O,I,U;D.parameters={...D.parameters,docs:{...(O=D.parameters)==null?void 0:O.docs,source:{originalSource:`{
|
|
6
|
+
args: {
|
|
7
|
+
data: [{
|
|
8
|
+
name: 'Work',
|
|
9
|
+
value: 40,
|
|
10
|
+
color: '#7c3aed'
|
|
11
|
+
}, {
|
|
12
|
+
name: 'Sleep',
|
|
13
|
+
value: 30,
|
|
14
|
+
color: '#3b82f6'
|
|
15
|
+
}, {
|
|
16
|
+
name: 'Personal',
|
|
17
|
+
value: 20,
|
|
18
|
+
color: '#10b981'
|
|
19
|
+
}, {
|
|
20
|
+
name: 'Exercise',
|
|
21
|
+
value: 10,
|
|
22
|
+
color: '#f59e0b'
|
|
23
|
+
}],
|
|
24
|
+
width: 400,
|
|
25
|
+
height: 400,
|
|
26
|
+
title: 'Daily Time Distribution',
|
|
27
|
+
showLegend: false
|
|
28
|
+
}
|
|
29
|
+
}`,...(U=(I=D.parameters)==null?void 0:I.docs)==null?void 0:U.source}}};var H,J,z;P.parameters={...P.parameters,docs:{...(H=P.parameters)==null?void 0:H.docs,source:{originalSource:`{
|
|
30
|
+
args: {
|
|
31
|
+
data: [{
|
|
32
|
+
name: 'Frontend Development',
|
|
33
|
+
value: 35,
|
|
34
|
+
color: '#8b5cf6'
|
|
35
|
+
}, {
|
|
36
|
+
name: 'Backend Development',
|
|
37
|
+
value: 25,
|
|
38
|
+
color: '#3b82f6'
|
|
39
|
+
}, {
|
|
40
|
+
name: 'Meetings',
|
|
41
|
+
value: 15,
|
|
42
|
+
color: '#10b981'
|
|
43
|
+
}, {
|
|
44
|
+
name: 'Code Review',
|
|
45
|
+
value: 10,
|
|
46
|
+
color: '#f59e0b'
|
|
47
|
+
}, {
|
|
48
|
+
name: 'Documentation',
|
|
49
|
+
value: 8,
|
|
50
|
+
color: '#ec4899'
|
|
51
|
+
}, {
|
|
52
|
+
name: 'Testing',
|
|
53
|
+
value: 7,
|
|
54
|
+
color: '#14b8a6'
|
|
55
|
+
}],
|
|
56
|
+
width: 500,
|
|
57
|
+
height: 500,
|
|
58
|
+
title: 'Project Time Allocation',
|
|
59
|
+
showLegend: true
|
|
60
|
+
}
|
|
61
|
+
}`,...(z=(J=P.parameters)==null?void 0:J.docs)==null?void 0:z.source}}};var Y,G,K;j.parameters={...j.parameters,docs:{...(Y=j.parameters)==null?void 0:Y.docs,source:{originalSource:`{
|
|
62
|
+
args: {
|
|
63
|
+
data: [{
|
|
64
|
+
name: 'Q1 2024',
|
|
65
|
+
value: 250000
|
|
66
|
+
}, {
|
|
67
|
+
name: 'Q2 2024',
|
|
68
|
+
value: 300000
|
|
69
|
+
}, {
|
|
70
|
+
name: 'Q3 2024',
|
|
71
|
+
value: 280000
|
|
72
|
+
}, {
|
|
73
|
+
name: 'Q4 2024',
|
|
74
|
+
value: 320000
|
|
75
|
+
}],
|
|
76
|
+
width: 450,
|
|
77
|
+
height: 450,
|
|
78
|
+
title: 'Quarterly Revenue Distribution',
|
|
79
|
+
showLegend: true
|
|
80
|
+
}
|
|
81
|
+
}`,...(K=(G=j.parameters)==null?void 0:G.docs)==null?void 0:K.source}}};var W,X,Z;k.parameters={...k.parameters,docs:{...(W=k.parameters)==null?void 0:W.docs,source:{originalSource:`{
|
|
82
|
+
args: {
|
|
83
|
+
data: [{
|
|
84
|
+
name: 'Company A',
|
|
85
|
+
value: 35,
|
|
86
|
+
color: '#dc2626'
|
|
87
|
+
}, {
|
|
88
|
+
name: 'Company B',
|
|
89
|
+
value: 28,
|
|
90
|
+
color: '#2563eb'
|
|
91
|
+
}, {
|
|
92
|
+
name: 'Company C',
|
|
93
|
+
value: 18,
|
|
94
|
+
color: '#16a34a'
|
|
95
|
+
}, {
|
|
96
|
+
name: 'Company D',
|
|
97
|
+
value: 12,
|
|
98
|
+
color: '#f59e0b'
|
|
99
|
+
}, {
|
|
100
|
+
name: 'Others',
|
|
101
|
+
value: 7,
|
|
102
|
+
color: '#6b7280'
|
|
103
|
+
}],
|
|
104
|
+
width: 500,
|
|
105
|
+
height: 500,
|
|
106
|
+
title: 'Market Share Analysis',
|
|
107
|
+
showLegend: true
|
|
108
|
+
}
|
|
109
|
+
}`,...(Z=(X=k.parameters)==null?void 0:X.docs)==null?void 0:Z.source}}};var ee,ne,te;M.parameters={...M.parameters,docs:{...(ee=M.parameters)==null?void 0:ee.docs,source:{originalSource:`{
|
|
110
|
+
args: {
|
|
111
|
+
data: [{
|
|
112
|
+
name: 'Housing',
|
|
113
|
+
value: 1500,
|
|
114
|
+
color: '#dc2626'
|
|
115
|
+
}, {
|
|
116
|
+
name: 'Food',
|
|
117
|
+
value: 600,
|
|
118
|
+
color: '#f59e0b'
|
|
119
|
+
}, {
|
|
120
|
+
name: 'Transportation',
|
|
121
|
+
value: 400,
|
|
122
|
+
color: '#3b82f6'
|
|
123
|
+
}, {
|
|
124
|
+
name: 'Entertainment',
|
|
125
|
+
value: 300,
|
|
126
|
+
color: '#8b5cf6'
|
|
127
|
+
}, {
|
|
128
|
+
name: 'Utilities',
|
|
129
|
+
value: 200,
|
|
130
|
+
color: '#10b981'
|
|
131
|
+
}, {
|
|
132
|
+
name: 'Healthcare',
|
|
133
|
+
value: 250,
|
|
134
|
+
color: '#ec4899'
|
|
135
|
+
}, {
|
|
136
|
+
name: 'Savings',
|
|
137
|
+
value: 750,
|
|
138
|
+
color: '#059669'
|
|
139
|
+
}],
|
|
140
|
+
width: 550,
|
|
141
|
+
height: 550,
|
|
142
|
+
title: 'Monthly Expense Breakdown',
|
|
143
|
+
showLegend: true
|
|
144
|
+
}
|
|
145
|
+
}`,...(te=(ne=M.parameters)==null?void 0:ne.docs)==null?void 0:te.source}}};var ae,re,oe;N.parameters={...N.parameters,docs:{...(ae=N.parameters)==null?void 0:ae.docs,source:{originalSource:`{
|
|
146
|
+
args: {
|
|
147
|
+
data: [{
|
|
148
|
+
name: 'Yes',
|
|
149
|
+
value: 73,
|
|
150
|
+
color: '#10b981'
|
|
151
|
+
}, {
|
|
152
|
+
name: 'No',
|
|
153
|
+
value: 27,
|
|
154
|
+
color: '#ef4444'
|
|
155
|
+
}],
|
|
156
|
+
width: 350,
|
|
157
|
+
height: 350,
|
|
158
|
+
title: 'Survey Results',
|
|
159
|
+
showLegend: false
|
|
160
|
+
}
|
|
161
|
+
}`,...(oe=(re=N.parameters)==null?void 0:re.docs)==null?void 0:oe.source}}};var le,se,ie;E.parameters={...E.parameters,docs:{...(le=E.parameters)==null?void 0:le.docs,source:{originalSource:`{
|
|
162
|
+
args: {
|
|
163
|
+
data: [{
|
|
164
|
+
name: 'JavaScript',
|
|
165
|
+
value: 25
|
|
166
|
+
}, {
|
|
167
|
+
name: 'Python',
|
|
168
|
+
value: 20
|
|
169
|
+
}, {
|
|
170
|
+
name: 'Java',
|
|
171
|
+
value: 15
|
|
172
|
+
}, {
|
|
173
|
+
name: 'TypeScript',
|
|
174
|
+
value: 12
|
|
175
|
+
}, {
|
|
176
|
+
name: 'C++',
|
|
177
|
+
value: 8
|
|
178
|
+
}, {
|
|
179
|
+
name: 'C#',
|
|
180
|
+
value: 6
|
|
181
|
+
}, {
|
|
182
|
+
name: 'Go',
|
|
183
|
+
value: 5
|
|
184
|
+
}, {
|
|
185
|
+
name: 'Rust',
|
|
186
|
+
value: 4
|
|
187
|
+
}, {
|
|
188
|
+
name: 'Swift',
|
|
189
|
+
value: 3
|
|
190
|
+
}, {
|
|
191
|
+
name: 'Kotlin',
|
|
192
|
+
value: 2
|
|
193
|
+
}],
|
|
194
|
+
width: 600,
|
|
195
|
+
height: 600,
|
|
196
|
+
title: 'Programming Language Usage',
|
|
197
|
+
showLegend: true
|
|
198
|
+
}
|
|
199
|
+
}`,...(ie=(se=E.parameters)==null?void 0:se.docs)==null?void 0:ie.source}}};const Ne=["SimpleDistribution","ProjectTimeBreakdown","QuarterlyRevenue","MarketShare","ExpenseCategories","TwoCategories","ManyCategories"];export{M as ExpenseCategories,E as ManyCategories,k as MarketShare,P as ProjectTimeBreakdown,j as QuarterlyRevenue,D as SimpleDistribution,N as TwoCategories,Ne as __namedExportsOrder,Me as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._pixel-blast-container_a95g7_1{width:100%;min-height:100vh;position:relative;overflow:hidden}._pixel-blast-container_a95g7_1 canvas{display:block;width:100%;height:100%;position:absolute;top:0;left:0}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import{r as z,j as Ee}from"./iframe-2N7rjfXm.js";import{E as re,R as le,b as ie,a as me}from"./index-DcRHiSf7.js";import{W as we,d as ne,n as Re,S as Ce,a as Pe,i as qe,a9 as Te,q as be,M as Ae,f as ze,G as M,a2 as Me,z as se}from"./three.module--_vTUKhS.js";import"./preload-helper-C1FmrZbK.js";const Fe={"pixel-blast-container":"_pixel-blast-container_a95g7_1"},ke=()=>{const l=document.createElement("canvas");l.width=64,l.height=64;const i=l.getContext("2d");if(!i)throw new Error("2D context not available");i.fillStyle="black",i.fillRect(0,0,l.width,l.height);const T=new Me(l);T.minFilter=se,T.magFilter=se,T.generateMipmaps=!1;const E=[];let w=null;const m=64;let R=.1*64;const F=1/m,k=()=>{i.fillStyle="black",i.fillRect(0,0,l.width,l.height)},I=a=>{const n={x:a.x*64,y:(1-a.y)*64};let c=1;const C=v=>Math.sin(v*Math.PI/2),g=v=>-v*(v-2);a.age<m*.3?c=C(a.age/(m*.3)):c=g(1-(a.age-m*.3)/(m*.7))||0,c*=a.force;const h=`${(a.vx+1)/2*255}, ${(a.vy+1)/2*255}, ${c*255}`,p=64*5;i.shadowOffsetX=p,i.shadowOffsetY=p,i.shadowBlur=R,i.shadowColor=`rgba(${h},${.22*c})`,i.beginPath(),i.fillStyle="rgba(255,0,0,1)",i.arc(n.x-p,n.y-p,R,0,Math.PI*2),i.fill()};return{canvas:l,texture:T,addTouch:a=>{let n=0,c=0,C=0;if(w){const g=a.x-w.x,h=a.y-w.y;if(g===0&&h===0)return;const p=g*g+h*h,v=Math.sqrt(p);c=g/(v||1),C=h/(v||1),n=Math.min(p*1e4,1)}w={x:a.x,y:a.y},E.push({x:a.x,y:a.y,age:0,force:n,vx:c,vy:C})},update:()=>{k();for(let a=E.length-1;a>=0;a--){const n=E[a],c=n.force*F*(1-n.age/m);n.x+=n.vx*c,n.y+=n.vy*c,n.age++,n.age>m&&E.splice(a,1)}for(let a=0;a<E.length;a++)I(E[a]);T.needsUpdate=!0},set radiusScale(a){R=.1*64*a},get radiusScale(){return R/(.1*64)},size:64}},Ie=(b,l)=>{const i=`
|
|
2
|
+
uniform sampler2D uTexture;
|
|
3
|
+
uniform float uStrength;
|
|
4
|
+
uniform float uTime;
|
|
5
|
+
uniform float uFreq;
|
|
6
|
+
|
|
7
|
+
void mainUv(inout vec2 uv) {
|
|
8
|
+
vec4 tex = texture2D(uTexture, uv);
|
|
9
|
+
float vx = tex.r * 2.0 - 1.0;
|
|
10
|
+
float vy = tex.g * 2.0 - 1.0;
|
|
11
|
+
float intensity = tex.b;
|
|
12
|
+
|
|
13
|
+
float wave = 0.5 + 0.5 * sin(uTime * uFreq + intensity * 6.2831853);
|
|
14
|
+
|
|
15
|
+
float amt = uStrength * intensity * wave;
|
|
16
|
+
|
|
17
|
+
uv += vec2(vx, vy) * amt;
|
|
18
|
+
}
|
|
19
|
+
`;return new me("LiquidEffect",i,{uniforms:new Map([["uTexture",new M(b)],["uStrength",new M((l==null?void 0:l.strength)??.025)],["uTime",new M(0)],["uFreq",new M((l==null?void 0:l.freq)??4.5)]])})},ue={square:0,circle:1,triangle:2,diamond:3},Ve=`
|
|
20
|
+
void main() {
|
|
21
|
+
gl_Position = vec4(position, 1.0);
|
|
22
|
+
}
|
|
23
|
+
`,_e=`
|
|
24
|
+
precision highp float;
|
|
25
|
+
|
|
26
|
+
uniform vec3 uColor;
|
|
27
|
+
uniform vec2 uResolution;
|
|
28
|
+
uniform float uTime;
|
|
29
|
+
uniform float uPixelSize;
|
|
30
|
+
uniform float uScale;
|
|
31
|
+
uniform float uDensity;
|
|
32
|
+
uniform float uPixelJitter;
|
|
33
|
+
uniform int uEnableRipples;
|
|
34
|
+
uniform float uRippleSpeed;
|
|
35
|
+
uniform float uRippleThickness;
|
|
36
|
+
uniform float uRippleIntensity;
|
|
37
|
+
uniform float uEdgeFade;
|
|
38
|
+
|
|
39
|
+
uniform int uShapeType;
|
|
40
|
+
const int SHAPE_SQUARE = 0;
|
|
41
|
+
const int SHAPE_CIRCLE = 1;
|
|
42
|
+
const int SHAPE_TRIANGLE = 2;
|
|
43
|
+
const int SHAPE_DIAMOND = 3;
|
|
44
|
+
|
|
45
|
+
const int MAX_CLICKS = 10;
|
|
46
|
+
|
|
47
|
+
uniform vec2 uClickPos [MAX_CLICKS];
|
|
48
|
+
uniform float uClickTimes[MAX_CLICKS];
|
|
49
|
+
|
|
50
|
+
out vec4 fragColor;
|
|
51
|
+
|
|
52
|
+
float Bayer2(vec2 a) {
|
|
53
|
+
a = floor(a);
|
|
54
|
+
return fract(a.x / 2. + a.y * a.y * .75);
|
|
55
|
+
}
|
|
56
|
+
#define Bayer4(a) (Bayer2(.5*(a))*0.25 + Bayer2(a))
|
|
57
|
+
#define Bayer8(a) (Bayer4(.5*(a))*0.25 + Bayer2(a))
|
|
58
|
+
|
|
59
|
+
#define FBM_OCTAVES 5
|
|
60
|
+
#define FBM_LACUNARITY 1.25
|
|
61
|
+
#define FBM_GAIN 1.0
|
|
62
|
+
|
|
63
|
+
float hash11(float n){ return fract(sin(n)*43758.5453); }
|
|
64
|
+
|
|
65
|
+
float vnoise(vec3 p){
|
|
66
|
+
vec3 ip = floor(p);
|
|
67
|
+
vec3 fp = fract(p);
|
|
68
|
+
float n000 = hash11(dot(ip + vec3(0.0,0.0,0.0), vec3(1.0,57.0,113.0)));
|
|
69
|
+
float n100 = hash11(dot(ip + vec3(1.0,0.0,0.0), vec3(1.0,57.0,113.0)));
|
|
70
|
+
float n010 = hash11(dot(ip + vec3(0.0,1.0,0.0), vec3(1.0,57.0,113.0)));
|
|
71
|
+
float n110 = hash11(dot(ip + vec3(1.0,1.0,0.0), vec3(1.0,57.0,113.0)));
|
|
72
|
+
float n001 = hash11(dot(ip + vec3(0.0,0.0,1.0), vec3(1.0,57.0,113.0)));
|
|
73
|
+
float n101 = hash11(dot(ip + vec3(1.0,0.0,1.0), vec3(1.0,57.0,113.0)));
|
|
74
|
+
float n011 = hash11(dot(ip + vec3(0.0,1.0,1.0), vec3(1.0,57.0,113.0)));
|
|
75
|
+
float n111 = hash11(dot(ip + vec3(1.0,1.0,1.0), vec3(1.0,57.0,113.0)));
|
|
76
|
+
vec3 w = fp*fp*fp*(fp*(fp*6.0-15.0)+10.0);
|
|
77
|
+
float x00 = mix(n000, n100, w.x);
|
|
78
|
+
float x10 = mix(n010, n110, w.x);
|
|
79
|
+
float x01 = mix(n001, n101, w.x);
|
|
80
|
+
float x11 = mix(n011, n111, w.x);
|
|
81
|
+
float y0 = mix(x00, x10, w.y);
|
|
82
|
+
float y1 = mix(x01, x11, w.y);
|
|
83
|
+
return mix(y0, y1, w.z) * 2.0 - 1.0;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
float fbm2(vec2 uv, float t){
|
|
87
|
+
vec3 p = vec3(uv * uScale, t);
|
|
88
|
+
float amp = 1.0;
|
|
89
|
+
float freq = 1.0;
|
|
90
|
+
float sum = 1.0;
|
|
91
|
+
for (int i = 0; i < FBM_OCTAVES; ++i){
|
|
92
|
+
sum += amp * vnoise(p * freq);
|
|
93
|
+
freq *= FBM_LACUNARITY;
|
|
94
|
+
amp *= FBM_GAIN;
|
|
95
|
+
}
|
|
96
|
+
return sum * 0.5 + 0.5;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
float maskCircle(vec2 p, float cov){
|
|
100
|
+
float r = sqrt(cov) * .25;
|
|
101
|
+
float d = length(p - 0.5) - r;
|
|
102
|
+
float aa = 0.5 * fwidth(d);
|
|
103
|
+
return cov * (1.0 - smoothstep(-aa, aa, d * 2.0));
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
float maskTriangle(vec2 p, vec2 id, float cov){
|
|
107
|
+
bool flip = mod(id.x + id.y, 2.0) > 0.5;
|
|
108
|
+
if (flip) p.x = 1.0 - p.x;
|
|
109
|
+
float r = sqrt(cov);
|
|
110
|
+
float d = p.y - r*(1.0 - p.x);
|
|
111
|
+
float aa = fwidth(d);
|
|
112
|
+
return cov * clamp(0.5 - d/aa, 0.0, 1.0);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
float maskDiamond(vec2 p, float cov){
|
|
116
|
+
float r = sqrt(cov) * 0.564;
|
|
117
|
+
return step(abs(p.x - 0.49) + abs(p.y - 0.49), r);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
void main(){
|
|
121
|
+
float pixelSize = uPixelSize;
|
|
122
|
+
vec2 fragCoord = gl_FragCoord.xy - uResolution * .5;
|
|
123
|
+
float aspectRatio = uResolution.x / uResolution.y;
|
|
124
|
+
|
|
125
|
+
vec2 pixelId = floor(fragCoord / pixelSize);
|
|
126
|
+
vec2 pixelUV = fract(fragCoord / pixelSize);
|
|
127
|
+
|
|
128
|
+
float cellPixelSize = 8.0 * pixelSize;
|
|
129
|
+
vec2 cellId = floor(fragCoord / cellPixelSize);
|
|
130
|
+
vec2 cellCoord = cellId * cellPixelSize;
|
|
131
|
+
vec2 uv = cellCoord / uResolution * vec2(aspectRatio, 1.0);
|
|
132
|
+
|
|
133
|
+
float base = fbm2(uv, uTime * 0.05);
|
|
134
|
+
base = base * 0.5 - 0.65;
|
|
135
|
+
|
|
136
|
+
float feed = base + (uDensity - 0.5) * 0.3;
|
|
137
|
+
|
|
138
|
+
float speed = uRippleSpeed;
|
|
139
|
+
float thickness = uRippleThickness;
|
|
140
|
+
const float dampT = 1.0;
|
|
141
|
+
const float dampR = 10.0;
|
|
142
|
+
|
|
143
|
+
if (uEnableRipples == 1) {
|
|
144
|
+
for (int i = 0; i < MAX_CLICKS; ++i){
|
|
145
|
+
vec2 pos = uClickPos[i];
|
|
146
|
+
if (pos.x < 0.0) continue;
|
|
147
|
+
float cellPixelSize = 8.0 * pixelSize;
|
|
148
|
+
vec2 cuv = (((pos - uResolution * .5 - cellPixelSize * .5) / (uResolution))) * vec2(aspectRatio, 1.0);
|
|
149
|
+
float t = max(uTime - uClickTimes[i], 0.0);
|
|
150
|
+
float r = distance(uv, cuv);
|
|
151
|
+
float waveR = speed * t;
|
|
152
|
+
float ring = exp(-pow((r - waveR) / thickness, 2.0));
|
|
153
|
+
float atten = exp(-dampT * t) * exp(-dampR * r);
|
|
154
|
+
feed = max(feed, ring * atten * uRippleIntensity);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
float bayer = Bayer8(fragCoord / uPixelSize) - 0.5;
|
|
159
|
+
float bw = step(0.5, feed + bayer);
|
|
160
|
+
|
|
161
|
+
float h = fract(sin(dot(floor(fragCoord / uPixelSize), vec2(127.1, 311.7))) * 43758.5453);
|
|
162
|
+
float jitterScale = 1.0 + (h - 0.5) * uPixelJitter;
|
|
163
|
+
float coverage = bw * jitterScale;
|
|
164
|
+
float M;
|
|
165
|
+
if (uShapeType == SHAPE_CIRCLE) M = maskCircle (pixelUV, coverage);
|
|
166
|
+
else if (uShapeType == SHAPE_TRIANGLE) M = maskTriangle(pixelUV, pixelId, coverage);
|
|
167
|
+
else if (uShapeType == SHAPE_DIAMOND) M = maskDiamond(pixelUV, coverage);
|
|
168
|
+
else M = coverage;
|
|
169
|
+
|
|
170
|
+
if (uEdgeFade > 0.0) {
|
|
171
|
+
vec2 norm = gl_FragCoord.xy / uResolution;
|
|
172
|
+
float edge = min(min(norm.x, norm.y), min(1.0 - norm.x, 1.0 - norm.y));
|
|
173
|
+
float fade = smoothstep(0.0, uEdgeFade, edge);
|
|
174
|
+
M *= fade;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
vec3 color = uColor;
|
|
178
|
+
|
|
179
|
+
// sRGB gamma correction - convert linear to sRGB for accurate color output
|
|
180
|
+
vec3 srgbColor = mix(
|
|
181
|
+
color * 12.92,
|
|
182
|
+
1.055 * pow(color, vec3(1.0 / 2.4)) - 0.055,
|
|
183
|
+
step(0.0031308, color)
|
|
184
|
+
);
|
|
185
|
+
|
|
186
|
+
fragColor = vec4(srgbColor, M);
|
|
187
|
+
}
|
|
188
|
+
`,H=10,pe=({variant:b="square",pixelSize:l=3,color:i="#B19EEF",className:T,style:E,antialias:w=!0,patternScale:m=2,patternDensity:R=1,liquid:F=!1,liquidStrength:k=.1,liquidRadius:I=1,pixelSizeJitter:_=0,enableRipples:B=!0,rippleIntensityScale:a=1,rippleThickness:n=.1,rippleSpeed:c=.3,liquidWobbleSpeed:C=4.5,autoPauseOffscreen:g=!0,speed:h=.5,transparent:p=!0,edgeFade:v=.5,noiseAmount:L=0})=>{const X=z.useRef(null),ve=z.useRef({visible:!0}),$=z.useRef(h),f=z.useRef(null),N=z.useRef(null);return z.useEffect(()=>{var j,J,W;const y=X.current;if(!y)return;$.current=h;const he=["antialias","liquid","noiseAmount"],K={antialias:w,liquid:F,noiseAmount:L};let D=!1;if(!f.current)D=!0;else if(N.current){for(const e of he)if(N.current[e]!==K[e]){D=!0;break}}if(D){if(f.current){const o=f.current;(j=o.resizeObserver)==null||j.disconnect(),cancelAnimationFrame(o.raf),(J=o.quad)==null||J.geometry.dispose(),o.material.dispose(),(W=o.composer)==null||W.dispose(),o.renderer.dispose(),o.renderer.forceContextLoss(),o.renderer.domElement.parentElement===y&&y.removeChild(o.renderer.domElement),f.current=null}const e=document.createElement("canvas"),t=new we({canvas:e,antialias:w,alpha:!0,powerPreference:"high-performance"});t.domElement.style.width="100%",t.domElement.style.height="100%",t.setPixelRatio(Math.min(window.devicePixelRatio||1,2)),y.appendChild(t.domElement),p?t.setClearAlpha(0):t.setClearColor(0,1);const s={uResolution:{value:new ne(0,0)},uTime:{value:0},uColor:{value:new Re(i)},uClickPos:{value:Array.from({length:H},()=>new ne(-1,-1))},uClickTimes:{value:new Float32Array(H)},uShapeType:{value:ue[b]??0},uPixelSize:{value:l*t.getPixelRatio()},uScale:{value:m},uDensity:{value:R},uPixelJitter:{value:_},uEnableRipples:{value:B?1:0},uRippleSpeed:{value:c},uRippleThickness:{value:n},uRippleIntensity:{value:a},uEdgeFade:{value:v}},P=new Ce,A=new Pe(-1,1,1,-1,0,1),Y=new qe({vertexShader:Ve,fragmentShader:_e,uniforms:s,transparent:!0,depthTest:!1,depthWrite:!1,glslVersion:Te}),xe=new be(2,2),Q=new Ae(xe,Y);P.add(Q);const Z=new ze,ee=()=>{var d;const o=y.clientWidth||1,r=y.clientHeight||1;t.setSize(o,r,!1),s.uResolution.value.set(t.domElement.width,t.domElement.height),(d=f.current)!=null&&d.composer&&f.current.composer.setSize(t.domElement.width,t.domElement.height),s.uPixelSize.value=l*t.getPixelRatio()};ee();const te=new ResizeObserver(ee);te.observe(y);const ae=(()=>{var o;if(typeof window<"u"&&((o=window.crypto)!=null&&o.getRandomValues)){const r=new Uint32Array(1);return window.crypto.getRandomValues(r),r[0]/4294967295}return Math.random()})()*1e3;let u,q,V;if(F){q=ke(),q.radiusScale=I,u=new re(t);const o=new le(P,A);V=Ie(q.texture,{strength:k,freq:C});const r=new ie(A,V);r.renderToScreen=!0,u.addPass(o),u.addPass(r)}if(L>0){u||(u=new re(t),u.addPass(new le(P,A)));const o=new me("NoiseEffect","uniform float uTime; uniform float uAmount; float hash(vec2 p){ return fract(sin(dot(p, vec2(127.1,311.7))) * 43758.5453);} void mainUv(inout vec2 uv){} void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){ float n=hash(floor(uv*vec2(1920.0,1080.0))+floor(uTime*60.0)); float g=(n-0.5)*uAmount; outputColor=inputColor+vec4(vec3(g),0.0);} ",{uniforms:new Map([["uTime",new M(0)],["uAmount",new M(L)]])}),r=new ie(A,o);r.renderToScreen=!0,u&&u.passes.length>0&&u.passes.forEach(d=>d.renderToScreen=!1),u.addPass(r)}u&&u.setSize(t.domElement.width,t.domElement.height);const oe=o=>{const r=t.domElement.getBoundingClientRect(),d=t.domElement.width/r.width,x=t.domElement.height/r.height,S=(o.clientX-r.left)*d,Se=(r.height-(o.clientY-r.top))*x;return{fx:S,fy:Se,w:t.domElement.width,h:t.domElement.height}},ge=o=>{var S;const{fx:r,fy:d}=oe(o),x=((S=f.current)==null?void 0:S.clickIx)??0;s.uClickPos.value[x].set(r,d),s.uClickTimes.value[x]=s.uTime.value,f.current&&(f.current.clickIx=(x+1)%H)},ye=o=>{if(!q)return;const{fx:r,fy:d,w:x,h:S}=oe(o);q.addTouch({x:r/x,y:d/S})};t.domElement.addEventListener("pointerdown",ge,{passive:!0}),t.domElement.addEventListener("pointermove",ye,{passive:!0});let O=0;const U=()=>{if(g&&!ve.current.visible){O=requestAnimationFrame(U);return}s.uTime.value=ae+Z.getElapsedTime()*$.current,V&&(V.uniforms.get("uTime").value=s.uTime.value),u?(q&&q.update(),u.passes.forEach(o=>{const r=o.effects;r&&r.forEach(d=>{var S;const x=(S=d.uniforms)==null?void 0:S.get("uTime");x&&(x.value=s.uTime.value)})}),u.render()):t.render(P,A),O=requestAnimationFrame(U)};O=requestAnimationFrame(U),f.current={renderer:t,scene:P,camera:A,material:Y,clock:Z,clickIx:0,uniforms:s,resizeObserver:te,raf:O,quad:Q,timeOffset:ae,composer:u,touch:q,liquidEffect:V}}else{const e=f.current;if(e.uniforms.uShapeType.value=ue[b]??0,e.uniforms.uPixelSize.value=l*e.renderer.getPixelRatio(),e.uniforms.uColor.value.set(i),e.uniforms.uScale.value=m,e.uniforms.uDensity.value=R,e.uniforms.uPixelJitter.value=_,e.uniforms.uEnableRipples.value=B?1:0,e.uniforms.uRippleIntensity.value=a,e.uniforms.uRippleThickness.value=n,e.uniforms.uRippleSpeed.value=c,e.uniforms.uEdgeFade.value=v,p?e.renderer.setClearAlpha(0):e.renderer.setClearColor(0,1),e.liquidEffect){const t=e.liquidEffect;t&&(t.value=k);const s=e.liquidEffect.uniforms.get("uFreq");s&&(s.value=C)}e.touch&&(e.touch.radiusScale=I)}return N.current=K,()=>{var t,s,P;if(f.current&&D||!f.current)return;const e=f.current;(t=e.resizeObserver)==null||t.disconnect(),cancelAnimationFrame(e.raf),(s=e.quad)==null||s.geometry.dispose(),e.material.dispose(),(P=e.composer)==null||P.dispose(),e.renderer.dispose(),e.renderer.forceContextLoss(),e.renderer.domElement.parentElement===y&&y.removeChild(e.renderer.domElement),f.current=null}},[w,F,L,l,m,R,B,a,n,c,_,v,p,k,I,C,g,b,i,h]),Ee.jsx("div",{ref:X,className:`${Fe["pixel-blast-container"]} ${T??""}`,style:E,"aria-label":"PixelBlast interactive background"})};pe.__docgenInfo={description:"",methods:[],displayName:"PixelBlast",props:{variant:{defaultValue:{value:"'square'",computed:!1},required:!1},pixelSize:{defaultValue:{value:"3",computed:!1},required:!1},color:{defaultValue:{value:"'#B19EEF'",computed:!1},required:!1},antialias:{defaultValue:{value:"true",computed:!1},required:!1},patternScale:{defaultValue:{value:"2",computed:!1},required:!1},patternDensity:{defaultValue:{value:"1",computed:!1},required:!1},liquid:{defaultValue:{value:"false",computed:!1},required:!1},liquidStrength:{defaultValue:{value:"0.1",computed:!1},required:!1},liquidRadius:{defaultValue:{value:"1",computed:!1},required:!1},pixelSizeJitter:{defaultValue:{value:"0",computed:!1},required:!1},enableRipples:{defaultValue:{value:"true",computed:!1},required:!1},rippleIntensityScale:{defaultValue:{value:"1",computed:!1},required:!1},rippleThickness:{defaultValue:{value:"0.1",computed:!1},required:!1},rippleSpeed:{defaultValue:{value:"0.3",computed:!1},required:!1},liquidWobbleSpeed:{defaultValue:{value:"4.5",computed:!1},required:!1},autoPauseOffscreen:{defaultValue:{value:"true",computed:!1},required:!1},speed:{defaultValue:{value:"0.5",computed:!1},required:!1},transparent:{defaultValue:{value:"true",computed:!1},required:!1},edgeFade:{defaultValue:{value:"0.5",computed:!1},required:!1},noiseAmount:{defaultValue:{value:"0",computed:!1},required:!1}}};const Ne={title:"ReactBits/Backgrounds/PixelBlast",component:pe,parameters:{layout:"fullscreen"},tags:["autodocs"]},G={args:{variant:"square",pixelSize:3,color:"#B19EEF",antialias:!0,patternScale:2,patternDensity:1,liquid:!1,liquidStrength:.1,liquidRadius:1,pixelSizeJitter:0,enableRipples:!0,rippleIntensityScale:1,rippleThickness:.1,rippleSpeed:.3,liquidWobbleSpeed:4.5,autoPauseOffscreen:!0,speed:.5,transparent:!0,edgeFade:.5,noiseAmount:0}};var ce,fe,de;G.parameters={...G.parameters,docs:{...(ce=G.parameters)==null?void 0:ce.docs,source:{originalSource:`{
|
|
189
|
+
args: {
|
|
190
|
+
variant: 'square',
|
|
191
|
+
pixelSize: 3,
|
|
192
|
+
color: '#B19EEF',
|
|
193
|
+
antialias: true,
|
|
194
|
+
patternScale: 2,
|
|
195
|
+
patternDensity: 1,
|
|
196
|
+
liquid: false,
|
|
197
|
+
liquidStrength: 0.1,
|
|
198
|
+
liquidRadius: 1,
|
|
199
|
+
pixelSizeJitter: 0,
|
|
200
|
+
enableRipples: true,
|
|
201
|
+
rippleIntensityScale: 1,
|
|
202
|
+
rippleThickness: 0.1,
|
|
203
|
+
rippleSpeed: 0.3,
|
|
204
|
+
liquidWobbleSpeed: 4.5,
|
|
205
|
+
autoPauseOffscreen: true,
|
|
206
|
+
speed: 0.5,
|
|
207
|
+
transparent: true,
|
|
208
|
+
edgeFade: 0.5,
|
|
209
|
+
noiseAmount: 0
|
|
210
|
+
}
|
|
211
|
+
}`,...(de=(fe=G.parameters)==null?void 0:fe.docs)==null?void 0:de.source}}};const Ue=["Default"];export{G as Default,Ue as __namedExportsOrder,Ne as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._pixel-canvas_wo94u_1{width:100%;min-height:100vh;display:block}._pixel-card_wo94u_7{height:400px;width:300px;position:relative;overflow:hidden;display:grid;place-items:center;aspect-ratio:4 / 5;border:1px solid #27272a;border-radius:25px;isolation:isolate;transition:border-color .2s cubic-bezier(.5,1,.89,1);-webkit-user-select:none;user-select:none}._pixel-card_wo94u_7:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;margin:auto;aspect-ratio:1;background:radial-gradient(circle,#09090b,transparent 85%);opacity:0;transition:opacity .8s cubic-bezier(.5,1,.89,1)}._pixel-card_wo94u_7:hover:before,._pixel-card_wo94u_7:focus-within:before{opacity:1}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{r as l,j as V}from"./iframe-2N7rjfXm.js";import"./preload-helper-C1FmrZbK.js";const q={"pixel-canvas":"_pixel-canvas_wo94u_1","pixel-card":"_pixel-card_wo94u_7"};class J{constructor(t,u,p,x,i,y,n){this.width=t.width,this.height=t.height,this.ctx=u,this.x=p,this.y=x,this.color=i,this.speed=this.getRandomValue(.1,.9)*y,this.size=0,this.sizeStep=Math.random()*.4,this.minSize=.5,this.maxSizeInteger=2,this.maxSize=this.getRandomValue(this.minSize,this.maxSizeInteger),this.delay=n,this.counter=0,this.counterStep=Math.random()*4+(this.width+this.height)*.01,this.isIdle=!1,this.isReverse=!1,this.isShimmer=!1}getRandomValue(t,u){return Math.random()*(u-t)+t}draw(){const t=this.maxSizeInteger*.5-this.size*.5;this.ctx.fillStyle=this.color,this.ctx.fillRect(this.x+t,this.y+t,this.size,this.size)}appear(){if(this.isIdle=!1,this.counter<=this.delay){this.counter+=this.counterStep;return}this.size>=this.maxSize&&(this.isShimmer=!0),this.isShimmer?this.shimmer():this.size+=this.sizeStep,this.draw()}disappear(){if(this.isShimmer=!1,this.counter=0,this.size<=0){this.isIdle=!0;return}else this.size-=.1;this.draw()}shimmer(){this.size>=this.maxSize?this.isReverse=!0:this.size<=this.minSize&&(this.isReverse=!1),this.isReverse?this.size-=this.speed:this.size+=this.speed}}function K(m,t){const i=parseInt(m,10);return i<=0||t?0:i>=100?100*.001:i*.001}const T={default:{activeColor:null,gap:5,speed:35,colors:"#f8fafc,#f1f5f9,#cbd5e1",noFocus:!1},blue:{activeColor:"#e0f2fe",gap:10,speed:25,colors:"#e0f2fe,#7dd3fc,#0ea5e9",noFocus:!1},yellow:{activeColor:"#fef08a",gap:3,speed:20,colors:"#fef08a,#fde047,#eab308",noFocus:!1},pink:{activeColor:"#fecdd3",gap:6,speed:80,colors:"#fecdd3,#fda4af,#e11d48",noFocus:!0}};function O({variant:m="default",gap:t,speed:u,colors:p,noFocus:x,className:i="",children:y}){const n=l.useRef(null),s=l.useRef(null),I=l.useRef([]),h=l.useRef(null),F=l.useRef(performance.now()),M=l.useRef(window.matchMedia("(prefers-reduced-motion: reduce)").matches).current,g=T[m]||T.default,C=t??g.gap,A=u??g.speed,_=p??g.colors,v=x??g.noFocus,b=()=>{if(!n.current||!s.current)return;const e=n.current.getBoundingClientRect(),a=Math.floor(e.width),o=Math.floor(e.height),z=s.current.getContext("2d");s.current.width=a,s.current.height=o,s.current.style.width=`${a}px`,s.current.style.height=`${o}px`;const d=_.split(","),f=[];for(let c=0;c<a;c+=parseInt(C,10))for(let r=0;r<o;r+=parseInt(C,10)){const S=d[Math.floor(Math.random()*d.length)],E=c-a/2,N=r-o/2,G=Math.sqrt(E*E+N*N),L=M?0:G;f.push(new J(s.current,z,c,r,S,K(A,M),L))}I.current=f},P=e=>{var c;h.current=requestAnimationFrame(()=>P(e));const a=performance.now(),o=a-F.current,z=1e3/60;if(o<z)return;F.current=a-o%z;const d=(c=s.current)==null?void 0:c.getContext("2d");if(!d||!s.current)return;d.clearRect(0,0,s.current.width,s.current.height);let f=!0;for(let r=0;r<I.current.length;r++){const S=I.current[r];S[e](),S.isIdle||(f=!1)}f&&cancelAnimationFrame(h.current)},R=e=>{cancelAnimationFrame(h.current),h.current=requestAnimationFrame(()=>P(e))},D=()=>R("appear"),H=()=>R("disappear"),W=e=>{e.currentTarget.contains(e.relatedTarget)||R("appear")},k=e=>{e.currentTarget.contains(e.relatedTarget)||R("disappear")};return l.useEffect(()=>{b();const e=new ResizeObserver(()=>{b()});return n.current&&e.observe(n.current),()=>{e.disconnect(),cancelAnimationFrame(h.current)}},[C,A,_,v]),V.jsxs("div",{ref:n,className:`${q["pixel-card"]} ${i}`,onMouseEnter:D,onMouseLeave:H,onFocus:v?void 0:W,onBlur:v?void 0:k,tabIndex:v?-1:0,children:[V.jsx("canvas",{className:`${q["pixel-canvas"]}`,ref:s}),y]})}O.__docgenInfo={description:"",methods:[],displayName:"PixelCard",props:{variant:{defaultValue:{value:"'default'",computed:!1},required:!1},className:{defaultValue:{value:"''",computed:!1},required:!1}}};const X={title:"ReactBits/Components/PixelCard",component:O,parameters:{layout:"fullscreen"},tags:["autodocs"]},w={args:{variant:"default",children:"Hello World"}};var $,j,B;w.parameters={...w.parameters,docs:{...($=w.parameters)==null?void 0:$.docs,source:{originalSource:`{
|
|
2
|
+
args: {
|
|
3
|
+
variant: 'default',
|
|
4
|
+
children: 'Hello World'
|
|
5
|
+
}
|
|
6
|
+
}`,...(B=(j=w.parameters)==null?void 0:j.docs)==null?void 0:B.source}}};const Y=["Default"];export{w as Default,Y as __namedExportsOrder,X as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._pixel-snow-container_udm6i_1{width:100%;min-height:100vh;position:relative;overflow:hidden;contain:layout style paint}._pixel-snow-container_udm6i_1 canvas{display:block;width:100%;min-height:100vh;transform:translateZ(0);will-change:transform;backface-visibility:hidden}
|