kmcom-nuxt-layers 2.2.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +2 -1
|
@@ -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
|
* Aurora Shader Layer
|
|
6
3
|
* Northern lights / aurora borealis effect
|
|
@@ -9,7 +6,7 @@ import { Color } from 'three'
|
|
|
9
6
|
import { float, mix, pow, smoothstep, time as tslTime, uniform, uv, vec2, vec3 } from 'three/tsl'
|
|
10
7
|
|
|
11
8
|
import { simplexNoise2D } from '../common/noise'
|
|
12
|
-
import type { TSLNode } from '../types'
|
|
9
|
+
import type { FloatUniform, TSLNode } from '../types'
|
|
13
10
|
|
|
14
11
|
export type AuroraOptions = {
|
|
15
12
|
/** Array of colors (3 recommended) */
|
|
@@ -31,14 +28,14 @@ export type AuroraOptions = {
|
|
|
31
28
|
}
|
|
32
29
|
|
|
33
30
|
export type AuroraUniforms = {
|
|
34
|
-
speed:
|
|
35
|
-
density:
|
|
36
|
-
fadePower:
|
|
37
|
-
glowIntensity:
|
|
38
|
-
mouseX:
|
|
39
|
-
mouseStrength:
|
|
40
|
-
skyColor:
|
|
41
|
-
colors:
|
|
31
|
+
speed: FloatUniform
|
|
32
|
+
density: FloatUniform
|
|
33
|
+
fadePower: FloatUniform
|
|
34
|
+
glowIntensity: FloatUniform
|
|
35
|
+
mouseX: FloatUniform
|
|
36
|
+
mouseStrength: FloatUniform
|
|
37
|
+
skyColor: TSLNode
|
|
38
|
+
colors: TSLNode[]
|
|
42
39
|
}
|
|
43
40
|
|
|
44
41
|
/**
|
|
@@ -106,13 +103,13 @@ export function aurora(uniforms: AuroraUniforms, uvNode?: TSLNode): TSLNode {
|
|
|
106
103
|
const auroraSmooth = smoothstep(-0.2, 0.8, auroraValue)
|
|
107
104
|
|
|
108
105
|
// Get colors
|
|
109
|
-
const col1 = vec3(uniforms.colors[0]
|
|
110
|
-
const col2 = vec3(uniforms.colors[1]
|
|
111
|
-
const col3 = vec3(uniforms.colors[2]
|
|
112
|
-
const sky = vec3(uniforms.skyColor
|
|
106
|
+
const col1 = vec3(uniforms.colors[0])
|
|
107
|
+
const col2 = vec3(uniforms.colors[1])
|
|
108
|
+
const col3 = vec3(uniforms.colors[2])
|
|
109
|
+
const sky = vec3(uniforms.skyColor)
|
|
113
110
|
|
|
114
111
|
// Color mixing
|
|
115
|
-
let color = mix(col1, col2, auroraSmooth)
|
|
112
|
+
let color: TSLNode = mix(col1, col2, auroraSmooth)
|
|
116
113
|
color = mix(color, col3, curtain2.mul(fade).mul(0.5))
|
|
117
114
|
|
|
118
115
|
// Add glow
|
|
@@ -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
|
* Mesh Gradient Shader Layer
|
|
6
3
|
* Organic blob-based gradient effect
|
|
@@ -9,7 +6,7 @@ import { Color } from 'three'
|
|
|
9
6
|
import { cos, float, mix, sin, time as tslTime, uniform, uv, vec2, vec3 } from 'three/tsl'
|
|
10
7
|
|
|
11
8
|
import { blob } from '../common/shapes'
|
|
12
|
-
import type { TSLNode } from '../types'
|
|
9
|
+
import type { FloatUniform, TSLNode } from '../types'
|
|
13
10
|
|
|
14
11
|
export type MeshGradientOptions = {
|
|
15
12
|
/** Array of colors (4 recommended) */
|
|
@@ -29,13 +26,13 @@ export type MeshGradientOptions = {
|
|
|
29
26
|
}
|
|
30
27
|
|
|
31
28
|
export type MeshGradientUniforms = {
|
|
32
|
-
speed:
|
|
33
|
-
blobScale:
|
|
34
|
-
softness:
|
|
35
|
-
mouseX:
|
|
36
|
-
mouseY:
|
|
37
|
-
mouseStrength:
|
|
38
|
-
colors:
|
|
29
|
+
speed: FloatUniform
|
|
30
|
+
blobScale: FloatUniform
|
|
31
|
+
softness: FloatUniform
|
|
32
|
+
mouseX: FloatUniform
|
|
33
|
+
mouseY: FloatUniform
|
|
34
|
+
mouseStrength: FloatUniform
|
|
35
|
+
colors: TSLNode[]
|
|
39
36
|
}
|
|
40
37
|
|
|
41
38
|
/**
|
|
@@ -117,13 +114,13 @@ export function meshGradient(uniforms: MeshGradientUniforms, uvNode?: TSLNode):
|
|
|
117
114
|
const b4 = blob(uvCoord, c4, uniforms.blobScale.mul(0.25), uniforms.softness.mul(0.72))
|
|
118
115
|
|
|
119
116
|
// Get colors from uniforms
|
|
120
|
-
const col1 = vec3(uniforms.colors[0]
|
|
121
|
-
const col2 = vec3(uniforms.colors[1]
|
|
122
|
-
const col3 = vec3(uniforms.colors[2]
|
|
123
|
-
const col4 = vec3(uniforms.colors[3]
|
|
117
|
+
const col1 = vec3(uniforms.colors[0])
|
|
118
|
+
const col2 = vec3(uniforms.colors[1])
|
|
119
|
+
const col3 = vec3(uniforms.colors[2])
|
|
120
|
+
const col4 = vec3(uniforms.colors[3])
|
|
124
121
|
|
|
125
122
|
// Mix colors based on blob influence
|
|
126
|
-
let color = col1
|
|
123
|
+
let color: TSLNode = col1
|
|
127
124
|
color = mix(color, col2, b1)
|
|
128
125
|
color = mix(color, col3, b2.mul(0.8))
|
|
129
126
|
color = mix(color, col4, b3.mul(0.7))
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/* eslint-disable complexity */
|
|
2
|
-
/* eslint-disable @typescript-eslint/consistent-type-assertions */
|
|
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
|
* Paper Shading Shader Layer
|
|
7
3
|
* Inspired by Paper Shaders - organic, hand-drawn aesthetic
|
|
@@ -11,7 +7,7 @@ import { abs, float, mix, smoothstep, time as tslTime, uniform, uv, vec3 } from
|
|
|
11
7
|
|
|
12
8
|
import { grain as grainFn, paperTexture } from '../common/grain'
|
|
13
9
|
import { fbm2D, simplexNoise2D } from '../common/noise'
|
|
14
|
-
import type { TSLNode } from '../types'
|
|
10
|
+
import type { FloatUniform, TSLNode } from '../types'
|
|
15
11
|
|
|
16
12
|
export type PaperShadingOptions = {
|
|
17
13
|
/** Base paper color */
|
|
@@ -35,15 +31,15 @@ export type PaperShadingOptions = {
|
|
|
35
31
|
}
|
|
36
32
|
|
|
37
33
|
export type PaperShadingUniforms = {
|
|
38
|
-
paperColor:
|
|
39
|
-
inkColor:
|
|
40
|
-
inkColor2:
|
|
41
|
-
speed:
|
|
42
|
-
textureIntensity:
|
|
43
|
-
flowIntensity:
|
|
44
|
-
grainIntensity:
|
|
45
|
-
bleed:
|
|
46
|
-
edgeDarkness:
|
|
34
|
+
paperColor: TSLNode
|
|
35
|
+
inkColor: TSLNode
|
|
36
|
+
inkColor2: TSLNode
|
|
37
|
+
speed: FloatUniform
|
|
38
|
+
textureIntensity: FloatUniform
|
|
39
|
+
flowIntensity: FloatUniform
|
|
40
|
+
grainIntensity: FloatUniform
|
|
41
|
+
bleed: FloatUniform
|
|
42
|
+
edgeDarkness: FloatUniform
|
|
47
43
|
}
|
|
48
44
|
|
|
49
45
|
/**
|
|
@@ -85,13 +81,13 @@ export function paperShading(uniforms: PaperShadingUniforms, uvNode?: TSLNode):
|
|
|
85
81
|
const time = tslTime.mul(uniforms.speed)
|
|
86
82
|
|
|
87
83
|
// Paper texture base
|
|
88
|
-
const paper = vec3(uniforms.paperColor
|
|
89
|
-
const ink1 = vec3(uniforms.inkColor
|
|
90
|
-
const ink2 = vec3(uniforms.inkColor2
|
|
84
|
+
const paper = vec3(uniforms.paperColor)
|
|
85
|
+
const ink1 = vec3(uniforms.inkColor)
|
|
86
|
+
const ink2 = vec3(uniforms.inkColor2)
|
|
91
87
|
|
|
92
88
|
// Paper fiber texture
|
|
93
89
|
const fiberNoise = paperTexture(uvCoord, 20, uniforms.textureIntensity, time)
|
|
94
|
-
let color = paper.add(fiberNoise)
|
|
90
|
+
let color: TSLNode = paper.add(fiberNoise)
|
|
95
91
|
|
|
96
92
|
// Ink flow simulation
|
|
97
93
|
const flowNoise1 = fbm2D(uvCoord.mul(3).add(time.mul(0.5)), { octaves: 4 })
|
|
@@ -118,7 +114,7 @@ export function paperShading(uniforms: PaperShadingUniforms, uvNode?: TSLNode):
|
|
|
118
114
|
color = mix(color, ink2, inkShape2.mul(0.5))
|
|
119
115
|
|
|
120
116
|
// Edge darkening (vignette-like)
|
|
121
|
-
const edgeDist = abs(uvCoord.sub(0.5)).mul(2)
|
|
117
|
+
const edgeDist: TSLNode = abs(uvCoord.sub(0.5)).mul(2)
|
|
122
118
|
const edgeFactor = smoothstep(0.5, 1.2, edgeDist.x.add(edgeDist.y))
|
|
123
119
|
color = color.mul(float(1).sub(edgeFactor.mul(uniforms.edgeDarkness)))
|
|
124
120
|
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
/* eslint-disable complexity */
|
|
2
|
-
/* eslint-disable @typescript-eslint/consistent-type-assertions */
|
|
3
|
-
/* eslint-disable @typescript-eslint/consistent-type-definitions */
|
|
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
|
* ShaderGradient-inspired Shader Layer
|
|
8
3
|
* 3D morphing gradient effect similar to shadergradient.co
|
|
9
4
|
*/
|
|
10
5
|
import { Color } from 'three'
|
|
11
|
-
import { cos, mix, pow, smoothstep, time as tslTime, uniform, uv, vec2, vec3 } from 'three/tsl'
|
|
6
|
+
import { cos, mix, pow, sin, smoothstep, time as tslTime, uniform, uv, vec2, vec3 } from 'three/tsl'
|
|
12
7
|
|
|
13
8
|
import { fbm2D, simplexNoise2D } from '../common/noise'
|
|
14
|
-
import type { TSLNode } from '../types'
|
|
9
|
+
import type { FloatUniform, TSLNode } from '../types'
|
|
15
10
|
|
|
16
|
-
export
|
|
11
|
+
export type ShaderGradientOptions = {
|
|
17
12
|
/** Primary color */
|
|
18
13
|
color1?: string
|
|
19
14
|
/** Secondary color */
|
|
@@ -36,17 +31,17 @@ export interface ShaderGradientOptions {
|
|
|
36
31
|
zoom?: number
|
|
37
32
|
}
|
|
38
33
|
|
|
39
|
-
export
|
|
40
|
-
color1:
|
|
41
|
-
color2:
|
|
42
|
-
color3:
|
|
43
|
-
speed:
|
|
44
|
-
morphIntensity:
|
|
45
|
-
grain:
|
|
46
|
-
lightX:
|
|
47
|
-
lightY:
|
|
48
|
-
brightness:
|
|
49
|
-
zoom:
|
|
34
|
+
export type ShaderGradientUniforms = {
|
|
35
|
+
color1: TSLNode
|
|
36
|
+
color2: TSLNode
|
|
37
|
+
color3: TSLNode
|
|
38
|
+
speed: FloatUniform
|
|
39
|
+
morphIntensity: FloatUniform
|
|
40
|
+
grain: FloatUniform
|
|
41
|
+
lightX: FloatUniform
|
|
42
|
+
lightY: FloatUniform
|
|
43
|
+
brightness: FloatUniform
|
|
44
|
+
zoom: FloatUniform
|
|
50
45
|
}
|
|
51
46
|
|
|
52
47
|
/**
|
|
@@ -114,12 +109,12 @@ export function shaderGradient(uniforms: ShaderGradientUniforms, uvNode?: TSLNod
|
|
|
114
109
|
const lightFalloff = smoothstep(1.5, 0, lightDist)
|
|
115
110
|
|
|
116
111
|
// Color blending with noise
|
|
117
|
-
const col1 = vec3(uniforms.color1
|
|
118
|
-
const col2 = vec3(uniforms.color2
|
|
119
|
-
const col3 = vec3(uniforms.color3
|
|
112
|
+
const col1 = vec3(uniforms.color1)
|
|
113
|
+
const col2 = vec3(uniforms.color2)
|
|
114
|
+
const col3 = vec3(uniforms.color3)
|
|
120
115
|
|
|
121
116
|
// Complex color mixing
|
|
122
|
-
let color = mix(col1, col2, noise1)
|
|
117
|
+
let color: TSLNode = mix(col1, col2, noise1)
|
|
123
118
|
color = mix(color, col3, noise2.mul(0.7))
|
|
124
119
|
color = mix(color, col1, noise3.mul(0.3).mul(lightFalloff))
|
|
125
120
|
|
|
@@ -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
|
* Stripe Gradient Shader Layer
|
|
6
3
|
* Flowing gradient effect inspired by Stripe.com
|
|
@@ -9,7 +6,7 @@ import { Color } from 'three'
|
|
|
9
6
|
import { float, mix, smoothstep, time as tslTime, uniform, uv, vec2, vec3 } from 'three/tsl'
|
|
10
7
|
|
|
11
8
|
import { simplexNoise2D } from '../common/noise'
|
|
12
|
-
import type { TSLNode } from '../types'
|
|
9
|
+
import type { FloatUniform, TSLNode } from '../types'
|
|
13
10
|
|
|
14
11
|
export type StripeGradientOptions = {
|
|
15
12
|
/** Array of colors (3-5 recommended) */
|
|
@@ -29,13 +26,13 @@ export type StripeGradientOptions = {
|
|
|
29
26
|
}
|
|
30
27
|
|
|
31
28
|
export type StripeGradientUniforms = {
|
|
32
|
-
speed:
|
|
33
|
-
noiseScale:
|
|
34
|
-
flowAngle:
|
|
35
|
-
mouseX:
|
|
36
|
-
mouseY:
|
|
37
|
-
mouseStrength:
|
|
38
|
-
colors:
|
|
29
|
+
speed: FloatUniform
|
|
30
|
+
noiseScale: FloatUniform
|
|
31
|
+
flowAngle: FloatUniform
|
|
32
|
+
mouseX: FloatUniform
|
|
33
|
+
mouseY: FloatUniform
|
|
34
|
+
mouseStrength: FloatUniform
|
|
35
|
+
colors: TSLNode[]
|
|
39
36
|
}
|
|
40
37
|
|
|
41
38
|
/**
|
|
@@ -97,14 +94,14 @@ export function stripeGradient(uniforms: StripeGradientUniforms, uvNode?: TSLNod
|
|
|
97
94
|
.add(0.5)
|
|
98
95
|
|
|
99
96
|
// Get colors from uniforms
|
|
100
|
-
const c0 = vec3(uniforms.colors[0]
|
|
101
|
-
const c1 = vec3(uniforms.colors[1]
|
|
102
|
-
const c2 = vec3(uniforms.colors[2]
|
|
103
|
-
const c3 = vec3(uniforms.colors[3]
|
|
104
|
-
const c4 = vec3(uniforms.colors[4]
|
|
97
|
+
const c0 = vec3(uniforms.colors[0])
|
|
98
|
+
const c1 = vec3(uniforms.colors[1])
|
|
99
|
+
const c2 = vec3(uniforms.colors[2])
|
|
100
|
+
const c3 = vec3(uniforms.colors[3])
|
|
101
|
+
const c4 = vec3(uniforms.colors[4])
|
|
105
102
|
|
|
106
103
|
// Blend multiple colors based on noise
|
|
107
|
-
let color = c0
|
|
104
|
+
let color: TSLNode = c0
|
|
108
105
|
color = mix(color, c1, smoothstep(0, 0.5, n1))
|
|
109
106
|
color = mix(color, c2, smoothstep(0.3, 0.7, n2))
|
|
110
107
|
color = mix(color, c3, smoothstep(0.4, 0.8, n3))
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
1
|
/**
|
|
3
2
|
* TSL Type Definitions
|
|
4
3
|
* Simplified types for Three.js TSL nodes
|
|
@@ -7,7 +6,16 @@
|
|
|
7
6
|
// TSL nodes are complex internally, so we use a simple type alias
|
|
8
7
|
// This provides flexibility while maintaining code readability
|
|
9
8
|
|
|
9
|
+
import type { UniformNode } from 'three/webgpu'
|
|
10
|
+
|
|
10
11
|
export type TSLNode = any
|
|
11
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Float uniform with full TSL operator support.
|
|
15
|
+
* `ReturnType<typeof uniform>` collapses to `UniformNode<unknown, unknown>`,
|
|
16
|
+
* which has no operator methods — use this concrete type instead.
|
|
17
|
+
*/
|
|
18
|
+
export type FloatUniform = UniformNode<'float', number>
|
|
19
|
+
|
|
12
20
|
// Re-export common Three types
|
|
13
21
|
export type { Color, Texture, Vector2, Vector3, Vector4 } from 'three'
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
2
|
-
// @ts-nocheck
|
|
3
1
|
import { abs, cos, float, Fn, mod, pow, sin } from 'three/tsl'
|
|
4
2
|
|
|
5
3
|
import type { TSLNode } from '../../types'
|
|
@@ -28,6 +26,48 @@ export const loopTime = Fn(([time, duration]: [TSLNode, TSLNode]) => {
|
|
|
28
26
|
return mod(time, duration)
|
|
29
27
|
})
|
|
30
28
|
|
|
29
|
+
/**
|
|
30
|
+
* Bounce easing (standalone so `easing` does not reference itself)
|
|
31
|
+
*/
|
|
32
|
+
const easeOutBounceFn = Fn(([t]: [TSLNode]) => {
|
|
33
|
+
const n1 = 7.5625
|
|
34
|
+
const d1 = 2.75
|
|
35
|
+
|
|
36
|
+
const c1 = t.lessThan(1.0 / d1).select(t.mul(t).mul(n1), float(0.0))
|
|
37
|
+
const c2 = t
|
|
38
|
+
.greaterThanEqual(1.0 / d1)
|
|
39
|
+
.mul(t.lessThan(2.0 / d1))
|
|
40
|
+
.select(
|
|
41
|
+
t
|
|
42
|
+
.sub(1.5 / d1)
|
|
43
|
+
.mul(t.sub(1.5 / d1))
|
|
44
|
+
.mul(n1)
|
|
45
|
+
.add(0.75),
|
|
46
|
+
float(0.0)
|
|
47
|
+
)
|
|
48
|
+
const c3 = t
|
|
49
|
+
.greaterThanEqual(2.0 / d1)
|
|
50
|
+
.mul(t.lessThan(2.5 / d1))
|
|
51
|
+
.select(
|
|
52
|
+
t
|
|
53
|
+
.sub(2.25 / d1)
|
|
54
|
+
.mul(t.sub(2.25 / d1))
|
|
55
|
+
.mul(n1)
|
|
56
|
+
.add(0.9375),
|
|
57
|
+
float(0.0)
|
|
58
|
+
)
|
|
59
|
+
const c4 = t.greaterThanEqual(2.5 / d1).select(
|
|
60
|
+
t
|
|
61
|
+
.sub(2.625 / d1)
|
|
62
|
+
.mul(t.sub(2.625 / d1))
|
|
63
|
+
.mul(n1)
|
|
64
|
+
.add(0.984375),
|
|
65
|
+
float(0.0)
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
return c1.add(c2).add(c3).add(c4)
|
|
69
|
+
})
|
|
70
|
+
|
|
31
71
|
/**
|
|
32
72
|
* Easing functions
|
|
33
73
|
*/
|
|
@@ -36,33 +76,28 @@ export const easing = {
|
|
|
36
76
|
easeInQuad: Fn(([t]: [TSLNode]) => t.mul(t)),
|
|
37
77
|
easeOutQuad: Fn(([t]: [TSLNode]) => t.mul(float(2.0).sub(t))),
|
|
38
78
|
easeInOutQuad: Fn(([t]: [TSLNode]) => {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
.select(t.mul(t).mul(2.0), float(1.0).sub(float(-2.0).mul(t).add(2.0).pow(2.0).div(2.0)))
|
|
79
|
+
const inv: TSLNode = float(-2.0).mul(t).add(2.0)
|
|
80
|
+
return t.lessThan(0.5).select(t.mul(t).mul(2.0), float(1.0).sub(inv.pow(2.0).div(2.0)))
|
|
42
81
|
}),
|
|
43
82
|
|
|
44
83
|
// Cubic
|
|
45
84
|
easeInCubic: Fn(([t]: [TSLNode]) => t.mul(t).mul(t)),
|
|
46
85
|
easeOutCubic: Fn(([t]: [TSLNode]) => float(1.0).sub(pow(float(1.0).sub(t), 3.0))),
|
|
47
86
|
easeInOutCubic: Fn(([t]: [TSLNode]) => {
|
|
87
|
+
const inv: TSLNode = float(-2.0).mul(t).add(2.0)
|
|
48
88
|
return t
|
|
49
89
|
.lessThan(0.5)
|
|
50
|
-
.select(
|
|
51
|
-
t.mul(t).mul(t).mul(4.0),
|
|
52
|
-
float(1.0).sub(pow(float(-2.0).mul(t).add(2.0), 3.0).div(2.0))
|
|
53
|
-
)
|
|
90
|
+
.select(t.mul(t).mul(t).mul(4.0), float(1.0).sub(inv.pow(3.0).div(2.0)))
|
|
54
91
|
}),
|
|
55
92
|
|
|
56
93
|
// Quartic
|
|
57
94
|
easeInQuart: Fn(([t]: [TSLNode]) => t.mul(t).mul(t).mul(t)),
|
|
58
95
|
easeOutQuart: Fn(([t]: [TSLNode]) => float(1.0).sub(pow(float(1.0).sub(t), 4.0))),
|
|
59
96
|
easeInOutQuart: Fn(([t]: [TSLNode]) => {
|
|
97
|
+
const inv: TSLNode = float(-2.0).mul(t).add(2.0)
|
|
60
98
|
return t
|
|
61
99
|
.lessThan(0.5)
|
|
62
|
-
.select(
|
|
63
|
-
t.mul(t).mul(t).mul(t).mul(8.0),
|
|
64
|
-
float(1.0).sub(pow(float(-2.0).mul(t).add(2.0), 4.0).div(2.0))
|
|
65
|
-
)
|
|
100
|
+
.select(t.mul(t).mul(t).mul(t).mul(8.0), float(1.0).sub(inv.pow(4.0).div(2.0)))
|
|
66
101
|
}),
|
|
67
102
|
|
|
68
103
|
// Exponential
|
|
@@ -175,46 +210,9 @@ export const easing = {
|
|
|
175
210
|
}),
|
|
176
211
|
|
|
177
212
|
// Bounce
|
|
178
|
-
easeOutBounce:
|
|
179
|
-
const n1 = 7.5625
|
|
180
|
-
const d1 = 2.75
|
|
181
|
-
|
|
182
|
-
const c1 = t.lessThan(1.0 / d1).select(t.mul(t).mul(n1), float(0.0))
|
|
183
|
-
const c2 = t
|
|
184
|
-
.greaterThanEqual(1.0 / d1)
|
|
185
|
-
.mul(t.lessThan(2.0 / d1))
|
|
186
|
-
.select(
|
|
187
|
-
t
|
|
188
|
-
.sub(1.5 / d1)
|
|
189
|
-
.mul(t.sub(1.5 / d1))
|
|
190
|
-
.mul(n1)
|
|
191
|
-
.add(0.75),
|
|
192
|
-
float(0.0)
|
|
193
|
-
)
|
|
194
|
-
const c3 = t
|
|
195
|
-
.greaterThanEqual(2.0 / d1)
|
|
196
|
-
.mul(t.lessThan(2.5 / d1))
|
|
197
|
-
.select(
|
|
198
|
-
t
|
|
199
|
-
.sub(2.25 / d1)
|
|
200
|
-
.mul(t.sub(2.25 / d1))
|
|
201
|
-
.mul(n1)
|
|
202
|
-
.add(0.9375),
|
|
203
|
-
float(0.0)
|
|
204
|
-
)
|
|
205
|
-
const c4 = t.greaterThanEqual(2.5 / d1).select(
|
|
206
|
-
t
|
|
207
|
-
.sub(2.625 / d1)
|
|
208
|
-
.mul(t.sub(2.625 / d1))
|
|
209
|
-
.mul(n1)
|
|
210
|
-
.add(0.984375),
|
|
211
|
-
float(0.0)
|
|
212
|
-
)
|
|
213
|
-
|
|
214
|
-
return c1.add(c2).add(c3).add(c4)
|
|
215
|
-
}),
|
|
213
|
+
easeOutBounce: easeOutBounceFn,
|
|
216
214
|
easeInBounce: Fn(([t]: [TSLNode]) => {
|
|
217
|
-
return float(1.0).sub(
|
|
215
|
+
return float(1.0).sub(easeOutBounceFn(float(1.0).sub(t)))
|
|
218
216
|
}),
|
|
219
217
|
}
|
|
220
218
|
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
2
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
3
|
-
// @ts-nocheck
|
|
4
1
|
import { abs, clamp, float, Fn, max, min, mix, mod, vec3 } from 'three/tsl'
|
|
5
2
|
|
|
6
3
|
import type { GradientStop, TSLNode } from '../../types'
|
|
@@ -10,15 +7,17 @@ import { circularDistance } from './math'
|
|
|
10
7
|
* Linear gradient with multiple color stops
|
|
11
8
|
*/
|
|
12
9
|
export const gradientLinear = Fn(([t, stops]: [TSLNode, GradientStop[]]) => {
|
|
13
|
-
|
|
14
|
-
if (
|
|
10
|
+
const [firstStop] = stops
|
|
11
|
+
if (!firstStop) return vec3(0.0)
|
|
12
|
+
if (stops.length === 1) return firstStop.color
|
|
15
13
|
|
|
16
|
-
let result: TSLNode =
|
|
14
|
+
let result: TSLNode = firstStop.color
|
|
17
15
|
|
|
18
16
|
for (let i = 1; i < stops.length; i++) {
|
|
19
|
-
const prevStop = stops[i - 1]
|
|
20
|
-
const currStop = stops[i]
|
|
21
|
-
|
|
17
|
+
const prevStop = stops[i - 1]
|
|
18
|
+
const currStop = stops[i]
|
|
19
|
+
if (!prevStop || !currStop) continue
|
|
20
|
+
const localT: TSLNode = clamp(
|
|
22
21
|
t.sub(prevStop.position).div(currStop.position - prevStop.position),
|
|
23
22
|
0.0,
|
|
24
23
|
1.0
|
|
@@ -31,8 +30,10 @@ export const gradientLinear = Fn(([t, stops]: [TSLNode, GradientStop[]]) => {
|
|
|
31
30
|
}
|
|
32
31
|
|
|
33
32
|
// Handle end
|
|
34
|
-
const lastStop = stops[stops.length - 1]
|
|
35
|
-
|
|
33
|
+
const lastStop = stops[stops.length - 1]
|
|
34
|
+
if (lastStop) {
|
|
35
|
+
result = mix(result, lastStop.color, t.greaterThanEqual(lastStop.position))
|
|
36
|
+
}
|
|
36
37
|
|
|
37
38
|
return result
|
|
38
39
|
})
|
|
@@ -118,13 +119,13 @@ export const hslToRgb = Fn(([hsl]: [TSLNode]) => {
|
|
|
118
119
|
const s = hsl.y
|
|
119
120
|
const l = hsl.z
|
|
120
121
|
|
|
121
|
-
const c = float(1.0)
|
|
122
|
+
const c: TSLNode = float(1.0)
|
|
122
123
|
.sub(abs(l.mul(2.0).sub(1.0)))
|
|
123
124
|
.mul(s)
|
|
124
|
-
const x = c.mul(float(1.0).sub(abs(mod(h.mul(6.0), 2.0).sub(1.0))))
|
|
125
|
+
const x: TSLNode = c.mul(float(1.0).sub(abs(mod(h.mul(6.0), 2.0).sub(1.0))))
|
|
125
126
|
const m = l.sub(c.mul(0.5))
|
|
126
127
|
|
|
127
|
-
const h6 = h.mul(6.0)
|
|
128
|
+
const h6: TSLNode = h.mul(6.0)
|
|
128
129
|
|
|
129
130
|
const rgb0 = h6.lessThan(1.0).select(vec3(c, x, 0.0), vec3(0.0))
|
|
130
131
|
const rgb1 = h6
|
|
@@ -152,7 +153,7 @@ export const hslToRgb = Fn(([hsl]: [TSLNode]) => {
|
|
|
152
153
|
* Shift hue by an amount (0-1)
|
|
153
154
|
*/
|
|
154
155
|
export const hueShift = Fn(([rgb, shift]: [TSLNode, TSLNode]) => {
|
|
155
|
-
const hsl = rgbToHsl(rgb)
|
|
156
|
+
const hsl: TSLNode = rgbToHsl(rgb)
|
|
156
157
|
const newH = mod(hsl.x.add(shift), 1.0)
|
|
157
158
|
return hslToRgb(vec3(newH, hsl.y, hsl.z))
|
|
158
159
|
})
|
|
@@ -161,8 +162,8 @@ export const hueShift = Fn(([rgb, shift]: [TSLNode, TSLNode]) => {
|
|
|
161
162
|
* Adjust saturation
|
|
162
163
|
*/
|
|
163
164
|
export const adjustSaturation = Fn(([rgb, amount]: [TSLNode, TSLNode]) => {
|
|
164
|
-
const hsl = rgbToHsl(rgb)
|
|
165
|
-
const newS = clamp(hsl.y.mul(amount), 0.0, 1.0)
|
|
165
|
+
const hsl: TSLNode = rgbToHsl(rgb)
|
|
166
|
+
const newS: TSLNode = clamp(hsl.y.mul(amount), 0.0, 1.0)
|
|
166
167
|
return hslToRgb(vec3(hsl.x, newS, hsl.z))
|
|
167
168
|
})
|
|
168
169
|
|
|
@@ -187,7 +188,7 @@ export const adjustVibrance = Fn(([rgb, vibrance]: [TSLNode, TSLNode]) => {
|
|
|
187
188
|
const maxC = max(max(rgb.x, rgb.y), rgb.z)
|
|
188
189
|
const minC = min(min(rgb.x, rgb.y), rgb.z)
|
|
189
190
|
const sat = maxC.sub(minC)
|
|
190
|
-
const satFactor = float(1.0).sub(sat).mul(vibrance)
|
|
191
|
-
const gray = rgb.x.mul(0.299).add(rgb.y.mul(0.587)).add(rgb.z.mul(0.114))
|
|
191
|
+
const satFactor: TSLNode = float(1.0).sub(sat).mul(vibrance)
|
|
192
|
+
const gray: TSLNode = rgb.x.mul(0.299).add(rgb.y.mul(0.587)).add(rgb.z.mul(0.114))
|
|
192
193
|
return mix(vec3(gray), rgb, float(1.0).add(satFactor))
|
|
193
194
|
})
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
2
|
-
// @ts-nocheck
|
|
3
1
|
import { abs, dot, float, floor, Fn, fract, max, mix, mod, vec2, vec3, vec4 } from 'three/tsl'
|
|
4
2
|
|
|
5
3
|
import type { FBMOptions, TSLNode } from '../../types'
|
|
@@ -9,14 +7,14 @@ import type { FBMOptions, TSLNode } from '../../types'
|
|
|
9
7
|
*/
|
|
10
8
|
|
|
11
9
|
const hash22 = Fn(([p]: [TSLNode]) => {
|
|
12
|
-
const p3 = fract(p.mul(vec2(443.8975, 397.2973)))
|
|
13
|
-
const shifted = p3.add(dot(p3, p3.yx.add(19.19)))
|
|
10
|
+
const p3: TSLNode = fract(p.mul(vec2(443.8975, 397.2973)))
|
|
11
|
+
const shifted: TSLNode = p3.add(dot(p3, p3.yx.add(19.19)))
|
|
14
12
|
return fract(vec2(shifted.x.mul(shifted.y), shifted.y.mul(shifted.x)))
|
|
15
13
|
})
|
|
16
14
|
|
|
17
15
|
const hash31 = Fn(([p]: [TSLNode]) => {
|
|
18
|
-
const p3 = fract(p.mul(vec3(443.8975, 397.2973, 491.1871)))
|
|
19
|
-
const shifted = p3.add(dot(p3, p3.yzx.add(19.19)))
|
|
16
|
+
const p3: TSLNode = fract(p.mul(vec3(443.8975, 397.2973, 491.1871)))
|
|
17
|
+
const shifted: TSLNode = p3.add(dot(p3, p3.yzx.add(19.19)))
|
|
20
18
|
return fract(shifted.x.mul(shifted.y).mul(shifted.z))
|
|
21
19
|
})
|
|
22
20
|
|
|
@@ -32,7 +30,7 @@ export const simplexNoise2D = Fn(([uv]: [TSLNode]) => {
|
|
|
32
30
|
)
|
|
33
31
|
|
|
34
32
|
// First corner
|
|
35
|
-
const i = floor(uv.add(dot(uv, C.yy)))
|
|
33
|
+
const i: TSLNode = floor(uv.add(dot(uv, C.yy)))
|
|
36
34
|
const x0 = uv.sub(i).add(dot(i, C.xx))
|
|
37
35
|
|
|
38
36
|
// Other corners
|
|
@@ -41,7 +39,7 @@ export const simplexNoise2D = Fn(([uv]: [TSLNode]) => {
|
|
|
41
39
|
const x2 = x0.add(C.zz)
|
|
42
40
|
|
|
43
41
|
// Permutations
|
|
44
|
-
const iMod = mod(i, 289.0)
|
|
42
|
+
const iMod: TSLNode = mod(i, 289.0)
|
|
45
43
|
const p = mod(
|
|
46
44
|
mod(iMod.y.add(vec3(0.0, i1.y, 1.0)), 289.0)
|
|
47
45
|
.mul(34.0)
|
|
@@ -95,7 +93,7 @@ export const perlinNoise3D = Fn(([position]: [TSLNode]) => {
|
|
|
95
93
|
const Pf = fract(position)
|
|
96
94
|
|
|
97
95
|
// Quintic interpolation
|
|
98
|
-
const u = Pf.mul(Pf)
|
|
96
|
+
const u: TSLNode = Pf.mul(Pf)
|
|
99
97
|
.mul(Pf)
|
|
100
98
|
.mul(Pf.mul(Pf.mul(6.0).sub(15.0)).add(10.0))
|
|
101
99
|
|
|
@@ -180,9 +178,9 @@ export const curlNoise3D = Fn(([position]: [TSLNode]) => {
|
|
|
180
178
|
const dz = vec3(0, 0, eps)
|
|
181
179
|
|
|
182
180
|
// Compute derivatives
|
|
183
|
-
const px = perlinNoise3D(position.add(dx)).sub(perlinNoise3D(position.sub(dx)))
|
|
184
|
-
const py = perlinNoise3D(position.add(dy)).sub(perlinNoise3D(position.sub(dy)))
|
|
185
|
-
const pz = perlinNoise3D(position.add(dz)).sub(perlinNoise3D(position.sub(dz)))
|
|
181
|
+
const px: TSLNode = perlinNoise3D(position.add(dx)).sub(perlinNoise3D(position.sub(dx)))
|
|
182
|
+
const py: TSLNode = perlinNoise3D(position.add(dy)).sub(perlinNoise3D(position.sub(dy)))
|
|
183
|
+
const pz: TSLNode = perlinNoise3D(position.add(dz)).sub(perlinNoise3D(position.sub(dz)))
|
|
186
184
|
|
|
187
185
|
// Curl = nabla x F
|
|
188
186
|
const curlX = py.sub(pz)
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
2
|
-
// @ts-nocheck - TSL types are complex
|
|
3
1
|
/**
|
|
4
2
|
* OKLCH color space utilities for both TSL (GPU) and JS (CPU) use.
|
|
5
3
|
*/
|
|
@@ -53,15 +51,16 @@ export function oklchToLinearSRGB(l: TSLNode, c: TSLNode, h: TSLNode): TSLNode {
|
|
|
53
51
|
*/
|
|
54
52
|
export function parseOKLCH(str: string): [number, number, number] {
|
|
55
53
|
const match = str.match(/oklch\(\s*([\d.]+%?)\s+([\d.]+)\s+([\d.]+)\s*\)/)
|
|
56
|
-
|
|
54
|
+
const [, lRaw, cRaw, hRaw] = match ?? []
|
|
55
|
+
if (!lRaw || !cRaw || !hRaw) {
|
|
57
56
|
throw new Error(`Invalid OKLCH string: ${str}`)
|
|
58
57
|
}
|
|
59
58
|
|
|
60
|
-
let l = parseFloat(
|
|
61
|
-
if (
|
|
59
|
+
let l = parseFloat(lRaw)
|
|
60
|
+
if (lRaw.endsWith('%')) l /= 100
|
|
62
61
|
|
|
63
|
-
const c = parseFloat(
|
|
64
|
-
const h = parseFloat(
|
|
62
|
+
const c = parseFloat(cRaw)
|
|
63
|
+
const h = parseFloat(hRaw)
|
|
65
64
|
|
|
66
65
|
return [l, c, h]
|
|
67
66
|
}
|