kmcom-nuxt-layers 2.1.6 → 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 +22 -6
- package/layers/content/app/composables/useBlogPosts.ts +3 -1
- 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 +3 -3
- package/layers/content/app/composables/usePortfolioItems.ts +3 -3
- 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 +6 -3
- package/layers/scroll/app/components/Motion/Parallax.vue +38 -42
- package/layers/scroll/app/components/Motion/PinnedSection.vue +6 -3
- 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 +1 -2
- 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 +1 -2
- 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 +110 -76
- 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 +7 -5
|
@@ -1,56 +1,58 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
// @ts-nocheck
|
|
3
2
|
import { Color, Vector2, Vector3 } from 'three'
|
|
4
|
-
import { float, smoothstep, uniform, vec2,
|
|
3
|
+
import { float, smoothstep, uniform, vec2, vec4 } from 'three/tsl'
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* Procedural lens flare — starburst + ghost circle artefacts along the flare axis.
|
|
8
7
|
*/
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
8
|
+
const {
|
|
9
|
+
position = [0.7, 0.8],
|
|
10
|
+
color = '#fffde0',
|
|
11
|
+
intensity = 0.6,
|
|
12
|
+
ghostCount = 4,
|
|
13
|
+
order = 0,
|
|
14
|
+
} = defineProps<{
|
|
15
|
+
/** Light source position in UV space */
|
|
16
|
+
position?: [number, number]
|
|
17
|
+
/** Flare colour */
|
|
18
|
+
color?: string
|
|
19
|
+
/** Overall brightness */
|
|
20
|
+
intensity?: number
|
|
21
|
+
/** How many ghost circles along the axis */
|
|
22
|
+
ghostCount?: number
|
|
23
|
+
order?: number
|
|
24
|
+
}>()
|
|
23
25
|
|
|
24
26
|
function toVec3Node(hex: string) {
|
|
25
27
|
const c = new Color(hex)
|
|
26
28
|
return uniform(new Vector3(c.r, c.g, c.b))
|
|
27
29
|
}
|
|
28
30
|
|
|
29
|
-
const posNode = uniform(new Vector2(...
|
|
30
|
-
const colorNode = toVec3Node(
|
|
31
|
-
const intensityNode = uniform(
|
|
32
|
-
const ghostCountNode = uniform(
|
|
31
|
+
const posNode = uniform(new Vector2(...position))
|
|
32
|
+
const colorNode = toVec3Node(color)
|
|
33
|
+
const intensityNode = uniform(intensity)
|
|
34
|
+
const ghostCountNode = uniform(ghostCount)
|
|
33
35
|
watch(
|
|
34
|
-
() =>
|
|
36
|
+
() => position,
|
|
35
37
|
([x, y]) => {
|
|
36
38
|
posNode.value.set(x, y)
|
|
37
39
|
}
|
|
38
40
|
)
|
|
39
41
|
watch(
|
|
40
|
-
() =>
|
|
42
|
+
() => color,
|
|
41
43
|
(v) => {
|
|
42
44
|
const c = new Color(v)
|
|
43
45
|
colorNode.value.set(c.r, c.g, c.b)
|
|
44
46
|
}
|
|
45
47
|
)
|
|
46
48
|
watch(
|
|
47
|
-
() =>
|
|
49
|
+
() => intensity,
|
|
48
50
|
(v) => {
|
|
49
51
|
intensityNode.value = v
|
|
50
52
|
}
|
|
51
53
|
)
|
|
52
54
|
watch(
|
|
53
|
-
() =>
|
|
55
|
+
() => ghostCount,
|
|
54
56
|
(v) => {
|
|
55
57
|
ghostCountNode.value = v
|
|
56
58
|
}
|
|
@@ -82,5 +84,5 @@
|
|
|
82
84
|
const flare = colorNode.mul(burst.add(ghosts))
|
|
83
85
|
|
|
84
86
|
return vec4(prev.xyz.add(flare), prev.w)
|
|
85
|
-
},
|
|
87
|
+
}, order)
|
|
86
88
|
</script>
|
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
// @ts-nocheck
|
|
3
2
|
import { Color } from 'three'
|
|
4
3
|
import { mix, uniform, vec4 } from 'three/tsl'
|
|
5
4
|
|
|
6
5
|
import { blendLighten } from '../../shaders/common/blend'
|
|
6
|
+
import type { TSLNode } from '../../shaders/types'
|
|
7
7
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
const {
|
|
9
|
+
color = '#808080',
|
|
10
|
+
opacity = 1,
|
|
11
|
+
order = 0,
|
|
12
|
+
} = defineProps<{
|
|
13
|
+
color?: string
|
|
14
|
+
opacity?: number
|
|
15
|
+
order?: number
|
|
16
|
+
}>()
|
|
16
17
|
|
|
17
|
-
const colorNode = uniform(new Color(
|
|
18
|
-
const opacityNode = uniform(
|
|
18
|
+
const colorNode: TSLNode = uniform(new Color(color))
|
|
19
|
+
const opacityNode = uniform(opacity)
|
|
19
20
|
watch(
|
|
20
|
-
() =>
|
|
21
|
+
() => color,
|
|
21
22
|
(v) => {
|
|
22
23
|
colorNode.value.set(v)
|
|
23
24
|
}
|
|
24
25
|
)
|
|
25
26
|
watch(
|
|
26
|
-
() =>
|
|
27
|
+
() => opacity,
|
|
27
28
|
(v) => {
|
|
28
29
|
opacityNode.value = v
|
|
29
30
|
}
|
|
@@ -31,6 +32,6 @@
|
|
|
31
32
|
|
|
32
33
|
useShaderStage(
|
|
33
34
|
(prev) => vec4(mix(prev.xyz, blendLighten(prev.xyz, colorNode), opacityNode), prev.w),
|
|
34
|
-
|
|
35
|
+
order
|
|
35
36
|
)
|
|
36
37
|
</script>
|
|
@@ -1,35 +1,31 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
// @ts-nocheck
|
|
3
2
|
import { Color } from 'three'
|
|
4
3
|
import { mix, uniform, vec4 } from 'three/tsl'
|
|
5
4
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
order: 0,
|
|
18
|
-
}
|
|
19
|
-
)
|
|
5
|
+
const {
|
|
6
|
+
colorA = '#000000',
|
|
7
|
+
colorB = '#ffffff',
|
|
8
|
+
axis = 'y',
|
|
9
|
+
order = 0,
|
|
10
|
+
} = defineProps<{
|
|
11
|
+
colorA?: string
|
|
12
|
+
colorB?: string
|
|
13
|
+
axis?: 'x' | 'y'
|
|
14
|
+
order?: number
|
|
15
|
+
}>()
|
|
20
16
|
|
|
21
|
-
const colorAVal = new Color(
|
|
22
|
-
const colorBVal = new Color(
|
|
17
|
+
const colorAVal = new Color(colorA)
|
|
18
|
+
const colorBVal = new Color(colorB)
|
|
23
19
|
const colorANode = uniform(colorAVal)
|
|
24
20
|
const colorBNode = uniform(colorBVal)
|
|
25
21
|
watch(
|
|
26
|
-
() =>
|
|
22
|
+
() => colorA,
|
|
27
23
|
(v) => {
|
|
28
24
|
colorANode.value.set(v)
|
|
29
25
|
}
|
|
30
26
|
)
|
|
31
27
|
watch(
|
|
32
|
-
() =>
|
|
28
|
+
() => colorB,
|
|
33
29
|
(v) => {
|
|
34
30
|
colorBNode.value.set(v)
|
|
35
31
|
}
|
|
@@ -38,7 +34,7 @@
|
|
|
38
34
|
const { uvNode } = useShaderPipelineContext()
|
|
39
35
|
|
|
40
36
|
useShaderStage((_prev) => {
|
|
41
|
-
const t =
|
|
37
|
+
const t = axis === 'x' ? uvNode.value.x : uvNode.value.y
|
|
42
38
|
return vec4(mix(colorANode, colorBNode, t), 1.0)
|
|
43
|
-
},
|
|
39
|
+
}, order)
|
|
44
40
|
</script>
|
|
@@ -1,64 +1,60 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
// @ts-nocheck
|
|
3
2
|
import { Color, Vector3 } from 'three'
|
|
4
3
|
import { float, mix, step, uniform, vec4 } from 'three/tsl'
|
|
5
4
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
order: 0,
|
|
24
|
-
}
|
|
25
|
-
)
|
|
5
|
+
const {
|
|
6
|
+
colorA = '#000000',
|
|
7
|
+
colorB = '#ffffff',
|
|
8
|
+
colorC,
|
|
9
|
+
colorD,
|
|
10
|
+
axis = 'y',
|
|
11
|
+
order = 0,
|
|
12
|
+
} = defineProps<{
|
|
13
|
+
colorA?: string
|
|
14
|
+
colorB?: string
|
|
15
|
+
/** Optional third stop (defaults to colorB when omitted → 2-stop gradient) */
|
|
16
|
+
colorC?: string
|
|
17
|
+
/** Optional fourth stop (defaults to colorC when omitted → 3-stop gradient) */
|
|
18
|
+
colorD?: string
|
|
19
|
+
axis?: 'x' | 'y'
|
|
20
|
+
order?: number
|
|
21
|
+
}>()
|
|
26
22
|
|
|
27
23
|
function toVec3U(hex: string) {
|
|
28
24
|
const c = new Color(hex)
|
|
29
25
|
return uniform(new Vector3(c.r, c.g, c.b))
|
|
30
26
|
}
|
|
31
27
|
|
|
32
|
-
const cA = toVec3U(
|
|
33
|
-
const cB = toVec3U(
|
|
34
|
-
const cC = toVec3U(
|
|
35
|
-
const cD = toVec3U(
|
|
28
|
+
const cA = toVec3U(colorA)
|
|
29
|
+
const cB = toVec3U(colorB)
|
|
30
|
+
const cC = toVec3U(colorC ?? colorB)
|
|
31
|
+
const cD = toVec3U(colorD ?? colorC ?? colorB)
|
|
36
32
|
|
|
37
33
|
watch(
|
|
38
|
-
() =>
|
|
34
|
+
() => colorA,
|
|
39
35
|
(v) => {
|
|
40
36
|
const c = new Color(v)
|
|
41
37
|
cA.value.set(c.r, c.g, c.b)
|
|
42
38
|
}
|
|
43
39
|
)
|
|
44
40
|
watch(
|
|
45
|
-
() =>
|
|
41
|
+
() => colorB,
|
|
46
42
|
(v) => {
|
|
47
43
|
const c = new Color(v)
|
|
48
44
|
cB.value.set(c.r, c.g, c.b)
|
|
49
45
|
}
|
|
50
46
|
)
|
|
51
47
|
watch(
|
|
52
|
-
() =>
|
|
48
|
+
() => colorC,
|
|
53
49
|
(v) => {
|
|
54
|
-
const c = new Color(v ??
|
|
50
|
+
const c = new Color(v ?? colorB)
|
|
55
51
|
cC.value.set(c.r, c.g, c.b)
|
|
56
52
|
}
|
|
57
53
|
)
|
|
58
54
|
watch(
|
|
59
|
-
() =>
|
|
55
|
+
() => colorD,
|
|
60
56
|
(v) => {
|
|
61
|
-
const c = new Color(v ??
|
|
57
|
+
const c = new Color(v ?? colorC ?? colorB)
|
|
62
58
|
cD.value.set(c.r, c.g, c.b)
|
|
63
59
|
}
|
|
64
60
|
)
|
|
@@ -66,7 +62,7 @@
|
|
|
66
62
|
const pipeline = useShaderPipelineContext()
|
|
67
63
|
|
|
68
64
|
useShaderStage(() => {
|
|
69
|
-
const t =
|
|
65
|
+
const t = axis === 'x' ? pipeline.uvNode.value.x : pipeline.uvNode.value.y
|
|
70
66
|
|
|
71
67
|
// Map t [0,1] to 3 equal segments, clamping so t=1 maps to lt=1 not lt=0
|
|
72
68
|
const tN = t.mul(float(3)).min(float(2.9999))
|
|
@@ -85,5 +81,5 @@
|
|
|
85
81
|
// Cascade: start with c01, replace with c12 at seg>=1, replace with c23 at seg>=2
|
|
86
82
|
const col = mix(mix(c01, c12, inSeg1), c23, inSeg2)
|
|
87
83
|
return vec4(col, float(1))
|
|
88
|
-
},
|
|
84
|
+
}, order)
|
|
89
85
|
</script>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
// @ts-nocheck
|
|
3
2
|
import { float, pow, uniform, vec4 } from 'three/tsl'
|
|
4
3
|
|
|
5
4
|
/**
|
|
@@ -7,18 +6,15 @@
|
|
|
7
6
|
* Use as the last step in HDR pipelines before output.
|
|
8
7
|
* Approximate form: pow(col, 1/2.2).
|
|
9
8
|
*/
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}>(),
|
|
16
|
-
{ gamma: 2.2, order: 0 }
|
|
17
|
-
)
|
|
9
|
+
const { gamma = 2.2, order = 0 } = defineProps<{
|
|
10
|
+
/** Gamma exponent — 2.2 matches sRGB standard */
|
|
11
|
+
gamma?: number
|
|
12
|
+
order?: number
|
|
13
|
+
}>()
|
|
18
14
|
|
|
19
|
-
const gammaNode = uniform(
|
|
15
|
+
const gammaNode = uniform(gamma)
|
|
20
16
|
watch(
|
|
21
|
-
() =>
|
|
17
|
+
() => gamma,
|
|
22
18
|
(v) => {
|
|
23
19
|
gammaNode.value = v
|
|
24
20
|
}
|
|
@@ -26,6 +22,6 @@
|
|
|
26
22
|
|
|
27
23
|
useShaderStage(
|
|
28
24
|
(prev) => vec4(pow(prev.xyz.max(float(0)), float(1).div(gammaNode)), prev.w),
|
|
29
|
-
|
|
25
|
+
order
|
|
30
26
|
)
|
|
31
27
|
</script>
|
|
@@ -1,94 +1,88 @@
|
|
|
1
|
-
<!-- eslint-disable vue/define-props-destructuring -->
|
|
2
|
-
<!-- eslint-disable @typescript-eslint/ban-ts-comment -->
|
|
3
1
|
<script setup lang="ts">
|
|
4
|
-
// @ts-nocheck
|
|
5
2
|
import { Color, Vector3 } from 'three'
|
|
6
3
|
import { float, mix, sin, time, uniform, vec4 } from 'three/tsl'
|
|
7
4
|
|
|
8
5
|
import { fbm2D } from '../../shaders/common/noise'
|
|
9
6
|
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
order: 0,
|
|
37
|
-
}
|
|
38
|
-
)
|
|
7
|
+
const {
|
|
8
|
+
colorA = '#f5f0e8',
|
|
9
|
+
colorB = '#6a5a4a',
|
|
10
|
+
frequency = 5,
|
|
11
|
+
noiseScale = 3,
|
|
12
|
+
noiseStrength = 8,
|
|
13
|
+
sharpness = 4,
|
|
14
|
+
speed = 0,
|
|
15
|
+
order = 0,
|
|
16
|
+
} = defineProps<{
|
|
17
|
+
/** Base (vein background) colour */
|
|
18
|
+
colorA?: string
|
|
19
|
+
/** Vein colour */
|
|
20
|
+
colorB?: string
|
|
21
|
+
/** Marble vein frequency */
|
|
22
|
+
frequency?: number
|
|
23
|
+
/** FBM noise scale for vein turbulence */
|
|
24
|
+
noiseScale?: number
|
|
25
|
+
/** Noise strength applied to sine input */
|
|
26
|
+
noiseStrength?: number
|
|
27
|
+
/** Vein sharpness — higher = thinner veins */
|
|
28
|
+
sharpness?: number
|
|
29
|
+
/** Animation speed */
|
|
30
|
+
speed?: number
|
|
31
|
+
order?: number
|
|
32
|
+
}>()
|
|
39
33
|
|
|
40
34
|
function toVec3Node(hex: string) {
|
|
41
35
|
const c = new Color(hex)
|
|
42
36
|
return uniform(new Vector3(c.r, c.g, c.b))
|
|
43
37
|
}
|
|
44
38
|
|
|
45
|
-
const colorANode = toVec3Node(
|
|
46
|
-
const colorBNode = toVec3Node(
|
|
47
|
-
const freqNode = uniform(
|
|
48
|
-
const noiseScaleNode = uniform(
|
|
49
|
-
const noiseStrNode = uniform(
|
|
50
|
-
const sharpNode = uniform(
|
|
51
|
-
const speedNode = uniform(
|
|
39
|
+
const colorANode = toVec3Node(colorA)
|
|
40
|
+
const colorBNode = toVec3Node(colorB)
|
|
41
|
+
const freqNode = uniform(frequency)
|
|
42
|
+
const noiseScaleNode = uniform(noiseScale)
|
|
43
|
+
const noiseStrNode = uniform(noiseStrength)
|
|
44
|
+
const sharpNode = uniform(sharpness)
|
|
45
|
+
const speedNode = uniform(speed)
|
|
52
46
|
watch(
|
|
53
|
-
() =>
|
|
47
|
+
() => colorA,
|
|
54
48
|
(v) => {
|
|
55
49
|
const c = new Color(v)
|
|
56
50
|
colorANode.value.set(c.r, c.g, c.b)
|
|
57
51
|
}
|
|
58
52
|
)
|
|
59
53
|
watch(
|
|
60
|
-
() =>
|
|
54
|
+
() => colorB,
|
|
61
55
|
(v) => {
|
|
62
56
|
const c = new Color(v)
|
|
63
57
|
colorBNode.value.set(c.r, c.g, c.b)
|
|
64
58
|
}
|
|
65
59
|
)
|
|
66
60
|
watch(
|
|
67
|
-
() =>
|
|
61
|
+
() => frequency,
|
|
68
62
|
(v) => {
|
|
69
63
|
freqNode.value = v
|
|
70
64
|
}
|
|
71
65
|
)
|
|
72
66
|
watch(
|
|
73
|
-
() =>
|
|
67
|
+
() => noiseScale,
|
|
74
68
|
(v) => {
|
|
75
69
|
noiseScaleNode.value = v
|
|
76
70
|
}
|
|
77
71
|
)
|
|
78
72
|
watch(
|
|
79
|
-
() =>
|
|
73
|
+
() => noiseStrength,
|
|
80
74
|
(v) => {
|
|
81
75
|
noiseStrNode.value = v
|
|
82
76
|
}
|
|
83
77
|
)
|
|
84
78
|
watch(
|
|
85
|
-
() =>
|
|
79
|
+
() => sharpness,
|
|
86
80
|
(v) => {
|
|
87
81
|
sharpNode.value = v
|
|
88
82
|
}
|
|
89
83
|
)
|
|
90
84
|
watch(
|
|
91
|
-
() =>
|
|
85
|
+
() => speed,
|
|
92
86
|
(v) => {
|
|
93
87
|
speedNode.value = v
|
|
94
88
|
}
|
|
@@ -105,5 +99,5 @@
|
|
|
105
99
|
.abs()
|
|
106
100
|
.pow(sharpNode)
|
|
107
101
|
return vec4(mix(colorANode, colorBNode, vein), float(1))
|
|
108
|
-
},
|
|
102
|
+
}, order)
|
|
109
103
|
</script>
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
<!-- eslint-disable vue/define-props-destructuring -->
|
|
2
|
-
<!-- eslint-disable @typescript-eslint/ban-ts-comment -->
|
|
3
1
|
<script setup lang="ts">
|
|
4
|
-
// @ts-nocheck
|
|
5
2
|
import { smoothstep, uniform, vec4 } from 'three/tsl'
|
|
6
3
|
|
|
7
4
|
/**
|
|
@@ -11,34 +8,31 @@
|
|
|
11
8
|
* Example (Grainient final step):
|
|
12
9
|
* <MixBlend axis="y" :edge0="0.45" :edge1="0.55" />
|
|
13
10
|
*/
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
order: 0,
|
|
29
|
-
}
|
|
30
|
-
)
|
|
11
|
+
const {
|
|
12
|
+
axis = 'y',
|
|
13
|
+
edge0 = 0.45,
|
|
14
|
+
edge1 = 0.55,
|
|
15
|
+
invert = false,
|
|
16
|
+
order = 0,
|
|
17
|
+
} = defineProps<{
|
|
18
|
+
axis?: 'x' | 'y'
|
|
19
|
+
edge0?: number
|
|
20
|
+
edge1?: number
|
|
21
|
+
/** 0 = fade to transparent, 1 = fade to opaque (keep prev) */
|
|
22
|
+
invert?: boolean
|
|
23
|
+
order?: number
|
|
24
|
+
}>()
|
|
31
25
|
|
|
32
|
-
const edge0Node = uniform(
|
|
33
|
-
const edge1Node = uniform(
|
|
26
|
+
const edge0Node = uniform(edge0)
|
|
27
|
+
const edge1Node = uniform(edge1)
|
|
34
28
|
watch(
|
|
35
|
-
() =>
|
|
29
|
+
() => edge0,
|
|
36
30
|
(v) => {
|
|
37
31
|
edge0Node.value = v
|
|
38
32
|
}
|
|
39
33
|
)
|
|
40
34
|
watch(
|
|
41
|
-
() =>
|
|
35
|
+
() => edge1,
|
|
42
36
|
(v) => {
|
|
43
37
|
edge1Node.value = v
|
|
44
38
|
}
|
|
@@ -47,9 +41,9 @@
|
|
|
47
41
|
const { uvNode } = useShaderPipelineContext()
|
|
48
42
|
|
|
49
43
|
useShaderStage((prev) => {
|
|
50
|
-
const coord =
|
|
44
|
+
const coord = axis === 'x' ? uvNode.value.x : uvNode.value.y
|
|
51
45
|
const mask = smoothstep(edge0Node, edge1Node, coord)
|
|
52
|
-
const alpha =
|
|
46
|
+
const alpha = invert ? mask.oneMinus() : mask
|
|
53
47
|
return vec4(prev.xyz, prev.w.mul(alpha))
|
|
54
|
-
},
|
|
48
|
+
}, order)
|
|
55
49
|
</script>
|
|
@@ -1,46 +1,41 @@
|
|
|
1
|
-
<!-- eslint-disable vue/define-props-destructuring -->
|
|
2
|
-
<!-- eslint-disable @typescript-eslint/ban-ts-comment -->
|
|
3
1
|
<script setup lang="ts">
|
|
4
|
-
// @ts-nocheck
|
|
5
2
|
import { Color, Vector3 } from 'three'
|
|
6
3
|
import { uniform, vec4 } from 'three/tsl'
|
|
7
4
|
|
|
8
5
|
import { desaturate } from '../../shaders/common/blend'
|
|
9
6
|
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
7
|
+
const {
|
|
8
|
+
color = '#4466aa',
|
|
9
|
+
desaturation = 1,
|
|
10
|
+
order = 0,
|
|
11
|
+
} = defineProps<{
|
|
12
|
+
/** Tint colour applied after desaturation */
|
|
13
|
+
color?: string
|
|
14
|
+
/** How much to desaturate before tinting: 1 = full greyscale */
|
|
15
|
+
desaturation?: number
|
|
16
|
+
order?: number
|
|
17
|
+
}>()
|
|
20
18
|
|
|
21
19
|
function toVec3Node(hex: string) {
|
|
22
20
|
const c = new Color(hex)
|
|
23
21
|
return uniform(new Vector3(c.r, c.g, c.b))
|
|
24
22
|
}
|
|
25
23
|
|
|
26
|
-
const colorNode = toVec3Node(
|
|
27
|
-
const desatNode = uniform(
|
|
24
|
+
const colorNode = toVec3Node(color)
|
|
25
|
+
const desatNode = uniform(desaturation)
|
|
28
26
|
watch(
|
|
29
|
-
() =>
|
|
27
|
+
() => color,
|
|
30
28
|
(v) => {
|
|
31
29
|
const c = new Color(v)
|
|
32
30
|
colorNode.value.set(c.r, c.g, c.b)
|
|
33
31
|
}
|
|
34
32
|
)
|
|
35
33
|
watch(
|
|
36
|
-
() =>
|
|
34
|
+
() => desaturation,
|
|
37
35
|
(v) => {
|
|
38
36
|
desatNode.value = v
|
|
39
37
|
}
|
|
40
38
|
)
|
|
41
39
|
|
|
42
|
-
useShaderStage(
|
|
43
|
-
(prev) => vec4(desaturate(prev.xyz, desatNode).mul(colorNode), prev.w),
|
|
44
|
-
props.order
|
|
45
|
-
)
|
|
40
|
+
useShaderStage((prev) => vec4(desaturate(prev.xyz, desatNode).mul(colorNode), prev.w), order)
|
|
46
41
|
</script>
|