@3driseai/3drise-viewer 0.1.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/dist/components/AnimatedObject.d.ts +22 -0
- package/dist/components/AnimatedObject.d.ts.map +1 -0
- package/dist/components/AnimatedObject.js +65 -0
- package/dist/components/Bubbles.d.ts +9 -0
- package/dist/components/Bubbles.d.ts.map +1 -0
- package/dist/components/Bubbles.js +105 -0
- package/dist/components/CameraController.d.ts +10 -0
- package/dist/components/CameraController.d.ts.map +1 -0
- package/dist/components/CameraController.js +158 -0
- package/dist/components/Clouds.d.ts +9 -0
- package/dist/components/Clouds.d.ts.map +1 -0
- package/dist/components/Clouds.js +278 -0
- package/dist/components/Corona.d.ts +18 -0
- package/dist/components/Corona.d.ts.map +1 -0
- package/dist/components/Corona.js +12 -0
- package/dist/components/CreatedObject.d.ts +14 -0
- package/dist/components/CreatedObject.d.ts.map +1 -0
- package/dist/components/CreatedObject.js +103 -0
- package/dist/components/CustomPrimitive.d.ts +12 -0
- package/dist/components/CustomPrimitive.d.ts.map +1 -0
- package/dist/components/CustomPrimitive.js +87 -0
- package/dist/components/Earth.d.ts +8 -0
- package/dist/components/Earth.d.ts.map +1 -0
- package/dist/components/Earth.js +38 -0
- package/dist/components/EffectsGenerator.d.ts +10 -0
- package/dist/components/EffectsGenerator.d.ts.map +1 -0
- package/dist/components/EffectsGenerator.js +71 -0
- package/dist/components/EffectsGroup.d.ts +8 -0
- package/dist/components/EffectsGroup.d.ts.map +1 -0
- package/dist/components/EffectsGroup.js +11 -0
- package/dist/components/EnvironmentManager.d.ts +9 -0
- package/dist/components/EnvironmentManager.d.ts.map +1 -0
- package/dist/components/EnvironmentManager.js +74 -0
- package/dist/components/EnvironmentObject.d.ts +8 -0
- package/dist/components/EnvironmentObject.d.ts.map +1 -0
- package/dist/components/EnvironmentObject.js +14 -0
- package/dist/components/Flares.d.ts +24 -0
- package/dist/components/Flares.d.ts.map +1 -0
- package/dist/components/Flares.js +134 -0
- package/dist/components/Frame.d.ts +23 -0
- package/dist/components/Frame.d.ts.map +1 -0
- package/dist/components/Frame.js +55 -0
- package/dist/components/FrameGeometry.d.ts +10 -0
- package/dist/components/FrameGeometry.d.ts.map +1 -0
- package/dist/components/FrameGeometry.js +17 -0
- package/dist/components/FrameImage.d.ts +2 -0
- package/dist/components/FrameImage.d.ts.map +1 -0
- package/dist/components/FrameImage.js +15 -0
- package/dist/components/Galaxy.d.ts +10 -0
- package/dist/components/Galaxy.d.ts.map +1 -0
- package/dist/components/Galaxy.js +29 -0
- package/dist/components/GalleryLayout.d.ts +12 -0
- package/dist/components/GalleryLayout.d.ts.map +1 -0
- package/dist/components/GalleryLayout.js +20 -0
- package/dist/components/GeometryShape.d.ts +54 -0
- package/dist/components/GeometryShape.d.ts.map +1 -0
- package/dist/components/GeometryShape.js +318 -0
- package/dist/components/Glyphs.d.ts +9 -0
- package/dist/components/Glyphs.d.ts.map +1 -0
- package/dist/components/Glyphs.js +58 -0
- package/dist/components/GridHelper.d.ts +23 -0
- package/dist/components/GridHelper.d.ts.map +1 -0
- package/dist/components/GridHelper.js +36 -0
- package/dist/components/GridsGenerator.d.ts +10 -0
- package/dist/components/GridsGenerator.d.ts.map +1 -0
- package/dist/components/GridsGenerator.js +14 -0
- package/dist/components/HdrPlaylistRenderer.d.ts +10 -0
- package/dist/components/HdrPlaylistRenderer.d.ts.map +1 -0
- package/dist/components/HdrPlaylistRenderer.js +364 -0
- package/dist/components/ImageGeometry.d.ts +13 -0
- package/dist/components/ImageGeometry.d.ts.map +1 -0
- package/dist/components/ImageGeometry.js +62 -0
- package/dist/components/Lensflare.d.ts +12 -0
- package/dist/components/Lensflare.d.ts.map +1 -0
- package/dist/components/Lensflare.js +66 -0
- package/dist/components/Letter.d.ts +19 -0
- package/dist/components/Letter.d.ts.map +1 -0
- package/dist/components/Letter.js +83 -0
- package/dist/components/Letters.d.ts +16 -0
- package/dist/components/Letters.d.ts.map +1 -0
- package/dist/components/Letters.js +18 -0
- package/dist/components/LightObject.d.ts +8 -0
- package/dist/components/LightObject.d.ts.map +1 -0
- package/dist/components/LightObject.js +65 -0
- package/dist/components/LightsManager.d.ts +8 -0
- package/dist/components/LightsManager.d.ts.map +1 -0
- package/dist/components/LightsManager.js +104 -0
- package/dist/components/Lines.d.ts +9 -0
- package/dist/components/Lines.d.ts.map +1 -0
- package/dist/components/Lines.js +19 -0
- package/dist/components/LoadingIndicator.d.ts +10 -0
- package/dist/components/LoadingIndicator.d.ts.map +1 -0
- package/dist/components/LoadingIndicator.js +6 -0
- package/dist/components/MaterialLibrary.d.ts +9 -0
- package/dist/components/MaterialLibrary.d.ts.map +1 -0
- package/dist/components/MaterialLibrary.js +57 -0
- package/dist/components/Moon.d.ts +13 -0
- package/dist/components/Moon.d.ts.map +1 -0
- package/dist/components/Moon.js +66 -0
- package/dist/components/MyGrid.d.ts +15 -0
- package/dist/components/MyGrid.d.ts.map +1 -0
- package/dist/components/MyGrid.js +72 -0
- package/dist/components/ObjectNode.d.ts +13 -0
- package/dist/components/ObjectNode.d.ts.map +1 -0
- package/dist/components/ObjectNode.js +139 -0
- package/dist/components/ObjectNodeApi.d.ts +13 -0
- package/dist/components/ObjectNodeApi.d.ts.map +1 -0
- package/dist/components/ObjectNodeApi.js +18 -0
- package/dist/components/ObjectsRenderer.d.ts +15 -0
- package/dist/components/ObjectsRenderer.d.ts.map +1 -0
- package/dist/components/ObjectsRenderer.js +40 -0
- package/dist/components/ObjectsRendererApi.d.ts +31 -0
- package/dist/components/ObjectsRendererApi.d.ts.map +1 -0
- package/dist/components/ObjectsRendererApi.js +76 -0
- package/dist/components/Ocean.d.ts +8 -0
- package/dist/components/Ocean.d.ts.map +1 -0
- package/dist/components/Ocean.js +169 -0
- package/dist/components/Outline.d.ts +21 -0
- package/dist/components/Outline.d.ts.map +1 -0
- package/dist/components/Outline.js +14 -0
- package/dist/components/ParticlesR3f.d.ts +11 -0
- package/dist/components/ParticlesR3f.d.ts.map +1 -0
- package/dist/components/ParticlesR3f.js +110 -0
- package/dist/components/Path.d.ts +13 -0
- package/dist/components/Path.d.ts.map +1 -0
- package/dist/components/Path.js +41 -0
- package/dist/components/PathGeometry.d.ts +11 -0
- package/dist/components/PathGeometry.d.ts.map +1 -0
- package/dist/components/PathGeometry.js +109 -0
- package/dist/components/PathRenderer.d.ts +12 -0
- package/dist/components/PathRenderer.d.ts.map +1 -0
- package/dist/components/PathRenderer.js +36 -0
- package/dist/components/Planet.d.ts +16 -0
- package/dist/components/Planet.d.ts.map +1 -0
- package/dist/components/Planet.js +60 -0
- package/dist/components/PointCloud.d.ts +10 -0
- package/dist/components/PointCloud.d.ts.map +1 -0
- package/dist/components/PointCloud.js +113 -0
- package/dist/components/ProductionScene.d.ts +5 -0
- package/dist/components/ProductionScene.d.ts.map +1 -0
- package/dist/components/ProductionScene.js +7 -0
- package/dist/components/ProjectLoader.d.ts +16 -0
- package/dist/components/ProjectLoader.d.ts.map +1 -0
- package/dist/components/ProjectLoader.js +85 -0
- package/dist/components/Rain.d.ts +8 -0
- package/dist/components/Rain.d.ts.map +1 -0
- package/dist/components/Rain.js +259 -0
- package/dist/components/RiseLogo.d.ts +19 -0
- package/dist/components/RiseLogo.d.ts.map +1 -0
- package/dist/components/RiseLogo.js +75 -0
- package/dist/components/SceneBuilder.d.ts +5 -0
- package/dist/components/SceneBuilder.d.ts.map +1 -0
- package/dist/components/SceneBuilder.js +133 -0
- package/dist/components/SceneFog.d.ts +8 -0
- package/dist/components/SceneFog.d.ts.map +1 -0
- package/dist/components/SceneFog.js +19 -0
- package/dist/components/Shape.d.ts +5 -0
- package/dist/components/Shape.d.ts.map +1 -0
- package/dist/components/Shape.js +11 -0
- package/dist/components/ShootingStar.d.ts +16 -0
- package/dist/components/ShootingStar.d.ts.map +1 -0
- package/dist/components/ShootingStar.js +92 -0
- package/dist/components/ShootingStars.d.ts +8 -0
- package/dist/components/ShootingStars.d.ts.map +1 -0
- package/dist/components/ShootingStars.js +41 -0
- package/dist/components/SkyController.d.ts +10 -0
- package/dist/components/SkyController.d.ts.map +1 -0
- package/dist/components/SkyController.js +208 -0
- package/dist/components/SkyMesh.d.ts +10 -0
- package/dist/components/SkyMesh.d.ts.map +1 -0
- package/dist/components/SkyMesh.js +36 -0
- package/dist/components/SkySystem.d.ts +32 -0
- package/dist/components/SkySystem.d.ts.map +1 -0
- package/dist/components/SkySystem.js +46 -0
- package/dist/components/Skybox.d.ts +12 -0
- package/dist/components/Skybox.d.ts.map +1 -0
- package/dist/components/Skybox.js +92 -0
- package/dist/components/SolarSystem.d.ts +8 -0
- package/dist/components/SolarSystem.d.ts.map +1 -0
- package/dist/components/SolarSystem.js +77 -0
- package/dist/components/SparklesBurst.d.ts +9 -0
- package/dist/components/SparklesBurst.d.ts.map +1 -0
- package/dist/components/SparklesBurst.js +62 -0
- package/dist/components/Stars.d.ts +15 -0
- package/dist/components/Stars.d.ts.map +1 -0
- package/dist/components/Stars.js +250 -0
- package/dist/components/Sun.d.ts +15 -0
- package/dist/components/Sun.d.ts.map +1 -0
- package/dist/components/Sun.js +7 -0
- package/dist/components/SunCore.d.ts +18 -0
- package/dist/components/SunCore.d.ts.map +1 -0
- package/dist/components/SunCore.js +14 -0
- package/dist/components/SunLight.d.ts +15 -0
- package/dist/components/SunLight.d.ts.map +1 -0
- package/dist/components/SunLight.js +57 -0
- package/dist/components/Text2D.d.ts +9 -0
- package/dist/components/Text2D.d.ts.map +1 -0
- package/dist/components/Text2D.js +56 -0
- package/dist/components/Text3D.d.ts +10 -0
- package/dist/components/Text3D.d.ts.map +1 -0
- package/dist/components/Text3D.js +8 -0
- package/dist/components/VolumePoints.d.ts +19 -0
- package/dist/components/VolumePoints.d.ts.map +1 -0
- package/dist/components/VolumePoints.js +8 -0
- package/dist/components/cursor/AuraCursor.d.ts +6 -0
- package/dist/components/cursor/AuraCursor.d.ts.map +1 -0
- package/dist/components/cursor/AuraCursor.js +30 -0
- package/dist/components/cursor/AuroraCursor.d.ts +6 -0
- package/dist/components/cursor/AuroraCursor.d.ts.map +1 -0
- package/dist/components/cursor/AuroraCursor.js +207 -0
- package/dist/components/cursor/BubblesCursor.d.ts +6 -0
- package/dist/components/cursor/BubblesCursor.d.ts.map +1 -0
- package/dist/components/cursor/BubblesCursor.js +184 -0
- package/dist/components/cursor/CometCursor.d.ts +6 -0
- package/dist/components/cursor/CometCursor.d.ts.map +1 -0
- package/dist/components/cursor/CometCursor.js +191 -0
- package/dist/components/cursor/CrosshairCursor.d.ts +6 -0
- package/dist/components/cursor/CrosshairCursor.d.ts.map +1 -0
- package/dist/components/cursor/CrosshairCursor.js +142 -0
- package/dist/components/cursor/CursorActions.d.ts +8 -0
- package/dist/components/cursor/CursorActions.d.ts.map +1 -0
- package/dist/components/cursor/CursorActions.js +124 -0
- package/dist/components/cursor/CursorController.d.ts +10 -0
- package/dist/components/cursor/CursorController.d.ts.map +1 -0
- package/dist/components/cursor/CursorController.js +5 -0
- package/dist/components/cursor/CursorEffects.d.ts +16 -0
- package/dist/components/cursor/CursorEffects.d.ts.map +1 -0
- package/dist/components/cursor/CursorEffects.js +110 -0
- package/dist/components/cursor/FerrofluidCursor.d.ts +6 -0
- package/dist/components/cursor/FerrofluidCursor.d.ts.map +1 -0
- package/dist/components/cursor/FerrofluidCursor.js +102 -0
- package/dist/components/cursor/GlyphRingCursor.d.ts +6 -0
- package/dist/components/cursor/GlyphRingCursor.d.ts.map +1 -0
- package/dist/components/cursor/GlyphRingCursor.js +123 -0
- package/dist/components/cursor/LightningCursor.d.ts +6 -0
- package/dist/components/cursor/LightningCursor.d.ts.map +1 -0
- package/dist/components/cursor/LightningCursor.js +28 -0
- package/dist/components/cursor/LiquidMetalCursor.d.ts +6 -0
- package/dist/components/cursor/LiquidMetalCursor.d.ts.map +1 -0
- package/dist/components/cursor/LiquidMetalCursor.js +61 -0
- package/dist/components/cursor/OrbCursor.d.ts +6 -0
- package/dist/components/cursor/OrbCursor.d.ts.map +1 -0
- package/dist/components/cursor/OrbCursor.js +32 -0
- package/dist/components/cursor/PlasmaWhipCursor.d.ts +6 -0
- package/dist/components/cursor/PlasmaWhipCursor.d.ts.map +1 -0
- package/dist/components/cursor/PlasmaWhipCursor.js +134 -0
- package/dist/components/cursor/SparklesCursor.d.ts +6 -0
- package/dist/components/cursor/SparklesCursor.d.ts.map +1 -0
- package/dist/components/cursor/SparklesCursor.js +151 -0
- package/dist/components/cursor/TeslaCursor.d.ts +6 -0
- package/dist/components/cursor/TeslaCursor.d.ts.map +1 -0
- package/dist/components/cursor/TeslaCursor.js +223 -0
- package/dist/components/cursor/clickActions/BoltFlashAction.d.ts +11 -0
- package/dist/components/cursor/clickActions/BoltFlashAction.d.ts.map +1 -0
- package/dist/components/cursor/clickActions/BoltFlashAction.js +62 -0
- package/dist/components/cursor/clickActions/GlyphInscriptionAction.d.ts +11 -0
- package/dist/components/cursor/clickActions/GlyphInscriptionAction.d.ts.map +1 -0
- package/dist/components/cursor/clickActions/GlyphInscriptionAction.js +114 -0
- package/dist/components/cursor/clickActions/ImplosionAction.d.ts +11 -0
- package/dist/components/cursor/clickActions/ImplosionAction.d.ts.map +1 -0
- package/dist/components/cursor/clickActions/ImplosionAction.js +93 -0
- package/dist/components/cursor/clickActions/PhaseShiftAction.d.ts +11 -0
- package/dist/components/cursor/clickActions/PhaseShiftAction.d.ts.map +1 -0
- package/dist/components/cursor/clickActions/PhaseShiftAction.js +71 -0
- package/dist/components/cursor/clickActions/PlasmaBombAction.d.ts +11 -0
- package/dist/components/cursor/clickActions/PlasmaBombAction.d.ts.map +1 -0
- package/dist/components/cursor/clickActions/PlasmaBombAction.js +98 -0
- package/dist/components/cursor/clickActions/RealityTearAction.d.ts +11 -0
- package/dist/components/cursor/clickActions/RealityTearAction.d.ts.map +1 -0
- package/dist/components/cursor/clickActions/RealityTearAction.js +92 -0
- package/dist/components/cursor/clickActions/ShockwaveAction.d.ts +11 -0
- package/dist/components/cursor/clickActions/ShockwaveAction.d.ts.map +1 -0
- package/dist/components/cursor/clickActions/ShockwaveAction.js +55 -0
- package/dist/components/cursor/clickActions/SparklesBurstAction.d.ts +11 -0
- package/dist/components/cursor/clickActions/SparklesBurstAction.d.ts.map +1 -0
- package/dist/components/cursor/clickActions/SparklesBurstAction.js +99 -0
- package/dist/components/cursor/clickActions/VoronoiFractureAction.d.ts +11 -0
- package/dist/components/cursor/clickActions/VoronoiFractureAction.d.ts.map +1 -0
- package/dist/components/cursor/clickActions/VoronoiFractureAction.js +149 -0
- package/dist/components/effects/AuraEffect.d.ts +10 -0
- package/dist/components/effects/AuraEffect.d.ts.map +1 -0
- package/dist/components/effects/AuraEffect.js +127 -0
- package/dist/components/effects/AuroraEffect.d.ts +10 -0
- package/dist/components/effects/AuroraEffect.d.ts.map +1 -0
- package/dist/components/effects/AuroraEffect.js +112 -0
- package/dist/components/effects/BlackHoleEffect.d.ts +10 -0
- package/dist/components/effects/BlackHoleEffect.d.ts.map +1 -0
- package/dist/components/effects/BlackHoleEffect.js +193 -0
- package/dist/components/effects/ConstellationEffect.d.ts +10 -0
- package/dist/components/effects/ConstellationEffect.d.ts.map +1 -0
- package/dist/components/effects/ConstellationEffect.js +189 -0
- package/dist/components/effects/DataStreamEffect.d.ts +10 -0
- package/dist/components/effects/DataStreamEffect.d.ts.map +1 -0
- package/dist/components/effects/DataStreamEffect.js +138 -0
- package/dist/components/effects/DnaHelixEffect.d.ts +10 -0
- package/dist/components/effects/DnaHelixEffect.d.ts.map +1 -0
- package/dist/components/effects/DnaHelixEffect.js +311 -0
- package/dist/components/effects/Fire.d.ts +20 -0
- package/dist/components/effects/Fire.d.ts.map +1 -0
- package/dist/components/effects/Fire.js +208 -0
- package/dist/components/effects/FireEffect.d.ts +10 -0
- package/dist/components/effects/FireEffect.d.ts.map +1 -0
- package/dist/components/effects/FireEffect.js +194 -0
- package/dist/components/effects/ForcefieldEffect.d.ts +10 -0
- package/dist/components/effects/ForcefieldEffect.d.ts.map +1 -0
- package/dist/components/effects/ForcefieldEffect.js +132 -0
- package/dist/components/effects/HologramEffect.d.ts +10 -0
- package/dist/components/effects/HologramEffect.d.ts.map +1 -0
- package/dist/components/effects/HologramEffect.js +143 -0
- package/dist/components/effects/IceCrystalsEffect.d.ts +10 -0
- package/dist/components/effects/IceCrystalsEffect.d.ts.map +1 -0
- package/dist/components/effects/IceCrystalsEffect.js +190 -0
- package/dist/components/effects/LightningEffect.d.ts +10 -0
- package/dist/components/effects/LightningEffect.d.ts.map +1 -0
- package/dist/components/effects/LightningEffect.js +240 -0
- package/dist/components/effects/MoleculesEffect.d.ts +10 -0
- package/dist/components/effects/MoleculesEffect.d.ts.map +1 -0
- package/dist/components/effects/MoleculesEffect.js +173 -0
- package/dist/components/effects/NeuralNetworkEffect.d.ts +10 -0
- package/dist/components/effects/NeuralNetworkEffect.d.ts.map +1 -0
- package/dist/components/effects/NeuralNetworkEffect.js +188 -0
- package/dist/components/effects/OrbEffect.d.ts +10 -0
- package/dist/components/effects/OrbEffect.d.ts.map +1 -0
- package/dist/components/effects/OrbEffect.js +291 -0
- package/dist/components/effects/PortalEffect.d.ts +10 -0
- package/dist/components/effects/PortalEffect.d.ts.map +1 -0
- package/dist/components/effects/PortalEffect.js +191 -0
- package/dist/components/effects/ShockwaveEffect.d.ts +10 -0
- package/dist/components/effects/ShockwaveEffect.d.ts.map +1 -0
- package/dist/components/effects/ShockwaveEffect.js +160 -0
- package/dist/components/effects/SmokePlumeEffect.d.ts +10 -0
- package/dist/components/effects/SmokePlumeEffect.d.ts.map +1 -0
- package/dist/components/effects/SmokePlumeEffect.js +141 -0
- package/dist/components/effects/SmokeRibbon.d.ts +13 -0
- package/dist/components/effects/SmokeRibbon.d.ts.map +1 -0
- package/dist/components/effects/SmokeRibbon.js +69 -0
- package/dist/components/effects/SmokeRingEffect.d.ts +10 -0
- package/dist/components/effects/SmokeRingEffect.d.ts.map +1 -0
- package/dist/components/effects/SmokeRingEffect.js +158 -0
- package/dist/components/effects/VolumetricFogEffect.d.ts +10 -0
- package/dist/components/effects/VolumetricFogEffect.d.ts.map +1 -0
- package/dist/components/effects/VolumetricFogEffect.js +111 -0
- package/dist/components/extractOutline.d.ts +18 -0
- package/dist/components/extractOutline.d.ts.map +1 -0
- package/dist/components/extractOutline.js +47 -0
- package/dist/constants.d.ts +2 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +5 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/use3driseShader.d.ts +17 -0
- package/dist/hooks/use3driseShader.d.ts.map +1 -0
- package/dist/hooks/use3driseShader.js +100 -0
- package/dist/hooks/useAnimationEvents.d.ts +10 -0
- package/dist/hooks/useAnimationEvents.d.ts.map +1 -0
- package/dist/hooks/useAnimationEvents.js +49 -0
- package/dist/hooks/useCameraAnimation.d.ts +35 -0
- package/dist/hooks/useCameraAnimation.d.ts.map +1 -0
- package/dist/hooks/useCameraAnimation.js +277 -0
- package/dist/hooks/useContinuousEffects.d.ts +15 -0
- package/dist/hooks/useContinuousEffects.d.ts.map +1 -0
- package/dist/hooks/useContinuousEffects.js +177 -0
- package/dist/hooks/useCubeCamera.d.ts +18 -0
- package/dist/hooks/useCubeCamera.d.ts.map +1 -0
- package/dist/hooks/useCubeCamera.js +73 -0
- package/dist/hooks/useEnvironmentEffects.d.ts +12 -0
- package/dist/hooks/useEnvironmentEffects.d.ts.map +1 -0
- package/dist/hooks/useEnvironmentEffects.js +22 -0
- package/dist/hooks/useFrameAnimations.d.ts +24 -0
- package/dist/hooks/useFrameAnimations.d.ts.map +1 -0
- package/dist/hooks/useFrameAnimations.js +217 -0
- package/dist/hooks/useFrameEffects.d.ts +6 -0
- package/dist/hooks/useFrameEffects.d.ts.map +1 -0
- package/dist/hooks/useFrameEffects.js +19 -0
- package/dist/hooks/useGsapAnimation.d.ts +122 -0
- package/dist/hooks/useGsapAnimation.d.ts.map +1 -0
- package/dist/hooks/useGsapAnimation.js +316 -0
- package/dist/hooks/useInteraction.d.ts +12 -0
- package/dist/hooks/useInteraction.d.ts.map +1 -0
- package/dist/hooks/useInteraction.js +273 -0
- package/dist/hooks/useInteractionEffects.d.ts +11 -0
- package/dist/hooks/useInteractionEffects.d.ts.map +1 -0
- package/dist/hooks/useInteractionEffects.js +74 -0
- package/dist/hooks/useKey.d.ts +26 -0
- package/dist/hooks/useKey.d.ts.map +1 -0
- package/dist/hooks/useKey.js +73 -0
- package/dist/hooks/useLightAnimation.d.ts +10 -0
- package/dist/hooks/useLightAnimation.d.ts.map +1 -0
- package/dist/hooks/useLightAnimation.js +34 -0
- package/dist/hooks/useLightHandlers.d.ts +14 -0
- package/dist/hooks/useLightHandlers.d.ts.map +1 -0
- package/dist/hooks/useLightHandlers.js +116 -0
- package/dist/hooks/useLightMouseMove.d.ts +11 -0
- package/dist/hooks/useLightMouseMove.d.ts.map +1 -0
- package/dist/hooks/useLightMouseMove.js +27 -0
- package/dist/hooks/useLightShadow.d.ts +6 -0
- package/dist/hooks/useLightShadow.d.ts.map +1 -0
- package/dist/hooks/useLightShadow.js +63 -0
- package/dist/hooks/useMaterialApplication.d.ts +4 -0
- package/dist/hooks/useMaterialApplication.d.ts.map +1 -0
- package/dist/hooks/useMaterialApplication.js +157 -0
- package/dist/hooks/useMaterialOptions.d.ts +14 -0
- package/dist/hooks/useMaterialOptions.d.ts.map +1 -0
- package/dist/hooks/useMaterialOptions.js +118 -0
- package/dist/hooks/useMaterialUniforms.d.ts +18 -0
- package/dist/hooks/useMaterialUniforms.d.ts.map +1 -0
- package/dist/hooks/useMaterialUniforms.js +96 -0
- package/dist/hooks/useMeshController.d.ts +3 -0
- package/dist/hooks/useMeshController.d.ts.map +1 -0
- package/dist/hooks/useMeshController.js +168 -0
- package/dist/hooks/useMouseHandlers.d.ts +8 -0
- package/dist/hooks/useMouseHandlers.d.ts.map +1 -0
- package/dist/hooks/useMouseHandlers.js +47 -0
- package/dist/hooks/useNumericAnimation.d.ts +5 -0
- package/dist/hooks/useNumericAnimation.d.ts.map +1 -0
- package/dist/hooks/useNumericAnimation.js +42 -0
- package/dist/hooks/useObjectAnimation.d.ts +13 -0
- package/dist/hooks/useObjectAnimation.d.ts.map +1 -0
- package/dist/hooks/useObjectAnimation.js +35 -0
- package/dist/hooks/useObjectEdges.d.ts +3 -0
- package/dist/hooks/useObjectEdges.d.ts.map +1 -0
- package/dist/hooks/useObjectEdges.js +199 -0
- package/dist/hooks/useObjectEffects.d.ts +23 -0
- package/dist/hooks/useObjectEffects.d.ts.map +1 -0
- package/dist/hooks/useObjectEffects.js +162 -0
- package/dist/hooks/useOrbitControls.d.ts +7 -0
- package/dist/hooks/useOrbitControls.d.ts.map +1 -0
- package/dist/hooks/useOrbitControls.js +9 -0
- package/dist/hooks/useOutline.d.ts +9 -0
- package/dist/hooks/useOutline.d.ts.map +1 -0
- package/dist/hooks/useOutline.js +14 -0
- package/dist/hooks/useParticlePositions.d.ts +19 -0
- package/dist/hooks/useParticlePositions.d.ts.map +1 -0
- package/dist/hooks/useParticlePositions.js +56 -0
- package/dist/hooks/useParticlesColors.d.ts +14 -0
- package/dist/hooks/useParticlesColors.d.ts.map +1 -0
- package/dist/hooks/useParticlesColors.js +27 -0
- package/dist/hooks/useParticlesTextures.d.ts +10 -0
- package/dist/hooks/useParticlesTextures.d.ts.map +1 -0
- package/dist/hooks/useParticlesTextures.js +23 -0
- package/dist/hooks/usePathAnimation.d.ts +26 -0
- package/dist/hooks/usePathAnimation.d.ts.map +1 -0
- package/dist/hooks/usePathAnimation.js +130 -0
- package/dist/hooks/useSequenceAnimation.d.ts +14 -0
- package/dist/hooks/useSequenceAnimation.d.ts.map +1 -0
- package/dist/hooks/useSequenceAnimation.js +260 -0
- package/dist/hooks/useShadowApplication.d.ts +3 -0
- package/dist/hooks/useShadowApplication.d.ts.map +1 -0
- package/dist/hooks/useShadowApplication.js +31 -0
- package/dist/hooks/useShapeGeometry.d.ts +8 -0
- package/dist/hooks/useShapeGeometry.d.ts.map +1 -0
- package/dist/hooks/useShapeGeometry.js +12 -0
- package/dist/hooks/useSkyAnimation.d.ts +13 -0
- package/dist/hooks/useSkyAnimation.d.ts.map +1 -0
- package/dist/hooks/useSkyAnimation.js +36 -0
- package/dist/hooks/useSkySystem.d.ts +25 -0
- package/dist/hooks/useSkySystem.d.ts.map +1 -0
- package/dist/hooks/useSkySystem.js +59 -0
- package/dist/hooks/useSkyUniforms.d.ts +18 -0
- package/dist/hooks/useSkyUniforms.d.ts.map +1 -0
- package/dist/hooks/useSkyUniforms.js +71 -0
- package/dist/hooks/useTransformControls.d.ts +6 -0
- package/dist/hooks/useTransformControls.d.ts.map +1 -0
- package/dist/hooks/useTransformControls.js +111 -0
- package/dist/hooks/useVolumePoints.d.ts +9 -0
- package/dist/hooks/useVolumePoints.d.ts.map +1 -0
- package/dist/hooks/useVolumePoints.js +22 -0
- package/dist/hooks/useWaterEnvironment.d.ts +5 -0
- package/dist/hooks/useWaterEnvironment.d.ts.map +1 -0
- package/dist/hooks/useWaterEnvironment.js +27 -0
- package/dist/hooks/useWaterReflections.d.ts +18 -0
- package/dist/hooks/useWaterReflections.d.ts.map +1 -0
- package/dist/hooks/useWaterReflections.js +84 -0
- package/dist/index.d.ts +146 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +119 -0
- package/dist/services/AnimationsManager.d.ts +33 -0
- package/dist/services/AnimationsManager.d.ts.map +1 -0
- package/dist/services/AnimationsManager.js +58 -0
- package/dist/services/FontManager.d.ts +32 -0
- package/dist/services/FontManager.d.ts.map +1 -0
- package/dist/services/FontManager.js +76 -0
- package/dist/services/TexturesManager.d.ts +17 -0
- package/dist/services/TexturesManager.d.ts.map +1 -0
- package/dist/services/TexturesManager.js +48 -0
- package/dist/shaders/RainMaterial.d.ts +34 -0
- package/dist/shaders/RainMaterial.d.ts.map +1 -0
- package/dist/shaders/RainMaterial.js +56 -0
- package/dist/shaders/ShaderEffectsMaterial.d.ts +228 -0
- package/dist/shaders/ShaderEffectsMaterial.d.ts.map +1 -0
- package/dist/shaders/ShaderEffectsMaterial.js +233 -0
- package/dist/shaders/ShootingStarMaterial.d.ts +14 -0
- package/dist/shaders/ShootingStarMaterial.d.ts.map +1 -0
- package/dist/shaders/ShootingStarMaterial.js +33 -0
- package/dist/shaders/SkyboxMaterial.d.ts +38 -0
- package/dist/shaders/SkyboxMaterial.d.ts.map +1 -0
- package/dist/shaders/SkyboxMaterial.js +57 -0
- package/dist/shaders/effects/EffectsVertexFunctions.glsl.d.ts +2 -0
- package/dist/shaders/effects/EffectsVertexFunctions.glsl.d.ts.map +1 -0
- package/dist/shaders/effects/EffectsVertexFunctions.glsl.js +115 -0
- package/dist/utils/CameraSingleton.d.ts +43 -0
- package/dist/utils/CameraSingleton.d.ts.map +1 -0
- package/dist/utils/CameraSingleton.js +199 -0
- package/dist/utils/anchorUtils.d.ts +10 -0
- package/dist/utils/anchorUtils.d.ts.map +1 -0
- package/dist/utils/anchorUtils.js +13 -0
- package/dist/utils/cursorPicking.d.ts +8 -0
- package/dist/utils/cursorPicking.d.ts.map +1 -0
- package/dist/utils/cursorPicking.js +35 -0
- package/dist/utils/extractOutline.d.ts +18 -0
- package/dist/utils/extractOutline.d.ts.map +1 -0
- package/dist/utils/extractOutline.js +47 -0
- package/dist/utils/frameAnimations.d.ts +49 -0
- package/dist/utils/frameAnimations.d.ts.map +1 -0
- package/dist/utils/frameAnimations.js +213 -0
- package/dist/utils/handleGenerativeEffectsAnimations.d.ts +5 -0
- package/dist/utils/handleGenerativeEffectsAnimations.d.ts.map +1 -0
- package/dist/utils/handleGenerativeEffectsAnimations.js +268 -0
- package/dist/utils/hasHoverAnimation.d.ts +3 -0
- package/dist/utils/hasHoverAnimation.d.ts.map +1 -0
- package/dist/utils/hasHoverAnimation.js +15 -0
- package/dist/utils/materialUtils.d.ts +23 -0
- package/dist/utils/materialUtils.d.ts.map +1 -0
- package/dist/utils/materialUtils.js +81 -0
- package/dist/utils/particleAnimations.d.ts +3 -0
- package/dist/utils/particleAnimations.d.ts.map +1 -0
- package/dist/utils/particleAnimations.js +17 -0
- package/dist/utils/sampleVolume.d.ts +21 -0
- package/dist/utils/sampleVolume.d.ts.map +1 -0
- package/dist/utils/sampleVolume.js +44 -0
- package/dist/utils/sceneQuery.d.ts +9 -0
- package/dist/utils/sceneQuery.d.ts.map +1 -0
- package/dist/utils/sceneQuery.js +22 -0
- package/dist/utils/shaderUtils.d.ts +6 -0
- package/dist/utils/shaderUtils.d.ts.map +1 -0
- package/dist/utils/shaderUtils.js +151 -0
- package/dist/utils/shapes.d.ts +74 -0
- package/dist/utils/shapes.d.ts.map +1 -0
- package/dist/utils/shapes.js +443 -0
- package/dist/utils/textEffects.d.ts +31 -0
- package/dist/utils/textEffects.d.ts.map +1 -0
- package/dist/utils/textEffects.js +61 -0
- package/dist/utils/utils3d.d.ts +7 -0
- package/dist/utils/utils3d.d.ts.map +1 -0
- package/dist/utils/utils3d.js +34 -0
- package/package.json +44 -0
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
+
import { useFrame, useThree } from '@react-three/fiber';
|
|
4
|
+
import * as THREE from 'three';
|
|
5
|
+
import { gsap } from 'gsap';
|
|
6
|
+
import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
|
|
7
|
+
const CUBE_SIZE = 256;
|
|
8
|
+
const MODE_INDEX = {
|
|
9
|
+
crossfade: 0,
|
|
10
|
+
wipe: 1,
|
|
11
|
+
iris: 2,
|
|
12
|
+
dissolve: 3,
|
|
13
|
+
'vertical-divider': 4,
|
|
14
|
+
'horizontal-divider': 5,
|
|
15
|
+
};
|
|
16
|
+
const isDividerMode = (m) => m === 4 || m === 5;
|
|
17
|
+
// ── Shaders ─────────────────────────────────────────────────────────────────
|
|
18
|
+
const cubeVertexShader = /* glsl */ `
|
|
19
|
+
varying vec3 vDir;
|
|
20
|
+
void main() {
|
|
21
|
+
vDir = position;
|
|
22
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
25
|
+
const cubeFragmentShader = /* glsl */ `
|
|
26
|
+
precision highp float;
|
|
27
|
+
uniform samplerCube tA;
|
|
28
|
+
uniform samplerCube tB;
|
|
29
|
+
uniform float uMix;
|
|
30
|
+
uniform int uMode;
|
|
31
|
+
uniform vec3 uWipeAxis;
|
|
32
|
+
uniform vec3 uIrisCenter;
|
|
33
|
+
uniform float uNoiseScale;
|
|
34
|
+
uniform float uFeather;
|
|
35
|
+
varying vec3 vDir;
|
|
36
|
+
|
|
37
|
+
float hash3(vec3 p) {
|
|
38
|
+
p = fract(p * vec3(0.1031, 0.1030, 0.0973));
|
|
39
|
+
p += dot(p, p.yzx + 33.33);
|
|
40
|
+
return fract((p.x + p.y) * p.z);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
float noise3(vec3 p) {
|
|
44
|
+
vec3 i = floor(p);
|
|
45
|
+
vec3 f = fract(p);
|
|
46
|
+
f = f * f * (3.0 - 2.0 * f);
|
|
47
|
+
float n000 = hash3(i);
|
|
48
|
+
float n100 = hash3(i + vec3(1.0, 0.0, 0.0));
|
|
49
|
+
float n010 = hash3(i + vec3(0.0, 1.0, 0.0));
|
|
50
|
+
float n110 = hash3(i + vec3(1.0, 1.0, 0.0));
|
|
51
|
+
float n001 = hash3(i + vec3(0.0, 0.0, 1.0));
|
|
52
|
+
float n101 = hash3(i + vec3(1.0, 0.0, 1.0));
|
|
53
|
+
float n011 = hash3(i + vec3(0.0, 1.0, 1.0));
|
|
54
|
+
float n111 = hash3(i + vec3(1.0, 1.0, 1.0));
|
|
55
|
+
float nx00 = mix(n000, n100, f.x);
|
|
56
|
+
float nx10 = mix(n010, n110, f.x);
|
|
57
|
+
float nx01 = mix(n001, n101, f.x);
|
|
58
|
+
float nx11 = mix(n011, n111, f.x);
|
|
59
|
+
float nxy0 = mix(nx00, nx10, f.y);
|
|
60
|
+
float nxy1 = mix(nx01, nx11, f.y);
|
|
61
|
+
return mix(nxy0, nxy1, f.z);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
void main() {
|
|
65
|
+
vec3 dir = normalize(vDir);
|
|
66
|
+
vec4 a = textureCube(tA, dir);
|
|
67
|
+
vec4 b = textureCube(tB, dir);
|
|
68
|
+
float blend;
|
|
69
|
+
|
|
70
|
+
if (uMode == 0) {
|
|
71
|
+
blend = uMix;
|
|
72
|
+
} else if (uMode == 1) {
|
|
73
|
+
float s = dot(dir, normalize(uWipeAxis)) * 0.5 + 0.5;
|
|
74
|
+
float adj = uMix * (1.0 + 2.0 * uFeather) - uFeather;
|
|
75
|
+
blend = 1.0 - smoothstep(adj - uFeather, adj + uFeather, s);
|
|
76
|
+
} else if (uMode == 2) {
|
|
77
|
+
float ang = acos(clamp(dot(dir, normalize(uIrisCenter)), -1.0, 1.0));
|
|
78
|
+
float radius = uMix * (3.14159265 + 2.0 * uFeather) - uFeather;
|
|
79
|
+
blend = 1.0 - smoothstep(radius - uFeather, radius + uFeather, ang);
|
|
80
|
+
} else {
|
|
81
|
+
float n = noise3(dir * uNoiseScale);
|
|
82
|
+
float adj = uMix * (1.0 + 2.0 * uFeather) - uFeather;
|
|
83
|
+
blend = 1.0 - smoothstep(adj - uFeather, adj + uFeather, n);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
gl_FragColor = mix(a, b, blend);
|
|
87
|
+
}
|
|
88
|
+
`;
|
|
89
|
+
const bgVertexShader = /* glsl */ `
|
|
90
|
+
uniform mat4 uCamWorldMatrix;
|
|
91
|
+
uniform mat4 uProjMatrixInv;
|
|
92
|
+
varying vec3 vWorldDir;
|
|
93
|
+
varying vec2 vScreenUV;
|
|
94
|
+
void main() {
|
|
95
|
+
vScreenUV = position.xy * 0.5 + 0.5;
|
|
96
|
+
vec4 viewPos = uProjMatrixInv * vec4(position.xy, 1.0, 1.0);
|
|
97
|
+
viewPos /= viewPos.w;
|
|
98
|
+
vWorldDir = (uCamWorldMatrix * vec4(viewPos.xyz, 0.0)).xyz;
|
|
99
|
+
gl_Position = vec4(position.xy, 1.0, 1.0);
|
|
100
|
+
}
|
|
101
|
+
`;
|
|
102
|
+
const bgFragmentShader = /* glsl */ `
|
|
103
|
+
precision highp float;
|
|
104
|
+
uniform samplerCube tA;
|
|
105
|
+
uniform samplerCube tB;
|
|
106
|
+
uniform int uMode;
|
|
107
|
+
uniform float uDividerX;
|
|
108
|
+
uniform float uDividerY;
|
|
109
|
+
uniform float uFeather;
|
|
110
|
+
varying vec3 vWorldDir;
|
|
111
|
+
varying vec2 vScreenUV;
|
|
112
|
+
void main() {
|
|
113
|
+
vec3 dir = normalize(vWorldDir);
|
|
114
|
+
vec4 a = textureCube(tA, dir);
|
|
115
|
+
vec4 b = textureCube(tB, dir);
|
|
116
|
+
float blend;
|
|
117
|
+
if (uMode == 4) {
|
|
118
|
+
blend = smoothstep(uDividerX - uFeather, uDividerX + uFeather, vScreenUV.x);
|
|
119
|
+
} else {
|
|
120
|
+
blend = smoothstep(uDividerY - uFeather, uDividerY + uFeather, vScreenUV.y);
|
|
121
|
+
}
|
|
122
|
+
gl_FragColor = mix(a, b, blend);
|
|
123
|
+
}
|
|
124
|
+
`;
|
|
125
|
+
// ── Loader ──────────────────────────────────────────────────────────────────
|
|
126
|
+
const loadEquirectHdr = (url) => new Promise((resolve, reject) => {
|
|
127
|
+
const loader = new RGBELoader();
|
|
128
|
+
loader.setDataType(THREE.HalfFloatType);
|
|
129
|
+
loader.load(url, (tex) => resolve(tex), undefined, reject);
|
|
130
|
+
});
|
|
131
|
+
// ── Order policy ────────────────────────────────────────────────────────────
|
|
132
|
+
const pickNext = (order, current, length, directionRef) => {
|
|
133
|
+
if (length <= 1)
|
|
134
|
+
return current;
|
|
135
|
+
if (order === 'sequential')
|
|
136
|
+
return (current + 1) % length;
|
|
137
|
+
if (order === 'random') {
|
|
138
|
+
let pick = current;
|
|
139
|
+
while (pick === current)
|
|
140
|
+
pick = Math.floor(Math.random() * length);
|
|
141
|
+
return pick;
|
|
142
|
+
}
|
|
143
|
+
// yoyo
|
|
144
|
+
let next = current + directionRef.current;
|
|
145
|
+
if (next >= length) {
|
|
146
|
+
directionRef.current = -1;
|
|
147
|
+
next = current - 1;
|
|
148
|
+
}
|
|
149
|
+
else if (next < 0) {
|
|
150
|
+
directionRef.current = 1;
|
|
151
|
+
next = current + 1;
|
|
152
|
+
}
|
|
153
|
+
return next;
|
|
154
|
+
};
|
|
155
|
+
// ── Component ───────────────────────────────────────────────────────────────
|
|
156
|
+
const HdrPlaylistRenderer = ({ urls, transition }) => {
|
|
157
|
+
const { scene, gl: renderer, camera } = useThree();
|
|
158
|
+
const mixRef = useRef(0);
|
|
159
|
+
const tlRef = useRef(null);
|
|
160
|
+
const stateRef = useRef(null);
|
|
161
|
+
const modeRef = useRef(MODE_INDEX[transition.types[0] ?? 'crossfade']);
|
|
162
|
+
const currentIdxRef = useRef(0);
|
|
163
|
+
const yoyoDirRef = useRef(1);
|
|
164
|
+
const typeIdxRef = useRef(0);
|
|
165
|
+
// Live transition snapshot — read each frame so slider changes apply instantly
|
|
166
|
+
// without rebuilding GPU resources or the timeline.
|
|
167
|
+
const transitionRef = useRef(transition);
|
|
168
|
+
useEffect(() => {
|
|
169
|
+
transitionRef.current = transition;
|
|
170
|
+
}, [transition]);
|
|
171
|
+
const bgMeshRef = useRef(null);
|
|
172
|
+
// Gates the timeline-build effect on the cube-RT pipeline being ready.
|
|
173
|
+
// Replaces a previous rAF poll — flips false → true once HDRs load and
|
|
174
|
+
// stateRef.current is populated, and back to false on URL/teardown changes.
|
|
175
|
+
const [pipelineReady, setPipelineReady] = useState(false);
|
|
176
|
+
// Stable uniforms object for the bg shader. Must NOT be inline JSX literal —
|
|
177
|
+
// R3F reassigns material.uniforms on parent re-render and would wipe tA/tB.
|
|
178
|
+
const bgUniforms = useMemo(() => ({
|
|
179
|
+
tA: { value: null },
|
|
180
|
+
tB: { value: null },
|
|
181
|
+
uMode: { value: 4 },
|
|
182
|
+
uDividerX: { value: 0.5 },
|
|
183
|
+
uDividerY: { value: 0.5 },
|
|
184
|
+
uFeather: { value: transition.dividerFeather ?? 0.003 },
|
|
185
|
+
uCamWorldMatrix: { value: new THREE.Matrix4() },
|
|
186
|
+
uProjMatrixInv: { value: new THREE.Matrix4() },
|
|
187
|
+
}),
|
|
188
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
189
|
+
[]);
|
|
190
|
+
// ── Build cube RTs + blend pipeline (rebuilds only when urls change) ──────
|
|
191
|
+
const urlsKey = urls.join('|');
|
|
192
|
+
useEffect(() => {
|
|
193
|
+
let disposed = false;
|
|
194
|
+
(async () => {
|
|
195
|
+
let equirects = [];
|
|
196
|
+
try {
|
|
197
|
+
equirects = await Promise.all(urls.map(loadEquirectHdr));
|
|
198
|
+
}
|
|
199
|
+
catch (err) {
|
|
200
|
+
console.error('[HdrPlaylistRenderer] HDR load failed', err);
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
if (disposed) {
|
|
204
|
+
equirects.forEach((t) => t.dispose());
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
const cubeRTOpts = {
|
|
208
|
+
type: THREE.HalfFloatType,
|
|
209
|
+
format: THREE.RGBAFormat,
|
|
210
|
+
generateMipmaps: true,
|
|
211
|
+
minFilter: THREE.LinearMipmapLinearFilter,
|
|
212
|
+
};
|
|
213
|
+
const cubeRTs = equirects.map((eq) => {
|
|
214
|
+
const rt = new THREE.WebGLCubeRenderTarget(CUBE_SIZE, cubeRTOpts);
|
|
215
|
+
rt.fromEquirectangularTexture(renderer, eq);
|
|
216
|
+
eq.dispose();
|
|
217
|
+
return rt;
|
|
218
|
+
});
|
|
219
|
+
const outRT = new THREE.WebGLCubeRenderTarget(CUBE_SIZE, cubeRTOpts);
|
|
220
|
+
const cubeCamera = new THREE.CubeCamera(0.1, 10, outRT);
|
|
221
|
+
const material = new THREE.ShaderMaterial({
|
|
222
|
+
uniforms: {
|
|
223
|
+
tA: { value: cubeRTs[0].texture },
|
|
224
|
+
tB: { value: cubeRTs[1 % cubeRTs.length].texture },
|
|
225
|
+
uMix: { value: 0 },
|
|
226
|
+
uMode: { value: 0 },
|
|
227
|
+
uWipeAxis: { value: new THREE.Vector3(0, 1, 0) },
|
|
228
|
+
uIrisCenter: { value: new THREE.Vector3(0, 1, 0) },
|
|
229
|
+
uNoiseScale: { value: 4.0 },
|
|
230
|
+
uFeather: { value: 0.07 },
|
|
231
|
+
},
|
|
232
|
+
vertexShader: cubeVertexShader,
|
|
233
|
+
fragmentShader: cubeFragmentShader,
|
|
234
|
+
side: THREE.BackSide,
|
|
235
|
+
});
|
|
236
|
+
const geo = new THREE.BoxGeometry(1, 1, 1);
|
|
237
|
+
const mesh = new THREE.Mesh(geo, material);
|
|
238
|
+
const blendScene = new THREE.Scene();
|
|
239
|
+
blendScene.add(mesh);
|
|
240
|
+
blendScene.add(cubeCamera);
|
|
241
|
+
stateRef.current = {
|
|
242
|
+
blendScene,
|
|
243
|
+
cubeCamera,
|
|
244
|
+
outRT,
|
|
245
|
+
material,
|
|
246
|
+
cubeRTs,
|
|
247
|
+
mesh,
|
|
248
|
+
};
|
|
249
|
+
bgUniforms.tA.value = cubeRTs[0].texture;
|
|
250
|
+
bgUniforms.tB.value = cubeRTs[1 % cubeRTs.length].texture;
|
|
251
|
+
currentIdxRef.current = 0;
|
|
252
|
+
yoyoDirRef.current = 1;
|
|
253
|
+
// Signal readiness AFTER stateRef is populated. The timeline-build effect
|
|
254
|
+
// listens for this and runs without polling.
|
|
255
|
+
setPipelineReady(true);
|
|
256
|
+
})();
|
|
257
|
+
return () => {
|
|
258
|
+
disposed = true;
|
|
259
|
+
setPipelineReady(false);
|
|
260
|
+
const s = stateRef.current;
|
|
261
|
+
if (s) {
|
|
262
|
+
s.outRT.dispose();
|
|
263
|
+
s.cubeRTs.forEach((rt) => rt.dispose());
|
|
264
|
+
s.material.dispose();
|
|
265
|
+
s.mesh.geometry.dispose();
|
|
266
|
+
}
|
|
267
|
+
stateRef.current = null;
|
|
268
|
+
};
|
|
269
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
270
|
+
}, [urlsKey, renderer, bgUniforms]);
|
|
271
|
+
// ── Build/rebuild GSAP timeline when timing-or-order props change ──────────
|
|
272
|
+
// Gated on `pipelineReady` so we never run before stateRef.current is
|
|
273
|
+
// populated — no rAF polling needed; React schedules us once the pipeline
|
|
274
|
+
// effect calls setPipelineReady(true).
|
|
275
|
+
useEffect(() => {
|
|
276
|
+
if (!pipelineReady)
|
|
277
|
+
return;
|
|
278
|
+
const s = stateRef.current;
|
|
279
|
+
if (!s)
|
|
280
|
+
return;
|
|
281
|
+
let cancelled = false;
|
|
282
|
+
tlRef.current?.kill();
|
|
283
|
+
const fadeSec = Math.max(0.05, transition.durationMs / 1000);
|
|
284
|
+
const holdSec = Math.max(0, transition.holdMs / 1000);
|
|
285
|
+
const stepTo = (target) => {
|
|
286
|
+
const tl = gsap.timeline();
|
|
287
|
+
tl.to({}, { duration: holdSec });
|
|
288
|
+
tl.to(mixRef, { current: target, duration: fadeSec, ease: 'sine.inOut' });
|
|
289
|
+
return tl;
|
|
290
|
+
};
|
|
291
|
+
const advance = () => {
|
|
292
|
+
if (cancelled || !stateRef.current)
|
|
293
|
+
return;
|
|
294
|
+
const st = stateRef.current;
|
|
295
|
+
const length = st.cubeRTs.length;
|
|
296
|
+
const cur = currentIdxRef.current;
|
|
297
|
+
const next = pickNext(transitionRef.current.order, cur, length, yoyoDirRef);
|
|
298
|
+
const types = transitionRef.current.types?.length
|
|
299
|
+
? transitionRef.current.types
|
|
300
|
+
: ['crossfade'];
|
|
301
|
+
const legType = types[typeIdxRef.current % types.length];
|
|
302
|
+
const legMode = MODE_INDEX[legType];
|
|
303
|
+
st.material.uniforms.uMode.value = isDividerMode(legMode) ? 0 : legMode;
|
|
304
|
+
st.material.uniforms.tA.value = st.cubeRTs[cur].texture;
|
|
305
|
+
st.material.uniforms.tB.value = st.cubeRTs[next].texture;
|
|
306
|
+
bgUniforms.tA.value = st.cubeRTs[cur].texture;
|
|
307
|
+
bgUniforms.tB.value = st.cubeRTs[next].texture;
|
|
308
|
+
modeRef.current = legMode;
|
|
309
|
+
mixRef.current = 0;
|
|
310
|
+
const tl = stepTo(1);
|
|
311
|
+
tl.eventCallback('onComplete', () => {
|
|
312
|
+
currentIdxRef.current = next;
|
|
313
|
+
typeIdxRef.current += 1;
|
|
314
|
+
if (!cancelled)
|
|
315
|
+
advance();
|
|
316
|
+
});
|
|
317
|
+
tlRef.current = tl;
|
|
318
|
+
};
|
|
319
|
+
advance();
|
|
320
|
+
return () => {
|
|
321
|
+
cancelled = true;
|
|
322
|
+
tlRef.current?.kill();
|
|
323
|
+
tlRef.current = null;
|
|
324
|
+
};
|
|
325
|
+
}, [pipelineReady, transition.durationMs, transition.holdMs, transition.order, urlsKey, bgUniforms]);
|
|
326
|
+
// ── Per-frame: render the blend and assign to scene ─────────────────────────
|
|
327
|
+
useFrame(() => {
|
|
328
|
+
const s = stateRef.current;
|
|
329
|
+
if (!s)
|
|
330
|
+
return;
|
|
331
|
+
const t = transitionRef.current;
|
|
332
|
+
s.material.uniforms.uMix.value = mixRef.current;
|
|
333
|
+
s.material.uniforms.uFeather.value = t.feather ?? 0.07;
|
|
334
|
+
s.material.uniforms.uNoiseScale.value = t.noiseScale ?? 4.0;
|
|
335
|
+
if (t.wipeAxis)
|
|
336
|
+
s.material.uniforms.uWipeAxis.value.set(...t.wipeAxis);
|
|
337
|
+
if (t.irisCenter)
|
|
338
|
+
s.material.uniforms.uIrisCenter.value.set(...t.irisCenter);
|
|
339
|
+
s.cubeCamera.update(renderer, s.blendScene);
|
|
340
|
+
scene.environment = s.outRT.texture;
|
|
341
|
+
const mode = modeRef.current;
|
|
342
|
+
const divider = isDividerMode(mode);
|
|
343
|
+
if (divider) {
|
|
344
|
+
scene.background = null;
|
|
345
|
+
if (bgMeshRef.current)
|
|
346
|
+
bgMeshRef.current.visible = true;
|
|
347
|
+
const feather = t.dividerFeather ?? 0.003;
|
|
348
|
+
const dividerPos = 1.0 - (mixRef.current * (1.0 + 2.0 * feather) - feather);
|
|
349
|
+
bgUniforms.uMode.value = mode;
|
|
350
|
+
bgUniforms.uDividerX.value = mode === 4 ? dividerPos : 0.5;
|
|
351
|
+
bgUniforms.uDividerY.value = mode === 5 ? dividerPos : 0.5;
|
|
352
|
+
bgUniforms.uFeather.value = feather;
|
|
353
|
+
bgUniforms.uCamWorldMatrix.value.copy(camera.matrixWorld);
|
|
354
|
+
bgUniforms.uProjMatrixInv.value.copy(camera.projectionMatrixInverse);
|
|
355
|
+
}
|
|
356
|
+
else {
|
|
357
|
+
scene.background = s.outRT.texture;
|
|
358
|
+
if (bgMeshRef.current)
|
|
359
|
+
bgMeshRef.current.visible = false;
|
|
360
|
+
}
|
|
361
|
+
});
|
|
362
|
+
return (_jsxs("mesh", { ref: bgMeshRef, frustumCulled: false, renderOrder: -1000, visible: false, children: [_jsx("planeGeometry", { args: [2, 2] }), _jsx("shaderMaterial", { depthTest: false, depthWrite: false, uniforms: bgUniforms, vertexShader: bgVertexShader, fragmentShader: bgFragmentShader })] }));
|
|
363
|
+
};
|
|
364
|
+
export default HdrPlaylistRenderer;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { GeometryType, ObjectEdges, MaterialSettings } from '@3driseai/3drise-core';
|
|
2
|
+
export interface ImageGeometryProps {
|
|
3
|
+
geometryType: GeometryType;
|
|
4
|
+
url: string;
|
|
5
|
+
position?: [number, number, number];
|
|
6
|
+
rotation?: [number, number, number];
|
|
7
|
+
scale?: [number, number, number];
|
|
8
|
+
outerFrameScale?: number;
|
|
9
|
+
materialSettings?: MaterialSettings;
|
|
10
|
+
edgesSettings?: ObjectEdges;
|
|
11
|
+
}
|
|
12
|
+
export declare const ImageGeometry: any;
|
|
13
|
+
//# sourceMappingURL=ImageGeometry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImageGeometry.d.ts","sourceRoot":"","sources":["../../src/components/ImageGeometry.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzF,MAAM,WAAW,kBAAkB;IAC/B,YAAY,EAAE,YAAY,CAAC;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,aAAa,CAAC,EAAE,WAAW,CAAC;CAC/B;AAED,eAAO,MAAM,aAAa,EAuDpB,GAAI,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useEffect, useMemo, useState } from 'react';
|
|
3
|
+
import { DoubleSide, Mesh, MeshBasicMaterial } from 'three';
|
|
4
|
+
import { createMeshByType } from '@3driseai/3drise-core';
|
|
5
|
+
import { texturesManager } from '@3driseai/3drise-core';
|
|
6
|
+
export const ImageGeometry = forwardRef(({ geometryType, url, position = [0, 0, 0], rotation = [0, 0, 0], scale = [1, 1, 1], }, ref) => {
|
|
7
|
+
const [texture, setTexture] = useState(null);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
const textureName = url.split('/').pop()?.split('.')[0] || `texture-${Date.now()}`;
|
|
10
|
+
texturesManager.loadTexture(textureName, url, 'images')
|
|
11
|
+
.then(setTexture)
|
|
12
|
+
.catch((err) => console.error('Failed to load texture:', err));
|
|
13
|
+
}, [url]);
|
|
14
|
+
const meshConfig = useMemo(() => {
|
|
15
|
+
const base = {
|
|
16
|
+
type: geometryType,
|
|
17
|
+
position,
|
|
18
|
+
rotation,
|
|
19
|
+
scale,
|
|
20
|
+
visible: true,
|
|
21
|
+
id: `image-${geometryType}-${Date.now()}`,
|
|
22
|
+
name: `image-${geometryType}`,
|
|
23
|
+
castShadow: true,
|
|
24
|
+
receiveShadow: true,
|
|
25
|
+
};
|
|
26
|
+
switch (geometryType) {
|
|
27
|
+
case 'plane':
|
|
28
|
+
return { ...base, scale: [1, 1, 1], widthSegments: 1, heightSegments: 1 };
|
|
29
|
+
case 'ring':
|
|
30
|
+
return { ...base, scale: [1, 1, 1], innerRadius: 0.5, outerRadius: 1, thetaSegments: 32, phiSegments: 8 };
|
|
31
|
+
case 'arc':
|
|
32
|
+
return { ...base, scale: [1, 1, 1], radius: 1, startAngle: 0, endAngle: Math.PI, width: 0.3, segments: 32 };
|
|
33
|
+
case 'bentPlane':
|
|
34
|
+
return { ...base, scale: [1, 1, 1], width: 2, height: 1, radius: 2, arc: Math.PI / 2, widthSegments: 32, heightSegments: 1 };
|
|
35
|
+
case 'bentPlaneInverse':
|
|
36
|
+
return { ...base, scale: [1, 1, 1], width: 2, height: 1, radius: 2, arc: Math.PI / 2, widthSegments: 32, heightSegments: 1 };
|
|
37
|
+
default:
|
|
38
|
+
return base;
|
|
39
|
+
}
|
|
40
|
+
}, [geometryType, position, rotation, scale]);
|
|
41
|
+
const createdMesh = useMemo(() => {
|
|
42
|
+
const mesh = createMeshByType(meshConfig)?.mesh;
|
|
43
|
+
if (!(mesh instanceof Mesh))
|
|
44
|
+
return null;
|
|
45
|
+
if (texture) {
|
|
46
|
+
mesh.material = new MeshBasicMaterial({
|
|
47
|
+
map: texture,
|
|
48
|
+
side: DoubleSide,
|
|
49
|
+
toneMapped: false,
|
|
50
|
+
transparent: true,
|
|
51
|
+
polygonOffset: true,
|
|
52
|
+
polygonOffsetFactor: 1,
|
|
53
|
+
polygonOffsetUnits: 1,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
return mesh;
|
|
57
|
+
}, [meshConfig, texture]);
|
|
58
|
+
if (!createdMesh)
|
|
59
|
+
return null;
|
|
60
|
+
return (_jsx("group", { position: position, rotation: rotation, children: _jsx("primitive", { name: url, ref: ref, object: createdMesh }) }));
|
|
61
|
+
});
|
|
62
|
+
ImageGeometry.displayName = 'ImageGeometry';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import React from "react";
|
|
3
|
+
import type { TimeSettings } from "@3driseai/3drise-core";
|
|
4
|
+
export interface LensflareProps {
|
|
5
|
+
visible?: boolean;
|
|
6
|
+
intensity?: number;
|
|
7
|
+
timeSettings?: TimeSettings;
|
|
8
|
+
}
|
|
9
|
+
export declare function createFlareTexture(type: number): THREE.CanvasTexture;
|
|
10
|
+
declare const Lensflare: React.FC<LensflareProps>;
|
|
11
|
+
export default Lensflare;
|
|
12
|
+
//# sourceMappingURL=Lensflare.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Lensflare.d.ts","sourceRoot":"","sources":["../../src/components/Lensflare.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,MAAM,WAAW,cAAc;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,YAAY,CAAC;CAC/B;AAGD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,aAAa,CA4BpE;AACD,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CA8BvC,CAAC;AACF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useMemo, useCallback } from 'react';
|
|
3
|
+
import * as THREE from 'three';
|
|
4
|
+
import { useThree } from '@react-three/fiber';
|
|
5
|
+
import { useSkySystem } from '../hooks/useSkySystem.js';
|
|
6
|
+
export function createFlareTexture(type) {
|
|
7
|
+
const canvas = document.createElement('canvas');
|
|
8
|
+
canvas.width = 256;
|
|
9
|
+
canvas.height = 256;
|
|
10
|
+
const ctx = canvas.getContext('2d');
|
|
11
|
+
if (type === 0) {
|
|
12
|
+
const gradient = ctx.createRadialGradient(128, 128, 0, 128, 128, 128);
|
|
13
|
+
gradient.addColorStop(0, 'rgba(255, 255, 255, 1)');
|
|
14
|
+
gradient.addColorStop(0.1, 'rgba(255, 250, 240, 0.9)');
|
|
15
|
+
gradient.addColorStop(0.25, 'rgba(255, 229, 176, 0.6)');
|
|
16
|
+
gradient.addColorStop(0.5, 'rgba(255, 229, 176, 0.2)');
|
|
17
|
+
gradient.addColorStop(1, 'rgba(255, 229, 176, 0)');
|
|
18
|
+
ctx.fillStyle = gradient;
|
|
19
|
+
ctx.fillRect(0, 0, 256, 256);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
const gradient = ctx.createRadialGradient(128, 128, 0, 128, 128, 128);
|
|
23
|
+
gradient.addColorStop(0, 'rgba(255, 229, 176, 0.6)');
|
|
24
|
+
gradient.addColorStop(0.3, 'rgba(255, 229, 176, 0.3)');
|
|
25
|
+
gradient.addColorStop(0.6, 'rgba(255, 229, 176, 0.1)');
|
|
26
|
+
gradient.addColorStop(1, 'rgba(255, 229, 176, 0)');
|
|
27
|
+
ctx.fillStyle = gradient;
|
|
28
|
+
ctx.fillRect(0, 0, 256, 256);
|
|
29
|
+
}
|
|
30
|
+
const texture = new THREE.CanvasTexture(canvas);
|
|
31
|
+
texture.minFilter = THREE.LinearFilter;
|
|
32
|
+
texture.magFilter = THREE.LinearFilter;
|
|
33
|
+
return texture;
|
|
34
|
+
}
|
|
35
|
+
const Lensflare = ({ visible = true, intensity = 1, timeSettings = { enabled: false, timeOfDay: 12, timescale: 1, autoAnimate: true, syncWithRealTime: false }, }) => {
|
|
36
|
+
const spriteRef = useRef(null);
|
|
37
|
+
const { camera } = useThree();
|
|
38
|
+
const texture = useMemo(() => createFlareTexture(0), []);
|
|
39
|
+
const material = useMemo(() => new THREE.SpriteMaterial({
|
|
40
|
+
map: texture,
|
|
41
|
+
transparent: true,
|
|
42
|
+
blending: THREE.AdditiveBlending,
|
|
43
|
+
depthWrite: false,
|
|
44
|
+
depthTest: false,
|
|
45
|
+
}), [texture]);
|
|
46
|
+
const handleTimeUpdate = useCallback((state) => {
|
|
47
|
+
const { sunDirection } = state;
|
|
48
|
+
if (spriteRef.current) {
|
|
49
|
+
const distance = Math.min(camera.far * 0.5, 200);
|
|
50
|
+
spriteRef.current.position.copy(camera.position);
|
|
51
|
+
spriteRef.current.position.addScaledVector(sunDirection, distance);
|
|
52
|
+
const flareScale = 5 * intensity;
|
|
53
|
+
spriteRef.current.scale.setScalar(flareScale);
|
|
54
|
+
material.opacity = sunDirection.y > 0 ? Math.min(sunDirection.y * 2, 1) : 0;
|
|
55
|
+
}
|
|
56
|
+
}, [camera, intensity, material]);
|
|
57
|
+
useSkySystem({
|
|
58
|
+
timeSettings,
|
|
59
|
+
onTimeUpdate: handleTimeUpdate,
|
|
60
|
+
enabled: visible,
|
|
61
|
+
});
|
|
62
|
+
if (!visible)
|
|
63
|
+
return null;
|
|
64
|
+
return (_jsx("sprite", { ref: spriteRef, material: material, renderOrder: Infinity }));
|
|
65
|
+
};
|
|
66
|
+
export default Lensflare;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { HoverSettings, Vector3Array, TransformEffect, MaterialSettings, ColorEffect, TextConfig } from '@3driseai/3drise-core';
|
|
2
|
+
import { Object3D } from "three";
|
|
3
|
+
export interface LetterData {
|
|
4
|
+
char: string;
|
|
5
|
+
position: Vector3Array;
|
|
6
|
+
index: number;
|
|
7
|
+
}
|
|
8
|
+
export interface LetterProps {
|
|
9
|
+
letterData: LetterData;
|
|
10
|
+
config: TextConfig;
|
|
11
|
+
materialSettings: MaterialSettings;
|
|
12
|
+
hoverSettings: HoverSettings;
|
|
13
|
+
transformEffects?: TransformEffect[];
|
|
14
|
+
colorEffects?: ColorEffect[];
|
|
15
|
+
isActive: boolean;
|
|
16
|
+
onClick?: (object: Object3D) => void;
|
|
17
|
+
}
|
|
18
|
+
export default function Letter({ letterData, config, materialSettings, hoverSettings, transformEffects, colorEffects, isActive, onClick, }: LetterProps): import("react").JSX.Element;
|
|
19
|
+
//# sourceMappingURL=Letter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Letter.d.ts","sourceRoot":"","sources":["../../src/components/Letter.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACrI,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,MAAM,WAAW,UAAU;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,YAAY,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IACxB,UAAU,EAAE,UAAU,CAAC;IACvB,MAAM,EAAE,UAAU,CAAC;IACnB,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,aAAa,EAAE,aAAa,CAAC;IAC7B,gBAAgB,CAAC,EAAE,eAAe,EAAE,CAAC;IACrC,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAC7B,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,KAAK,IAAI,CAAC;CACxC;AA6BD,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,gBAAgB,EAAE,aAAa,EAAE,gBAAqB,EAAE,YAAiB,EAAE,QAAQ,EAAE,OAAO,GAAG,EAAE,WAAW,+BAgDhK"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useState, useEffect } from 'react';
|
|
3
|
+
import { useFrame } from '@react-three/fiber';
|
|
4
|
+
import { useCursor, Text, Text3D, Center } from '@react-three/drei';
|
|
5
|
+
import MaterialLibrary from './MaterialLibrary.js';
|
|
6
|
+
import { createDefaultEffectState, applyTransformEffects } from '@3driseai/3drise-core';
|
|
7
|
+
import { useFrameEffects } from '../hooks/useFrameEffects.js';
|
|
8
|
+
import { fontManager } from '@3driseai/3drise-core';
|
|
9
|
+
const getText3DConfig = (config) => {
|
|
10
|
+
const c = config;
|
|
11
|
+
return {
|
|
12
|
+
size: c.size ?? 1,
|
|
13
|
+
height: c.height ?? 0.2,
|
|
14
|
+
curveSegments: c.curveSegments ?? 12,
|
|
15
|
+
bevelEnabled: c.bevelEnabled ?? true,
|
|
16
|
+
bevelThickness: c.bevelThickness ?? 0.03,
|
|
17
|
+
bevelSize: c.bevelSize ?? 0.02,
|
|
18
|
+
bevelOffset: c.bevelOffset ?? 0,
|
|
19
|
+
bevelSegments: c.bevelSegments ?? 5,
|
|
20
|
+
letterSpacing: c.letterSpacing ?? 0,
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
const getText2DConfig = (config) => {
|
|
24
|
+
const c = config;
|
|
25
|
+
return {
|
|
26
|
+
fontSize: c.fontSize ?? 1,
|
|
27
|
+
maxWidth: c.maxWidth ?? Infinity,
|
|
28
|
+
lineHeight: c.lineHeight ?? 1,
|
|
29
|
+
letterSpacing: c.letterSpacing ?? 0,
|
|
30
|
+
textAlign: c.textAlign ?? 'center',
|
|
31
|
+
anchorX: c.anchorX ?? 'center',
|
|
32
|
+
anchorY: c.anchorY ?? 'middle',
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export default function Letter({ letterData, config, materialSettings, hoverSettings, transformEffects = [], colorEffects = [], isActive, onClick, }) {
|
|
36
|
+
const groupRef = useRef(null);
|
|
37
|
+
const letterRef = useRef(null);
|
|
38
|
+
const hitboxRef = useRef(null);
|
|
39
|
+
const effectStateRef = useRef(null);
|
|
40
|
+
const [rnd] = useState(() => Math.random());
|
|
41
|
+
const [clicked, setClicked] = useState(false);
|
|
42
|
+
const { handlePointerEnter, handlePointerLeave, hovered } = useFrameEffects(isActive);
|
|
43
|
+
const { renderMode = 'bitmap', font } = config;
|
|
44
|
+
const text3DConfig = getText3DConfig(config);
|
|
45
|
+
const text2DConfig = getText2DConfig(config);
|
|
46
|
+
const { sensitivity = 0.5, applyToChildren = false } = hoverSettings;
|
|
47
|
+
const color = 'color' in materialSettings ? materialSettings.color : '#ffffff';
|
|
48
|
+
const opacity = 'opacity' in materialSettings ? materialSettings.opacity : 1;
|
|
49
|
+
const useDreiMaterials = materialSettings.materialType === 'advanced';
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
if (useDreiMaterials && renderMode === 'bitmap') {
|
|
52
|
+
console.warn('[Letter] Advanced materials not supported with bitmap text. Switch to text3d render mode.');
|
|
53
|
+
}
|
|
54
|
+
}, [useDreiMaterials, renderMode]);
|
|
55
|
+
useCursor(hovered);
|
|
56
|
+
const fontInfo = font ? fontManager.getFont(font) : null;
|
|
57
|
+
const bitmapFontUrl = fontInfo?.googleFont;
|
|
58
|
+
const text3dFontUrl = fontInfo?.threejsFont;
|
|
59
|
+
const enabledEffects = transformEffects.filter(e => e.enabled !== false);
|
|
60
|
+
useFrame((state, dt) => {
|
|
61
|
+
if (!groupRef.current || !letterRef.current || !applyToChildren)
|
|
62
|
+
return;
|
|
63
|
+
const time = state.clock.elapsedTime;
|
|
64
|
+
if (!effectStateRef.current) {
|
|
65
|
+
effectStateRef.current = createDefaultEffectState(letterRef.current);
|
|
66
|
+
}
|
|
67
|
+
if (enabledEffects.length > 0) {
|
|
68
|
+
applyTransformEffects(letterRef.current, enabledEffects, time, dt, effectStateRef.current, hovered, clicked, sensitivity);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
const handleClick = (e) => {
|
|
72
|
+
e.stopPropagation();
|
|
73
|
+
setClicked(!clicked);
|
|
74
|
+
if (groupRef.current)
|
|
75
|
+
onClick?.(groupRef.current);
|
|
76
|
+
};
|
|
77
|
+
const actualRenderMode = renderMode === 'text3d' && !font ? 'bitmap' : renderMode;
|
|
78
|
+
const fontSize = actualRenderMode === 'text3d' ? text3DConfig.size : text2DConfig.fontSize;
|
|
79
|
+
const boxWidth = fontSize * 0.8;
|
|
80
|
+
const boxHeight = fontSize * 1.2;
|
|
81
|
+
const boxDepth = actualRenderMode === 'text3d' ? text3DConfig.height + text3DConfig.bevelThickness * 2 : text3DConfig.height + 1;
|
|
82
|
+
return (_jsx("group", { position: letterData.position, rotation: [0, 0, 0], ref: groupRef, name: `letter-${letterData.char}-${letterData.index}`, userData: { char: letterData.char, index: letterData.index, position: letterData.position }, children: _jsx("group", { ref: letterRef, raycast: () => null, children: actualRenderMode === 'text3d' ? (_jsx(Center, { disableX: text2DConfig.anchorX === 'left', disableY: text2DConfig.anchorY === 'top', disableZ: false, children: _jsxs(Text3D, { font: text3dFontUrl || 'https://threejs.org/examples/fonts/helvetiker_regular.typeface.json', size: text3DConfig.size, height: text3DConfig.height, curveSegments: text3DConfig.curveSegments, bevelEnabled: text3DConfig.bevelEnabled, bevelThickness: text3DConfig.bevelThickness, bevelSize: text3DConfig.bevelSize, bevelOffset: text3DConfig.bevelOffset, bevelSegments: text3DConfig.bevelSegments, children: [letterData.char, useDreiMaterials && actualRenderMode === 'text3d' ? (_jsx(MaterialLibrary, { materialSettings: materialSettings })) : (_jsx("meshStandardMaterial", { color: color, transparent: opacity < 1, opacity: opacity }))] }) })) : (_jsx(Text, { fontSize: text2DConfig.fontSize, color: color, maxWidth: text2DConfig.maxWidth, lineHeight: text2DConfig.lineHeight, letterSpacing: text2DConfig.letterSpacing, textAlign: text2DConfig.textAlign, anchorX: text2DConfig.anchorX, anchorY: text2DConfig.anchorY, font: bitmapFontUrl || undefined, fillOpacity: opacity, children: letterData.char })) }) }));
|
|
83
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LetterData } from './Letter';
|
|
2
|
+
import type { HoverSettings } from "@3driseai/3drise-core";
|
|
3
|
+
import type { TextConfig } from "@3driseai/3drise-core";
|
|
4
|
+
import type { MaterialSettings } from "@3driseai/3drise-core";
|
|
5
|
+
import type { ColorEffect, TransformEffect } from "@3driseai/3drise-core";
|
|
6
|
+
export interface LettersProps {
|
|
7
|
+
text: string;
|
|
8
|
+
config: TextConfig;
|
|
9
|
+
materialSettings: MaterialSettings;
|
|
10
|
+
hoverSettings: HoverSettings;
|
|
11
|
+
transformEffects?: TransformEffect[];
|
|
12
|
+
colorEffects?: ColorEffect[];
|
|
13
|
+
onLetterClick?: (letterData: LetterData) => void;
|
|
14
|
+
}
|
|
15
|
+
export default function Letters({ text, config, materialSettings, hoverSettings, transformEffects, colorEffects, onLetterClick, }: LettersProps): import("react").JSX.Element;
|
|
16
|
+
//# sourceMappingURL=Letters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Letters.d.ts","sourceRoot":"","sources":["../../src/components/Letters.tsx"],"names":[],"mappings":"AACA,OAAe,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC1E,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,UAAU,CAAC;IACnB,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,aAAa,EAAE,aAAa,CAAC;IAC7B,gBAAgB,CAAC,EAAE,eAAe,EAAE,CAAC;IACrC,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAC7B,aAAa,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;CACpD;AAGD,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,gBAAgB,EAAE,aAAa,EAAE,gBAAqB,EAAE,YAAiB,EAAE,aAAa,GAAG,EAAE,YAAY,+BAcxJ"}
|