kmcom-nuxt-layers 2.2.0 → 2.2.2
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/layers/animations/app/components/Motion/CountUp.vue +30 -30
- package/layers/animations/app/components/Motion/Magnetic.vue +14 -14
- package/layers/animations/app/components/Motion/Marquee.vue +59 -62
- package/layers/animations/app/components/Motion/MarqueeText.vue +2 -2
- package/layers/animations/app/components/Motion/Staggered.vue +45 -49
- package/layers/animations/app/components/Motion/TextReveal.vue +21 -19
- package/layers/animations/app/components/Motion/Tilt.vue +13 -13
- package/layers/animations/app/components/Motion/VelocityEffect.vue +80 -80
- package/layers/animations/app/composables/useCountUp.ts +1 -1
- package/layers/animations/app/composables/useMarqueeVelocity.ts +2 -2
- package/layers/canvas/app/components/ShaderCanvas.vue +42 -49
- package/layers/canvas/app/composables/useRendererCapabilities.ts +29 -21
- package/layers/canvas/app/composables/useShaderTime.ts +4 -5
- package/layers/canvas/app/types/renderer.ts +5 -0
- package/layers/content/app/components/Blog/Article.vue +10 -7
- package/layers/content/app/components/Blog/Card.vue +0 -1
- package/layers/content/app/components/Blog/List.vue +2 -4
- package/layers/content/app/components/Gallery/AmbientImage.vue +0 -1
- package/layers/content/app/components/Gallery/Card.vue +0 -1
- package/layers/content/app/components/Gallery/Detail.vue +0 -2
- package/layers/content/app/components/Gallery/Grid.vue +0 -2
- package/layers/content/app/components/Gallery/ImageDetail.vue +0 -2
- package/layers/content/app/components/Gallery/Lightbox.vue +1 -6
- package/layers/content/app/components/NuxtContent/Detail.vue +3 -4
- package/layers/content/app/components/NuxtContent/List.vue +0 -1
- package/layers/content/app/components/NuxtContent/Surround.vue +0 -1
- package/layers/content/app/components/NuxtContent/Toc.vue +0 -1
- package/layers/content/app/components/Portfolio/Card.vue +0 -1
- package/layers/content/app/components/Portfolio/ColorPalette.vue +0 -1
- package/layers/content/app/components/Portfolio/Detail.vue +2 -4
- package/layers/content/app/components/Portfolio/ItemPage.vue +3 -1
- package/layers/content/app/components/Portfolio/List.vue +20 -5
- package/layers/content/app/components/Portfolio/Typography.vue +0 -1
- package/layers/content/app/components/content/Figure.vue +0 -1
- package/layers/content/app/composables/createPortfolioComposables.ts +21 -7
- package/layers/content/app/composables/useCollectionItem.ts +2 -3
- package/layers/content/app/composables/useCollectionSurround.ts +2 -3
- package/layers/content/app/composables/useContentPage.ts +0 -2
- package/layers/content/app/composables/useGalleryItems.ts +0 -2
- package/layers/content/app/composables/usePortfolioItems.ts +0 -2
- package/layers/content/app/types/app-config.d.ts +3 -1
- package/layers/content/app/types/collections.d.ts +46 -0
- package/layers/content/nuxt.config.ts +0 -1
- package/layers/core/app/components/ErrorBoundary.vue +0 -3
- package/layers/core/app/composables/useBrowser.ts +0 -1
- package/layers/core/app/composables/useCache.ts +0 -3
- package/layers/core/app/composables/useErrorLog.ts +0 -2
- package/layers/core/app/composables/useFeatures.ts +0 -3
- package/layers/core/app/composables/useLoading.ts +16 -15
- package/layers/core/app/composables/useNetworkInfo.ts +0 -2
- package/layers/core/app/composables/usePWAInfo.ts +0 -1
- package/layers/core/app/composables/useRendering.ts +0 -2
- package/layers/core/app/composables/useScreen.ts +0 -2
- package/layers/core/app/composables/useScrollGuard.ts +44 -44
- package/layers/core/app/layouts/default.vue +0 -1
- package/layers/core/app/plugins/error-handler.ts +4 -2
- package/layers/core/app/plugins/feature-detection.client.ts +4 -4
- package/layers/core/app/plugins/init.ts +4 -6
- package/layers/core/app/plugins/loading.client.ts +4 -3
- package/layers/core/app/plugins/scroll-guard.client.ts +4 -4
- package/layers/core/app/types/app-config.d.ts +1 -1
- package/layers/core/app/types/runtime-config.ts +13 -1
- package/layers/core/app/utils/helpers.ts +0 -4
- package/layers/feeds/app/app.config.ts +1 -1
- package/layers/feeds/app/plugins/feed-head.ts +4 -3
- package/layers/feeds/package.json +1 -1
- package/layers/forms/app/components/Form/Contact.vue +0 -2
- package/layers/forms/app/components/Form/Field.vue +0 -1
- package/layers/forms/app/composables/useFormSchema.ts +0 -1
- package/layers/forms/app/types/app-config.d.ts +1 -1
- package/layers/layout/app/components/Layout/Grid/Item.vue +0 -3
- package/layers/layout/app/components/Layout/Page/Container.vue +0 -4
- package/layers/layout/app/components/Layout/Page/Header.vue +0 -1
- package/layers/layout/app/components/Layout/Page/index.vue +0 -1
- package/layers/layout/app/components/Layout/Section/Gallery.vue +0 -1
- package/layers/layout/app/components/Layout/Section/Hero.vue +0 -3
- package/layers/layout/app/components/Layout/Section/Stack.vue +0 -3
- package/layers/layout/app/components/Layout/Section/Title.vue +0 -1
- package/layers/layout/app/composables/useGridConfig.ts +0 -1
- package/layers/layout/app/types/app-config.d.ts +6 -3
- package/layers/navigation/app/app.config.ts +1 -2
- package/layers/navigation/app/components/Links/Group.vue +0 -4
- package/layers/navigation/app/components/Links/Named.vue +0 -4
- package/layers/navigation/app/composables/mastNav.ts +0 -1
- package/layers/navigation/app/composables/toast.ts +0 -1
- package/layers/navigation/app/composables/useSite.ts +0 -1
- package/layers/navigation/app/utils/createModal.ts +0 -1
- package/layers/page-transitions/app/app.config.ts +1 -1
- package/layers/page-transitions/app/plugins/page-transitions.client.ts +4 -2
- package/layers/routing/app/composables/useRoutingConfig.ts +0 -1
- package/layers/routing/app/plugins/feature-flags.client.ts +4 -2
- package/layers/routing/app/plugins/scroll-routing.client.ts +4 -2
- package/layers/routing/app/types/app-config.d.ts +1 -2
- package/layers/routing/nuxt.config.ts +0 -1
- package/layers/scripts/app/app.config.ts +1 -2
- package/layers/scripts/app/composables/useAnalytics.ts +6 -6
- package/layers/scripts/app/composables/useGtm.ts +4 -4
- package/layers/scripts/app/composables/useScriptLoader.ts +12 -1
- package/layers/scroll/app/components/Motion/HorizontalScroll.vue +4 -1
- package/layers/scroll/app/components/Motion/Parallax.vue +38 -42
- package/layers/scroll/app/components/Motion/PinnedSection.vue +4 -1
- package/layers/scroll/app/components/Motion/ScrollLink.vue +26 -29
- package/layers/scroll/app/components/Motion/ScrollProgress.vue +38 -44
- package/layers/scroll/app/components/Motion/ScrollScene.vue +0 -1
- package/layers/scroll/app/components/Motion/ScrollStats.vue +19 -23
- package/layers/scroll/app/composables/useSmoothScroll.ts +21 -24
- package/layers/scroll/app/plugins/locomotive-scroll.client.ts +5 -2
- package/layers/seo/app/app.config.ts +0 -1
- package/layers/seo/app/composables/useSeoConfig.ts +0 -1
- package/layers/shader/app/components/Effect/PostProcessing.vue +3 -13
- package/layers/shader/app/components/Material/AmbientAurora.client.vue +41 -47
- package/layers/shader/app/components/Material/AmbientFlow.client.vue +47 -56
- package/layers/shader/app/components/Material/AmbientGradientMesh.client.vue +45 -51
- package/layers/shader/app/components/Material/AmbientNebula.client.vue +47 -53
- package/layers/shader/app/components/Material/AmbientOcean.client.vue +40 -46
- package/layers/shader/app/components/Material/Fresnel.client.vue +24 -29
- package/layers/shader/app/components/Material/Gradient.client.vue +61 -67
- package/layers/shader/app/components/Material/Image.client.vue +65 -71
- package/layers/shader/app/components/Material/Node.client.vue +46 -46
- package/layers/shader/app/components/Material/Noise.client.vue +48 -54
- package/layers/shader/app/components/Mesh/Plane.vue +15 -20
- package/layers/shader/app/components/Node/Color.client.vue +3 -4
- package/layers/shader/app/components/Node/Fresnel.client.vue +17 -26
- package/layers/shader/app/components/Node/Gradient.client.vue +36 -42
- package/layers/shader/app/components/Node/Mix.client.vue +13 -19
- package/layers/shader/app/components/Node/Noise.client.vue +0 -3
- package/layers/shader/app/components/Pipeline/ACESTonemap.client.vue +0 -2
- package/layers/shader/app/components/Pipeline/AddBlend.client.vue +15 -16
- package/layers/shader/app/components/Pipeline/AgedFilm.client.vue +27 -28
- package/layers/shader/app/components/Pipeline/Aurora.client.vue +37 -44
- package/layers/shader/app/components/Pipeline/BilinearGradient.client.vue +26 -33
- package/layers/shader/app/components/Pipeline/BillowNoise.client.vue +22 -23
- package/layers/shader/app/components/Pipeline/BrightnessContrast.client.vue +16 -20
- package/layers/shader/app/components/Pipeline/CellularNoise.client.vue +22 -23
- package/layers/shader/app/components/Pipeline/ChannelMixer.client.vue +28 -35
- package/layers/shader/app/components/Pipeline/ChebyshevNoiseField.client.vue +31 -31
- package/layers/shader/app/components/Pipeline/Checkerboard.client.vue +21 -23
- package/layers/shader/app/components/Pipeline/ChromaticAberration.client.vue +21 -23
- package/layers/shader/app/components/Pipeline/ChromaticScreenWaves.client.vue +31 -30
- package/layers/shader/app/components/Pipeline/Circle.client.vue +22 -23
- package/layers/shader/app/components/Pipeline/Clouds.client.vue +36 -43
- package/layers/shader/app/components/Pipeline/ColorBurnBlend.client.vue +15 -17
- package/layers/shader/app/components/Pipeline/ColorDodgeBlend.client.vue +15 -17
- package/layers/shader/app/components/Pipeline/ColourRamp.client.vue +28 -35
- package/layers/shader/app/components/Pipeline/ComplexPlaneField.client.vue +31 -38
- package/layers/shader/app/components/Pipeline/ConicGradient.client.vue +19 -21
- package/layers/shader/app/components/Pipeline/CosinePalette.client.vue +42 -49
- package/layers/shader/app/components/Pipeline/CoverageAlpha.client.vue +0 -4
- package/layers/shader/app/components/Pipeline/Cross.client.vue +28 -28
- package/layers/shader/app/components/Pipeline/CurlNoise.client.vue +26 -27
- package/layers/shader/app/components/Pipeline/DarkenBlend.client.vue +15 -17
- package/layers/shader/app/components/Pipeline/DayNightCycle.client.vue +26 -27
- package/layers/shader/app/components/Pipeline/Desaturate.client.vue +8 -15
- package/layers/shader/app/components/Pipeline/DiagonalGradient.client.vue +19 -21
- package/layers/shader/app/components/Pipeline/DiamondGradient.client.vue +19 -21
- package/layers/shader/app/components/Pipeline/DifferenceBlend.client.vue +15 -17
- package/layers/shader/app/components/Pipeline/DivideBlend.client.vue +14 -17
- package/layers/shader/app/components/Pipeline/DomainWarpedNoise.client.vue +30 -37
- package/layers/shader/app/components/Pipeline/Dots.client.vue +26 -33
- package/layers/shader/app/components/Pipeline/DuoTone.client.vue +16 -19
- package/layers/shader/app/components/Pipeline/ExclusionBlend.client.vue +14 -17
- package/layers/shader/app/components/Pipeline/ExponentialFog.client.vue +21 -23
- package/layers/shader/app/components/Pipeline/Exposure.client.vue +8 -15
- package/layers/shader/app/components/Pipeline/FBMNoise.client.vue +28 -36
- package/layers/shader/app/components/Pipeline/FilmBurn.client.vue +27 -28
- package/layers/shader/app/components/Pipeline/FilmGrain.client.vue +29 -29
- package/layers/shader/app/components/Pipeline/FisheyeRay.client.vue +11 -18
- package/layers/shader/app/components/Pipeline/Flame.client.vue +26 -27
- package/layers/shader/app/components/Pipeline/FocalGradient.client.vue +24 -25
- package/layers/shader/app/components/Pipeline/Gamma.client.vue +8 -14
- package/layers/shader/app/components/Pipeline/GodRays.client.vue +32 -39
- package/layers/shader/app/components/Pipeline/GradientNoise.client.vue +22 -22
- package/layers/shader/app/components/Pipeline/Grain.client.vue +34 -41
- package/layers/shader/app/components/Pipeline/Grid.client.vue +24 -24
- package/layers/shader/app/components/Pipeline/Halation.client.vue +22 -24
- package/layers/shader/app/components/Pipeline/Halftone.client.vue +16 -18
- package/layers/shader/app/components/Pipeline/HardLightBlend.client.vue +15 -16
- package/layers/shader/app/components/Pipeline/Haze.client.vue +22 -24
- package/layers/shader/app/components/Pipeline/Hexagon.client.vue +22 -22
- package/layers/shader/app/components/Pipeline/Hue.client.vue +8 -12
- package/layers/shader/app/components/Pipeline/Invert.client.vue +0 -1
- package/layers/shader/app/components/Pipeline/LensFlare.client.vue +27 -25
- package/layers/shader/app/components/Pipeline/LightenBlend.client.vue +15 -14
- package/layers/shader/app/components/Pipeline/LinearGradient.client.vue +17 -21
- package/layers/shader/app/components/Pipeline/LinearGradient4.client.vue +29 -33
- package/layers/shader/app/components/Pipeline/LinearToSRGB.client.vue +8 -12
- package/layers/shader/app/components/Pipeline/Marble.client.vue +41 -47
- package/layers/shader/app/components/Pipeline/MixBlend.client.vue +21 -27
- package/layers/shader/app/components/Pipeline/MonochromeTint.client.vue +16 -21
- package/layers/shader/app/components/Pipeline/MultiplyBlend.client.vue +15 -16
- package/layers/shader/app/components/Pipeline/NoisyGradient.client.vue +34 -40
- package/layers/shader/app/components/Pipeline/NoisyGradientBlend.client.vue +54 -60
- package/layers/shader/app/components/Pipeline/OverlayBlend.client.vue +15 -16
- package/layers/shader/app/components/Pipeline/PaperTexture.client.vue +22 -24
- package/layers/shader/app/components/Pipeline/Polygon.client.vue +32 -39
- package/layers/shader/app/components/Pipeline/Posterise.client.vue +8 -14
- package/layers/shader/app/components/Pipeline/RadialGradient.client.vue +18 -24
- package/layers/shader/app/components/Pipeline/RayAutoOrbit.client.vue +16 -18
- package/layers/shader/app/components/Pipeline/RayMouseOrbit.client.vue +16 -18
- package/layers/shader/app/components/Pipeline/RayRotateX.client.vue +8 -14
- package/layers/shader/app/components/Pipeline/RayRotateY.client.vue +8 -14
- package/layers/shader/app/components/Pipeline/RayRotateZ.client.vue +8 -14
- package/layers/shader/app/components/Pipeline/RayTiltBasis.client.vue +21 -22
- package/layers/shader/app/components/Pipeline/RaymarchTunnel.client.vue +34 -40
- package/layers/shader/app/components/Pipeline/Rectangle.client.vue +30 -36
- package/layers/shader/app/components/Pipeline/ReinhardTonemap.client.vue +0 -3
- package/layers/shader/app/components/Pipeline/RidgedNoise.client.vue +22 -22
- package/layers/shader/app/components/Pipeline/Ring.client.vue +26 -32
- package/layers/shader/app/components/Pipeline/RingField.client.vue +36 -33
- package/layers/shader/app/components/Pipeline/RisographGrain.client.vue +29 -35
- package/layers/shader/app/components/Pipeline/RotatedGradientBlend.client.vue +29 -35
- package/layers/shader/app/components/Pipeline/SDFColourMask.client.vue +15 -18
- package/layers/shader/app/components/Pipeline/SDFRadialMask.client.vue +16 -18
- package/layers/shader/app/components/Pipeline/SRGBToLinear.client.vue +8 -14
- package/layers/shader/app/components/Pipeline/Saturation.client.vue +8 -14
- package/layers/shader/app/components/Pipeline/Scanlines.client.vue +21 -22
- package/layers/shader/app/components/Pipeline/ScreenBlend.client.vue +15 -16
- package/layers/shader/app/components/Pipeline/ShaderDebugger.client.vue +28 -29
- package/layers/shader/app/components/Pipeline/SimplexNoise.client.vue +25 -32
- package/layers/shader/app/components/Pipeline/SkyAtmosphere.client.vue +37 -44
- package/layers/shader/app/components/Pipeline/SoftLightBlend.client.vue +15 -16
- package/layers/shader/app/components/Pipeline/SolidColour.client.vue +7 -16
- package/layers/shader/app/components/Pipeline/SplitTone.client.vue +27 -28
- package/layers/shader/app/components/Pipeline/Star.client.vue +31 -37
- package/layers/shader/app/components/Pipeline/Starfield.client.vue +29 -27
- package/layers/shader/app/components/Pipeline/Stripes.client.vue +28 -27
- package/layers/shader/app/components/Pipeline/SubtractBlend.client.vue +15 -16
- package/layers/shader/app/components/Pipeline/TanhTonemap.client.vue +8 -17
- package/layers/shader/app/components/Pipeline/Threshold.client.vue +8 -14
- package/layers/shader/app/components/Pipeline/Tint.client.vue +16 -18
- package/layers/shader/app/components/Pipeline/Triangle.client.vue +22 -22
- package/layers/shader/app/components/Pipeline/UVAspectCorrect.client.vue +0 -2
- package/layers/shader/app/components/Pipeline/UVBreath.client.vue +16 -18
- package/layers/shader/app/components/Pipeline/UVBulge.client.vue +16 -18
- package/layers/shader/app/components/Pipeline/UVClamp.client.vue +0 -3
- package/layers/shader/app/components/Pipeline/UVColumnOffset.client.vue +16 -18
- package/layers/shader/app/components/Pipeline/UVFlipX.client.vue +0 -3
- package/layers/shader/app/components/Pipeline/UVFlipXY.client.vue +0 -3
- package/layers/shader/app/components/Pipeline/UVFlipY.client.vue +0 -3
- package/layers/shader/app/components/Pipeline/UVFractBand.client.vue +16 -18
- package/layers/shader/app/components/Pipeline/UVMousePull.client.vue +8 -14
- package/layers/shader/app/components/Pipeline/UVNoiseRotate.client.vue +21 -27
- package/layers/shader/app/components/Pipeline/UVNoiseWarp.client.vue +21 -22
- package/layers/shader/app/components/Pipeline/UVOrbit.client.vue +8 -14
- package/layers/shader/app/components/Pipeline/UVParallax.client.vue +8 -18
- package/layers/shader/app/components/Pipeline/UVPixelate.client.vue +7 -14
- package/layers/shader/app/components/Pipeline/UVPulse.client.vue +16 -18
- package/layers/shader/app/components/Pipeline/UVRipple.client.vue +26 -26
- package/layers/shader/app/components/Pipeline/UVRotate.client.vue +16 -22
- package/layers/shader/app/components/Pipeline/UVScale.client.vue +16 -22
- package/layers/shader/app/components/Pipeline/UVScroll.client.vue +12 -18
- package/layers/shader/app/components/Pipeline/UVScrollX.client.vue +8 -14
- package/layers/shader/app/components/Pipeline/UVScrollY.client.vue +8 -14
- package/layers/shader/app/components/Pipeline/UVShear.client.vue +16 -18
- package/layers/shader/app/components/Pipeline/UVSineWarpXY.client.vue +18 -24
- package/layers/shader/app/components/Pipeline/UVSwapAxes.client.vue +0 -3
- package/layers/shader/app/components/Pipeline/UVTile.client.vue +12 -18
- package/layers/shader/app/components/Pipeline/UVTwirl.client.vue +16 -18
- package/layers/shader/app/components/Pipeline/UVWarp.client.vue +21 -22
- package/layers/shader/app/components/Pipeline/VHSBleed.client.vue +27 -28
- package/layers/shader/app/components/Pipeline/ValueNoise.client.vue +22 -22
- package/layers/shader/app/components/Pipeline/Vibrance.client.vue +11 -17
- package/layers/shader/app/components/Pipeline/Vignette.client.vue +14 -20
- package/layers/shader/app/components/Pipeline/VoronoiEdges.client.vue +29 -28
- package/layers/shader/app/components/Pipeline/Water.client.vue +31 -37
- package/layers/shader/app/components/Pipeline/WaveBendLayer.client.vue +26 -32
- package/layers/shader/app/components/Pipeline/WaveColourLayer.client.vue +37 -36
- package/layers/shader/app/components/Pipeline/WhiteBalance.client.vue +23 -26
- package/layers/shader/app/components/Pipeline/Wood.client.vue +34 -40
- package/layers/shader/app/components/Preset/Aurora.client.vue +0 -7
- package/layers/shader/app/components/Preset/Flow.client.vue +15 -23
- package/layers/shader/app/components/Preset/GradientMesh.client.vue +15 -23
- package/layers/shader/app/components/Preset/Nebula.client.vue +15 -25
- package/layers/shader/app/components/Preset/Ocean.client.vue +15 -24
- package/layers/shader/app/components/Preset/ThemeAurora.client.vue +38 -47
- package/layers/shader/app/components/Preset/ThemeBubble.client.vue +38 -47
- package/layers/shader/app/components/Preset/ThemeFlow.client.vue +38 -47
- package/layers/shader/app/components/Preset/ThemeGradient.client.vue +38 -47
- package/layers/shader/app/components/Preset/ThemeLavaLamp.client.vue +38 -47
- package/layers/shader/app/components/Preset/ThemePlasma.client.vue +38 -47
- package/layers/shader/app/components/Preset/ThemeWave.client.vue +38 -47
- package/layers/shader/app/components/Shader/Background.client.vue +109 -75
- package/layers/shader/app/components/Shader/Debug.vue +4 -14
- package/layers/shader/app/components/Shader/Host.client.vue +7 -9
- package/layers/shader/app/components/Shader/Material.client.vue +8 -20
- package/layers/shader/app/components/Shader/Pipeline.client.vue +0 -6
- package/layers/shader/app/components/Shader/Runtime.client.vue +0 -5
- package/layers/shader/app/composables/useAmbientMaterials.ts +4 -9
- package/layers/shader/app/composables/useCSSColourUniform.ts +0 -4
- package/layers/shader/app/composables/useCSSFloatUniform.ts +0 -3
- package/layers/shader/app/composables/useShader.ts +1 -4
- package/layers/shader/app/composables/useShaderColor.ts +4 -6
- package/layers/shader/app/composables/useShaderFloat.ts +1 -3
- package/layers/shader/app/composables/useShaderGraph.ts +4 -5
- package/layers/shader/app/composables/useShaderRuntime.ts +0 -5
- package/layers/shader/app/composables/useShaderVec2.ts +4 -8
- package/layers/shader/app/composables/useSunDirectionUniform.ts +0 -6
- package/layers/shader/app/composables/useThemeColors.ts +0 -1
- package/layers/shader/app/composables/useUniforms.ts +25 -9
- package/layers/shader/app/plugins/shader.client.ts +4 -3
- package/layers/shader/app/shaders/common/blend.ts +2 -4
- package/layers/shader/app/shaders/common/complex.ts +0 -2
- package/layers/shader/app/shaders/common/effects.ts +5 -13
- package/layers/shader/app/shaders/common/grain.ts +2 -7
- package/layers/shader/app/shaders/common/lighting.ts +0 -3
- package/layers/shader/app/shaders/common/math.ts +12 -8
- package/layers/shader/app/shaders/common/noise.ts +48 -48
- package/layers/shader/app/shaders/common/noiseHelpers.ts +6 -6
- package/layers/shader/app/shaders/common/palette.ts +10 -11
- package/layers/shader/app/shaders/common/patterns.ts +1 -4
- package/layers/shader/app/shaders/common/sdf.ts +11 -7
- package/layers/shader/app/shaders/common/shapes.ts +25 -15
- package/layers/shader/app/shaders/common/tonemapping.ts +0 -2
- package/layers/shader/app/shaders/common/uv.ts +20 -29
- package/layers/shader/app/shaders/createMaterial.ts +2 -5
- package/layers/shader/app/shaders/layers/aurora.ts +14 -17
- package/layers/shader/app/shaders/layers/meshGradient.ts +13 -16
- package/layers/shader/app/shaders/layers/paperShading.ts +15 -19
- package/layers/shader/app/shaders/layers/shaderGradient.ts +18 -23
- package/layers/shader/app/shaders/layers/stripe.ts +14 -17
- package/layers/shader/app/shaders/types.ts +9 -1
- package/layers/shader/app/types/app-config.d.ts +1 -1
- package/layers/shader/app/types/tsl.ts +0 -1
- package/layers/shader/app/types/uniforms.ts +0 -1
- package/layers/shader/app/utils/tsl/animation.ts +50 -52
- package/layers/shader/app/utils/tsl/color.ts +20 -19
- package/layers/shader/app/utils/tsl/noise.ts +10 -12
- package/layers/shader/app/utils/tsl/oklch.ts +6 -7
- package/layers/shader/app/utils/tsl/patterns.ts +4 -6
- package/layers/shader/app/utils/tsl/tween.ts +2 -4
- package/layers/shader/app/utils/tsl/uv.ts +6 -6
- package/layers/theme/app/components/ThemePicker/AccentButton.vue +1 -3
- package/layers/theme/app/components/ThemePicker/Colors.vue +0 -1
- package/layers/theme/app/composables/useAccentColor.ts +0 -1
- package/layers/theme/app/plugins/theme.client.ts +4 -3
- package/layers/theme/app/types/app-config.d.ts +1 -2
- package/layers/transitions/app/components/Motion/Transition.vue +15 -22
- package/layers/typography/app/components/Typography/CodeBlock.vue +16 -19
- package/layers/typography/app/components/Typography/Headline.vue +46 -49
- package/layers/typography/app/components/Typography/HeadlineScreen.vue +36 -40
- package/layers/typography/app/components/Typography/QuoteBlock.vue +3 -4
- package/layers/typography/app/components/Typography/TextStroke.vue +15 -20
- package/layers/typography/app/components/Typography/index.vue +0 -4
- package/layers/typography/app/composables/typography.ts +9 -11
- package/layers/visual/app/app.config.ts +1 -2
- package/layers/visual/app/components/Accent/Blob.vue +0 -3
- package/layers/visual/app/components/Accent/Scene.vue +12 -17
- package/layers/visual/app/components/Base/Modal.vue +0 -1
- package/layers/visual/app/components/Gradient/Background.vue +10 -13
- package/layers/visual/app/components/Gradient/Text.vue +10 -13
- package/layers/visual/app/components/Media/Picture.vue +0 -1
- package/layers/visual/app/components/Progress/Bar.vue +0 -1
- package/layers/visual/app/components/Progress/Circular.vue +0 -1
- package/layers/visual/app/components/Tint/Overlay.vue +0 -2
- package/layers/visual/app/composables/gradient.ts +6 -11
- package/layers/visual/app/composables/picture.ts +0 -1
- package/layers/visual/app/composables/tint.ts +0 -1
- package/layers/visual/app/types/media.ts +0 -1
- package/package.json +3 -2
|
@@ -1,55 +1,46 @@
|
|
|
1
|
-
<!-- eslint-disable @typescript-eslint/no-explicit-any -->
|
|
2
|
-
<!-- eslint-disable vue/no-boolean-default -->
|
|
3
|
-
<!-- eslint-disable @typescript-eslint/no-unused-vars -->
|
|
4
|
-
<!-- eslint-disable vue/define-props-destructuring -->
|
|
5
|
-
<!-- eslint-disable @typescript-eslint/ban-ts-comment -->
|
|
6
1
|
<script setup lang="ts">
|
|
7
|
-
// @ts-nocheck - TSL types
|
|
8
2
|
import {
|
|
9
3
|
createAmbientUniforms,
|
|
10
4
|
createThemePlasmaColorNode,
|
|
11
5
|
} from '#layers/shader/app/composables/useAmbientMaterials'
|
|
12
6
|
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
color4: '#38bdf8',
|
|
33
|
-
}
|
|
34
|
-
)
|
|
7
|
+
const {
|
|
8
|
+
speed = 1.0,
|
|
9
|
+
intensity = 1.0,
|
|
10
|
+
mouseInteraction = true,
|
|
11
|
+
mouseStrength = 0.3,
|
|
12
|
+
color1 = '#8b5cf6',
|
|
13
|
+
color2 = '#6366f1',
|
|
14
|
+
color3 = '#a78bfa',
|
|
15
|
+
color4 = '#38bdf8',
|
|
16
|
+
} = defineProps<{
|
|
17
|
+
speed?: number
|
|
18
|
+
intensity?: number
|
|
19
|
+
mouseInteraction?: boolean
|
|
20
|
+
mouseStrength?: number
|
|
21
|
+
color1?: string
|
|
22
|
+
color2?: string
|
|
23
|
+
color3?: string
|
|
24
|
+
color4?: string
|
|
25
|
+
}>()
|
|
35
26
|
|
|
36
27
|
const emit = defineEmits<{
|
|
37
28
|
node: [colorNode: any]
|
|
38
29
|
}>()
|
|
39
30
|
|
|
40
31
|
const uniforms = createAmbientUniforms({
|
|
41
|
-
speed:
|
|
42
|
-
intensity:
|
|
43
|
-
mouseInteraction:
|
|
32
|
+
speed: speed,
|
|
33
|
+
intensity: intensity,
|
|
34
|
+
mouseInteraction: mouseInteraction,
|
|
44
35
|
})
|
|
45
|
-
if (
|
|
46
|
-
uniforms.mouseStrength.value =
|
|
36
|
+
if (mouseInteraction) {
|
|
37
|
+
uniforms.mouseStrength.value = mouseStrength
|
|
47
38
|
}
|
|
48
39
|
|
|
49
|
-
const c1 = useShaderColor(
|
|
50
|
-
const c2 = useShaderColor(
|
|
51
|
-
const c3 = useShaderColor(
|
|
52
|
-
const c4 = useShaderColor(
|
|
40
|
+
const c1 = useShaderColor(color1)
|
|
41
|
+
const c2 = useShaderColor(color2)
|
|
42
|
+
const c3 = useShaderColor(color3)
|
|
43
|
+
const c4 = useShaderColor(color4)
|
|
53
44
|
|
|
54
45
|
const colorNode = createThemePlasmaColorNode(uniforms, {
|
|
55
46
|
color1: c1.node,
|
|
@@ -59,19 +50,19 @@
|
|
|
59
50
|
})
|
|
60
51
|
|
|
61
52
|
watch(
|
|
62
|
-
() =>
|
|
53
|
+
() => color1,
|
|
63
54
|
(hex) => c1.tweenTo(hex, 0.8)
|
|
64
55
|
)
|
|
65
56
|
watch(
|
|
66
|
-
() =>
|
|
57
|
+
() => color2,
|
|
67
58
|
(hex) => c2.tweenTo(hex, 0.8)
|
|
68
59
|
)
|
|
69
60
|
watch(
|
|
70
|
-
() =>
|
|
61
|
+
() => color3,
|
|
71
62
|
(hex) => c3.tweenTo(hex, 0.8)
|
|
72
63
|
)
|
|
73
64
|
watch(
|
|
74
|
-
() =>
|
|
65
|
+
() => color4,
|
|
75
66
|
(hex) => c4.tweenTo(hex, 0.8)
|
|
76
67
|
)
|
|
77
68
|
|
|
@@ -90,27 +81,27 @@
|
|
|
90
81
|
}
|
|
91
82
|
|
|
92
83
|
watch(
|
|
93
|
-
() =>
|
|
84
|
+
() => speed,
|
|
94
85
|
(v) => {
|
|
95
86
|
uniforms.speed.value = v
|
|
96
87
|
}
|
|
97
88
|
)
|
|
98
89
|
watch(
|
|
99
|
-
() =>
|
|
90
|
+
() => intensity,
|
|
100
91
|
(v) => {
|
|
101
92
|
uniforms.intensity.value = v
|
|
102
93
|
}
|
|
103
94
|
)
|
|
104
95
|
watch(
|
|
105
|
-
() =>
|
|
96
|
+
() => mouseInteraction,
|
|
106
97
|
(v) => {
|
|
107
|
-
uniforms.mouseStrength.value = v ?
|
|
98
|
+
uniforms.mouseStrength.value = v ? mouseStrength : 0
|
|
108
99
|
}
|
|
109
100
|
)
|
|
110
101
|
watch(
|
|
111
|
-
() =>
|
|
102
|
+
() => mouseStrength,
|
|
112
103
|
(v) => {
|
|
113
|
-
if (
|
|
104
|
+
if (mouseInteraction) uniforms.mouseStrength.value = v
|
|
114
105
|
}
|
|
115
106
|
)
|
|
116
107
|
|
|
@@ -1,55 +1,46 @@
|
|
|
1
|
-
<!-- eslint-disable @typescript-eslint/no-explicit-any -->
|
|
2
|
-
<!-- eslint-disable vue/no-boolean-default -->
|
|
3
|
-
<!-- eslint-disable @typescript-eslint/no-unused-vars -->
|
|
4
|
-
<!-- eslint-disable vue/define-props-destructuring -->
|
|
5
|
-
<!-- eslint-disable @typescript-eslint/ban-ts-comment -->
|
|
6
1
|
<script setup lang="ts">
|
|
7
|
-
// @ts-nocheck - TSL types
|
|
8
2
|
import {
|
|
9
3
|
createAmbientUniforms,
|
|
10
4
|
createThemeWaveColorNode,
|
|
11
5
|
} from '#layers/shader/app/composables/useAmbientMaterials'
|
|
12
6
|
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
color4: '#38bdf8',
|
|
33
|
-
}
|
|
34
|
-
)
|
|
7
|
+
const {
|
|
8
|
+
speed = 1.0,
|
|
9
|
+
intensity = 1.0,
|
|
10
|
+
mouseInteraction = true,
|
|
11
|
+
mouseStrength = 0.3,
|
|
12
|
+
color1 = '#8b5cf6',
|
|
13
|
+
color2 = '#6366f1',
|
|
14
|
+
color3 = '#a78bfa',
|
|
15
|
+
color4 = '#38bdf8',
|
|
16
|
+
} = defineProps<{
|
|
17
|
+
speed?: number
|
|
18
|
+
intensity?: number
|
|
19
|
+
mouseInteraction?: boolean
|
|
20
|
+
mouseStrength?: number
|
|
21
|
+
color1?: string
|
|
22
|
+
color2?: string
|
|
23
|
+
color3?: string
|
|
24
|
+
color4?: string
|
|
25
|
+
}>()
|
|
35
26
|
|
|
36
27
|
const emit = defineEmits<{
|
|
37
28
|
node: [colorNode: any]
|
|
38
29
|
}>()
|
|
39
30
|
|
|
40
31
|
const uniforms = createAmbientUniforms({
|
|
41
|
-
speed:
|
|
42
|
-
intensity:
|
|
43
|
-
mouseInteraction:
|
|
32
|
+
speed: speed,
|
|
33
|
+
intensity: intensity,
|
|
34
|
+
mouseInteraction: mouseInteraction,
|
|
44
35
|
})
|
|
45
|
-
if (
|
|
46
|
-
uniforms.mouseStrength.value =
|
|
36
|
+
if (mouseInteraction) {
|
|
37
|
+
uniforms.mouseStrength.value = mouseStrength
|
|
47
38
|
}
|
|
48
39
|
|
|
49
|
-
const c1 = useShaderColor(
|
|
50
|
-
const c2 = useShaderColor(
|
|
51
|
-
const c3 = useShaderColor(
|
|
52
|
-
const c4 = useShaderColor(
|
|
40
|
+
const c1 = useShaderColor(color1)
|
|
41
|
+
const c2 = useShaderColor(color2)
|
|
42
|
+
const c3 = useShaderColor(color3)
|
|
43
|
+
const c4 = useShaderColor(color4)
|
|
53
44
|
|
|
54
45
|
const colorNode = createThemeWaveColorNode(uniforms, {
|
|
55
46
|
color1: c1.node,
|
|
@@ -59,19 +50,19 @@
|
|
|
59
50
|
})
|
|
60
51
|
|
|
61
52
|
watch(
|
|
62
|
-
() =>
|
|
53
|
+
() => color1,
|
|
63
54
|
(hex) => c1.tweenTo(hex, 0.8)
|
|
64
55
|
)
|
|
65
56
|
watch(
|
|
66
|
-
() =>
|
|
57
|
+
() => color2,
|
|
67
58
|
(hex) => c2.tweenTo(hex, 0.8)
|
|
68
59
|
)
|
|
69
60
|
watch(
|
|
70
|
-
() =>
|
|
61
|
+
() => color3,
|
|
71
62
|
(hex) => c3.tweenTo(hex, 0.8)
|
|
72
63
|
)
|
|
73
64
|
watch(
|
|
74
|
-
() =>
|
|
65
|
+
() => color4,
|
|
75
66
|
(hex) => c4.tweenTo(hex, 0.8)
|
|
76
67
|
)
|
|
77
68
|
|
|
@@ -90,27 +81,27 @@
|
|
|
90
81
|
}
|
|
91
82
|
|
|
92
83
|
watch(
|
|
93
|
-
() =>
|
|
84
|
+
() => speed,
|
|
94
85
|
(v) => {
|
|
95
86
|
uniforms.speed.value = v
|
|
96
87
|
}
|
|
97
88
|
)
|
|
98
89
|
watch(
|
|
99
|
-
() =>
|
|
90
|
+
() => intensity,
|
|
100
91
|
(v) => {
|
|
101
92
|
uniforms.intensity.value = v
|
|
102
93
|
}
|
|
103
94
|
)
|
|
104
95
|
watch(
|
|
105
|
-
() =>
|
|
96
|
+
() => mouseInteraction,
|
|
106
97
|
(v) => {
|
|
107
|
-
uniforms.mouseStrength.value = v ?
|
|
98
|
+
uniforms.mouseStrength.value = v ? mouseStrength : 0
|
|
108
99
|
}
|
|
109
100
|
)
|
|
110
101
|
watch(
|
|
111
|
-
() =>
|
|
102
|
+
() => mouseStrength,
|
|
112
103
|
(v) => {
|
|
113
|
-
if (
|
|
104
|
+
if (mouseInteraction) uniforms.mouseStrength.value = v
|
|
114
105
|
}
|
|
115
106
|
)
|
|
116
107
|
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
<!-- eslint-disable @typescript-eslint/no-explicit-any -->
|
|
2
|
-
<!-- eslint-disable vue/no-boolean-default -->
|
|
3
|
-
<!-- eslint-disable @typescript-eslint/no-unused-vars -->
|
|
4
|
-
<!-- eslint-disable vue/define-props-destructuring -->
|
|
5
|
-
<!-- eslint-disable @typescript-eslint/ban-ts-comment -->
|
|
6
|
-
|
|
7
1
|
<script setup lang="ts">
|
|
8
|
-
// @ts-nocheck - Three.js WebGPU types
|
|
9
2
|
import { useWindowSize } from '@vueuse/core'
|
|
10
3
|
import {
|
|
11
4
|
ACESFilmicToneMapping,
|
|
@@ -22,33 +15,30 @@
|
|
|
22
15
|
} from 'three'
|
|
23
16
|
import { WebGPURenderer } from 'three/webgpu'
|
|
24
17
|
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
pointerEvents: 'none',
|
|
50
|
-
}
|
|
51
|
-
)
|
|
18
|
+
const {
|
|
19
|
+
material = null,
|
|
20
|
+
clearColor = '#000000',
|
|
21
|
+
toneMapping = 'aces',
|
|
22
|
+
antialias = true,
|
|
23
|
+
fixed = true,
|
|
24
|
+
zIndex = -1,
|
|
25
|
+
pointerEvents = 'none',
|
|
26
|
+
} = defineProps<{
|
|
27
|
+
/** The TSL node material to render */
|
|
28
|
+
material?: any
|
|
29
|
+
/** Background clear color */
|
|
30
|
+
clearColor?: string
|
|
31
|
+
/** Tone mapping algorithm */
|
|
32
|
+
toneMapping?: 'aces' | 'reinhard' | 'cineon' | 'linear'
|
|
33
|
+
/** Enable antialiasing */
|
|
34
|
+
antialias?: boolean
|
|
35
|
+
/** Fixed position (covers viewport) */
|
|
36
|
+
fixed?: boolean
|
|
37
|
+
/** Z-index for the background */
|
|
38
|
+
zIndex?: number
|
|
39
|
+
/** Pointer events on the canvas */
|
|
40
|
+
pointerEvents?: 'none' | 'auto'
|
|
41
|
+
}>()
|
|
52
42
|
|
|
53
43
|
const emit = defineEmits<{
|
|
54
44
|
ready: [renderer: any]
|
|
@@ -63,6 +53,8 @@
|
|
|
63
53
|
let planeMesh: Mesh
|
|
64
54
|
let animationId: number
|
|
65
55
|
let initialized = false
|
|
56
|
+
let initStarted = false
|
|
57
|
+
let disposed = false
|
|
66
58
|
|
|
67
59
|
const toneMappingMap: Record<string, number> = {
|
|
68
60
|
aces: ACESFilmicToneMapping,
|
|
@@ -72,13 +64,13 @@
|
|
|
72
64
|
}
|
|
73
65
|
|
|
74
66
|
const containerStyle = computed<Record<string, string | number>>(() => ({
|
|
75
|
-
position:
|
|
67
|
+
position: fixed ? 'fixed' : 'absolute',
|
|
76
68
|
top: 0,
|
|
77
69
|
left: 0,
|
|
78
|
-
width:
|
|
79
|
-
height:
|
|
80
|
-
zIndex:
|
|
81
|
-
pointerEvents:
|
|
70
|
+
width: fixed ? '100vw' : '100%',
|
|
71
|
+
height: fixed ? '100vh' : '100%',
|
|
72
|
+
zIndex: zIndex,
|
|
73
|
+
pointerEvents: pointerEvents,
|
|
82
74
|
overflow: 'hidden',
|
|
83
75
|
}))
|
|
84
76
|
|
|
@@ -94,6 +86,9 @@
|
|
|
94
86
|
}
|
|
95
87
|
|
|
96
88
|
function animate() {
|
|
89
|
+
// Bail if the component unmounted — guards against a frame scheduled just
|
|
90
|
+
// before teardown rendering on a disposed renderer.
|
|
91
|
+
if (disposed) return
|
|
97
92
|
animationId = requestAnimationFrame(animate)
|
|
98
93
|
if (renderer && scene && camera) {
|
|
99
94
|
renderer.render(scene, camera)
|
|
@@ -102,41 +97,67 @@
|
|
|
102
97
|
|
|
103
98
|
async function init() {
|
|
104
99
|
const canvas = canvasRef.value
|
|
105
|
-
if (!canvas) return
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
100
|
+
if (!canvas || disposed) return
|
|
101
|
+
|
|
102
|
+
try {
|
|
103
|
+
// WebGPURenderer falls back to WebGL2 if WebGPU is unavailable
|
|
104
|
+
renderer = new WebGPURenderer({ canvas, antialias: antialias })
|
|
105
|
+
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2))
|
|
106
|
+
renderer.setSize(width.value, height.value)
|
|
107
|
+
renderer.setClearColor(new Color(clearColor))
|
|
108
|
+
renderer.toneMapping = toneMappingMap[toneMapping] ?? ACESFilmicToneMapping
|
|
109
|
+
renderer.outputColorSpace = SRGBColorSpace
|
|
110
|
+
|
|
111
|
+
// Required async init for WebGPU context setup
|
|
112
|
+
await renderer.init()
|
|
113
|
+
|
|
114
|
+
// The component can unmount while the await above is pending (navigating
|
|
115
|
+
// away before WebGPU finishes initializing). onUnmounted already ran and
|
|
116
|
+
// disposed the renderer, so abort before starting the animation loop —
|
|
117
|
+
// otherwise we leak a throwing rAF loop rendering on a disposed renderer.
|
|
118
|
+
if (disposed) {
|
|
119
|
+
renderer.dispose()
|
|
120
|
+
return
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
scene = new Scene()
|
|
124
|
+
camera = new PerspectiveCamera(75, width.value / (height.value || 1), 0.1, 100)
|
|
125
|
+
camera.position.set(0, 0, 1)
|
|
126
|
+
|
|
127
|
+
const { width: pw, height: ph } = getPlaneSize(width.value, height.value)
|
|
128
|
+
const geometry = new PlaneGeometry(pw, ph)
|
|
129
|
+
planeMesh = new Mesh(geometry, material ?? new MeshBasicMaterial({ color: 0x000000 }))
|
|
130
|
+
scene.add(planeMesh)
|
|
131
|
+
|
|
132
|
+
// Pre-compile the shader pipeline only when the material's colorNode is already
|
|
133
|
+
// set (i.e. the preset component mounted and emitted @node before us). Without
|
|
134
|
+
// a colorNode the compilation produces a black fallback and a later needsUpdate
|
|
135
|
+
// won't reliably trigger a GPU pipeline rebuild in all drivers.
|
|
136
|
+
// When colorNode is absent we skip pre-compilation and let the first render()
|
|
137
|
+
// call compile lazily — the browser may stutter once, but the output is correct.
|
|
138
|
+
if (material?.colorNode) {
|
|
139
|
+
await renderer.compileAsync(scene, camera)
|
|
140
|
+
if (disposed) {
|
|
141
|
+
renderer.dispose()
|
|
142
|
+
return
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
initialized = true
|
|
147
|
+
emit('ready', renderer)
|
|
148
|
+
} catch (e) {
|
|
149
|
+
console.error('[ShaderBackground] init() failed:', e)
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// Always start the animation loop even if pre-compilation failed — Three.js
|
|
153
|
+
// will compile lazily on the first render() call.
|
|
154
|
+
if (scene && camera) {
|
|
155
|
+
animate()
|
|
156
|
+
}
|
|
136
157
|
}
|
|
137
158
|
|
|
138
159
|
watch(
|
|
139
|
-
() =>
|
|
160
|
+
() => material,
|
|
140
161
|
(mat) => {
|
|
141
162
|
if (planeMesh && mat) {
|
|
142
163
|
planeMesh.material = mat
|
|
@@ -145,7 +166,7 @@
|
|
|
145
166
|
)
|
|
146
167
|
|
|
147
168
|
watch(
|
|
148
|
-
() =>
|
|
169
|
+
() => clearColor,
|
|
149
170
|
(color) => {
|
|
150
171
|
if (renderer && initialized) {
|
|
151
172
|
renderer.setClearColor(new Color(color))
|
|
@@ -165,11 +186,24 @@
|
|
|
165
186
|
}
|
|
166
187
|
})
|
|
167
188
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
189
|
+
// As a `.client.vue` component, the real <canvas> can attach a tick after this
|
|
190
|
+
// component's onMounted fires, leaving canvasRef.value null. Drive init() off the
|
|
191
|
+
// template ref so it runs the moment the canvas element actually binds.
|
|
192
|
+
watch(
|
|
193
|
+
canvasRef,
|
|
194
|
+
(canvas) => {
|
|
195
|
+
if (canvas && !initStarted) {
|
|
196
|
+
initStarted = true
|
|
197
|
+
init()
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
{ immediate: true, flush: 'post' }
|
|
201
|
+
)
|
|
171
202
|
|
|
172
203
|
onUnmounted(() => {
|
|
204
|
+
// Mark disposed first so an in-flight async init() aborts instead of
|
|
205
|
+
// starting the animation loop after teardown.
|
|
206
|
+
disposed = true
|
|
173
207
|
cancelAnimationFrame(animationId)
|
|
174
208
|
planeMesh?.geometry.dispose()
|
|
175
209
|
renderer?.dispose()
|
|
@@ -1,17 +1,7 @@
|
|
|
1
|
-
<!-- eslint-disable @typescript-eslint/no-explicit-any -->
|
|
2
|
-
<!-- eslint-disable vue/no-boolean-default -->
|
|
3
|
-
<!-- eslint-disable @typescript-eslint/no-unused-vars -->
|
|
4
|
-
<!-- eslint-disable vue/define-props-destructuring -->
|
|
5
|
-
<!-- eslint-disable @typescript-eslint/ban-ts-comment -->
|
|
6
1
|
<script setup lang="ts">
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}>(),
|
|
11
|
-
{
|
|
12
|
-
show: true,
|
|
13
|
-
}
|
|
14
|
-
)
|
|
2
|
+
const { show = true } = defineProps<{
|
|
3
|
+
show?: boolean
|
|
4
|
+
}>()
|
|
15
5
|
|
|
16
6
|
const config = useAppConfig()
|
|
17
7
|
const shaderConfig = (config.shader || {}) as {
|
|
@@ -21,7 +11,7 @@
|
|
|
21
11
|
const { $shader } = useNuxtApp() as { $shader?: { useWebGPU: boolean } }
|
|
22
12
|
|
|
23
13
|
const showDebug = computed(() => {
|
|
24
|
-
if (!
|
|
14
|
+
if (!show) return false
|
|
25
15
|
return import.meta.dev && shaderConfig.debugPanel !== false
|
|
26
16
|
})
|
|
27
17
|
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
<!-- eslint-disable no-restricted-imports -->
|
|
2
|
-
<!-- eslint-disable @typescript-eslint/no-explicit-any -->
|
|
3
|
-
<!-- eslint-disable vue/no-boolean-default -->
|
|
4
|
-
<!-- eslint-disable @typescript-eslint/no-unused-vars -->
|
|
5
|
-
<!-- eslint-disable vue/define-props-destructuring -->
|
|
6
|
-
<!-- eslint-disable @typescript-eslint/ban-ts-comment -->
|
|
7
1
|
<script setup lang="ts">
|
|
8
|
-
// @ts-nocheck - TSL types
|
|
9
2
|
import type { Component } from 'vue'
|
|
10
3
|
import { tweenUniform } from '#layers/shader/app/utils/tsl/tween'
|
|
11
4
|
import { DoubleSide } from 'three'
|
|
@@ -52,6 +45,10 @@
|
|
|
52
45
|
const currentPreset = shallowRef<Component | null>(props.preset)
|
|
53
46
|
const nextPreset = shallowRef<Component | null>(null)
|
|
54
47
|
|
|
48
|
+
function setCurrentPreset(preset: Component | null) {
|
|
49
|
+
currentPreset.value = preset
|
|
50
|
+
}
|
|
51
|
+
|
|
55
52
|
// Material created once, updated via colorNode
|
|
56
53
|
const material = new MeshBasicNodeMaterial()
|
|
57
54
|
material.side = DoubleSide
|
|
@@ -87,8 +84,9 @@
|
|
|
87
84
|
if (!newPreset || newPreset === oldPreset) return
|
|
88
85
|
|
|
89
86
|
if (!currentPreset.value) {
|
|
90
|
-
// First preset — no transition
|
|
91
|
-
currentPreset.value
|
|
87
|
+
// First preset — no transition (setter call sidesteps the null-narrowing
|
|
88
|
+
// TS applies to `currentPreset.value` inside this branch)
|
|
89
|
+
setCurrentPreset(newPreset)
|
|
92
90
|
return
|
|
93
91
|
}
|
|
94
92
|
|
|
@@ -1,33 +1,21 @@
|
|
|
1
|
-
<!-- eslint-disable vue/no-unused-properties -->
|
|
2
|
-
<!-- eslint-disable @typescript-eslint/no-explicit-any -->
|
|
3
|
-
<!-- eslint-disable vue/no-boolean-default -->
|
|
4
|
-
<!-- eslint-disable @typescript-eslint/no-unused-vars -->
|
|
5
|
-
<!-- eslint-disable vue/define-props-destructuring -->
|
|
6
|
-
<!-- eslint-disable @typescript-eslint/ban-ts-comment -->
|
|
7
1
|
<script setup lang="ts">
|
|
8
|
-
|
|
9
|
-
import { DoubleSide } from 'three'
|
|
2
|
+
import { BackSide, DoubleSide, FrontSide } from 'three'
|
|
10
3
|
import { MeshBasicNodeMaterial } from 'three/webgpu'
|
|
11
4
|
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}>(),
|
|
17
|
-
{
|
|
18
|
-
transparent: false,
|
|
19
|
-
side: 'double',
|
|
20
|
-
}
|
|
21
|
-
)
|
|
5
|
+
const { transparent = false, side = 'double' } = defineProps<{
|
|
6
|
+
transparent?: boolean
|
|
7
|
+
side?: 'front' | 'back' | 'double'
|
|
8
|
+
}>()
|
|
22
9
|
|
|
23
10
|
// Create the shader graph context for child nodes
|
|
24
11
|
const graph = useShaderGraph()
|
|
25
12
|
|
|
26
13
|
// Create material ONCE in setup -- never recreated
|
|
27
14
|
const material = new MeshBasicNodeMaterial()
|
|
28
|
-
|
|
15
|
+
const sideMap = { front: FrontSide, back: BackSide, double: DoubleSide } as const
|
|
16
|
+
material.side = sideMap[side]
|
|
29
17
|
|
|
30
|
-
if (
|
|
18
|
+
if (transparent) {
|
|
31
19
|
material.transparent = true
|
|
32
20
|
}
|
|
33
21
|
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
<!-- eslint-disable @typescript-eslint/no-explicit-any -->
|
|
2
|
-
<!-- eslint-disable vue/no-boolean-default -->
|
|
3
|
-
<!-- eslint-disable @typescript-eslint/no-unused-vars -->
|
|
4
|
-
<!-- eslint-disable vue/define-props-destructuring -->
|
|
5
|
-
<!-- eslint-disable @typescript-eslint/ban-ts-comment -->
|
|
6
1
|
<script setup lang="ts">
|
|
7
|
-
// @ts-nocheck - TSL types are complex
|
|
8
2
|
import { DoubleSide } from 'three'
|
|
9
3
|
import { float, Fn, positionLocal, uv, vec3, vec4 } from 'three/tsl'
|
|
10
4
|
import { MeshBasicNodeMaterial } from 'three/webgpu'
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
<!-- eslint-disable @typescript-eslint/no-explicit-any -->
|
|
2
|
-
<!-- eslint-disable vue/no-boolean-default -->
|
|
3
|
-
<!-- eslint-disable @typescript-eslint/no-unused-vars -->
|
|
4
|
-
<!-- eslint-disable vue/define-props-destructuring -->
|
|
5
|
-
<!-- eslint-disable @typescript-eslint/ban-ts-comment -->
|
|
6
1
|
<script setup lang="ts">
|
|
7
2
|
const props = withDefaults(
|
|
8
3
|
defineProps<{
|