kmcom-nuxt-layers 2.2.5 → 2.2.8
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/docs/FEEDS.md +197 -0
- package/docs/LAYERS-FIXES.md +101 -0
- package/docs/MIGRATION.md +627 -0
- package/docs/feed-layer.md +374 -0
- package/docs/patch-picture-provider-type.md +52 -0
- package/docs/shaderGuide.md +2071 -0
- package/docs/types-architecture.md +234 -0
- package/layers/animations/app/components/Motion/CountUp.vue +1 -1
- package/layers/animations/app/components/Motion/Magnetic.vue +1 -1
- package/layers/animations/app/components/Motion/Marquee.vue +3 -2
- package/layers/animations/app/components/Motion/MarqueeText.vue +3 -2
- package/layers/animations/app/components/Motion/Tilt.vue +1 -1
- package/layers/animations/app/composables/useCountUp.ts +4 -1
- package/layers/animations/app/composables/useMagneticElement.ts +2 -4
- package/layers/animations/app/composables/useMarqueeCopies.ts +4 -4
- package/layers/animations/app/composables/useTiltEffect.ts +1 -1
- package/layers/animations/app/types/animations.ts +8 -0
- package/layers/animations/app/types/index.ts +1 -0
- package/layers/animations/package.json +4 -1
- package/layers/canvas/app/components/ShaderCanvas.vue +4 -4
- package/layers/canvas/app/composables/useRendererCapabilities.ts +19 -15
- package/layers/canvas/app/types/index.ts +1 -0
- package/layers/canvas/package.json +2 -1
- package/layers/canvas/tsconfig.json +2 -1
- package/layers/content/app/components/Blog/Card.vue +5 -5
- package/layers/content/app/components/Gallery/AmbientImage.vue +3 -3
- package/layers/content/app/components/Gallery/Card.vue +3 -3
- package/layers/content/app/components/Gallery/Lightbox.vue +5 -1
- package/layers/content/app/components/NuxtContent/Detail.vue +5 -1
- package/layers/content/app/components/NuxtContent/Surround.vue +5 -3
- package/layers/content/app/components/NuxtContent/Toc.vue +1 -1
- package/layers/content/app/components/Portfolio/Card.vue +5 -5
- package/layers/content/app/components/content/Figure.vue +3 -3
- package/layers/content/app/composables/useBlogPosts.ts +2 -2
- package/layers/content/app/composables/useCollectionItem.ts +1 -3
- package/layers/content/app/composables/useGalleryItems.ts +2 -2
- package/layers/content/app/types/index.ts +1 -0
- package/layers/content/package.json +2 -1
- package/layers/core/app/composables/useCache.ts +0 -1
- package/layers/core/app/composables/useErrorLog.ts +9 -11
- package/layers/core/app/plugins/error-handler.ts +36 -36
- package/layers/core/app/plugins/feature-detection.client.ts +15 -15
- package/layers/core/app/plugins/init.ts +121 -129
- package/layers/core/app/plugins/loading.client.ts +27 -27
- package/layers/core/app/plugins/scroll-guard.client.ts +26 -26
- package/layers/core/app/utils/helpers.ts +14 -12
- package/layers/core/nuxt.config.ts +1 -0
- package/layers/feeds/app/plugins/feed-head.ts +62 -63
- package/layers/feeds/package.json +2 -1
- package/layers/feeds/server/routes/feed/discovery.get.ts +1 -2
- package/layers/feeds/server/utils/content-adapter.ts +3 -2
- package/layers/forms/app/components/Form/Field.vue +4 -4
- package/layers/forms/app/types/index.ts +1 -0
- package/layers/forms/package.json +2 -1
- package/layers/forms/server/api/contact.post.ts +1 -1
- package/layers/layout/app/components/Layout/Grid/Item.vue +33 -19
- package/layers/layout/app/components/Layout/Page/Container.vue +11 -11
- package/layers/layout/app/components/Layout/Page/Header.vue +1 -1
- package/layers/layout/app/components/Layout/Page/index.vue +1 -1
- package/layers/layout/app/components/Layout/Section/Gallery.vue +6 -1
- package/layers/layout/app/components/Layout/Section/Title.vue +1 -1
- package/layers/layout/app/types/index.ts +1 -0
- package/layers/layout/package.json +2 -1
- package/layers/mailer/app/types/index.ts +1 -0
- package/layers/mailer/app/types/mailer.ts +25 -0
- package/layers/mailer/package.json +2 -1
- package/layers/motion/package.json +2 -1
- package/layers/navigation/app/components/Links/Group.vue +1 -0
- package/layers/navigation/app/components/Links/Named.vue +2 -0
- package/layers/navigation/app/types/index.ts +1 -0
- package/layers/navigation/package.json +4 -1
- package/layers/page-transitions/app/plugins/page-transitions.client.ts +9 -9
- package/layers/page-transitions/package.json +4 -1
- package/layers/routing/app/plugins/feature-flags.client.ts +9 -9
- package/layers/routing/app/types/app-config.d.ts +3 -1
- package/layers/routing/app/types/index.ts +1 -0
- package/layers/routing/package.json +2 -1
- package/layers/scripts/app/composables/useGtm.ts +1 -1
- package/layers/scripts/app/types/index.ts +1 -0
- package/layers/scripts/app/types/scripts.ts +14 -0
- package/layers/scripts/package.json +2 -1
- package/layers/scroll/app/components/Motion/ScrollScene.vue +3 -1
- package/layers/scroll/app/composables/useScrollSteps.ts +2 -9
- package/layers/scroll/app/composables/useSectionProgress.ts +2 -1
- package/layers/scroll/app/plugins/locomotive-scroll.client.ts +54 -61
- package/layers/scroll/app/types/index.ts +1 -0
- package/layers/scroll/app/types/scroll.ts +32 -0
- package/layers/scroll/package.json +3 -0
- package/layers/seo/package.json +2 -1
- package/layers/shader/app/components/Material/Fresnel.client.vue +1 -1
- package/layers/shader/app/components/Material/Image.client.vue +1 -1
- package/layers/shader/app/components/Material/Node.client.vue +7 -7
- package/layers/shader/app/components/Material/Noise.client.vue +1 -1
- package/layers/shader/app/components/Node/Color.client.vue +17 -20
- package/layers/shader/app/components/Node/Noise.client.vue +31 -34
- package/layers/shader/app/components/Pipeline/Aurora.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/BilinearGradient.client.vue +8 -11
- package/layers/shader/app/components/Pipeline/BillowNoise.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/BrightnessContrast.client.vue +6 -2
- package/layers/shader/app/components/Pipeline/CellularNoise.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/Checkerboard.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/Circle.client.vue +5 -8
- package/layers/shader/app/components/Pipeline/Clouds.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/ColorBurnBlend.client.vue +2 -19
- package/layers/shader/app/components/Pipeline/ColorDodgeBlend.client.vue +2 -19
- package/layers/shader/app/components/Pipeline/ColourRamp.client.vue +5 -9
- package/layers/shader/app/components/Pipeline/ConicGradient.client.vue +5 -8
- package/layers/shader/app/components/Pipeline/Cross.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/CurlNoise.client.vue +3 -7
- package/layers/shader/app/components/Pipeline/DarkenBlend.client.vue +2 -19
- package/layers/shader/app/components/Pipeline/DayNightCycle.client.vue +5 -8
- package/layers/shader/app/components/Pipeline/DiagonalGradient.client.vue +5 -8
- package/layers/shader/app/components/Pipeline/DiamondGradient.client.vue +5 -8
- package/layers/shader/app/components/Pipeline/DifferenceBlend.client.vue +2 -19
- package/layers/shader/app/components/Pipeline/DomainWarpedNoise.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/Dots.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/DuoTone.client.vue +5 -9
- package/layers/shader/app/components/Pipeline/ExclusionBlend.client.vue +3 -23
- package/layers/shader/app/components/Pipeline/ExponentialFog.client.vue +4 -7
- package/layers/shader/app/components/Pipeline/FilmBurn.client.vue +4 -7
- package/layers/shader/app/components/Pipeline/Flame.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/FocalGradient.client.vue +5 -8
- package/layers/shader/app/components/Pipeline/GodRays.client.vue +4 -7
- package/layers/shader/app/components/Pipeline/GradientNoise.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/Grid.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/Halation.client.vue +3 -7
- package/layers/shader/app/components/Pipeline/HardLightBlend.client.vue +2 -19
- package/layers/shader/app/components/Pipeline/Haze.client.vue +4 -7
- package/layers/shader/app/components/Pipeline/Hexagon.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/LensFlare.client.vue +4 -7
- package/layers/shader/app/components/Pipeline/LightenBlend.client.vue +2 -19
- package/layers/shader/app/components/Pipeline/LinearGradient4.client.vue +2 -2
- package/layers/shader/app/components/Pipeline/Marble.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/MonochromeTint.client.vue +3 -7
- package/layers/shader/app/components/Pipeline/MultiplyBlend.client.vue +2 -19
- package/layers/shader/app/components/Pipeline/NoisyGradient.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/NoisyGradientBlend.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/OverlayBlend.client.vue +2 -19
- package/layers/shader/app/components/Pipeline/Polygon.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/RaymarchTunnel.client.vue +4 -7
- package/layers/shader/app/components/Pipeline/Rectangle.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/RidgedNoise.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/Ring.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/ScreenBlend.client.vue +2 -19
- package/layers/shader/app/components/Pipeline/SkyAtmosphere.client.vue +6 -9
- package/layers/shader/app/components/Pipeline/SoftLightBlend.client.vue +2 -19
- package/layers/shader/app/components/Pipeline/SplitTone.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/Star.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/Stripes.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/Tint.client.vue +4 -7
- package/layers/shader/app/components/Pipeline/Triangle.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/ValueNoise.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/VoronoiEdges.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/Water.client.vue +5 -8
- package/layers/shader/app/components/Pipeline/WaveBendLayer.client.vue +4 -7
- package/layers/shader/app/components/Pipeline/WaveColourLayer.client.vue +3 -7
- package/layers/shader/app/components/Pipeline/Wood.client.vue +4 -8
- package/layers/shader/app/components/Preset/Aurora.client.vue +15 -21
- package/layers/shader/app/components/Preset/Flow.client.vue +2 -1
- package/layers/shader/app/components/Preset/GradientMesh.client.vue +2 -1
- package/layers/shader/app/components/Preset/Nebula.client.vue +2 -1
- package/layers/shader/app/components/Preset/Ocean.client.vue +2 -1
- package/layers/shader/app/components/Preset/ThemeAurora.client.vue +30 -90
- package/layers/shader/app/components/Preset/ThemeBubble.client.vue +30 -91
- package/layers/shader/app/components/Preset/ThemeFlow.client.vue +30 -90
- package/layers/shader/app/components/Preset/ThemeGradient.client.vue +30 -91
- package/layers/shader/app/components/Preset/ThemeLavaLamp.client.vue +30 -90
- package/layers/shader/app/components/Preset/ThemePlasma.client.vue +30 -90
- package/layers/shader/app/components/Preset/ThemeWave.client.vue +30 -90
- package/layers/shader/app/components/Shader/Background.client.vue +4 -4
- package/layers/shader/app/components/Shader/Host.client.vue +31 -33
- package/layers/shader/app/components/Shader/Runtime.client.vue +15 -23
- package/layers/shader/app/composables/useAmbientMaterials.ts +53 -51
- package/layers/shader/app/composables/useShaderMixBlend.ts +26 -0
- package/layers/shader/app/composables/useThemePreset.ts +75 -0
- package/layers/shader/app/plugins/shader.client.ts +21 -21
- package/layers/shader/app/shaders/common/noise.ts +2 -7
- package/layers/shader/app/shaders/types.ts +6 -6
- package/layers/shader/app/types/tsl.ts +7 -25
- package/layers/shader/app/types/uniforms.ts +2 -1
- package/layers/shader/app/utils/tsl/color.ts +7 -1
- package/layers/shader/package.json +2 -1
- package/layers/theme/app/components/ThemePicker/Colors.vue +1 -3
- package/layers/theme/app/plugins/theme.client.ts +54 -51
- package/layers/theme/app/types/app-config.d.ts +4 -2
- package/layers/theme/app/types/index.ts +1 -0
- package/layers/theme/app/types/theme.ts +3 -18
- package/layers/theme/package.json +2 -1
- package/layers/theme/server/plugins/theme-fouc.ts +1 -1
- package/layers/transitions/package.json +4 -1
- package/layers/typography/app/components/Typography/CodeBlock.vue +2 -2
- package/layers/typography/app/components/Typography/Headline.vue +2 -2
- package/layers/typography/app/components/Typography/HeadlineScreen.vue +1 -1
- package/layers/typography/app/components/Typography/QuoteBlock.vue +4 -1
- package/layers/typography/app/components/Typography/TextStroke.vue +2 -0
- package/layers/typography/app/components/Typography/index.vue +36 -27
- package/layers/typography/app/composables/typography.ts +27 -21
- package/layers/typography/app/types/colors.ts +9 -29
- package/layers/typography/app/types/index.ts +2 -0
- package/layers/typography/package.json +4 -1
- package/layers/ui/package.json +2 -1
- package/layers/visual/app/app.config.ts +5 -2
- package/layers/visual/app/components/Accent/Blob.vue +20 -20
- package/layers/visual/app/components/Accent/Scene.vue +2 -2
- package/layers/visual/app/components/Base/Modal.vue +2 -2
- package/layers/visual/app/components/Gradient/Background.vue +2 -2
- package/layers/visual/app/components/Gradient/Text.vue +2 -2
- package/layers/visual/app/components/Media/Picture.vue +3 -1
- package/layers/visual/app/components/Progress/Bar.vue +6 -6
- package/layers/visual/app/components/Tint/Overlay.vue +14 -14
- package/layers/visual/app/composables/accent.ts +10 -8
- package/layers/visual/app/composables/gradient.ts +2 -3
- package/layers/visual/app/composables/tint.ts +7 -7
- package/layers/visual/app/types/index.ts +6 -0
- package/layers/visual/app/types/media.ts +4 -2
- package/layers/visual/app/types/tint.ts +2 -1
- package/layers/visual/package.json +4 -1
- package/package.json +5 -2
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
import { Color, Vector3 } from 'three'
|
|
3
3
|
import { clamp, dot, float, mix, pow, uniform, vec4 } from 'three/tsl'
|
|
4
4
|
|
|
5
|
+
import { hexToVec3Uniform } from '../../utils/tsl/color'
|
|
6
|
+
|
|
5
7
|
const {
|
|
6
8
|
zenith = '#1a3a8a',
|
|
7
9
|
horizon = '#7ab0d8',
|
|
@@ -26,15 +28,10 @@
|
|
|
26
28
|
order?: number
|
|
27
29
|
}>()
|
|
28
30
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const zenithNode = toVec3Node(zenith)
|
|
35
|
-
const horizonNode = toVec3Node(horizon)
|
|
36
|
-
const groundNode = toVec3Node(ground)
|
|
37
|
-
const sunColorNode = toVec3Node(sunColor)
|
|
31
|
+
const zenithNode = hexToVec3Uniform(zenith)
|
|
32
|
+
const horizonNode = hexToVec3Uniform(horizon)
|
|
33
|
+
const groundNode = hexToVec3Uniform(ground)
|
|
34
|
+
const sunColorNode = hexToVec3Uniform(sunColor)
|
|
38
35
|
const sunPowerNode = uniform(sunPower)
|
|
39
36
|
|
|
40
37
|
const sunDir = new Vector3(...sunDirection).normalize()
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { Color } from 'three'
|
|
3
|
-
import { mix, uniform, vec4 } from 'three/tsl'
|
|
4
|
-
|
|
5
2
|
import { blendSoftLight } from '../../shaders/common/blend'
|
|
6
|
-
import type { TSLNode } from '../../shaders/types'
|
|
7
3
|
|
|
8
4
|
const {
|
|
9
5
|
color = '#808080',
|
|
@@ -15,23 +11,10 @@
|
|
|
15
11
|
order?: number
|
|
16
12
|
}>()
|
|
17
13
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
watch(
|
|
14
|
+
useShaderMixBlend(
|
|
15
|
+
blendSoftLight,
|
|
21
16
|
() => color,
|
|
22
|
-
(v) => {
|
|
23
|
-
colorNode.value.set(v)
|
|
24
|
-
}
|
|
25
|
-
)
|
|
26
|
-
watch(
|
|
27
17
|
() => opacity,
|
|
28
|
-
(v) => {
|
|
29
|
-
opacityNode.value = v
|
|
30
|
-
}
|
|
31
|
-
)
|
|
32
|
-
|
|
33
|
-
useShaderStage(
|
|
34
|
-
(prev) => vec4(mix(prev.xyz, blendSoftLight(prev.xyz, colorNode), opacityNode), prev.w),
|
|
35
18
|
order
|
|
36
19
|
)
|
|
37
20
|
</script>
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { Color
|
|
2
|
+
import { Color } from 'three'
|
|
3
3
|
import { float, smoothstep, uniform, vec4 } from 'three/tsl'
|
|
4
4
|
|
|
5
5
|
import { luminance } from '../../shaders/common/blend'
|
|
6
|
+
import { hexToVec3Uniform } from '../../utils/tsl/color'
|
|
6
7
|
|
|
7
8
|
const {
|
|
8
9
|
shadowColor = '#1a2a5a',
|
|
@@ -22,13 +23,8 @@
|
|
|
22
23
|
order?: number
|
|
23
24
|
}>()
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return uniform(new Vector3(c.r, c.g, c.b))
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const shadowNode = toVec3Node(shadowColor)
|
|
31
|
-
const highlightNode = toVec3Node(highlightColor)
|
|
26
|
+
const shadowNode = hexToVec3Uniform(shadowColor)
|
|
27
|
+
const highlightNode = hexToVec3Uniform(highlightColor)
|
|
32
28
|
const balanceNode = uniform(balance)
|
|
33
29
|
const opacityNode = uniform(opacity)
|
|
34
30
|
watch(
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { Color
|
|
2
|
+
import { Color } from 'three'
|
|
3
3
|
import { float, mix, uniform, vec4 } from 'three/tsl'
|
|
4
4
|
|
|
5
5
|
import { star } from '../../shaders/common/shapes'
|
|
6
|
+
import { hexToVec3Uniform } from '../../utils/tsl/color'
|
|
6
7
|
|
|
7
8
|
const {
|
|
8
9
|
colorA = '#000000',
|
|
@@ -24,13 +25,8 @@
|
|
|
24
25
|
order?: number
|
|
25
26
|
}>()
|
|
26
27
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return uniform(new Vector3(c.r, c.g, c.b))
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const colorANode = toVec3Node(colorA)
|
|
33
|
-
const colorBNode = toVec3Node(colorB)
|
|
28
|
+
const colorANode = hexToVec3Uniform(colorA)
|
|
29
|
+
const colorBNode = hexToVec3Uniform(colorB)
|
|
34
30
|
const radiusNode = uniform(radius)
|
|
35
31
|
const innerNode = uniform(innerRatio)
|
|
36
32
|
const softnessNode = uniform(softness)
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { Color
|
|
2
|
+
import { Color } from 'three'
|
|
3
3
|
import { float, mix, uniform, vec4 } from 'three/tsl'
|
|
4
4
|
|
|
5
5
|
import { stripes } from '../../shaders/common/shapes'
|
|
6
|
+
import { hexToVec3Uniform } from '../../utils/tsl/color'
|
|
6
7
|
|
|
7
8
|
const {
|
|
8
9
|
colorA = '#000000',
|
|
@@ -22,13 +23,8 @@
|
|
|
22
23
|
order?: number
|
|
23
24
|
}>()
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return uniform(new Vector3(c.r, c.g, c.b))
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const colorANode = toVec3Node(colorA)
|
|
31
|
-
const colorBNode = toVec3Node(colorB)
|
|
26
|
+
const colorANode = hexToVec3Uniform(colorA)
|
|
27
|
+
const colorBNode = hexToVec3Uniform(colorB)
|
|
32
28
|
const freqNode = uniform(frequency)
|
|
33
29
|
const thickNode = uniform(thickness)
|
|
34
30
|
const angleNode = uniform((angle * Math.PI) / 180)
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { Color
|
|
2
|
+
import { Color } from 'three'
|
|
3
3
|
import { uniform, vec4 } from 'three/tsl'
|
|
4
4
|
|
|
5
|
+
import { hexToVec3Uniform } from '../../utils/tsl/color'
|
|
6
|
+
|
|
5
7
|
const {
|
|
6
8
|
color = '#ff8844',
|
|
7
9
|
opacity = 1,
|
|
@@ -14,12 +16,7 @@
|
|
|
14
16
|
order?: number
|
|
15
17
|
}>()
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
const c = new Color(hex)
|
|
19
|
-
return uniform(new Vector3(c.r, c.g, c.b))
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const colorNode = toVec3Node(color)
|
|
19
|
+
const colorNode = hexToVec3Uniform(color)
|
|
23
20
|
const opacityNode = uniform(opacity)
|
|
24
21
|
watch(
|
|
25
22
|
() => color,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { Color
|
|
2
|
+
import { Color } from 'three'
|
|
3
3
|
import { float, mix, smoothstep, uniform, vec4 } from 'three/tsl'
|
|
4
4
|
|
|
5
5
|
import { sdEquilateralTriangle } from '../../shaders/common/sdf'
|
|
6
|
+
import { hexToVec3Uniform } from '../../utils/tsl/color'
|
|
6
7
|
|
|
7
8
|
const {
|
|
8
9
|
colorA = '#000000',
|
|
@@ -18,13 +19,8 @@
|
|
|
18
19
|
order?: number
|
|
19
20
|
}>()
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return uniform(new Vector3(c.r, c.g, c.b))
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const colorANode = toVec3Node(colorA)
|
|
27
|
-
const colorBNode = toVec3Node(colorB)
|
|
22
|
+
const colorANode = hexToVec3Uniform(colorA)
|
|
23
|
+
const colorBNode = hexToVec3Uniform(colorB)
|
|
28
24
|
const sizeNode = uniform(size)
|
|
29
25
|
const softnessNode = uniform(softness)
|
|
30
26
|
watch(
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { Color
|
|
2
|
+
import { Color } from 'three'
|
|
3
3
|
import { float, mix, time, uniform, vec4 } from 'three/tsl'
|
|
4
4
|
|
|
5
5
|
import { valueNoise2D } from '../../shaders/common/noise'
|
|
6
|
+
import { hexToVec3Uniform } from '../../utils/tsl/color'
|
|
6
7
|
|
|
7
8
|
const {
|
|
8
9
|
colorA = '#000000',
|
|
@@ -18,13 +19,8 @@
|
|
|
18
19
|
order?: number
|
|
19
20
|
}>()
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return uniform(new Vector3(c.r, c.g, c.b))
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const colorANode = toVec3Node(colorA)
|
|
27
|
-
const colorBNode = toVec3Node(colorB)
|
|
22
|
+
const colorANode = hexToVec3Uniform(colorA)
|
|
23
|
+
const colorBNode = hexToVec3Uniform(colorB)
|
|
28
24
|
const scaleNode = uniform(scale)
|
|
29
25
|
const speedNode = uniform(speed)
|
|
30
26
|
watch(
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { Color
|
|
2
|
+
import { Color } from 'three'
|
|
3
3
|
import { float, mix, smoothstep, time, uniform, vec4 } from 'three/tsl'
|
|
4
4
|
|
|
5
5
|
import { voronoi2D } from '../../shaders/common/noise'
|
|
6
|
+
import { hexToVec3Uniform } from '../../utils/tsl/color'
|
|
6
7
|
|
|
7
8
|
/** Voronoi cell edge lines only — the cell boundaries as thin lines. */
|
|
8
9
|
const {
|
|
@@ -24,13 +25,8 @@
|
|
|
24
25
|
order?: number
|
|
25
26
|
}>()
|
|
26
27
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return uniform(new Vector3(c.r, c.g, c.b))
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const colorANode = toVec3Node(colorA)
|
|
33
|
-
const colorBNode = toVec3Node(colorB)
|
|
28
|
+
const colorANode = hexToVec3Uniform(colorA)
|
|
29
|
+
const colorBNode = hexToVec3Uniform(colorB)
|
|
34
30
|
const scaleNode = uniform(scale)
|
|
35
31
|
const edgeNode = uniform(edgeWidth)
|
|
36
32
|
const speedNode = uniform(speed)
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { Color
|
|
2
|
+
import { Color } from 'three'
|
|
3
3
|
import { float, mix, sin, time, uniform, vec4 } from 'three/tsl'
|
|
4
4
|
|
|
5
|
+
import { hexToVec3Uniform } from '../../utils/tsl/color'
|
|
6
|
+
|
|
5
7
|
const {
|
|
6
8
|
colorDeep = '#003366',
|
|
7
9
|
colorShallow = '#66ccff',
|
|
@@ -23,13 +25,8 @@
|
|
|
23
25
|
order?: number
|
|
24
26
|
}>()
|
|
25
27
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return uniform(new Vector3(c.r, c.g, c.b))
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const colorDeepNode = toVec3Node(colorDeep)
|
|
32
|
-
const colorShallowNode = toVec3Node(colorShallow)
|
|
28
|
+
const colorDeepNode = hexToVec3Uniform(colorDeep)
|
|
29
|
+
const colorShallowNode = hexToVec3Uniform(colorShallow)
|
|
33
30
|
const freqNode = uniform(frequency)
|
|
34
31
|
const ampNode = uniform(amplitude)
|
|
35
32
|
const speedNode = uniform(speed)
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { Color
|
|
2
|
+
import { Color } from 'three'
|
|
3
3
|
import { mix, sin, time, uniform, vec2, vec4 } from 'three/tsl'
|
|
4
4
|
|
|
5
|
+
import { hexToVec3Uniform } from '../../utils/tsl/color'
|
|
6
|
+
|
|
5
7
|
const {
|
|
6
8
|
color = '#4488ff',
|
|
7
9
|
opacity = 0.8,
|
|
@@ -18,12 +20,7 @@
|
|
|
18
20
|
order?: number
|
|
19
21
|
}>()
|
|
20
22
|
|
|
21
|
-
|
|
22
|
-
const c = new Color(hex)
|
|
23
|
-
return uniform(new Vector3(c.r, c.g, c.b))
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const colorNode = toVec3Node(color)
|
|
23
|
+
const colorNode = hexToVec3Uniform(color)
|
|
27
24
|
const opacityNode = uniform(opacity)
|
|
28
25
|
const freqNode = uniform(frequency)
|
|
29
26
|
const speedNode = uniform(speed)
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { Color
|
|
2
|
+
import { Color } from 'three'
|
|
3
3
|
import { mix, smoothstep, time, uniform, vec4 } from 'three/tsl'
|
|
4
4
|
|
|
5
5
|
import { simplexNoise2D } from '../../shaders/common/noise'
|
|
6
|
+
import { hexToVec3Uniform } from '../../utils/tsl/color'
|
|
6
7
|
|
|
7
8
|
const {
|
|
8
9
|
color = '#ffffff',
|
|
@@ -28,12 +29,7 @@
|
|
|
28
29
|
order?: number
|
|
29
30
|
}>()
|
|
30
31
|
|
|
31
|
-
|
|
32
|
-
const c = new Color(hex)
|
|
33
|
-
return uniform(new Vector3(c.r, c.g, c.b))
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const colorNode = toVec3Node(color)
|
|
32
|
+
const colorNode = hexToVec3Uniform(color)
|
|
37
33
|
const opacityNode = uniform(opacity)
|
|
38
34
|
const scaleNode = uniform(scale)
|
|
39
35
|
const edge0Node = uniform(edge0)
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { Color
|
|
2
|
+
import { Color } from 'three'
|
|
3
3
|
import { float, mix, sin, time, uniform, vec4 } from 'three/tsl'
|
|
4
4
|
|
|
5
5
|
import { fbm2D } from '../../shaders/common/noise'
|
|
6
|
+
import { hexToVec3Uniform } from '../../utils/tsl/color'
|
|
6
7
|
|
|
7
8
|
const {
|
|
8
9
|
colorA = '#8b5e3c',
|
|
@@ -26,13 +27,8 @@
|
|
|
26
27
|
order?: number
|
|
27
28
|
}>()
|
|
28
29
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return uniform(new Vector3(c.r, c.g, c.b))
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const colorANode = toVec3Node(colorA)
|
|
35
|
-
const colorBNode = toVec3Node(colorB)
|
|
30
|
+
const colorANode = hexToVec3Uniform(colorA)
|
|
31
|
+
const colorBNode = hexToVec3Uniform(colorB)
|
|
36
32
|
const ringFreqNode = uniform(ringFrequency)
|
|
37
33
|
const noiseScaleNode = uniform(noiseScale)
|
|
38
34
|
const noiseStrNode = uniform(noiseStrength)
|
|
@@ -3,30 +3,24 @@
|
|
|
3
3
|
createAmbientUniforms,
|
|
4
4
|
createAuroraColorNode,
|
|
5
5
|
} from '#layers/shader/app/composables/useAmbientMaterials'
|
|
6
|
+
import type { TSLNode } from '#layers/shader/app/types/tsl'
|
|
6
7
|
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
mouseInteraction: true,
|
|
17
|
-
}
|
|
18
|
-
)
|
|
8
|
+
const {
|
|
9
|
+
speed = 1.0,
|
|
10
|
+
intensity = 1.0,
|
|
11
|
+
mouseInteraction = true,
|
|
12
|
+
} = defineProps<{
|
|
13
|
+
speed?: number
|
|
14
|
+
intensity?: number
|
|
15
|
+
mouseInteraction?: boolean
|
|
16
|
+
}>()
|
|
19
17
|
|
|
20
18
|
const emit = defineEmits<{
|
|
21
|
-
node: [colorNode:
|
|
19
|
+
node: [colorNode: TSLNode]
|
|
22
20
|
}>()
|
|
23
21
|
|
|
24
22
|
// Create uniforms once
|
|
25
|
-
const uniforms = createAmbientUniforms({
|
|
26
|
-
speed: props.speed,
|
|
27
|
-
intensity: props.intensity,
|
|
28
|
-
mouseInteraction: props.mouseInteraction,
|
|
29
|
-
})
|
|
23
|
+
const uniforms = createAmbientUniforms({ speed, intensity, mouseInteraction })
|
|
30
24
|
|
|
31
25
|
// Build the TSL color node (references uniforms by pointer)
|
|
32
26
|
const colorNode = createAuroraColorNode(uniforms)
|
|
@@ -48,19 +42,19 @@
|
|
|
48
42
|
|
|
49
43
|
// Watch props to update uniforms (no recompilation)
|
|
50
44
|
watch(
|
|
51
|
-
() =>
|
|
45
|
+
() => speed,
|
|
52
46
|
(v) => {
|
|
53
47
|
uniforms.speed.value = v
|
|
54
48
|
}
|
|
55
49
|
)
|
|
56
50
|
watch(
|
|
57
|
-
() =>
|
|
51
|
+
() => intensity,
|
|
58
52
|
(v) => {
|
|
59
53
|
uniforms.intensity.value = v
|
|
60
54
|
}
|
|
61
55
|
)
|
|
62
56
|
watch(
|
|
63
|
-
() =>
|
|
57
|
+
() => mouseInteraction,
|
|
64
58
|
(v) => {
|
|
65
59
|
uniforms.mouseStrength.value = v ? 0.5 : 0
|
|
66
60
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
createAmbientUniforms,
|
|
4
4
|
createFlowColorNode,
|
|
5
5
|
} from '#layers/shader/app/composables/useAmbientMaterials'
|
|
6
|
+
import type { TSLNode } from '#layers/shader/app/types/tsl'
|
|
6
7
|
|
|
7
8
|
const {
|
|
8
9
|
speed = 1.0,
|
|
@@ -15,7 +16,7 @@
|
|
|
15
16
|
}>()
|
|
16
17
|
|
|
17
18
|
const emit = defineEmits<{
|
|
18
|
-
node: [colorNode:
|
|
19
|
+
node: [colorNode: TSLNode]
|
|
19
20
|
}>()
|
|
20
21
|
|
|
21
22
|
const uniforms = createAmbientUniforms({
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
createAmbientUniforms,
|
|
4
4
|
createGradientMeshColorNode,
|
|
5
5
|
} from '#layers/shader/app/composables/useAmbientMaterials'
|
|
6
|
+
import type { TSLNode } from '#layers/shader/app/types/tsl'
|
|
6
7
|
|
|
7
8
|
const {
|
|
8
9
|
speed = 1.0,
|
|
@@ -15,7 +16,7 @@
|
|
|
15
16
|
}>()
|
|
16
17
|
|
|
17
18
|
const emit = defineEmits<{
|
|
18
|
-
node: [colorNode:
|
|
19
|
+
node: [colorNode: TSLNode]
|
|
19
20
|
}>()
|
|
20
21
|
|
|
21
22
|
const uniforms = createAmbientUniforms({
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
createAmbientUniforms,
|
|
4
4
|
createNebulaColorNode,
|
|
5
5
|
} from '#layers/shader/app/composables/useAmbientMaterials'
|
|
6
|
+
import type { TSLNode } from '#layers/shader/app/types/tsl'
|
|
6
7
|
|
|
7
8
|
const {
|
|
8
9
|
speed = 1.0,
|
|
@@ -15,7 +16,7 @@
|
|
|
15
16
|
}>()
|
|
16
17
|
|
|
17
18
|
const emit = defineEmits<{
|
|
18
|
-
node: [colorNode:
|
|
19
|
+
node: [colorNode: TSLNode]
|
|
19
20
|
}>()
|
|
20
21
|
|
|
21
22
|
const uniforms = createAmbientUniforms({
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
createAmbientUniforms,
|
|
4
4
|
createOceanColorNode,
|
|
5
5
|
} from '#layers/shader/app/composables/useAmbientMaterials'
|
|
6
|
+
import type { TSLNode } from '#layers/shader/app/types/tsl'
|
|
6
7
|
|
|
7
8
|
const {
|
|
8
9
|
speed = 1.0,
|
|
@@ -15,7 +16,7 @@
|
|
|
15
16
|
}>()
|
|
16
17
|
|
|
17
18
|
const emit = defineEmits<{
|
|
18
|
-
node: [colorNode:
|
|
19
|
+
node: [colorNode: TSLNode]
|
|
19
20
|
}>()
|
|
20
21
|
|
|
21
22
|
const uniforms = createAmbientUniforms({
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} from '#layers/shader/app/composables/useAmbientMaterials'
|
|
2
|
+
import { createThemeAuroraColorNode } from '#layers/shader/app/composables/useAmbientMaterials'
|
|
3
|
+
import { type ThemePresetProps } from '#layers/shader/app/composables/useThemePreset'
|
|
4
|
+
import type { TSLNode } from '#layers/shader/app/types/tsl'
|
|
6
5
|
|
|
7
6
|
const {
|
|
8
7
|
speed = 1.0,
|
|
@@ -13,98 +12,39 @@
|
|
|
13
12
|
color2 = '#6366f1',
|
|
14
13
|
color3 = '#a78bfa',
|
|
15
14
|
color4 = '#38bdf8',
|
|
16
|
-
} = defineProps<
|
|
17
|
-
speed?: number
|
|
18
|
-
intensity?: number
|
|
19
|
-
mouseInteraction?: boolean
|
|
20
|
-
mouseStrength?: number
|
|
21
|
-
color1?: string
|
|
22
|
-
color2?: string
|
|
23
|
-
color3?: string
|
|
24
|
-
color4?: string
|
|
25
|
-
}>()
|
|
15
|
+
} = defineProps<ThemePresetProps>()
|
|
26
16
|
|
|
27
17
|
const emit = defineEmits<{
|
|
28
|
-
node: [colorNode:
|
|
18
|
+
node: [colorNode: TSLNode]
|
|
29
19
|
}>()
|
|
30
20
|
|
|
31
|
-
const uniforms =
|
|
32
|
-
speed
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
color2
|
|
48
|
-
|
|
49
|
-
|
|
21
|
+
const { uniforms, colorNode } = useThemePreset(createThemeAuroraColorNode, {
|
|
22
|
+
get speed() {
|
|
23
|
+
return speed
|
|
24
|
+
},
|
|
25
|
+
get intensity() {
|
|
26
|
+
return intensity
|
|
27
|
+
},
|
|
28
|
+
get mouseInteraction() {
|
|
29
|
+
return mouseInteraction
|
|
30
|
+
},
|
|
31
|
+
get mouseStrength() {
|
|
32
|
+
return mouseStrength
|
|
33
|
+
},
|
|
34
|
+
get color1() {
|
|
35
|
+
return color1
|
|
36
|
+
},
|
|
37
|
+
get color2() {
|
|
38
|
+
return color2
|
|
39
|
+
},
|
|
40
|
+
get color3() {
|
|
41
|
+
return color3
|
|
42
|
+
},
|
|
43
|
+
get color4() {
|
|
44
|
+
return color4
|
|
45
|
+
},
|
|
50
46
|
})
|
|
51
47
|
|
|
52
|
-
watch(
|
|
53
|
-
() => color1,
|
|
54
|
-
(hex) => c1.tweenTo(hex, 0.8)
|
|
55
|
-
)
|
|
56
|
-
watch(
|
|
57
|
-
() => color2,
|
|
58
|
-
(hex) => c2.tweenTo(hex, 0.8)
|
|
59
|
-
)
|
|
60
|
-
watch(
|
|
61
|
-
() => color3,
|
|
62
|
-
(hex) => c3.tweenTo(hex, 0.8)
|
|
63
|
-
)
|
|
64
|
-
watch(
|
|
65
|
-
() => color4,
|
|
66
|
-
(hex) => c4.tweenTo(hex, 0.8)
|
|
67
|
-
)
|
|
68
|
-
|
|
69
|
-
try {
|
|
70
|
-
const runtime = useShaderRuntimeContext()
|
|
71
|
-
watch(
|
|
72
|
-
() => [runtime.mouse.mouseX.value, runtime.mouse.mouseY.value],
|
|
73
|
-
([mx, my]) => {
|
|
74
|
-
uniforms.mouseX.value = mx
|
|
75
|
-
uniforms.mouseY.value = my
|
|
76
|
-
},
|
|
77
|
-
{ immediate: true }
|
|
78
|
-
)
|
|
79
|
-
} catch {
|
|
80
|
-
// No runtime context
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
watch(
|
|
84
|
-
() => speed,
|
|
85
|
-
(v) => {
|
|
86
|
-
uniforms.speed.value = v
|
|
87
|
-
}
|
|
88
|
-
)
|
|
89
|
-
watch(
|
|
90
|
-
() => intensity,
|
|
91
|
-
(v) => {
|
|
92
|
-
uniforms.intensity.value = v
|
|
93
|
-
}
|
|
94
|
-
)
|
|
95
|
-
watch(
|
|
96
|
-
() => mouseInteraction,
|
|
97
|
-
(v) => {
|
|
98
|
-
uniforms.mouseStrength.value = v ? mouseStrength : 0
|
|
99
|
-
}
|
|
100
|
-
)
|
|
101
|
-
watch(
|
|
102
|
-
() => mouseStrength,
|
|
103
|
-
(v) => {
|
|
104
|
-
if (mouseInteraction) uniforms.mouseStrength.value = v
|
|
105
|
-
}
|
|
106
|
-
)
|
|
107
|
-
|
|
108
48
|
emit('node', colorNode)
|
|
109
49
|
defineExpose({ uniforms, colorNode })
|
|
110
50
|
</script>
|