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,6 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/consistent-type-assertions */
|
|
2
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
3
|
-
// @ts-nocheck - TSL types are complex and not fully exported from three/tsl
|
|
4
1
|
/**
|
|
5
2
|
* Modular TSL Noise Utilities
|
|
6
3
|
* Provides composable noise functions for shader effects
|
|
@@ -92,7 +89,7 @@ export function valueNoise2D(st: TSLNode): TSLNode {
|
|
|
92
89
|
const d = hash21(i.add(vec2(1, 1)))
|
|
93
90
|
|
|
94
91
|
// Smooth interpolation
|
|
95
|
-
const u = f.mul(f).mul(float(3).sub(f.mul(2)))
|
|
92
|
+
const u: TSLNode = f.mul(f).mul(float(3).sub(f.mul(2)))
|
|
96
93
|
|
|
97
94
|
return mix(mix(a, b, u.x), mix(c, d, u.x), u.y)
|
|
98
95
|
}
|
|
@@ -103,7 +100,7 @@ export function valueNoise2D(st: TSLNode): TSLNode {
|
|
|
103
100
|
export function simplexNoise2D(v: TSLNode): TSLNode {
|
|
104
101
|
const C = vec4(0.211324865405187, 0.366025403784439, -0.577350269189626, 0.024390243902439)
|
|
105
102
|
|
|
106
|
-
const i = floor(v.add(dot(v, C.yy)))
|
|
103
|
+
const i: TSLNode = floor(v.add(dot(v, C.yy)))
|
|
107
104
|
const x0 = v.sub(i).add(dot(i, C.xx))
|
|
108
105
|
|
|
109
106
|
const i1x = step(x0.y, x0.x)
|
|
@@ -113,7 +110,7 @@ export function simplexNoise2D(v: TSLNode): TSLNode {
|
|
|
113
110
|
const x12 = x0.xyxy.add(C.xxzz)
|
|
114
111
|
const x12_mod = vec4(x12.x.sub(i1.x), x12.y.sub(i1.y), x12.z, x12.w)
|
|
115
112
|
|
|
116
|
-
const iMod = mod(i, 289)
|
|
113
|
+
const iMod: TSLNode = mod(i, 289)
|
|
117
114
|
const p1 = mod(
|
|
118
115
|
iMod.y
|
|
119
116
|
.add(vec3(0, i1.y, 1))
|
|
@@ -151,11 +148,11 @@ export function simplexNoise2D(v: TSLNode): TSLNode {
|
|
|
151
148
|
const ox = floor(x.add(0.5))
|
|
152
149
|
const a0 = x.sub(ox)
|
|
153
150
|
|
|
154
|
-
const mMod = m4.mul(float(1.79284291400159).sub(a0.mul(a0).add(h.mul(h)).mul(0.85373472095314)))
|
|
151
|
+
const mMod: TSLNode = m4.mul(float(1.79284291400159).sub(a0.mul(a0).add(h.mul(h)).mul(0.85373472095314)))
|
|
155
152
|
|
|
156
|
-
const gx = a0.x.mul(x0.x).add(h.x.mul(x0.y))
|
|
157
|
-
const gy = a0.y.mul(x12_mod.x).add(h.y.mul(x12_mod.y))
|
|
158
|
-
const gz = a0.z.mul(x12_mod.z).add(h.z.mul(x12_mod.w))
|
|
153
|
+
const gx: TSLNode = a0.x.mul(x0.x).add(h.x.mul(x0.y))
|
|
154
|
+
const gy: TSLNode = a0.y.mul(x12_mod.x).add(h.y.mul(x12_mod.y))
|
|
155
|
+
const gz: TSLNode = a0.z.mul(x12_mod.z).add(h.z.mul(x12_mod.w))
|
|
159
156
|
|
|
160
157
|
return dot(mMod, vec3(gx, gy, gz)).mul(130)
|
|
161
158
|
}
|
|
@@ -170,7 +167,7 @@ export function simplexNoise2D(v: TSLNode): TSLNode {
|
|
|
170
167
|
export function gradientNoise3D(p: TSLNode): TSLNode {
|
|
171
168
|
const i = floor(p)
|
|
172
169
|
const f = fract(p)
|
|
173
|
-
const u = f.mul(f).mul(float(3).sub(f.mul(2)))
|
|
170
|
+
const u: TSLNode = f.mul(f).mul(float(3).sub(f.mul(2)))
|
|
174
171
|
|
|
175
172
|
return mix(
|
|
176
173
|
mix(
|
|
@@ -221,9 +218,9 @@ export type FBMOptions = {
|
|
|
221
218
|
export function fbm2D(p: TSLNode, options: FBMOptions = {}): TSLNode {
|
|
222
219
|
const { octaves = 5, lacunarity = 2.0, gain = 0.5, amplitude = 0.5, frequency = 1.0 } = options
|
|
223
220
|
|
|
224
|
-
let value = float(0)
|
|
225
|
-
let amp = float(amplitude)
|
|
226
|
-
let freq = float(frequency)
|
|
221
|
+
let value: TSLNode = float(0)
|
|
222
|
+
let amp: TSLNode = float(amplitude)
|
|
223
|
+
let freq: TSLNode = float(frequency)
|
|
227
224
|
const currentP = p
|
|
228
225
|
|
|
229
226
|
for (let i = 0; i < octaves; i++) {
|
|
@@ -241,9 +238,9 @@ export function fbm2D(p: TSLNode, options: FBMOptions = {}): TSLNode {
|
|
|
241
238
|
export function fbm3D(p: TSLNode, options: FBMOptions = {}): TSLNode {
|
|
242
239
|
const { octaves = 5, lacunarity = 2.0, gain = 0.5, amplitude = 0.5, frequency = 1.0 } = options
|
|
243
240
|
|
|
244
|
-
let value = float(0)
|
|
245
|
-
let amp = float(amplitude)
|
|
246
|
-
let freq = float(frequency)
|
|
241
|
+
let value: TSLNode = float(0)
|
|
242
|
+
let amp: TSLNode = float(amplitude)
|
|
243
|
+
let freq: TSLNode = float(frequency)
|
|
247
244
|
|
|
248
245
|
for (let i = 0; i < octaves; i++) {
|
|
249
246
|
value = value.add(amp.mul(gradientNoise3D(p.mul(freq))))
|
|
@@ -271,8 +268,8 @@ export function voronoi2D(uv: TSLNode, scale: TSLNode | number = 1): VoronoiResu
|
|
|
271
268
|
const i = floor(scaledUV)
|
|
272
269
|
const f = fract(scaledUV)
|
|
273
270
|
|
|
274
|
-
let minDist = float(1)
|
|
275
|
-
let cellId = vec2(0, 0)
|
|
271
|
+
let minDist: TSLNode = float(1)
|
|
272
|
+
let cellId: TSLNode = vec2(0, 0)
|
|
276
273
|
|
|
277
274
|
// Check 3x3 neighborhood
|
|
278
275
|
for (let y = -1; y <= 1; y++) {
|
|
@@ -284,7 +281,7 @@ export function voronoi2D(uv: TSLNode, scale: TSLNode | number = 1): VoronoiResu
|
|
|
284
281
|
|
|
285
282
|
const isCloser = step(dist, minDist)
|
|
286
283
|
minDist = mix(minDist, dist, isCloser)
|
|
287
|
-
cellId = mix(cellId, i.add(neighbor), isCloser)
|
|
284
|
+
cellId = mix(cellId, i.add(neighbor), isCloser)
|
|
288
285
|
}
|
|
289
286
|
}
|
|
290
287
|
|
|
@@ -329,9 +326,9 @@ export function domainWarp2D(
|
|
|
329
326
|
export function turbulence2D(p: TSLNode, options: FBMOptions = {}): TSLNode {
|
|
330
327
|
const { octaves = 5, lacunarity = 2.0, gain = 0.5, amplitude = 0.5, frequency = 1.0 } = options
|
|
331
328
|
|
|
332
|
-
let value = float(0)
|
|
333
|
-
let amp = float(amplitude)
|
|
334
|
-
let freq = float(frequency)
|
|
329
|
+
let value: TSLNode = float(0)
|
|
330
|
+
let amp: TSLNode = float(amplitude)
|
|
331
|
+
let freq: TSLNode = float(frequency)
|
|
335
332
|
|
|
336
333
|
for (let i = 0; i < octaves; i++) {
|
|
337
334
|
value = value.add(amp.mul(abs(simplexNoise2D(p.mul(freq)))))
|
|
@@ -355,7 +352,7 @@ export function simplexNoise3d(v: TSLNode): TSLNode {
|
|
|
355
352
|
const D = vec4(0.0, 0.5, 1.0, 2.0)
|
|
356
353
|
|
|
357
354
|
const i = vec3(floor(v.add(dot(v, C.yyy)))).toVar()
|
|
358
|
-
const x0 = vec3(v.sub(i).add(dot(i, C.xxx))).toVar()
|
|
355
|
+
const x0: TSLNode = vec3(v.sub(i).add(dot(i, C.xxx))).toVar()
|
|
359
356
|
|
|
360
357
|
const g = vec3(step(x0.yzx, x0.xyz)).toVar()
|
|
361
358
|
const l = vec3(sub(1.0, g)).toVar()
|
|
@@ -384,14 +381,15 @@ export function simplexNoise3d(v: TSLNode): TSLNode {
|
|
|
384
381
|
const y_ = vec4(floor(j.sub(mul(7.0, x_)))).toVar()
|
|
385
382
|
const x = vec4(x_.mul(ns.x).add(ns.yyyy)).toVar()
|
|
386
383
|
const y = vec4(y_.mul(ns.x).add(ns.yyyy)).toVar()
|
|
387
|
-
const h = vec4(sub(1.0, abs(x).sub(abs(y)))).toVar()
|
|
384
|
+
const h: TSLNode = vec4(sub(1.0, abs(x).sub(abs(y)))).toVar()
|
|
388
385
|
|
|
389
386
|
const b0 = vec4(x.xy, y.xy).toVar()
|
|
390
387
|
const b1 = vec4(x.zw, y.zw).toVar()
|
|
391
388
|
|
|
392
389
|
const s0 = vec4(floor(b0).mul(2.0).add(1.0)).toVar()
|
|
393
390
|
const s1 = vec4(floor(b1).mul(2.0).add(1.0)).toVar()
|
|
394
|
-
const
|
|
391
|
+
const zeroVec4: TSLNode = vec4(0.0)
|
|
392
|
+
const sh = vec4(step(h, zeroVec4).negate()).toVar()
|
|
395
393
|
|
|
396
394
|
const a0 = vec4(b0.xzyw.add(s0.xzyw.mul(sh.xxyy))).toVar()
|
|
397
395
|
const a1 = vec4(b1.xzyw.add(s1.xzyw.mul(sh.zzww))).toVar()
|
|
@@ -429,7 +427,7 @@ export function simplexNoise4d(v: TSLNode): TSLNode {
|
|
|
429
427
|
const C = vec2(0.138196601125010504, 0.309016994374947451)
|
|
430
428
|
|
|
431
429
|
const i = vec4(floor(v.add(dot(v, C.yyyy)))).toVar()
|
|
432
|
-
const x0 = vec4(v.sub(i).add(dot(i, C.xxxx))).toVar()
|
|
430
|
+
const x0: TSLNode = vec4(v.sub(i).add(dot(i, C.xxxx))).toVar()
|
|
433
431
|
|
|
434
432
|
const i0 = vec4().toVar()
|
|
435
433
|
const isX = vec3(step(x0.yzw, x0.xxx)).toVar()
|
|
@@ -529,19 +527,21 @@ export function perlinNoise3d(P: TSLNode): TSLNode {
|
|
|
529
527
|
const ixy0 = vec4(permuteVec4(ixy.add(iz0))).toVar()
|
|
530
528
|
const ixy1 = vec4(permuteVec4(ixy.add(iz1))).toVar()
|
|
531
529
|
|
|
532
|
-
const gx0 = vec4(ixy0.mul(1.0 / 7.0)).toVar()
|
|
533
|
-
const gy0 = vec4(fract(floor(gx0).mul(1.0 / 7.0)).sub(0.5)).toVar()
|
|
530
|
+
const gx0: TSLNode = vec4(ixy0.mul(1.0 / 7.0)).toVar()
|
|
531
|
+
const gy0: TSLNode = vec4(fract(floor(gx0).mul(1.0 / 7.0)).sub(0.5)).toVar()
|
|
534
532
|
gx0.assign(fract(gx0))
|
|
535
|
-
const gz0 = vec4(vec4(0.5).sub(abs(gx0)).sub(abs(gy0))).toVar()
|
|
536
|
-
const
|
|
533
|
+
const gz0: TSLNode = vec4(vec4(0.5).sub(abs(gx0)).sub(abs(gy0))).toVar()
|
|
534
|
+
const zero0: TSLNode = vec4(0.0)
|
|
535
|
+
const sz0: TSLNode = vec4(step(gz0, zero0)).toVar()
|
|
537
536
|
gx0.subAssign(sz0.mul(step(0.0, gx0).sub(0.5)))
|
|
538
537
|
gy0.subAssign(sz0.mul(step(0.0, gy0).sub(0.5)))
|
|
539
538
|
|
|
540
|
-
const gx1 = vec4(ixy1.mul(1.0 / 7.0)).toVar()
|
|
541
|
-
const gy1 = vec4(fract(floor(gx1).mul(1.0 / 7.0)).sub(0.5)).toVar()
|
|
539
|
+
const gx1: TSLNode = vec4(ixy1.mul(1.0 / 7.0)).toVar()
|
|
540
|
+
const gy1: TSLNode = vec4(fract(floor(gx1).mul(1.0 / 7.0)).sub(0.5)).toVar()
|
|
542
541
|
gx1.assign(fract(gx1))
|
|
543
|
-
const gz1 = vec4(vec4(0.5).sub(abs(gx1)).sub(abs(gy1))).toVar()
|
|
544
|
-
const
|
|
542
|
+
const gz1: TSLNode = vec4(vec4(0.5).sub(abs(gx1)).sub(abs(gy1))).toVar()
|
|
543
|
+
const zero1: TSLNode = vec4(0.0)
|
|
544
|
+
const sz1: TSLNode = vec4(step(gz1, zero1)).toVar()
|
|
545
545
|
gx1.subAssign(sz1.mul(step(0.0, gx1).sub(0.5)))
|
|
546
546
|
gy1.subAssign(sz1.mul(step(0.0, gy1).sub(0.5)))
|
|
547
547
|
|
|
@@ -649,10 +649,10 @@ export function curlNoise3d(inputA: TSLNode): TSLNode {
|
|
|
649
649
|
export function ridgedFbm2d(p: TSLNode, options: FBMOptions = {}): TSLNode {
|
|
650
650
|
const { octaves = 5, lacunarity = 2.0, gain = 0.5, amplitude = 0.5, frequency = 1.0 } = options
|
|
651
651
|
|
|
652
|
-
let value = float(0)
|
|
653
|
-
let amp = float(amplitude)
|
|
654
|
-
let freq = float(frequency)
|
|
655
|
-
let maxValue = float(0)
|
|
652
|
+
let value: TSLNode = float(0)
|
|
653
|
+
let amp: TSLNode = float(amplitude)
|
|
654
|
+
let freq: TSLNode = float(frequency)
|
|
655
|
+
let maxValue: TSLNode = float(0)
|
|
656
656
|
|
|
657
657
|
for (let i = 0; i < octaves; i++) {
|
|
658
658
|
// Sample noise and create ridges by taking absolute value and inverting
|
|
@@ -678,10 +678,10 @@ export function ridgedFbm2d(p: TSLNode, options: FBMOptions = {}): TSLNode {
|
|
|
678
678
|
export function ridgedFbm3d(p: TSLNode, options: FBMOptions = {}): TSLNode {
|
|
679
679
|
const { octaves = 5, lacunarity = 2.0, gain = 0.5, amplitude = 0.5, frequency = 1.0 } = options
|
|
680
680
|
|
|
681
|
-
let value = float(0)
|
|
682
|
-
let amp = float(amplitude)
|
|
683
|
-
let freq = float(frequency)
|
|
684
|
-
let maxValue = float(0)
|
|
681
|
+
let value: TSLNode = float(0)
|
|
682
|
+
let amp: TSLNode = float(amplitude)
|
|
683
|
+
let freq: TSLNode = float(frequency)
|
|
684
|
+
let maxValue: TSLNode = float(0)
|
|
685
685
|
|
|
686
686
|
for (let i = 0; i < octaves; i++) {
|
|
687
687
|
const noiseValue = simplexNoise3d(p.mul(freq))
|
|
@@ -779,7 +779,7 @@ export function turbulenceRotational(
|
|
|
779
779
|
const amp = float(amplitude).toVar()
|
|
780
780
|
|
|
781
781
|
// Turbulence rotation matrix
|
|
782
|
-
const rot = mat2(0.6, -0.8, 0.8, 0.6).toVar()
|
|
782
|
+
const rot: TSLNode = mat2(0.6, -0.8, 0.8, 0.6).toVar()
|
|
783
783
|
|
|
784
784
|
// Loop through turbulence octaves
|
|
785
785
|
Loop({ start: 0.0, end: octaves, type: 'float' }, ({ i }) => {
|
|
@@ -810,10 +810,10 @@ export function turbulenceRotational(
|
|
|
810
810
|
export function fbm3dSimplex(p: TSLNode, options: FBMOptions = {}): TSLNode {
|
|
811
811
|
const { octaves = 4, lacunarity = 2.0, gain = 0.5, amplitude = 1.0, frequency = 1.0 } = options
|
|
812
812
|
|
|
813
|
-
let value = float(0)
|
|
814
|
-
let amp = float(amplitude)
|
|
815
|
-
let freq = float(frequency)
|
|
816
|
-
let maxValue = float(0)
|
|
813
|
+
let value: TSLNode = float(0)
|
|
814
|
+
let amp: TSLNode = float(amplitude)
|
|
815
|
+
let freq: TSLNode = float(frequency)
|
|
816
|
+
let maxValue: TSLNode = float(0)
|
|
817
817
|
|
|
818
818
|
for (let i = 0; i < octaves; i++) {
|
|
819
819
|
value = value.add(simplexNoise3d(p.mul(freq)).mul(amp))
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
2
|
-
// @ts-nocheck - TSL types are complex and not fully exported from three/tsl
|
|
3
1
|
/**
|
|
4
2
|
* Modular TSL Noise Helper Functions
|
|
5
3
|
* Provides primitive functions required by 3D/4D noise algorithms
|
|
@@ -100,16 +98,18 @@ export function taylorInvSqrtFloat(r: TSLNode): TSLNode {
|
|
|
100
98
|
*/
|
|
101
99
|
export function grad4(j: TSLNode, ip: TSLNode): TSLNode {
|
|
102
100
|
const ones = vec4(1.0, 1.0, 1.0, -1.0)
|
|
103
|
-
const p = vec4().toVar()
|
|
104
|
-
const s = vec4().toVar()
|
|
101
|
+
const p: TSLNode = vec4().toVar()
|
|
102
|
+
const s: TSLNode = vec4().toVar()
|
|
105
103
|
|
|
106
104
|
p.xyz.assign(
|
|
107
105
|
floor(fract(vec3(j).mul(ip.xyz)).mul(7.0))
|
|
108
106
|
.mul(ip.z)
|
|
109
107
|
.sub(1.0)
|
|
110
108
|
)
|
|
111
|
-
|
|
112
|
-
|
|
109
|
+
const pAbs: TSLNode = abs(p.xyz)
|
|
110
|
+
p.w.assign(sub(1.5, dot(pAbs, ones.xyz)))
|
|
111
|
+
const zero4: TSLNode = vec4(0.0)
|
|
112
|
+
s.assign(vec4(lessThan(p, zero4)))
|
|
113
113
|
p.xyz.assign(p.xyz.add(s.xyz.mul(2.0).sub(1.0).mul(s.www)))
|
|
114
114
|
|
|
115
115
|
return p
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/* eslint-disable max-params */
|
|
2
|
-
/* eslint-disable @typescript-eslint/consistent-type-assertions */
|
|
3
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
4
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
5
|
-
// @ts-nocheck - TSL types are complex and not fully exported from three/tsl
|
|
6
1
|
/**
|
|
7
2
|
* Modular TSL Palette & Color Utilities
|
|
8
3
|
* Provides composable color palette functions for shader effects
|
|
@@ -105,19 +100,23 @@ export function gradientMulti(t: TSLNode, stops: ColorStop[]): TSLNode {
|
|
|
105
100
|
|
|
106
101
|
// Sort stops by position
|
|
107
102
|
const sortedStops = [...stops].sort((a, b) => a.position - b.position)
|
|
103
|
+
const [firstStop] = sortedStops
|
|
104
|
+
if (!firstStop) {
|
|
105
|
+
throw new Error('Gradient requires at least 2 color stops')
|
|
106
|
+
}
|
|
108
107
|
|
|
109
|
-
let result = hexToVec3(
|
|
108
|
+
let result: TSLNode = hexToVec3(firstStop.color)
|
|
110
109
|
|
|
111
110
|
for (let i = 1; i < sortedStops.length; i++) {
|
|
112
111
|
const prevStop = sortedStops[i - 1]
|
|
113
112
|
const currStop = sortedStops[i]
|
|
113
|
+
if (!prevStop || !currStop) continue
|
|
114
114
|
|
|
115
|
-
const prevColor = hexToVec3(prevStop.color)
|
|
116
115
|
const currColor = hexToVec3(currStop.color)
|
|
117
116
|
|
|
118
117
|
const localT = clamp(t.sub(prevStop.position).div(currStop.position - prevStop.position), 0, 1)
|
|
119
118
|
|
|
120
|
-
result = mix(result, currColor, step(prevStop.position, t).mul(localT))
|
|
119
|
+
result = mix(result, currColor, step(prevStop.position, t).mul(localT))
|
|
121
120
|
}
|
|
122
121
|
|
|
123
122
|
return result
|
|
@@ -309,9 +308,9 @@ export function hslToRgb(hsl: TSLNode): TSLNode {
|
|
|
309
308
|
const hue = fract(h).mul(6)
|
|
310
309
|
|
|
311
310
|
// Choose color based on hue sector
|
|
312
|
-
const r = mix(mix(c, x, step(1, hue)), mix(float(0), x, step(4, hue)), step(2, hue))
|
|
313
|
-
const g = mix(mix(x, c, step(1, hue)), mix(x, float(0), step(4, hue)), step(2, hue))
|
|
314
|
-
const b = mix(float(0), mix(c, x, step(4, hue)), step(3, hue))
|
|
311
|
+
const r: TSLNode = mix(mix(c, x, step(1, hue)), mix(float(0), x, step(4, hue)), step(2, hue))
|
|
312
|
+
const g: TSLNode = mix(mix(x, c, step(1, hue)), mix(x, float(0), step(4, hue)), step(2, hue))
|
|
313
|
+
const b: TSLNode = mix(float(0), mix(c, x, step(4, hue)), step(3, hue))
|
|
315
314
|
|
|
316
315
|
return vec3(r, g, b).add(m)
|
|
317
316
|
}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/* eslint-disable complexity */
|
|
2
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
3
|
-
// @ts-nocheck - TSL types are complex and not fully exported from three/tsl
|
|
4
1
|
/**
|
|
5
2
|
* Modular TSL Pattern Utilities
|
|
6
3
|
* Provides procedural texture patterns
|
|
@@ -37,7 +34,7 @@ export function canvasWeavePattern(uv: TSLNode): TSLNode {
|
|
|
37
34
|
|
|
38
35
|
// Add noise to warp the grid itself
|
|
39
36
|
const noiseOffset = fbm3dSimplex(vec3(uv.mul(30.0), 0.0), { octaves: 3 }).mul(0.1)
|
|
40
|
-
const warpedGrid = grid.add(noiseOffset)
|
|
37
|
+
const warpedGrid: TSLNode = grid.add(noiseOffset)
|
|
41
38
|
|
|
42
39
|
// Create irregular weave pattern
|
|
43
40
|
const weaveX = sin(
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
2
|
-
// @ts-nocheck - TSL types are complex and not fully exported from three/tsl
|
|
3
1
|
/**
|
|
4
2
|
* Modular TSL SDF (Signed Distance Field) Utilities
|
|
5
3
|
* Provides 2D/3D SDF shapes and operations for procedural geometry
|
|
@@ -8,6 +6,9 @@ import {
|
|
|
8
6
|
abs,
|
|
9
7
|
add,
|
|
10
8
|
clamp,
|
|
9
|
+
dot,
|
|
10
|
+
float,
|
|
11
|
+
If,
|
|
11
12
|
length,
|
|
12
13
|
max,
|
|
13
14
|
min,
|
|
@@ -93,9 +94,10 @@ export function sdHexagon(p: TSLNode, r: TSLNode | number = 0.5): TSLNode {
|
|
|
93
94
|
const radius = typeof r === 'number' ? float(r) : r
|
|
94
95
|
const k = vec3(-0.866025404, 0.5, 0.577350269)
|
|
95
96
|
|
|
96
|
-
const _p = abs(p).toVar()
|
|
97
|
+
const _p: TSLNode = abs(p).toVar()
|
|
97
98
|
_p.subAssign(float(2.0).mul(min(dot(k.xy, _p), 0.0).mul(k.xy)))
|
|
98
|
-
|
|
99
|
+
const clampedX: TSLNode = clamp(_p.x, k.z.negate().mul(radius), k.z.mul(radius))
|
|
100
|
+
_p.subAssign(vec2(clampedX, radius))
|
|
99
101
|
|
|
100
102
|
return length(_p).mul(sign(_p.y))
|
|
101
103
|
}
|
|
@@ -108,13 +110,15 @@ export function sdHexagon(p: TSLNode, r: TSLNode | number = 0.5): TSLNode {
|
|
|
108
110
|
export function sdEquilateralTriangle(p: TSLNode, r: TSLNode | number = 0.1): TSLNode {
|
|
109
111
|
const radius = typeof r === 'number' ? float(r) : r
|
|
110
112
|
const k = sqrt(3.0)
|
|
111
|
-
const _p = (p ?? vec2(0)).toVar()
|
|
113
|
+
const _p: TSLNode = (p ?? vec2(0)).toVar()
|
|
112
114
|
|
|
113
115
|
_p.x = abs(_p.x).sub(radius).toVar()
|
|
114
116
|
_p.y = _p.y.add(radius.div(k)).toVar()
|
|
115
117
|
|
|
116
118
|
If(_p.x.add(k.mul(_p.y)).greaterThan(0), () => {
|
|
117
|
-
_p.
|
|
119
|
+
const foldedX: TSLNode = _p.x.sub(k.mul(_p.y))
|
|
120
|
+
const foldedY: TSLNode = k.negate().mul(_p.x).sub(_p.y)
|
|
121
|
+
_p.assign(vec2(foldedX, foldedY).div(2))
|
|
118
122
|
})
|
|
119
123
|
|
|
120
124
|
_p.x.subAssign(clamp(_p.x, radius.mul(-2), 0.0))
|
|
@@ -221,6 +225,6 @@ export function sdTriangle(p: TSLNode, size: TSLNode | number = 0.4): TSLNode {
|
|
|
221
225
|
*/
|
|
222
226
|
export function sdBox3d(p: TSLNode, b: TSLNode | [number, number, number] = [0, 0, 0]): TSLNode {
|
|
223
227
|
const size = Array.isArray(b) ? vec3(b[0], b[1], b[2]) : b
|
|
224
|
-
const q = abs(p).sub(size)
|
|
228
|
+
const q: TSLNode = abs(p).sub(size)
|
|
225
229
|
return length(max(q, 0.0)).add(min(max(q.x, max(q.y, q.z)), 0.0))
|
|
226
230
|
}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/* eslint-disable max-params */
|
|
2
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
3
|
-
// @ts-nocheck - TSL types are complex and not fully exported from three/tsl
|
|
4
1
|
/**
|
|
5
2
|
* Modular TSL Shape Utilities
|
|
6
3
|
* Provides composable shape functions for shader effects
|
|
@@ -18,6 +15,7 @@ import {
|
|
|
18
15
|
mix,
|
|
19
16
|
sin,
|
|
20
17
|
smoothstep,
|
|
18
|
+
step,
|
|
21
19
|
vec2,
|
|
22
20
|
} from 'three/tsl'
|
|
23
21
|
|
|
@@ -110,7 +108,7 @@ export function roundedRect(
|
|
|
110
108
|
const r = typeof cornerRadius === 'number' ? float(cornerRadius) : cornerRadius
|
|
111
109
|
const s = typeof softness === 'number' ? float(softness) : softness
|
|
112
110
|
|
|
113
|
-
const p = abs(uv.sub(c)).sub(sz.div(2)).add(r)
|
|
111
|
+
const p: TSLNode = abs(uv.sub(c)).sub(sz.div(2)).add(r)
|
|
114
112
|
const d = length(max(p, 0))
|
|
115
113
|
.add(min(max(p.x, p.y), 0))
|
|
116
114
|
.sub(r)
|
|
@@ -129,7 +127,7 @@ export function rect(
|
|
|
129
127
|
const c = Array.isArray(center) ? vec2(center[0], center[1]) : center
|
|
130
128
|
const sz = Array.isArray(size) ? vec2(size[0], size[1]) : size
|
|
131
129
|
|
|
132
|
-
const p = abs(uv.sub(c))
|
|
130
|
+
const p: TSLNode = abs(uv.sub(c))
|
|
133
131
|
const halfSize = sz.div(2)
|
|
134
132
|
|
|
135
133
|
return step(p.x, halfSize.x).mul(step(p.y, halfSize.y))
|
|
@@ -230,7 +228,7 @@ export function grid(
|
|
|
230
228
|
const size = typeof cellSize === 'number' ? float(cellSize) : cellSize
|
|
231
229
|
const width = typeof lineWidth === 'number' ? float(lineWidth) : lineWidth
|
|
232
230
|
|
|
233
|
-
const gridUV = fract(uv.div(size))
|
|
231
|
+
const gridUV: TSLNode = fract(uv.div(size))
|
|
234
232
|
const halfWidth = width.div(size).div(2)
|
|
235
233
|
|
|
236
234
|
const xLine = step(gridUV.x, halfWidth).add(step(float(1).sub(halfWidth), gridUV.x))
|
|
@@ -245,15 +243,19 @@ export function grid(
|
|
|
245
243
|
export function dots(
|
|
246
244
|
uv: TSLNode,
|
|
247
245
|
cellSize: TSLNode | number = 0.1,
|
|
248
|
-
dotRadius: TSLNode | number = 0.03
|
|
246
|
+
dotRadius: TSLNode | number = 0.03,
|
|
247
|
+
softness?: TSLNode | number
|
|
249
248
|
): TSLNode {
|
|
250
249
|
const size = typeof cellSize === 'number' ? float(cellSize) : cellSize
|
|
251
250
|
const radius = typeof dotRadius === 'number' ? float(dotRadius) : dotRadius
|
|
252
251
|
|
|
253
|
-
const gridUV = fract(uv.div(size)).sub(0.5)
|
|
252
|
+
const gridUV: TSLNode = fract(uv.div(size)).sub(0.5)
|
|
254
253
|
const d = length(gridUV.mul(size))
|
|
255
254
|
|
|
256
|
-
return step(d, radius)
|
|
255
|
+
if (softness === undefined) return step(d, radius)
|
|
256
|
+
|
|
257
|
+
const soft = typeof softness === 'number' ? float(softness) : softness
|
|
258
|
+
return float(1).sub(smoothstep(radius.sub(soft), radius.add(soft), d))
|
|
257
259
|
}
|
|
258
260
|
|
|
259
261
|
/**
|
|
@@ -261,7 +263,7 @@ export function dots(
|
|
|
261
263
|
*/
|
|
262
264
|
export function checker(uv: TSLNode, scale: TSLNode | number = 10): TSLNode {
|
|
263
265
|
const s = typeof scale === 'number' ? float(scale) : scale
|
|
264
|
-
const scaledUV = floor(uv.mul(s))
|
|
266
|
+
const scaledUV: TSLNode = floor(uv.mul(s))
|
|
265
267
|
return fract(scaledUV.x.add(scaledUV.y).mul(0.5)).mul(2)
|
|
266
268
|
}
|
|
267
269
|
|
|
@@ -277,7 +279,8 @@ export function star(
|
|
|
277
279
|
center: TSLNode | [number, number] = [0.5, 0.5],
|
|
278
280
|
points: number = 5,
|
|
279
281
|
innerRadius: TSLNode | number = 0.1,
|
|
280
|
-
outerRadius: TSLNode | number = 0.3
|
|
282
|
+
outerRadius: TSLNode | number = 0.3,
|
|
283
|
+
softness?: TSLNode | number
|
|
281
284
|
): TSLNode {
|
|
282
285
|
const c = Array.isArray(center) ? vec2(center[0], center[1]) : center
|
|
283
286
|
const inner = typeof innerRadius === 'number' ? float(innerRadius) : innerRadius
|
|
@@ -297,7 +300,10 @@ export function star(
|
|
|
297
300
|
const t = foldedAngle.div(halfSegment)
|
|
298
301
|
const targetRadius = mix(outer, inner, t)
|
|
299
302
|
|
|
300
|
-
return step(dist, targetRadius)
|
|
303
|
+
if (softness === undefined) return step(dist, targetRadius)
|
|
304
|
+
|
|
305
|
+
const soft = typeof softness === 'number' ? float(softness) : softness
|
|
306
|
+
return float(1).sub(smoothstep(targetRadius.sub(soft), targetRadius.add(soft), dist))
|
|
301
307
|
}
|
|
302
308
|
|
|
303
309
|
/**
|
|
@@ -333,7 +339,7 @@ export function concentricCircles(
|
|
|
333
339
|
const freq = typeof frequency === 'number' ? float(frequency) : frequency
|
|
334
340
|
const t = typeof thickness === 'number' ? float(thickness) : thickness
|
|
335
341
|
|
|
336
|
-
const d = length(uv.sub(c))
|
|
342
|
+
const d: TSLNode = length(uv.sub(c))
|
|
337
343
|
return step(fract(d.mul(freq)), t)
|
|
338
344
|
}
|
|
339
345
|
|
|
@@ -349,7 +355,8 @@ export function polygon(
|
|
|
349
355
|
center: TSLNode | [number, number] = [0.5, 0.5],
|
|
350
356
|
sides: number = 6,
|
|
351
357
|
radius: TSLNode | number = 0.3,
|
|
352
|
-
rotation: TSLNode | number = 0
|
|
358
|
+
rotation: TSLNode | number = 0,
|
|
359
|
+
softness?: TSLNode | number
|
|
353
360
|
): TSLNode {
|
|
354
361
|
const c = Array.isArray(center) ? vec2(center[0], center[1]) : center
|
|
355
362
|
const r = typeof radius === 'number' ? float(radius) : radius
|
|
@@ -365,5 +372,8 @@ export function polygon(
|
|
|
365
372
|
const foldedAngle = abs(fract(angle.div(segmentAngle).add(0.5)).sub(0.5)).mul(segmentAngle)
|
|
366
373
|
const edgeDist = r.mul(cos(segmentAngle.div(2))).div(cos(foldedAngle))
|
|
367
374
|
|
|
368
|
-
return step(dist, edgeDist)
|
|
375
|
+
if (softness === undefined) return step(dist, edgeDist)
|
|
376
|
+
|
|
377
|
+
const soft = typeof softness === 'number' ? float(softness) : softness
|
|
378
|
+
return float(1).sub(smoothstep(edgeDist.sub(soft), edgeDist.add(soft), dist))
|
|
369
379
|
}
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/consistent-type-assertions */
|
|
2
|
-
/* eslint-disable complexity */
|
|
3
|
-
/* eslint-disable max-params */
|
|
4
|
-
/* eslint-disable no-restricted-syntax */
|
|
5
|
-
/* eslint-disable no-nested-ternary */
|
|
6
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
7
|
-
// @ts-nocheck - TSL types are complex and not fully exported from three/tsl
|
|
8
1
|
/**
|
|
9
2
|
* Modular TSL UV Manipulation Utilities
|
|
10
3
|
* Provides composable UV transformation functions
|
|
11
4
|
*/
|
|
12
|
-
import { abs, atan, cos, float, floor, fract, length, pow, sin, smoothstep, vec2 } from 'three/tsl'
|
|
5
|
+
import { abs, atan, cos, float, floor, fract, length, mix, pow, sin, smoothstep, vec2 } from 'three/tsl'
|
|
13
6
|
|
|
14
7
|
import type { TSLNode } from '../types'
|
|
15
8
|
|
|
9
|
+
function toVec2Node(val: TSLNode | number | [number, number]): TSLNode {
|
|
10
|
+
if (typeof val === 'number') return vec2(val, val)
|
|
11
|
+
if (Array.isArray(val)) return vec2(val[0], val[1])
|
|
12
|
+
return val
|
|
13
|
+
}
|
|
14
|
+
|
|
16
15
|
// ============================================
|
|
17
16
|
// Basic Transformations
|
|
18
17
|
// ============================================
|
|
@@ -26,12 +25,7 @@ export function scaleUV(
|
|
|
26
25
|
center: TSLNode | [number, number] = [0.5, 0.5]
|
|
27
26
|
): TSLNode {
|
|
28
27
|
const c = Array.isArray(center) ? vec2(center[0], center[1]) : center
|
|
29
|
-
const s =
|
|
30
|
-
typeof scale === 'number'
|
|
31
|
-
? vec2(scale, scale)
|
|
32
|
-
: Array.isArray(scale)
|
|
33
|
-
? vec2(scale[0], scale[1])
|
|
34
|
-
: scale
|
|
28
|
+
const s = toVec2Node(scale)
|
|
35
29
|
|
|
36
30
|
return uv.sub(c).div(s).add(c)
|
|
37
31
|
}
|
|
@@ -71,12 +65,7 @@ export function translateUV(uv: TSLNode, offset: TSLNode | [number, number]): TS
|
|
|
71
65
|
* Tile UV (repeat)
|
|
72
66
|
*/
|
|
73
67
|
export function tileUV(uv: TSLNode, tiles: TSLNode | number | [number, number]): TSLNode {
|
|
74
|
-
const t =
|
|
75
|
-
typeof tiles === 'number'
|
|
76
|
-
? vec2(tiles, tiles)
|
|
77
|
-
: Array.isArray(tiles)
|
|
78
|
-
? vec2(tiles[0], tiles[1])
|
|
79
|
-
: tiles
|
|
68
|
+
const t = toVec2Node(tiles)
|
|
80
69
|
|
|
81
70
|
return fract(uv.mul(t))
|
|
82
71
|
}
|
|
@@ -118,10 +107,12 @@ export function fromPolar(
|
|
|
118
107
|
center: TSLNode | [number, number] = [0.5, 0.5]
|
|
119
108
|
): TSLNode {
|
|
120
109
|
const c = Array.isArray(center) ? vec2(center[0], center[1]) : center
|
|
121
|
-
const radius = polar.x
|
|
122
|
-
const angle = polar.y.mul(Math.PI * 2).sub(Math.PI)
|
|
110
|
+
const radius: TSLNode = polar.x
|
|
111
|
+
const angle: TSLNode = polar.y.mul(Math.PI * 2).sub(Math.PI)
|
|
123
112
|
|
|
124
|
-
|
|
113
|
+
const x: TSLNode = cos(angle).mul(radius)
|
|
114
|
+
const y: TSLNode = sin(angle).mul(radius)
|
|
115
|
+
return vec2(x, y).add(c)
|
|
125
116
|
}
|
|
126
117
|
|
|
127
118
|
// ============================================
|
|
@@ -145,14 +136,14 @@ export function waveUV(
|
|
|
145
136
|
if (direction === 'x') {
|
|
146
137
|
const offset = sin(uv.y.mul(freq).add(t)).mul(amp)
|
|
147
138
|
return vec2(uv.x.add(offset), uv.y)
|
|
148
|
-
}
|
|
139
|
+
}
|
|
140
|
+
if (direction === 'y') {
|
|
149
141
|
const offset = sin(uv.x.mul(freq).add(t)).mul(amp)
|
|
150
142
|
return vec2(uv.x, uv.y.add(offset))
|
|
151
|
-
} else {
|
|
152
|
-
const offsetX = sin(uv.y.mul(freq).add(t)).mul(amp)
|
|
153
|
-
const offsetY = sin(uv.x.mul(freq).add(t.mul(1.3))).mul(amp)
|
|
154
|
-
return vec2(uv.x.add(offsetX), uv.y.add(offsetY))
|
|
155
143
|
}
|
|
144
|
+
const offsetX = sin(uv.y.mul(freq).add(t)).mul(amp)
|
|
145
|
+
const offsetY = sin(uv.x.mul(freq).add(t.mul(1.3))).mul(amp)
|
|
146
|
+
return vec2(uv.x.add(offsetX), uv.y.add(offsetY))
|
|
156
147
|
}
|
|
157
148
|
|
|
158
149
|
/**
|
|
@@ -173,7 +164,7 @@ export function rippleUV(
|
|
|
173
164
|
const fall = typeof falloff === 'number' ? float(falloff) : falloff
|
|
174
165
|
|
|
175
166
|
const diff = uv.sub(c)
|
|
176
|
-
const dist = length(diff)
|
|
167
|
+
const dist: TSLNode = length(diff)
|
|
177
168
|
|
|
178
169
|
const ripple = sin(dist.mul(freq).sub(t)).mul(amp)
|
|
179
170
|
const falloffValue = pow(float(1).sub(dist.mul(fall)), 2).max(0)
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/consistent-type-assertions */
|
|
2
|
-
/* eslint-disable complexity */
|
|
3
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
4
|
-
// @ts-nocheck - TSL types are complex and not fully exported from three/tsl
|
|
5
1
|
/**
|
|
6
2
|
* Material Factory
|
|
7
3
|
* Creates Three.js TSL materials from shader layer functions
|
|
@@ -10,6 +6,8 @@ import { BackSide, DoubleSide, FrontSide, type Side } from 'three'
|
|
|
10
6
|
import { vec4 } from 'three/tsl'
|
|
11
7
|
import { MeshBasicNodeMaterial } from 'three/webgpu'
|
|
12
8
|
|
|
9
|
+
import type { TSLNode } from './types'
|
|
10
|
+
|
|
13
11
|
import {
|
|
14
12
|
aurora,
|
|
15
13
|
createAuroraUniforms,
|
|
@@ -47,7 +45,6 @@ import {
|
|
|
47
45
|
type StripeGradientUniforms,
|
|
48
46
|
} from './layers/stripe'
|
|
49
47
|
|
|
50
|
-
type TSLNode = ShaderNodeObject<Node>
|
|
51
48
|
|
|
52
49
|
// ============================================
|
|
53
50
|
// Types
|