@nous-research/ui 0.13.2 → 0.14.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/README.md +16 -0
- package/dist/assets/filler-bg0.webp +0 -0
- package/dist/assets.d.ts +38 -0
- package/dist/fonts.d.ts +0 -1
- package/dist/fonts.js +5 -7
- package/dist/hooks/use-capped-frame.d.ts +0 -1
- package/dist/hooks/use-capped-frame.js +12 -13
- package/dist/hooks/use-css-var-dims.d.ts +0 -1
- package/dist/hooks/use-css-var-dims.js +26 -21
- package/dist/hooks/use-gpu-tier.d.ts +0 -1
- package/dist/hooks/use-gpu-tier.js +90 -110
- package/dist/hooks/use-render-loop.d.ts +0 -1
- package/dist/hooks/use-render-loop.js +58 -58
- package/dist/hooks/use-smooth-controls.d.ts +0 -1
- package/dist/hooks/use-smooth-controls.js +204 -206
- package/dist/index.d.ts +0 -1
- package/dist/index.js +84 -58
- package/dist/ui/basic-page.d.ts +1 -2
- package/dist/ui/basic-page.js +15 -7
- package/dist/ui/build.css +1 -0
- package/dist/ui/components/animated-count.d.ts +1 -2
- package/dist/ui/components/animated-count.js +109 -85
- package/dist/ui/components/ascii.d.ts +2 -3
- package/dist/ui/components/ascii.js +75 -59
- package/dist/ui/components/badge.d.ts +1 -2
- package/dist/ui/components/badge.js +35 -18
- package/dist/ui/components/badges/nous-girl.d.ts +1 -2
- package/dist/ui/components/badges/nous-girl.js +80 -3
- package/dist/ui/components/blend-mode.d.ts +1 -2
- package/dist/ui/components/blend-mode.js +55 -63
- package/dist/ui/components/blink.d.ts +1 -2
- package/dist/ui/components/blink.js +15 -6
- package/dist/ui/components/button.d.ts +2 -3
- package/dist/ui/components/button.js +139 -90
- package/dist/ui/components/command-block.d.ts +2 -3
- package/dist/ui/components/command-block.js +52 -24
- package/dist/ui/components/cursor.d.ts +1 -2
- package/dist/ui/components/cursor.js +93 -54
- package/dist/ui/components/dropdown-menu.d.ts +1 -2
- package/dist/ui/components/dropdown-menu.js +99 -51
- package/dist/ui/components/fit-text/index.d.ts +0 -1
- package/dist/ui/components/fit-text/index.js +21 -13
- package/dist/ui/components/graphs/bar-chart.d.ts +1 -2
- package/dist/ui/components/graphs/bar-chart.js +116 -63
- package/dist/ui/components/graphs/index.d.ts +0 -1
- package/dist/ui/components/graphs/index.js +3 -4
- package/dist/ui/components/graphs/line-chart.d.ts +1 -2
- package/dist/ui/components/graphs/line-chart.js +159 -102
- package/dist/ui/components/graphs/utils.d.ts +2 -3
- package/dist/ui/components/graphs/utils.js +147 -114
- package/dist/ui/components/grid/index.d.ts +0 -1
- package/dist/ui/components/grid/index.js +12 -9
- package/dist/ui/components/hover-bg.d.ts +0 -1
- package/dist/ui/components/hover-bg.js +11 -6
- package/dist/ui/components/icons/arrow.d.ts +1 -2
- package/dist/ui/components/icons/arrow.js +42 -5
- package/dist/ui/components/icons/chevron.d.ts +1 -2
- package/dist/ui/components/icons/chevron.js +49 -5
- package/dist/ui/components/icons/discord.d.ts +1 -2
- package/dist/ui/components/icons/discord.js +12 -4
- package/dist/ui/components/icons/eye.d.ts +1 -2
- package/dist/ui/components/icons/eye.js +5 -3
- package/dist/ui/components/icons/gear.d.ts +1 -2
- package/dist/ui/components/icons/gear.js +28 -14
- package/dist/ui/components/icons/github.d.ts +1 -2
- package/dist/ui/components/icons/github.js +12 -4
- package/dist/ui/components/icons/hamburger.d.ts +1 -2
- package/dist/ui/components/icons/hamburger.js +54 -5
- package/dist/ui/components/icons/heart.d.ts +1 -2
- package/dist/ui/components/icons/heart.js +8 -3
- package/dist/ui/components/icons/index.d.ts +0 -1
- package/dist/ui/components/icons/index.js +11 -12
- package/dist/ui/components/icons/link.d.ts +1 -2
- package/dist/ui/components/icons/link.js +10 -3
- package/dist/ui/components/icons/minus.d.ts +1 -2
- package/dist/ui/components/icons/minus.js +10 -3
- package/dist/ui/components/icons/search.d.ts +1 -2
- package/dist/ui/components/icons/search.js +30 -3
- package/dist/ui/components/image-distortion.d.ts +1 -2
- package/dist/ui/components/image-distortion.js +300 -265
- package/dist/ui/components/leva-client.d.ts +1 -2
- package/dist/ui/components/leva-client.js +9 -10
- package/dist/ui/components/list-item.d.ts +0 -1
- package/dist/ui/components/list-item.js +26 -10
- package/dist/ui/components/modal/index.d.ts +1 -2
- package/dist/ui/components/modal/index.js +33 -14
- package/dist/ui/components/overlays/blend-modes.d.ts +0 -1
- package/dist/ui/components/overlays/blend-modes.js +11 -12
- package/dist/ui/components/overlays/glitch.d.ts +1 -2
- package/dist/ui/components/overlays/glitch.js +115 -110
- package/dist/ui/components/overlays/greys.d.ts +1 -2
- package/dist/ui/components/overlays/greys.js +200 -179
- package/dist/ui/components/overlays/index.d.ts +1 -2
- package/dist/ui/components/overlays/index.js +31 -17
- package/dist/ui/components/overlays/lens-layers.d.ts +1 -2
- package/dist/ui/components/overlays/lens-layers.js +89 -65
- package/dist/ui/components/overlays/lens.d.ts +0 -1
- package/dist/ui/components/overlays/lens.js +46 -52
- package/dist/ui/components/overlays/noise.d.ts +1 -2
- package/dist/ui/components/overlays/noise.js +112 -113
- package/dist/ui/components/overlays/vignette.d.ts +1 -2
- package/dist/ui/components/overlays/vignette.js +44 -38
- package/dist/ui/components/poster.d.ts +1 -2
- package/dist/ui/components/poster.js +240 -87
- package/dist/ui/components/progress.d.ts +1 -2
- package/dist/ui/components/progress.js +52 -12
- package/dist/ui/components/scene-canvas.d.ts +1 -2
- package/dist/ui/components/scene-canvas.js +169 -119
- package/dist/ui/components/scramble.d.ts +1 -2
- package/dist/ui/components/scramble.js +60 -59
- package/dist/ui/components/segmented.d.ts +2 -3
- package/dist/ui/components/segmented.js +47 -12
- package/dist/ui/components/select.d.ts +1 -2
- package/dist/ui/components/select.js +207 -120
- package/dist/ui/components/selection-switcher.d.ts +0 -1
- package/dist/ui/components/selection-switcher.js +29 -25
- package/dist/ui/components/shader.d.ts +1 -2
- package/dist/ui/components/shader.js +56 -38
- package/dist/ui/components/socials.d.ts +1 -2
- package/dist/ui/components/socials.js +18 -7
- package/dist/ui/components/spinner.d.ts +1 -2
- package/dist/ui/components/spinner.js +36 -25
- package/dist/ui/components/stats.d.ts +1 -2
- package/dist/ui/components/stats.js +33 -9
- package/dist/ui/components/switch.d.ts +0 -1
- package/dist/ui/components/switch.js +35 -11
- package/dist/ui/components/tabs.d.ts +3 -4
- package/dist/ui/components/tabs.js +38 -12
- package/dist/ui/components/terminal-demo.d.ts +1 -2
- package/dist/ui/components/terminal-demo.js +119 -74
- package/dist/ui/components/theme-toggle.d.ts +1 -2
- package/dist/ui/components/theme-toggle.js +63 -8
- package/dist/ui/components/tier-card.d.ts +1 -2
- package/dist/ui/components/tier-card.js +144 -24
- package/dist/ui/components/tv.d.ts +1 -2
- package/dist/ui/components/tv.js +138 -90
- package/dist/ui/components/typography/h1.d.ts +0 -1
- package/dist/ui/components/typography/h1.js +17 -8
- package/dist/ui/components/typography/h2.d.ts +0 -1
- package/dist/ui/components/typography/h2.js +17 -8
- package/dist/ui/components/typography/index.d.ts +0 -1
- package/dist/ui/components/typography/index.js +35 -24
- package/dist/ui/components/typography/legend.d.ts +1 -2
- package/dist/ui/components/typography/legend.js +18 -6
- package/dist/ui/components/typography/small.d.ts +0 -1
- package/dist/ui/components/typography/small.js +8 -7
- package/dist/ui/components/watchlist.d.ts +1 -2
- package/dist/ui/components/watchlist.js +77 -25
- package/dist/ui/fonts.css +7 -7
- package/dist/ui/footer.d.ts +1 -2
- package/dist/ui/footer.js +61 -25
- package/dist/ui/globals.css +5 -1
- package/dist/ui/header.d.ts +1 -2
- package/dist/ui/header.js +255 -60
- package/dist/ui/layout-wrapper.d.ts +1 -2
- package/dist/ui/layout-wrapper.js +5 -4
- package/dist/utils/color.d.ts +0 -1
- package/dist/utils/color.js +8 -9
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.js +37 -38
- package/dist/utils/poly.d.ts +0 -1
- package/dist/utils/poly.js +1 -2
- package/package.json +42 -24
- package/dist/assets/filler-bg0.jpg +0 -0
- package/dist/fonts.d.ts.map +0 -1
- package/dist/fonts.js.map +0 -1
- package/dist/hooks/use-capped-frame.d.ts.map +0 -1
- package/dist/hooks/use-capped-frame.js.map +0 -1
- package/dist/hooks/use-css-var-dims.d.ts.map +0 -1
- package/dist/hooks/use-css-var-dims.js.map +0 -1
- package/dist/hooks/use-gpu-tier.d.ts.map +0 -1
- package/dist/hooks/use-gpu-tier.js.map +0 -1
- package/dist/hooks/use-render-loop.d.ts.map +0 -1
- package/dist/hooks/use-render-loop.js.map +0 -1
- package/dist/hooks/use-smooth-controls.d.ts.map +0 -1
- package/dist/hooks/use-smooth-controls.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/ui/basic-page.d.ts.map +0 -1
- package/dist/ui/basic-page.js.map +0 -1
- package/dist/ui/components/animated-count.d.ts.map +0 -1
- package/dist/ui/components/animated-count.js.map +0 -1
- package/dist/ui/components/ascii.d.ts.map +0 -1
- package/dist/ui/components/ascii.js.map +0 -1
- package/dist/ui/components/badge.d.ts.map +0 -1
- package/dist/ui/components/badge.js.map +0 -1
- package/dist/ui/components/badges/nous-girl.d.ts.map +0 -1
- package/dist/ui/components/badges/nous-girl.js.map +0 -1
- package/dist/ui/components/blend-mode.d.ts.map +0 -1
- package/dist/ui/components/blend-mode.js.map +0 -1
- package/dist/ui/components/blink.d.ts.map +0 -1
- package/dist/ui/components/blink.js.map +0 -1
- package/dist/ui/components/button.d.ts.map +0 -1
- package/dist/ui/components/button.js.map +0 -1
- package/dist/ui/components/command-block.d.ts.map +0 -1
- package/dist/ui/components/command-block.js.map +0 -1
- package/dist/ui/components/cursor.d.ts.map +0 -1
- package/dist/ui/components/cursor.js.map +0 -1
- package/dist/ui/components/dropdown-menu.d.ts.map +0 -1
- package/dist/ui/components/dropdown-menu.js.map +0 -1
- package/dist/ui/components/fit-text/index.d.ts.map +0 -1
- package/dist/ui/components/fit-text/index.js.map +0 -1
- package/dist/ui/components/graphs/bar-chart.d.ts.map +0 -1
- package/dist/ui/components/graphs/bar-chart.js.map +0 -1
- package/dist/ui/components/graphs/index.d.ts.map +0 -1
- package/dist/ui/components/graphs/index.js.map +0 -1
- package/dist/ui/components/graphs/line-chart.d.ts.map +0 -1
- package/dist/ui/components/graphs/line-chart.js.map +0 -1
- package/dist/ui/components/graphs/utils.d.ts.map +0 -1
- package/dist/ui/components/graphs/utils.js.map +0 -1
- package/dist/ui/components/grid/index.d.ts.map +0 -1
- package/dist/ui/components/grid/index.js.map +0 -1
- package/dist/ui/components/hover-bg.d.ts.map +0 -1
- package/dist/ui/components/hover-bg.js.map +0 -1
- package/dist/ui/components/icons/arrow.d.ts.map +0 -1
- package/dist/ui/components/icons/arrow.js.map +0 -1
- package/dist/ui/components/icons/chevron.d.ts.map +0 -1
- package/dist/ui/components/icons/chevron.js.map +0 -1
- package/dist/ui/components/icons/discord.d.ts.map +0 -1
- package/dist/ui/components/icons/discord.js.map +0 -1
- package/dist/ui/components/icons/eye.d.ts.map +0 -1
- package/dist/ui/components/icons/eye.js.map +0 -1
- package/dist/ui/components/icons/gear.d.ts.map +0 -1
- package/dist/ui/components/icons/gear.js.map +0 -1
- package/dist/ui/components/icons/github.d.ts.map +0 -1
- package/dist/ui/components/icons/github.js.map +0 -1
- package/dist/ui/components/icons/hamburger.d.ts.map +0 -1
- package/dist/ui/components/icons/hamburger.js.map +0 -1
- package/dist/ui/components/icons/heart.d.ts.map +0 -1
- package/dist/ui/components/icons/heart.js.map +0 -1
- package/dist/ui/components/icons/index.d.ts.map +0 -1
- package/dist/ui/components/icons/index.js.map +0 -1
- package/dist/ui/components/icons/link.d.ts.map +0 -1
- package/dist/ui/components/icons/link.js.map +0 -1
- package/dist/ui/components/icons/minus.d.ts.map +0 -1
- package/dist/ui/components/icons/minus.js.map +0 -1
- package/dist/ui/components/icons/search.d.ts.map +0 -1
- package/dist/ui/components/icons/search.js.map +0 -1
- package/dist/ui/components/image-distortion.d.ts.map +0 -1
- package/dist/ui/components/image-distortion.js.map +0 -1
- package/dist/ui/components/leva-client.d.ts.map +0 -1
- package/dist/ui/components/leva-client.js.map +0 -1
- package/dist/ui/components/list-item.d.ts.map +0 -1
- package/dist/ui/components/list-item.js.map +0 -1
- package/dist/ui/components/modal/index.d.ts.map +0 -1
- package/dist/ui/components/modal/index.js.map +0 -1
- package/dist/ui/components/overlays/blend-modes.d.ts.map +0 -1
- package/dist/ui/components/overlays/blend-modes.js.map +0 -1
- package/dist/ui/components/overlays/glitch.d.ts.map +0 -1
- package/dist/ui/components/overlays/glitch.js.map +0 -1
- package/dist/ui/components/overlays/greys.d.ts.map +0 -1
- package/dist/ui/components/overlays/greys.js.map +0 -1
- package/dist/ui/components/overlays/index.d.ts.map +0 -1
- package/dist/ui/components/overlays/index.js.map +0 -1
- package/dist/ui/components/overlays/lens-layers.d.ts.map +0 -1
- package/dist/ui/components/overlays/lens-layers.js.map +0 -1
- package/dist/ui/components/overlays/lens.d.ts.map +0 -1
- package/dist/ui/components/overlays/lens.js.map +0 -1
- package/dist/ui/components/overlays/noise.d.ts.map +0 -1
- package/dist/ui/components/overlays/noise.js.map +0 -1
- package/dist/ui/components/overlays/vignette.d.ts.map +0 -1
- package/dist/ui/components/overlays/vignette.js.map +0 -1
- package/dist/ui/components/poster.d.ts.map +0 -1
- package/dist/ui/components/poster.js.map +0 -1
- package/dist/ui/components/progress.d.ts.map +0 -1
- package/dist/ui/components/progress.js.map +0 -1
- package/dist/ui/components/scene-canvas.d.ts.map +0 -1
- package/dist/ui/components/scene-canvas.js.map +0 -1
- package/dist/ui/components/scramble.d.ts.map +0 -1
- package/dist/ui/components/scramble.js.map +0 -1
- package/dist/ui/components/segmented.d.ts.map +0 -1
- package/dist/ui/components/segmented.js.map +0 -1
- package/dist/ui/components/select.d.ts.map +0 -1
- package/dist/ui/components/select.js.map +0 -1
- package/dist/ui/components/selection-switcher.d.ts.map +0 -1
- package/dist/ui/components/selection-switcher.js.map +0 -1
- package/dist/ui/components/shader.d.ts.map +0 -1
- package/dist/ui/components/shader.js.map +0 -1
- package/dist/ui/components/socials.d.ts.map +0 -1
- package/dist/ui/components/socials.js.map +0 -1
- package/dist/ui/components/spinner.d.ts.map +0 -1
- package/dist/ui/components/spinner.js.map +0 -1
- package/dist/ui/components/stats.d.ts.map +0 -1
- package/dist/ui/components/stats.js.map +0 -1
- package/dist/ui/components/switch.d.ts.map +0 -1
- package/dist/ui/components/switch.js.map +0 -1
- package/dist/ui/components/tabs.d.ts.map +0 -1
- package/dist/ui/components/tabs.js.map +0 -1
- package/dist/ui/components/terminal-demo.d.ts.map +0 -1
- package/dist/ui/components/terminal-demo.js.map +0 -1
- package/dist/ui/components/theme-toggle.d.ts.map +0 -1
- package/dist/ui/components/theme-toggle.js.map +0 -1
- package/dist/ui/components/tier-card.d.ts.map +0 -1
- package/dist/ui/components/tier-card.js.map +0 -1
- package/dist/ui/components/tv.d.ts.map +0 -1
- package/dist/ui/components/tv.js.map +0 -1
- package/dist/ui/components/typography/h1.d.ts.map +0 -1
- package/dist/ui/components/typography/h1.js.map +0 -1
- package/dist/ui/components/typography/h2.d.ts.map +0 -1
- package/dist/ui/components/typography/h2.js.map +0 -1
- package/dist/ui/components/typography/index.d.ts.map +0 -1
- package/dist/ui/components/typography/index.js.map +0 -1
- package/dist/ui/components/typography/legend.d.ts.map +0 -1
- package/dist/ui/components/typography/legend.js.map +0 -1
- package/dist/ui/components/typography/small.d.ts.map +0 -1
- package/dist/ui/components/typography/small.js.map +0 -1
- package/dist/ui/components/watchlist.d.ts.map +0 -1
- package/dist/ui/components/watchlist.js.map +0 -1
- package/dist/ui/footer.d.ts.map +0 -1
- package/dist/ui/footer.js.map +0 -1
- package/dist/ui/header.d.ts.map +0 -1
- package/dist/ui/header.js.map +0 -1
- package/dist/ui/layout-wrapper.d.ts.map +0 -1
- package/dist/ui/layout-wrapper.js.map +0 -1
- package/dist/utils/color.d.ts.map +0 -1
- package/dist/utils/color.js.map +0 -1
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/poly.d.ts.map +0 -1
- package/dist/utils/poly.js.map +0 -1
|
@@ -1,65 +1,59 @@
|
|
|
1
|
-
|
|
2
|
-
import { atom } from
|
|
3
|
-
import { setControlValue } from
|
|
1
|
+
"use client";
|
|
2
|
+
import { atom } from "nanostores";
|
|
3
|
+
import { setControlValue } from "../../../hooks/use-smooth-controls.js";
|
|
4
4
|
export const LENS_0 = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
Globe: { innerColor: "#170d02", innerOpacity: 0.1, outerColor: "#FFAC02" },
|
|
6
|
+
Lens: {
|
|
7
|
+
bgBlend: "difference",
|
|
8
|
+
bgColor: "#041C1C",
|
|
9
|
+
bgOpacity: 1,
|
|
10
|
+
fgColor: "#FFFFFF",
|
|
11
|
+
fgOpacity: 0,
|
|
12
|
+
fillerOpacity: 0.033,
|
|
13
|
+
mgColor: "#ffe6cb",
|
|
14
|
+
mgOpacity: 1
|
|
15
|
+
}
|
|
16
16
|
};
|
|
17
17
|
export const LENS_5I = {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
Globe: { innerColor: "#170d02", innerOpacity: 0.3, outerColor: "#FFAC02" },
|
|
19
|
+
Lens: {
|
|
20
|
+
bgBlend: "multiply",
|
|
21
|
+
bgColor: "#170d02",
|
|
22
|
+
bgOpacity: 1,
|
|
23
|
+
fgColor: "#FFFFFF",
|
|
24
|
+
fgOpacity: 1,
|
|
25
|
+
fillerOpacity: 0.06,
|
|
26
|
+
mgColor: "#FFAC02",
|
|
27
|
+
mgOpacity: 1
|
|
28
|
+
}
|
|
29
29
|
};
|
|
30
30
|
export const lens0 = (l, g) => ({
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
Globe: { ...LENS_0.Globe, ...g },
|
|
32
|
+
Lens: { ...LENS_0.Lens, ...l }
|
|
33
33
|
});
|
|
34
|
-
// The Hermes light-mode look is produced by a fullscreen opaque-white
|
|
35
|
-
// `mix-blend-mode: difference` foreground layer that inverts everything.
|
|
36
|
-
// Colored lenses that want a "white + accent" look MUST be built from
|
|
37
|
-
// LENS_5I, not LENS_0 — otherwise `bgBlend: 'difference'` + an opaque
|
|
38
|
-
// colored bg + active fg inversion land halfway between dark and light
|
|
39
|
-
// mode and produce a muddy warm wash instead of a clean inversion.
|
|
40
34
|
export const lens5i = (l, g) => ({
|
|
41
|
-
|
|
42
|
-
|
|
35
|
+
Globe: { ...LENS_5I.Globe, ...g },
|
|
36
|
+
Lens: { ...LENS_5I.Lens, ...l }
|
|
43
37
|
});
|
|
44
|
-
// Accent colors are the *pre-inversion* source; after the difference FG
|
|
45
|
-
// layer they read as their visual complement. e.g. `#FFAC02` (orange)
|
|
46
|
-
// renders as blue #0053FD on screen — that's the default LENS_5I accent.
|
|
47
38
|
export const LENSES = [
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
39
|
+
["0", LENS_0],
|
|
40
|
+
["1", lens0({ bgColor: "#0A1F1F" })],
|
|
41
|
+
["2", lens0({ bgColor: "#0E0313", mgColor: "#e6cbff" })],
|
|
42
|
+
["3", lens5i({ mgColor: "#FFAC02" })],
|
|
43
|
+
["4", lens5i({ bgColor: "#0E0313", mgColor: "#FF5500" })],
|
|
44
|
+
["5", lens0({ bgColor: "#1540B1", bgOpacity: 0.7 })],
|
|
45
|
+
["5i", LENS_5I],
|
|
46
|
+
["6", lens5i({ bgColor: "#170D02", mgColor: "#00E5FF" })]
|
|
56
47
|
];
|
|
57
|
-
export const applyLens = (preset, animate = false) => Object.entries(preset).forEach(
|
|
48
|
+
export const applyLens = (preset, animate = false) => Object.entries(preset).forEach(
|
|
49
|
+
([g, v]) => Object.entries(v).forEach(
|
|
50
|
+
([k, val]) => setControlValue(g, k, val, { animate })
|
|
51
|
+
)
|
|
52
|
+
);
|
|
58
53
|
export const $lightMode = atom(true);
|
|
59
54
|
export const toggleLens = () => {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
55
|
+
const isLight = $lightMode.get();
|
|
56
|
+
const next = isLight ? LENS_0 : LENS_5I;
|
|
57
|
+
$lightMode.set(!isLight);
|
|
58
|
+
applyLens(next, true);
|
|
64
59
|
};
|
|
65
|
-
//# sourceMappingURL=lens.js.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
export declare function Noise({ className, style }: NoiseProps): import("react
|
|
1
|
+
export declare function Noise({ className, style }: NoiseProps): import("react").JSX.Element | null;
|
|
2
2
|
interface NoiseProps {
|
|
3
3
|
className?: string;
|
|
4
4
|
style?: React.CSSProperties;
|
|
5
5
|
}
|
|
6
6
|
export {};
|
|
7
|
-
//# sourceMappingURL=noise.d.ts.map
|
|
@@ -1,19 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
import { jsx
|
|
3
|
-
import { useEffect, useRef } from
|
|
4
|
-
import * as THREE from
|
|
5
|
-
import { $gpuTier, useGpuTier } from
|
|
6
|
-
import { useSmoothControls } from
|
|
7
|
-
import { cn, hexToVec3 } from
|
|
8
|
-
import { BLEND_MODES } from
|
|
9
|
-
const vert =
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useRef } from "react";
|
|
4
|
+
import * as THREE from "three";
|
|
5
|
+
import { $gpuTier, useGpuTier } from "../../../hooks/use-gpu-tier.js";
|
|
6
|
+
import { useSmoothControls } from "../../../hooks/use-smooth-controls.js";
|
|
7
|
+
import { cn, hexToVec3 } from "../../../utils/index.js";
|
|
8
|
+
import { BLEND_MODES } from "./blend-modes.js";
|
|
9
|
+
const vert = (
|
|
10
|
+
/*glsl*/
|
|
11
|
+
`
|
|
10
12
|
varying vec2 vUv;
|
|
11
13
|
void main() {
|
|
12
14
|
vUv = uv;
|
|
13
15
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
14
16
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
`
|
|
18
|
+
);
|
|
19
|
+
const frag = (
|
|
20
|
+
/*glsl*/
|
|
21
|
+
`
|
|
17
22
|
uniform vec2 uRes;
|
|
18
23
|
uniform float uDpr, uSize, uDensity, uOpacity;
|
|
19
24
|
uniform vec3 uColor;
|
|
@@ -29,108 +34,102 @@ const frag = /*glsl*/ `
|
|
|
29
34
|
float n = hash(floor(vUv * uRes / (uSize * uDpr)));
|
|
30
35
|
gl_FragColor = vec4(uColor, step(1.0 - uDensity, n)) * uOpacity;
|
|
31
36
|
}
|
|
32
|
-
|
|
37
|
+
`
|
|
38
|
+
);
|
|
33
39
|
export function Noise({ className, style }) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
// Instead we render exactly once on mount, and re-render only when
|
|
53
|
-
// the user-controllable uniforms change or the viewport resizes.
|
|
54
|
-
useEffect(() => {
|
|
55
|
-
if (!canvasRef.current || !enabled) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
let renderer;
|
|
59
|
-
try {
|
|
60
|
-
renderer = new THREE.WebGLRenderer({
|
|
61
|
-
alpha: true,
|
|
62
|
-
canvas: canvasRef.current,
|
|
63
|
-
premultipliedAlpha: false
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
catch {
|
|
67
|
-
$gpuTier.set(0);
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
renderer.setClearColor(0x000000, 0);
|
|
71
|
-
const scene = new THREE.Scene();
|
|
72
|
-
const camera = new THREE.OrthographicCamera(-1, 1, 1, -1, 0, 1);
|
|
73
|
-
const geo = new THREE.PlaneGeometry(2, 2);
|
|
74
|
-
const mat = new THREE.ShaderMaterial({
|
|
75
|
-
fragmentShader: frag,
|
|
76
|
-
transparent: true,
|
|
77
|
-
uniforms: {
|
|
78
|
-
uColor: { value: hexToVec3(c.color) },
|
|
79
|
-
uDensity: { value: c.density },
|
|
80
|
-
uDpr: { value: 1 },
|
|
81
|
-
uOpacity: { value: c.opacity },
|
|
82
|
-
uRes: { value: new THREE.Vector2() },
|
|
83
|
-
uSize: { value: c.size }
|
|
84
|
-
},
|
|
85
|
-
vertexShader: vert
|
|
86
|
-
});
|
|
87
|
-
scene.add(new THREE.Mesh(geo, mat));
|
|
88
|
-
// Cap pixel ratio at 1.5 — noise is intentionally pixelated, so the
|
|
89
|
-
// extra retina samples are wasted fillrate.
|
|
90
|
-
const dpr = Math.min(devicePixelRatio, 1.5);
|
|
91
|
-
const render = () => {
|
|
92
|
-
mat.uniforms.uColor.value = hexToVec3(c.color);
|
|
93
|
-
mat.uniforms.uDensity.value = c.density;
|
|
94
|
-
mat.uniforms.uOpacity.value = c.opacity;
|
|
95
|
-
mat.uniforms.uSize.value = c.size;
|
|
96
|
-
mat.uniforms.uDpr.value = dpr;
|
|
97
|
-
renderer.render(scene, camera);
|
|
98
|
-
};
|
|
99
|
-
const resize = () => {
|
|
100
|
-
renderer.setSize(innerWidth, innerHeight);
|
|
101
|
-
renderer.setPixelRatio(dpr);
|
|
102
|
-
mat.uniforms.uRes.value.set(innerWidth * dpr, innerHeight * dpr);
|
|
103
|
-
render();
|
|
104
|
-
};
|
|
105
|
-
resize();
|
|
106
|
-
window.addEventListener('resize', resize);
|
|
107
|
-
// Re-render when the tab becomes visible again, in case the GL
|
|
108
|
-
// context was discarded by the browser while the page was
|
|
109
|
-
// backgrounded — otherwise we can come back to a transparent canvas.
|
|
110
|
-
const onVisibility = () => {
|
|
111
|
-
if (!document.hidden)
|
|
112
|
-
render();
|
|
113
|
-
};
|
|
114
|
-
document.addEventListener('visibilitychange', onVisibility);
|
|
115
|
-
return () => {
|
|
116
|
-
window.removeEventListener('resize', resize);
|
|
117
|
-
document.removeEventListener('visibilitychange', onVisibility);
|
|
118
|
-
mat.dispose();
|
|
119
|
-
geo.dispose();
|
|
120
|
-
renderer.dispose();
|
|
121
|
-
};
|
|
122
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
123
|
-
}, [
|
|
124
|
-
enabled,
|
|
125
|
-
gpuTier,
|
|
126
|
-
c.color,
|
|
127
|
-
c.density,
|
|
128
|
-
c.opacity,
|
|
129
|
-
c.size
|
|
130
|
-
]);
|
|
131
|
-
if (!enabled) {
|
|
132
|
-
return null;
|
|
40
|
+
const gpuTier = useGpuTier();
|
|
41
|
+
const c = useSmoothControls(
|
|
42
|
+
"Effects/Noise",
|
|
43
|
+
{
|
|
44
|
+
blend: { options: BLEND_MODES, value: "color-dodge" },
|
|
45
|
+
color: { value: "#eaeaea" },
|
|
46
|
+
density: { max: 1, min: 0, step: 0.01, value: 0.11 },
|
|
47
|
+
enabled: { value: true },
|
|
48
|
+
opacity: { max: 1, min: 0, step: 0.01, value: 0.55 },
|
|
49
|
+
size: { max: 10, min: 0.1, step: 0.1, value: 1 }
|
|
50
|
+
},
|
|
51
|
+
{ collapsed: true }
|
|
52
|
+
);
|
|
53
|
+
const canvasRef = useRef(null);
|
|
54
|
+
const enabled = c.enabled && gpuTier > 0;
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
if (!canvasRef.current || !enabled) {
|
|
57
|
+
return;
|
|
133
58
|
}
|
|
134
|
-
|
|
59
|
+
let renderer;
|
|
60
|
+
try {
|
|
61
|
+
renderer = new THREE.WebGLRenderer({
|
|
62
|
+
alpha: true,
|
|
63
|
+
canvas: canvasRef.current,
|
|
64
|
+
premultipliedAlpha: false
|
|
65
|
+
});
|
|
66
|
+
} catch {
|
|
67
|
+
$gpuTier.set(0);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
renderer.setClearColor(0, 0);
|
|
71
|
+
const scene = new THREE.Scene();
|
|
72
|
+
const camera = new THREE.OrthographicCamera(-1, 1, 1, -1, 0, 1);
|
|
73
|
+
const geo = new THREE.PlaneGeometry(2, 2);
|
|
74
|
+
const mat = new THREE.ShaderMaterial({
|
|
75
|
+
fragmentShader: frag,
|
|
76
|
+
transparent: true,
|
|
77
|
+
uniforms: {
|
|
78
|
+
uColor: { value: hexToVec3(c.color) },
|
|
79
|
+
uDensity: { value: c.density },
|
|
80
|
+
uDpr: { value: 1 },
|
|
81
|
+
uOpacity: { value: c.opacity },
|
|
82
|
+
uRes: { value: new THREE.Vector2() },
|
|
83
|
+
uSize: { value: c.size }
|
|
84
|
+
},
|
|
85
|
+
vertexShader: vert
|
|
86
|
+
});
|
|
87
|
+
scene.add(new THREE.Mesh(geo, mat));
|
|
88
|
+
const dpr = Math.min(devicePixelRatio, 1.5);
|
|
89
|
+
const render = () => {
|
|
90
|
+
mat.uniforms.uColor.value = hexToVec3(c.color);
|
|
91
|
+
mat.uniforms.uDensity.value = c.density;
|
|
92
|
+
mat.uniforms.uOpacity.value = c.opacity;
|
|
93
|
+
mat.uniforms.uSize.value = c.size;
|
|
94
|
+
mat.uniforms.uDpr.value = dpr;
|
|
95
|
+
renderer.render(scene, camera);
|
|
96
|
+
};
|
|
97
|
+
const resize = () => {
|
|
98
|
+
renderer.setSize(innerWidth, innerHeight);
|
|
99
|
+
renderer.setPixelRatio(dpr);
|
|
100
|
+
mat.uniforms.uRes.value.set(innerWidth * dpr, innerHeight * dpr);
|
|
101
|
+
render();
|
|
102
|
+
};
|
|
103
|
+
resize();
|
|
104
|
+
window.addEventListener("resize", resize);
|
|
105
|
+
const onVisibility = () => {
|
|
106
|
+
if (!document.hidden) render();
|
|
107
|
+
};
|
|
108
|
+
document.addEventListener("visibilitychange", onVisibility);
|
|
109
|
+
return () => {
|
|
110
|
+
window.removeEventListener("resize", resize);
|
|
111
|
+
document.removeEventListener("visibilitychange", onVisibility);
|
|
112
|
+
mat.dispose();
|
|
113
|
+
geo.dispose();
|
|
114
|
+
renderer.dispose();
|
|
115
|
+
};
|
|
116
|
+
}, [
|
|
117
|
+
enabled,
|
|
118
|
+
gpuTier,
|
|
119
|
+
c.color,
|
|
120
|
+
c.density,
|
|
121
|
+
c.opacity,
|
|
122
|
+
c.size
|
|
123
|
+
]);
|
|
124
|
+
if (!enabled) {
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
return /* @__PURE__ */ jsx(
|
|
128
|
+
"canvas",
|
|
129
|
+
{
|
|
130
|
+
className: cn("h-full w-full", className),
|
|
131
|
+
ref: canvasRef,
|
|
132
|
+
style: { mixBlendMode: c.blend, ...style }
|
|
133
|
+
}
|
|
134
|
+
);
|
|
135
135
|
}
|
|
136
|
-
//# sourceMappingURL=noise.js.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
export declare function Vignette({ className, style }: VignetteProps): import("react
|
|
1
|
+
export declare function Vignette({ className, style }: VignetteProps): import("react").JSX.Element | null;
|
|
2
2
|
interface VignetteProps {
|
|
3
3
|
className?: string;
|
|
4
4
|
style?: React.CSSProperties;
|
|
5
5
|
}
|
|
6
6
|
export {};
|
|
7
|
-
//# sourceMappingURL=vignette.d.ts.map
|
|
@@ -1,40 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
import { jsx
|
|
3
|
-
import { useSmoothControls } from
|
|
4
|
-
import { cn } from
|
|
5
|
-
import { hexToRgb } from
|
|
6
|
-
import { BLEND_MODES } from
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useSmoothControls } from "../../../hooks/use-smooth-controls.js";
|
|
4
|
+
import { cn } from "../../../utils/index.js";
|
|
5
|
+
import { hexToRgb } from "../../../utils/color.js";
|
|
6
|
+
import { BLEND_MODES } from "./blend-modes.js";
|
|
7
7
|
export function Vignette({ className, style }) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
37
|
-
|
|
38
|
-
|
|
8
|
+
const c = useSmoothControls(
|
|
9
|
+
"Effects/Vignette",
|
|
10
|
+
{
|
|
11
|
+
blend: { options: BLEND_MODES, value: "lighten" },
|
|
12
|
+
bottomLeft: { max: 1, min: 0, step: 0.01, value: 0 },
|
|
13
|
+
bottomRight: { max: 1, min: 0, step: 0.01, value: 0 },
|
|
14
|
+
color: { value: "#ffbd38" },
|
|
15
|
+
enabled: { value: true },
|
|
16
|
+
opacity: { max: 1, min: 0, step: 0.01, value: 0.22 },
|
|
17
|
+
size: { max: 1, min: 0, step: 0.01, value: 1 },
|
|
18
|
+
topLeft: { max: 1, min: 0, step: 0.01, value: 0.35 },
|
|
19
|
+
topRight: { max: 1, min: 0, step: 0.01, value: 0 }
|
|
20
|
+
},
|
|
21
|
+
{ collapsed: true }
|
|
22
|
+
);
|
|
23
|
+
if (!c.enabled) return null;
|
|
24
|
+
const rgb = hexToRgb(c.color);
|
|
25
|
+
const s = c.size * 60;
|
|
26
|
+
const grad = (x, y, i) => i > 0 && `radial-gradient(ellipse at ${x}% ${y}%, rgba(${rgb},0) ${s}%, rgba(${rgb},${i}) 100%)`;
|
|
27
|
+
const bg = [
|
|
28
|
+
grad(0, 0, c.topLeft),
|
|
29
|
+
grad(100, 0, c.topRight),
|
|
30
|
+
grad(0, 100, c.bottomLeft),
|
|
31
|
+
grad(100, 100, c.bottomRight)
|
|
32
|
+
].filter(Boolean);
|
|
33
|
+
if (!bg.length) return null;
|
|
34
|
+
return /* @__PURE__ */ jsx(
|
|
35
|
+
"div",
|
|
36
|
+
{
|
|
37
|
+
className: cn("h-full w-full", className),
|
|
38
|
+
style: {
|
|
39
|
+
background: bg.join(", "),
|
|
40
|
+
mixBlendMode: c.blend,
|
|
41
|
+
opacity: c.opacity,
|
|
42
|
+
...style
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
);
|
|
39
46
|
}
|
|
40
|
-
//# sourceMappingURL=vignette.js.map
|
|
@@ -12,7 +12,7 @@ import type { AutoPlayPattern } from './image-distortion';
|
|
|
12
12
|
* - `'dispatch'`: broadcast-card layout with sidebar copy, numbered tags,
|
|
13
13
|
* and chrome — for when the poster needs to carry information.
|
|
14
14
|
*/
|
|
15
|
-
export declare function Poster({ aspect, autoPlay, body, border, channel, children, className, cornerMarks, eyebrow, headline, layout, scale, seal, signature, src, tags, tint, tintStrength, variant, ...rest }: PosterProps): import("react
|
|
15
|
+
export declare function Poster({ aspect, autoPlay, body, border, channel, children, className, cornerMarks, eyebrow, headline, layout, scale, seal, signature, src, tags, tint, tintStrength, variant, ...rest }: PosterProps): import("react").JSX.Element;
|
|
16
16
|
export type PosterAspect = 'landscape' | 'portrait' | 'square' | 'story' | 'wide';
|
|
17
17
|
export type PosterVariant = 'dispatch' | 'vibe';
|
|
18
18
|
export interface PosterProps {
|
|
@@ -60,4 +60,3 @@ export interface PosterProps {
|
|
|
60
60
|
/** Layout variant. `'vibe'` (default) is full-bleed image; `'dispatch'` is the broadcast-card with sidebar copy. */
|
|
61
61
|
variant?: PosterVariant;
|
|
62
62
|
}
|
|
63
|
-
//# sourceMappingURL=poster.d.ts.map
|