@buoy-gg/shared-ui 7.0.25 → 7.0.27
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/lib/commonjs/JsModal.js +156 -20
- package/lib/commonjs/JsModal.web.js +85 -39
- package/lib/commonjs/dataViewer/VirtualizedDataExplorer.js +14 -4
- package/lib/commonjs/dataViewer/diffThemes.js +20 -18
- package/lib/commonjs/dataViewer/tree/TreeDiffViewer.js +8 -8
- package/lib/commonjs/hooks/safe-area-impl.js +1 -1
- package/lib/commonjs/icons/lucide-icons.js +74 -15
- package/lib/commonjs/index.js +86 -0
- package/lib/commonjs/ui/backgrounds/BackgroundSwitcher.js +248 -74
- package/lib/commonjs/ui/backgrounds/README.md +102 -20
- package/lib/commonjs/ui/backgrounds/backgroundStore.js +20 -6
- package/lib/commonjs/ui/backgrounds/index.js +91 -1
- package/lib/commonjs/ui/backgrounds/primitives.js +50 -14
- package/lib/commonjs/ui/backgrounds/registry.js +41 -64
- package/lib/commonjs/ui/backgrounds/rng.js +21 -0
- package/lib/commonjs/ui/backgrounds/skyClock.js +45 -0
- package/lib/commonjs/ui/backgrounds/variants/daylight.js +453 -0
- package/lib/commonjs/ui/backgrounds/variants/deepField.js +60 -30
- package/lib/commonjs/ui/backgrounds/variants/hyperspace.js +218 -0
- package/lib/commonjs/ui/backgrounds/variants/liveSky.js +898 -0
- package/lib/commonjs/ui/backgrounds/variants/meteors.js +257 -0
- package/lib/commonjs/ui/backgrounds/variants/moonlight.js +472 -0
- package/lib/commonjs/ui/backgrounds/variants/underwater.js +757 -0
- package/lib/commonjs/ui/components/Badge.js +11 -10
- package/lib/commonjs/ui/components/CompactRow.js +30 -17
- package/lib/commonjs/ui/components/DevToolsCard.js +12 -8
- package/lib/commonjs/ui/components/DynamicFilterView.js +43 -41
- package/lib/commonjs/ui/components/EventStepperFooter.js +38 -10
- package/lib/commonjs/ui/components/FilterComponents.js +11 -11
- package/lib/commonjs/ui/components/ModalHeader.js +13 -13
- package/lib/commonjs/ui/components/SectionHeader.js +3 -1
- package/lib/commonjs/ui/components/StorageTypeBadge.js +3 -2
- package/lib/commonjs/ui/components/TabSelector.js +56 -38
- package/lib/commonjs/ui/components/ValueTypeBadge.js +7 -6
- package/lib/commonjs/ui/components/WindowControls.js +37 -10
- package/lib/commonjs/ui/gameUI/constants/gameUIColors.js +8 -0
- package/lib/commonjs/ui/night/nightTheme.js +120 -0
- package/lib/commonjs/ui/night/primitives.js +498 -0
- package/lib/module/JsModal.js +156 -20
- package/lib/module/JsModal.web.js +83 -39
- package/lib/module/dataViewer/VirtualizedDataExplorer.js +14 -4
- package/lib/module/dataViewer/diffThemes.js +20 -18
- package/lib/module/dataViewer/tree/TreeDiffViewer.js +9 -9
- package/lib/module/hooks/safe-area-impl.js +1 -1
- package/lib/module/icons/lucide-icons.js +74 -15
- package/lib/module/index.js +4 -0
- package/lib/module/ui/backgrounds/BackgroundSwitcher.js +250 -76
- package/lib/module/ui/backgrounds/README.md +102 -20
- package/lib/module/ui/backgrounds/backgroundStore.js +19 -5
- package/lib/module/ui/backgrounds/index.js +11 -2
- package/lib/module/ui/backgrounds/primitives.js +53 -16
- package/lib/module/ui/backgrounds/registry.js +41 -64
- package/lib/module/ui/backgrounds/rng.js +20 -0
- package/lib/module/ui/backgrounds/skyClock.js +39 -0
- package/lib/module/ui/backgrounds/variants/daylight.js +449 -0
- package/lib/module/ui/backgrounds/variants/deepField.js +62 -31
- package/lib/module/ui/backgrounds/variants/hyperspace.js +214 -0
- package/lib/module/ui/backgrounds/variants/liveSky.js +893 -0
- package/lib/module/ui/backgrounds/variants/meteors.js +253 -0
- package/lib/module/ui/backgrounds/variants/moonlight.js +468 -0
- package/lib/module/ui/backgrounds/variants/underwater.js +753 -0
- package/lib/module/ui/components/Badge.js +11 -10
- package/lib/module/ui/components/CompactRow.js +30 -17
- package/lib/module/ui/components/DevToolsCard.js +12 -8
- package/lib/module/ui/components/DynamicFilterView.js +43 -41
- package/lib/module/ui/components/EventStepperFooter.js +38 -10
- package/lib/module/ui/components/FilterComponents.js +11 -11
- package/lib/module/ui/components/ModalHeader.js +13 -13
- package/lib/module/ui/components/SectionHeader.js +3 -1
- package/lib/module/ui/components/StorageTypeBadge.js +3 -2
- package/lib/module/ui/components/TabSelector.js +57 -39
- package/lib/module/ui/components/ValueTypeBadge.js +7 -6
- package/lib/module/ui/components/WindowControls.js +37 -10
- package/lib/module/ui/gameUI/constants/gameUIColors.js +8 -0
- package/lib/module/ui/night/nightTheme.js +116 -0
- package/lib/module/ui/night/primitives.js +485 -0
- package/lib/typescript/commonjs/JsModal.d.ts +18 -0
- package/lib/typescript/commonjs/JsModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/JsModal.web.d.ts +13 -0
- package/lib/typescript/commonjs/JsModal.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/dataViewer/VirtualizedDataExplorer.d.ts.map +1 -1
- package/lib/typescript/commonjs/dataViewer/diffThemes.d.ts +3 -1
- package/lib/typescript/commonjs/dataViewer/diffThemes.d.ts.map +1 -1
- package/lib/typescript/commonjs/dataViewer/tree/TreeDiffViewer.d.ts.map +1 -1
- package/lib/typescript/commonjs/hooks/safe-area-impl.d.ts +1 -1
- package/lib/typescript/commonjs/icons/lucide-icons.d.ts +12 -1
- package/lib/typescript/commonjs/icons/lucide-icons.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +3 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/backgrounds/BackgroundSwitcher.d.ts +26 -6
- package/lib/typescript/commonjs/ui/backgrounds/BackgroundSwitcher.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/backgrounds/backgroundStore.d.ts +3 -0
- package/lib/typescript/commonjs/ui/backgrounds/backgroundStore.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/backgrounds/index.d.ts +7 -1
- package/lib/typescript/commonjs/ui/backgrounds/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/backgrounds/primitives.d.ts +18 -3
- package/lib/typescript/commonjs/ui/backgrounds/primitives.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/backgrounds/registry.d.ts +8 -0
- package/lib/typescript/commonjs/ui/backgrounds/registry.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/backgrounds/rng.d.ts +6 -0
- package/lib/typescript/commonjs/ui/backgrounds/rng.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/backgrounds/skyClock.d.ts +17 -0
- package/lib/typescript/commonjs/ui/backgrounds/skyClock.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/backgrounds/types.d.ts +1 -1
- package/lib/typescript/commonjs/ui/backgrounds/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/backgrounds/variants/daylight.d.ts +30 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/daylight.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/deepField.d.ts +19 -4
- package/lib/typescript/commonjs/ui/backgrounds/variants/deepField.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/backgrounds/variants/hyperspace.d.ts +39 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/hyperspace.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/liveSky.d.ts +41 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/liveSky.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/meteors.d.ts +26 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/meteors.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/moonlight.d.ts +35 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/moonlight.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/underwater.d.ts +51 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/underwater.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/Badge.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/CompactRow.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/DynamicFilterView.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/EventStepperFooter.d.ts +2 -0
- package/lib/typescript/commonjs/ui/components/EventStepperFooter.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/StorageTypeBadge.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/TabSelector.d.ts +9 -0
- package/lib/typescript/commonjs/ui/components/TabSelector.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/ValueTypeBadge.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/WindowControls.d.ts +4 -2
- package/lib/typescript/commonjs/ui/components/WindowControls.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/gameUI/constants/gameUIColors.d.ts +8 -0
- package/lib/typescript/commonjs/ui/gameUI/constants/gameUIColors.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/night/nightTheme.d.ts +113 -0
- package/lib/typescript/commonjs/ui/night/nightTheme.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/night/primitives.d.ts +111 -0
- package/lib/typescript/commonjs/ui/night/primitives.d.ts.map +1 -0
- package/lib/typescript/module/JsModal.d.ts +18 -0
- package/lib/typescript/module/JsModal.d.ts.map +1 -1
- package/lib/typescript/module/JsModal.web.d.ts +13 -0
- package/lib/typescript/module/JsModal.web.d.ts.map +1 -1
- package/lib/typescript/module/dataViewer/VirtualizedDataExplorer.d.ts.map +1 -1
- package/lib/typescript/module/dataViewer/diffThemes.d.ts +3 -1
- package/lib/typescript/module/dataViewer/diffThemes.d.ts.map +1 -1
- package/lib/typescript/module/dataViewer/tree/TreeDiffViewer.d.ts.map +1 -1
- package/lib/typescript/module/hooks/safe-area-impl.d.ts +1 -1
- package/lib/typescript/module/icons/lucide-icons.d.ts +12 -1
- package/lib/typescript/module/icons/lucide-icons.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +3 -0
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/backgrounds/BackgroundSwitcher.d.ts +26 -6
- package/lib/typescript/module/ui/backgrounds/BackgroundSwitcher.d.ts.map +1 -1
- package/lib/typescript/module/ui/backgrounds/backgroundStore.d.ts +3 -0
- package/lib/typescript/module/ui/backgrounds/backgroundStore.d.ts.map +1 -1
- package/lib/typescript/module/ui/backgrounds/index.d.ts +7 -1
- package/lib/typescript/module/ui/backgrounds/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/backgrounds/primitives.d.ts +18 -3
- package/lib/typescript/module/ui/backgrounds/primitives.d.ts.map +1 -1
- package/lib/typescript/module/ui/backgrounds/registry.d.ts +8 -0
- package/lib/typescript/module/ui/backgrounds/registry.d.ts.map +1 -1
- package/lib/typescript/module/ui/backgrounds/rng.d.ts +6 -0
- package/lib/typescript/module/ui/backgrounds/rng.d.ts.map +1 -1
- package/lib/typescript/module/ui/backgrounds/skyClock.d.ts +17 -0
- package/lib/typescript/module/ui/backgrounds/skyClock.d.ts.map +1 -0
- package/lib/typescript/module/ui/backgrounds/types.d.ts +1 -1
- package/lib/typescript/module/ui/backgrounds/types.d.ts.map +1 -1
- package/lib/typescript/module/ui/backgrounds/variants/daylight.d.ts +30 -0
- package/lib/typescript/module/ui/backgrounds/variants/daylight.d.ts.map +1 -0
- package/lib/typescript/module/ui/backgrounds/variants/deepField.d.ts +19 -4
- package/lib/typescript/module/ui/backgrounds/variants/deepField.d.ts.map +1 -1
- package/lib/typescript/module/ui/backgrounds/variants/hyperspace.d.ts +39 -0
- package/lib/typescript/module/ui/backgrounds/variants/hyperspace.d.ts.map +1 -0
- package/lib/typescript/module/ui/backgrounds/variants/liveSky.d.ts +41 -0
- package/lib/typescript/module/ui/backgrounds/variants/liveSky.d.ts.map +1 -0
- package/lib/typescript/module/ui/backgrounds/variants/meteors.d.ts +26 -0
- package/lib/typescript/module/ui/backgrounds/variants/meteors.d.ts.map +1 -0
- package/lib/typescript/module/ui/backgrounds/variants/moonlight.d.ts +35 -0
- package/lib/typescript/module/ui/backgrounds/variants/moonlight.d.ts.map +1 -0
- package/lib/typescript/module/ui/backgrounds/variants/underwater.d.ts +51 -0
- package/lib/typescript/module/ui/backgrounds/variants/underwater.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/Badge.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/CompactRow.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/DynamicFilterView.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/EventStepperFooter.d.ts +2 -0
- package/lib/typescript/module/ui/components/EventStepperFooter.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/StorageTypeBadge.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TabSelector.d.ts +9 -0
- package/lib/typescript/module/ui/components/TabSelector.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/ValueTypeBadge.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/WindowControls.d.ts +4 -2
- package/lib/typescript/module/ui/components/WindowControls.d.ts.map +1 -1
- package/lib/typescript/module/ui/gameUI/constants/gameUIColors.d.ts +8 -0
- package/lib/typescript/module/ui/gameUI/constants/gameUIColors.d.ts.map +1 -1
- package/lib/typescript/module/ui/night/nightTheme.d.ts +113 -0
- package/lib/typescript/module/ui/night/nightTheme.d.ts.map +1 -0
- package/lib/typescript/module/ui/night/primitives.d.ts +111 -0
- package/lib/typescript/module/ui/night/primitives.d.ts.map +1 -0
- package/package.json +4 -4
- package/lib/commonjs/ui/backgrounds/variants/lattice.js +0 -579
- package/lib/commonjs/ui/backgrounds/variants/starfield.js +0 -210
- package/lib/module/ui/backgrounds/variants/lattice.js +0 -575
- package/lib/module/ui/backgrounds/variants/starfield.js +0 -206
- package/lib/typescript/commonjs/ui/backgrounds/variants/lattice.d.ts +0 -33
- package/lib/typescript/commonjs/ui/backgrounds/variants/lattice.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/backgrounds/variants/starfield.d.ts +0 -12
- package/lib/typescript/commonjs/ui/backgrounds/variants/starfield.d.ts.map +0 -1
- package/lib/typescript/module/ui/backgrounds/variants/lattice.d.ts +0 -33
- package/lib/typescript/module/ui/backgrounds/variants/lattice.d.ts.map +0 -1
- package/lib/typescript/module/ui/backgrounds/variants/starfield.d.ts +0 -12
- package/lib/typescript/module/ui/backgrounds/variants/starfield.d.ts.map +0 -1
|
@@ -0,0 +1,472 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.MoonlightTunable = exports.Moonlight = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _absoluteFill = require("../../../utils/absoluteFill.js");
|
|
10
|
+
var _primitives = require("../primitives.js");
|
|
11
|
+
var _rng = require("../rng.js");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
/**
|
|
14
|
+
* Moonlight — moon over a still sea, the glade shimmering below.
|
|
15
|
+
*
|
|
16
|
+
* Composed like the pixel-art seascape it's modelled on: a night-sky
|
|
17
|
+
* gradient with breathing stars, cloud banks with moonlit top edges, a
|
|
18
|
+
* cratered moon in a TIGHT bloom (many rings at steep falloff — a big
|
|
19
|
+
* 8-ring glow shows its rings as visible circles), mountain silhouettes with
|
|
20
|
+
* a few shore lights on the horizon, and a glade built from chunky
|
|
21
|
+
* row-quantized water blocks — brightest mid-glade, thinning at the horizon
|
|
22
|
+
* and toward the viewer.
|
|
23
|
+
*
|
|
24
|
+
* Same contract as ../README.md: native-driven loops only, static geometry
|
|
25
|
+
* rasterized, scatter tables at module load, geometry sized from the WINDOW
|
|
26
|
+
* (never the modal — resizing crops, it doesn't stretch). Per-dash rands come
|
|
27
|
+
* off ONE stream in a fixed stride (the Deep Field lesson).
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
const BASE_COLOR = "#040609";
|
|
31
|
+
const HORIZON = 0.46;
|
|
32
|
+
const MOON_X = 0.72;
|
|
33
|
+
const MOON_Y = 0.17;
|
|
34
|
+
const MOON_DIA = 56;
|
|
35
|
+
|
|
36
|
+
/** Craters as fractions of the moon: [dx, dy, dia] of MOON_DIA. */
|
|
37
|
+
const CRATERS = [[0.24, -0.12, 0.2], [-0.16, 0.2, 0.13], [0.08, 0.06, 0.1]];
|
|
38
|
+
|
|
39
|
+
/** Stride 3: x, y, size. */
|
|
40
|
+
const SKY_STAR_COUNT = 22;
|
|
41
|
+
const SKY_STARS = (0, _rng.scatter)(0x52b7, SKY_STAR_COUNT * 3);
|
|
42
|
+
|
|
43
|
+
// ============================================================================
|
|
44
|
+
// Clouds — dark banks with a moonlit top edge
|
|
45
|
+
// ============================================================================
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* A cloud is a row of overlapping ellipses; the lit rim is the SAME puffs in
|
|
49
|
+
* a lighter colour, drawn first and offset up toward the moon, so the body
|
|
50
|
+
* occludes all of it except a moonlit sliver along the top.
|
|
51
|
+
*/
|
|
52
|
+
|
|
53
|
+
const CLOUDS = [{
|
|
54
|
+
at: [0.16, 0.3],
|
|
55
|
+
puffs: [[-62, 4, 150, 20], [-44, -8, 62, 24], [-4, -14, 74, 30], [38, -4, 54, 20]],
|
|
56
|
+
rim: [4, -3.5],
|
|
57
|
+
bodyAlpha: 0.94
|
|
58
|
+
}, {
|
|
59
|
+
at: [0.84, 0.37],
|
|
60
|
+
puffs: [[-55, 3, 130, 18], [-30, -8, 56, 22], [8, -13, 64, 27], [42, -3, 44, 17]],
|
|
61
|
+
rim: [-2, -4],
|
|
62
|
+
bodyAlpha: 0.94
|
|
63
|
+
}, {
|
|
64
|
+
at: [0.46, 0.425],
|
|
65
|
+
puffs: [[-40, 2, 96, 13], [-12, -6, 48, 16], [22, -2, 38, 12]],
|
|
66
|
+
rim: [3, -3],
|
|
67
|
+
bodyAlpha: 0.9
|
|
68
|
+
}];
|
|
69
|
+
function cloudPuffs(cloud, cx, cy, key) {
|
|
70
|
+
const parts = [];
|
|
71
|
+
// Pass 1: the lit rim (drawn first, mostly hidden by the body).
|
|
72
|
+
for (let i = 0; i < cloud.puffs.length; i++) {
|
|
73
|
+
const [dx, dy, w, h] = cloud.puffs[i];
|
|
74
|
+
parts.push(/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
75
|
+
style: {
|
|
76
|
+
position: "absolute",
|
|
77
|
+
left: cx + dx + cloud.rim[0] - w / 2,
|
|
78
|
+
top: cy + dy + cloud.rim[1] - h / 2,
|
|
79
|
+
width: w,
|
|
80
|
+
height: h,
|
|
81
|
+
borderRadius: h / 2,
|
|
82
|
+
backgroundColor: (0, _rng.withAlpha)("#1D2A42", 0.35)
|
|
83
|
+
}
|
|
84
|
+
}, `${key}-r${i}`));
|
|
85
|
+
}
|
|
86
|
+
// Pass 2: the body.
|
|
87
|
+
for (let i = 0; i < cloud.puffs.length; i++) {
|
|
88
|
+
const [dx, dy, w, h] = cloud.puffs[i];
|
|
89
|
+
parts.push(/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
90
|
+
style: {
|
|
91
|
+
position: "absolute",
|
|
92
|
+
left: cx + dx - w / 2,
|
|
93
|
+
top: cy + dy - h / 2,
|
|
94
|
+
width: w,
|
|
95
|
+
height: h,
|
|
96
|
+
borderRadius: h / 2,
|
|
97
|
+
backgroundColor: (0, _rng.withAlpha)("#070D18", cloud.bodyAlpha)
|
|
98
|
+
}
|
|
99
|
+
}, `${key}-b${i}`));
|
|
100
|
+
}
|
|
101
|
+
return parts;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// ============================================================================
|
|
105
|
+
// Mountains — silhouette range on the horizon
|
|
106
|
+
// ============================================================================
|
|
107
|
+
|
|
108
|
+
/** [xFrac, base width, height, color] — border-trick triangles. */
|
|
109
|
+
const PEAKS = [[0.03, 120, 24, "#030609"], [0.11, 96, 36, "#020408"], [0.2, 140, 24, "#030609"], [0.29, 76, 15, "#020408"], [0.9, 96, 18, "#030609"], [0.98, 130, 27, "#020408"]];
|
|
110
|
+
|
|
111
|
+
/** Tiny warm shore lights at the foot of the range: xFrac positions. */
|
|
112
|
+
const SHORE_LIGHTS = [0.06, 0.13, 0.18, 0.26];
|
|
113
|
+
|
|
114
|
+
// ============================================================================
|
|
115
|
+
// Water blocks — the glade
|
|
116
|
+
// ============================================================================
|
|
117
|
+
|
|
118
|
+
/** Stride 4: depth, x jitter, width jitter, alpha jitter. */
|
|
119
|
+
const GLADE_LAYERS = [{
|
|
120
|
+
count: 44,
|
|
121
|
+
seed: 0x3aa1
|
|
122
|
+
}, {
|
|
123
|
+
count: 34,
|
|
124
|
+
seed: 0x77c2
|
|
125
|
+
}, {
|
|
126
|
+
count: 26,
|
|
127
|
+
seed: 0xb4e9
|
|
128
|
+
}];
|
|
129
|
+
const GLADE_TABLES = GLADE_LAYERS.map(l => (0, _rng.scatter)(l.seed, l.count * 4));
|
|
130
|
+
|
|
131
|
+
/** Quantizing block rows to this grid is what makes them read as ripples. */
|
|
132
|
+
const ROW_STEP = 7;
|
|
133
|
+
const GladeLayer = /*#__PURE__*/(0, _react.memo)(function GladeLayer({
|
|
134
|
+
indices,
|
|
135
|
+
drive,
|
|
136
|
+
scale,
|
|
137
|
+
raster,
|
|
138
|
+
width,
|
|
139
|
+
height,
|
|
140
|
+
animated
|
|
141
|
+
}) {
|
|
142
|
+
const sway = (0, _primitives.usePulse)(drive === "swayA" ? 9000 : 12500, animated && drive !== "breathe");
|
|
143
|
+
const breathe = (0, _primitives.usePulse)(6200, animated && drive === "breathe");
|
|
144
|
+
const moonX = width * MOON_X;
|
|
145
|
+
const horizonY = height * HORIZON;
|
|
146
|
+
const blocks = [];
|
|
147
|
+
for (const li of indices) {
|
|
148
|
+
const layer = GLADE_LAYERS[li];
|
|
149
|
+
const count = Math.round(layer.count * scale);
|
|
150
|
+
// Shipping scale reads the module-load table; an amplified scale (bench
|
|
151
|
+
// only) draws a longer stream from the same seed.
|
|
152
|
+
const table = scale === 1 ? GLADE_TABLES[li] : (0, _rng.scatter)(layer.seed, count * 4);
|
|
153
|
+
for (let i = 0; i < count; i++) {
|
|
154
|
+
const d = table[i * 4];
|
|
155
|
+
const jx = table[i * 4 + 1];
|
|
156
|
+
const jw = table[i * 4 + 2];
|
|
157
|
+
const ja = table[i * 4 + 3];
|
|
158
|
+
const y = horizonY + 4 + d * (height - horizonY) * 0.94;
|
|
159
|
+
const halfSpread = width * (0.03 + d * 0.16);
|
|
160
|
+
const x = moonX + (jx - 0.5) * 2 * halfSpread;
|
|
161
|
+
const blockW = 6 + d * 26 + jw * 10;
|
|
162
|
+
const blockH = d < 0.3 ? 1 : d < 0.62 ? 2 : 3;
|
|
163
|
+
// Brightest mid-glade and along the centre line, dimmer at the horizon
|
|
164
|
+
// and toward the viewer — the shape of a real moonglade.
|
|
165
|
+
const arc = Math.sin(Math.PI * (0.12 + d * 0.82));
|
|
166
|
+
const centered = Math.max(0.25, 1 - Math.abs(jx - 0.5) * 1.4);
|
|
167
|
+
const alpha = (0.16 + arc * 0.48) * centered * (0.75 + ja * 0.25);
|
|
168
|
+
blocks.push(/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
169
|
+
style: {
|
|
170
|
+
position: "absolute",
|
|
171
|
+
left: x - blockW / 2,
|
|
172
|
+
top: Math.round(y / ROW_STEP) * ROW_STEP,
|
|
173
|
+
width: blockW,
|
|
174
|
+
height: blockH,
|
|
175
|
+
borderRadius: 0.5,
|
|
176
|
+
backgroundColor: (0, _rng.withAlpha)("#CFE0F4", alpha)
|
|
177
|
+
}
|
|
178
|
+
}, `${li}-${i}`));
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
const style = drive === "breathe" ? {
|
|
182
|
+
opacity: breathe.interpolate({
|
|
183
|
+
inputRange: [0, 1],
|
|
184
|
+
outputRange: [0.55, 1]
|
|
185
|
+
})
|
|
186
|
+
} : {
|
|
187
|
+
transform: [{
|
|
188
|
+
translateX: sway.interpolate({
|
|
189
|
+
inputRange: [0, 1],
|
|
190
|
+
outputRange: drive === "swayA" ? [-7, 7] : [6, -6]
|
|
191
|
+
})
|
|
192
|
+
}]
|
|
193
|
+
};
|
|
194
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
|
|
195
|
+
style: [_absoluteFill.absoluteFill, style],
|
|
196
|
+
pointerEvents: "none",
|
|
197
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.RasterLayer, {
|
|
198
|
+
style: _absoluteFill.absoluteFill,
|
|
199
|
+
raster: raster,
|
|
200
|
+
children: blocks
|
|
201
|
+
})
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
// ============================================================================
|
|
206
|
+
// The scene
|
|
207
|
+
// ============================================================================
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* The tunable body. `Moonlight` below is this with the shipping defaults; the
|
|
211
|
+
* bench route (`example-dev-build/app/bg-bench.tsx`) drives the knobs so every
|
|
212
|
+
* measured variant is this exact code, not a copy of it.
|
|
213
|
+
*/
|
|
214
|
+
const MoonlightTunable = exports.MoonlightTunable = /*#__PURE__*/(0, _react.memo)(function MoonlightTunable({
|
|
215
|
+
gladeScale = 1,
|
|
216
|
+
fusedGlade = false,
|
|
217
|
+
raster = true,
|
|
218
|
+
chrome = true,
|
|
219
|
+
...props
|
|
220
|
+
}) {
|
|
221
|
+
const {
|
|
222
|
+
width,
|
|
223
|
+
height,
|
|
224
|
+
animated
|
|
225
|
+
} = props;
|
|
226
|
+
const twinkle = (0, _primitives.usePulse)(7400, animated);
|
|
227
|
+
const cloudDrift = (0, _primitives.usePulse)(26000, animated);
|
|
228
|
+
const starOpacity = twinkle.interpolate({
|
|
229
|
+
inputRange: [0, 1],
|
|
230
|
+
outputRange: [0.7, 1]
|
|
231
|
+
});
|
|
232
|
+
const cloudX = cloudDrift.interpolate({
|
|
233
|
+
inputRange: [0, 1],
|
|
234
|
+
outputRange: [-8, 8]
|
|
235
|
+
});
|
|
236
|
+
const moonX = width * MOON_X;
|
|
237
|
+
const moonY = height * MOON_Y;
|
|
238
|
+
const horizonY = height * HORIZON;
|
|
239
|
+
// Light geometry is sized from the WINDOW so resizing the modal never
|
|
240
|
+
// swells or shrinks the moon's bloom — only positions follow the modal.
|
|
241
|
+
const refW = _reactNative.Dimensions.get("window").width;
|
|
242
|
+
const stars = [];
|
|
243
|
+
for (let i = 0; i < SKY_STAR_COUNT; i++) {
|
|
244
|
+
const size = SKY_STARS[i * 3 + 2];
|
|
245
|
+
const dia = 1 + size * 1.3;
|
|
246
|
+
const x = SKY_STARS[i * 3] * width;
|
|
247
|
+
const y = SKY_STARS[i * 3 + 1] * horizonY * 0.92;
|
|
248
|
+
// Keep the sky clear right around the moon so its bloom stays clean.
|
|
249
|
+
if (Math.hypot(x - moonX, y - moonY) < refW * 0.18) continue;
|
|
250
|
+
stars.push(/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
251
|
+
style: {
|
|
252
|
+
position: "absolute",
|
|
253
|
+
left: x - dia / 2,
|
|
254
|
+
top: y - dia / 2,
|
|
255
|
+
width: dia,
|
|
256
|
+
height: dia,
|
|
257
|
+
borderRadius: dia / 2,
|
|
258
|
+
backgroundColor: (0, _rng.withAlpha)("#C9DAF0", 0.3 + size * 0.4)
|
|
259
|
+
}
|
|
260
|
+
}, i));
|
|
261
|
+
}
|
|
262
|
+
const clouds = CLOUDS.flatMap((cloud, i) => cloudPuffs(cloud, width * cloud.at[0], height * cloud.at[1], `c${i}`));
|
|
263
|
+
const mountains = PEAKS.map(([xf, wBase, h, color], i) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
264
|
+
style: {
|
|
265
|
+
position: "absolute",
|
|
266
|
+
left: width * xf - wBase / 2,
|
|
267
|
+
top: horizonY - h,
|
|
268
|
+
width: 0,
|
|
269
|
+
height: 0,
|
|
270
|
+
borderLeftWidth: wBase / 2,
|
|
271
|
+
borderRightWidth: wBase / 2,
|
|
272
|
+
borderBottomWidth: h,
|
|
273
|
+
borderLeftColor: "transparent",
|
|
274
|
+
borderRightColor: "transparent",
|
|
275
|
+
borderBottomColor: color
|
|
276
|
+
}
|
|
277
|
+
}, `m${i}`));
|
|
278
|
+
const lights = SHORE_LIGHTS.map((xf, i) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
279
|
+
style: {
|
|
280
|
+
position: "absolute",
|
|
281
|
+
left: width * xf,
|
|
282
|
+
top: horizonY - 3,
|
|
283
|
+
width: 2,
|
|
284
|
+
height: 1.5,
|
|
285
|
+
backgroundColor: (0, _rng.withAlpha)("#E8D9A8", 0.55 + i % 2 * 0.2)
|
|
286
|
+
}
|
|
287
|
+
}, `sl${i}`));
|
|
288
|
+
return (
|
|
289
|
+
/*#__PURE__*/
|
|
290
|
+
// Clips: the blooms are window-sized, so a small modal crops the scene.
|
|
291
|
+
(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
292
|
+
style: [_absoluteFill.absoluteFill, {
|
|
293
|
+
overflow: "hidden"
|
|
294
|
+
}],
|
|
295
|
+
pointerEvents: "none",
|
|
296
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Base, {
|
|
297
|
+
color: BASE_COLOR
|
|
298
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
299
|
+
style: {
|
|
300
|
+
position: "absolute",
|
|
301
|
+
left: 0,
|
|
302
|
+
right: 0,
|
|
303
|
+
top: 0,
|
|
304
|
+
height: horizonY
|
|
305
|
+
},
|
|
306
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.LinearFade, {
|
|
307
|
+
color: "#0A1424",
|
|
308
|
+
from: 0.45,
|
|
309
|
+
to: 0,
|
|
310
|
+
direction: "down",
|
|
311
|
+
bands: 20,
|
|
312
|
+
flattenBase: BASE_COLOR
|
|
313
|
+
})
|
|
314
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
|
|
315
|
+
style: [_absoluteFill.absoluteFill, {
|
|
316
|
+
opacity: starOpacity
|
|
317
|
+
}],
|
|
318
|
+
pointerEvents: "none",
|
|
319
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.RasterLayer, {
|
|
320
|
+
style: _absoluteFill.absoluteFill,
|
|
321
|
+
children: stars
|
|
322
|
+
})
|
|
323
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
|
|
324
|
+
style: [_absoluteFill.absoluteFill, {
|
|
325
|
+
transform: [{
|
|
326
|
+
translateX: cloudX
|
|
327
|
+
}]
|
|
328
|
+
}],
|
|
329
|
+
pointerEvents: "none",
|
|
330
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.RasterLayer, {
|
|
331
|
+
style: _absoluteFill.absoluteFill,
|
|
332
|
+
children: clouds
|
|
333
|
+
})
|
|
334
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.RadialGlow, {
|
|
335
|
+
size: refW * 0.44,
|
|
336
|
+
color: "#A9C2DE",
|
|
337
|
+
alpha: 0.15,
|
|
338
|
+
rings: 20,
|
|
339
|
+
falloff: 1.9,
|
|
340
|
+
style: {
|
|
341
|
+
position: "absolute",
|
|
342
|
+
left: moonX - refW * 0.22,
|
|
343
|
+
top: moonY - refW * 0.22
|
|
344
|
+
}
|
|
345
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.RadialGlow, {
|
|
346
|
+
size: 116,
|
|
347
|
+
color: "#DCE8F6",
|
|
348
|
+
alpha: 0.34,
|
|
349
|
+
rings: 10,
|
|
350
|
+
falloff: 1.6,
|
|
351
|
+
style: {
|
|
352
|
+
position: "absolute",
|
|
353
|
+
left: moonX - 58,
|
|
354
|
+
top: moonY - 58
|
|
355
|
+
}
|
|
356
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
357
|
+
style: {
|
|
358
|
+
position: "absolute",
|
|
359
|
+
left: moonX - MOON_DIA / 2,
|
|
360
|
+
top: moonY - MOON_DIA / 2,
|
|
361
|
+
width: MOON_DIA,
|
|
362
|
+
height: MOON_DIA,
|
|
363
|
+
borderRadius: MOON_DIA / 2,
|
|
364
|
+
// Fully opaque: any translucency lets the app behind the modal
|
|
365
|
+
// bleed through the brightest surface in the scene.
|
|
366
|
+
backgroundColor: "#EDF3FB",
|
|
367
|
+
overflow: "hidden"
|
|
368
|
+
},
|
|
369
|
+
children: CRATERS.map(([dx, dy, frac], i) => {
|
|
370
|
+
const d = MOON_DIA * frac;
|
|
371
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
372
|
+
style: {
|
|
373
|
+
position: "absolute",
|
|
374
|
+
left: MOON_DIA / 2 + dx * MOON_DIA - d / 2,
|
|
375
|
+
top: MOON_DIA / 2 + dy * MOON_DIA - d / 2,
|
|
376
|
+
width: d,
|
|
377
|
+
height: d,
|
|
378
|
+
borderRadius: d / 2,
|
|
379
|
+
backgroundColor: (0, _rng.withAlpha)("#9DB2C8", 0.32)
|
|
380
|
+
}
|
|
381
|
+
}, i);
|
|
382
|
+
})
|
|
383
|
+
}), chrome ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
384
|
+
style: {
|
|
385
|
+
position: "absolute",
|
|
386
|
+
left: 0,
|
|
387
|
+
right: 0,
|
|
388
|
+
top: horizonY - 76,
|
|
389
|
+
height: 76
|
|
390
|
+
},
|
|
391
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.LinearFade, {
|
|
392
|
+
color: "#17293F",
|
|
393
|
+
from: 0,
|
|
394
|
+
to: 0.28,
|
|
395
|
+
direction: "down",
|
|
396
|
+
bands: 12
|
|
397
|
+
})
|
|
398
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.RasterLayer, {
|
|
399
|
+
style: _absoluteFill.absoluteFill,
|
|
400
|
+
children: [mountains, lights]
|
|
401
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
402
|
+
style: {
|
|
403
|
+
position: "absolute",
|
|
404
|
+
left: 0,
|
|
405
|
+
right: 0,
|
|
406
|
+
top: horizonY,
|
|
407
|
+
height: 1,
|
|
408
|
+
backgroundColor: (0, _rng.withAlpha)("#9FB8D4", 0.12)
|
|
409
|
+
}
|
|
410
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
411
|
+
style: {
|
|
412
|
+
position: "absolute",
|
|
413
|
+
left: moonX - width * 0.16,
|
|
414
|
+
top: horizonY,
|
|
415
|
+
width: width * 0.32,
|
|
416
|
+
height: 1,
|
|
417
|
+
backgroundColor: (0, _rng.withAlpha)("#C6DAF0", 0.32)
|
|
418
|
+
}
|
|
419
|
+
}), chrome ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
420
|
+
style: {
|
|
421
|
+
position: "absolute",
|
|
422
|
+
left: 0,
|
|
423
|
+
right: 0,
|
|
424
|
+
top: horizonY,
|
|
425
|
+
bottom: 0
|
|
426
|
+
},
|
|
427
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.LinearFade, {
|
|
428
|
+
color: "#010409",
|
|
429
|
+
from: 0,
|
|
430
|
+
to: 0.5,
|
|
431
|
+
direction: "down",
|
|
432
|
+
bands: 12
|
|
433
|
+
})
|
|
434
|
+
}) : null, fusedGlade ? /*#__PURE__*/(0, _jsxRuntime.jsx)(GladeLayer, {
|
|
435
|
+
indices: [0, 1, 2],
|
|
436
|
+
drive: "swayA",
|
|
437
|
+
scale: gladeScale,
|
|
438
|
+
raster: raster,
|
|
439
|
+
...props
|
|
440
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
441
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(GladeLayer, {
|
|
442
|
+
indices: [0],
|
|
443
|
+
drive: "swayA",
|
|
444
|
+
scale: gladeScale,
|
|
445
|
+
raster: raster,
|
|
446
|
+
...props
|
|
447
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(GladeLayer, {
|
|
448
|
+
indices: [1],
|
|
449
|
+
drive: "swayB",
|
|
450
|
+
scale: gladeScale,
|
|
451
|
+
raster: raster,
|
|
452
|
+
...props
|
|
453
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(GladeLayer, {
|
|
454
|
+
indices: [2],
|
|
455
|
+
drive: "breathe",
|
|
456
|
+
scale: gladeScale,
|
|
457
|
+
raster: raster,
|
|
458
|
+
...props
|
|
459
|
+
})]
|
|
460
|
+
}), chrome ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Vignette, {
|
|
461
|
+
color: "#020305",
|
|
462
|
+
alpha: 0.42,
|
|
463
|
+
spread: 0.34
|
|
464
|
+
}) : null]
|
|
465
|
+
})
|
|
466
|
+
);
|
|
467
|
+
});
|
|
468
|
+
const Moonlight = exports.Moonlight = /*#__PURE__*/(0, _react.memo)(function Moonlight(props) {
|
|
469
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(MoonlightTunable, {
|
|
470
|
+
...props
|
|
471
|
+
});
|
|
472
|
+
});
|