@joydle/ui 0.1.0
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/dist/controls/ActionButton.d.ts +18 -0
- package/dist/controls/ActionButton.d.ts.map +1 -0
- package/dist/controls/ActionButton.js +108 -0
- package/dist/controls/ActionButton.js.map +1 -0
- package/dist/controls/ActionButtonGroup.d.ts +15 -0
- package/dist/controls/ActionButtonGroup.d.ts.map +1 -0
- package/dist/controls/ActionButtonGroup.js +55 -0
- package/dist/controls/ActionButtonGroup.js.map +1 -0
- package/dist/controls/Joystick.d.ts +9 -0
- package/dist/controls/Joystick.d.ts.map +1 -0
- package/dist/controls/Joystick.js +168 -0
- package/dist/controls/Joystick.js.map +1 -0
- package/dist/controls/SwipeZone.d.ts +10 -0
- package/dist/controls/SwipeZone.d.ts.map +1 -0
- package/dist/controls/SwipeZone.js +84 -0
- package/dist/controls/SwipeZone.js.map +1 -0
- package/dist/controls/TouchDPad.d.ts +9 -0
- package/dist/controls/TouchDPad.d.ts.map +1 -0
- package/dist/controls/TouchDPad.js +90 -0
- package/dist/controls/TouchDPad.js.map +1 -0
- package/dist/controls/index.d.ts +6 -0
- package/dist/controls/index.d.ts.map +1 -0
- package/dist/controls/index.js +9 -0
- package/dist/controls/index.js.map +1 -0
- package/dist/core/GameShell.d.ts +43 -0
- package/dist/core/GameShell.d.ts.map +1 -0
- package/dist/core/GameShell.js +91 -0
- package/dist/core/GameShell.js.map +1 -0
- package/dist/core/GameState.d.ts +35 -0
- package/dist/core/GameState.d.ts.map +1 -0
- package/dist/core/GameState.js +74 -0
- package/dist/core/GameState.js.map +1 -0
- package/dist/core/InputManager.d.ts +39 -0
- package/dist/core/InputManager.d.ts.map +1 -0
- package/dist/core/InputManager.js +149 -0
- package/dist/core/InputManager.js.map +1 -0
- package/dist/core/ScaleManager.d.ts +38 -0
- package/dist/core/ScaleManager.d.ts.map +1 -0
- package/dist/core/ScaleManager.js +106 -0
- package/dist/core/ScaleManager.js.map +1 -0
- package/dist/core/index.d.ts +9 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +14 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/types.d.ts +113 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +5 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/useGame.d.ts +22 -0
- package/dist/core/useGame.d.ts.map +1 -0
- package/dist/core/useGame.js +40 -0
- package/dist/core/useGame.js.map +1 -0
- package/dist/core/useGameLoop.d.ts +16 -0
- package/dist/core/useGameLoop.d.ts.map +1 -0
- package/dist/core/useGameLoop.js +35 -0
- package/dist/core/useGameLoop.js.map +1 -0
- package/dist/core/useGameSetup.d.ts +16 -0
- package/dist/core/useGameSetup.d.ts.map +1 -0
- package/dist/core/useGameSetup.js +27 -0
- package/dist/core/useGameSetup.js.map +1 -0
- package/dist/hud/BottomHint.d.ts +17 -0
- package/dist/hud/BottomHint.d.ts.map +1 -0
- package/dist/hud/BottomHint.js +68 -0
- package/dist/hud/BottomHint.js.map +1 -0
- package/dist/hud/ComboLabel.d.ts +18 -0
- package/dist/hud/ComboLabel.d.ts.map +1 -0
- package/dist/hud/ComboLabel.js +125 -0
- package/dist/hud/ComboLabel.js.map +1 -0
- package/dist/hud/HUD.d.ts +18 -0
- package/dist/hud/HUD.d.ts.map +1 -0
- package/dist/hud/HUD.js +72 -0
- package/dist/hud/HUD.js.map +1 -0
- package/dist/hud/Lives.d.ts +21 -0
- package/dist/hud/Lives.d.ts.map +1 -0
- package/dist/hud/Lives.js +92 -0
- package/dist/hud/Lives.js.map +1 -0
- package/dist/hud/Meter.d.ts +24 -0
- package/dist/hud/Meter.d.ts.map +1 -0
- package/dist/hud/Meter.js +133 -0
- package/dist/hud/Meter.js.map +1 -0
- package/dist/hud/MiniMap.d.ts +41 -0
- package/dist/hud/MiniMap.d.ts.map +1 -0
- package/dist/hud/MiniMap.js +103 -0
- package/dist/hud/MiniMap.js.map +1 -0
- package/dist/hud/Score.d.ts +15 -0
- package/dist/hud/Score.d.ts.map +1 -0
- package/dist/hud/Score.js +74 -0
- package/dist/hud/Score.js.map +1 -0
- package/dist/hud/Timer.d.ts +21 -0
- package/dist/hud/Timer.d.ts.map +1 -0
- package/dist/hud/Timer.js +111 -0
- package/dist/hud/Timer.js.map +1 -0
- package/dist/hud/WaveLabel.d.ts +15 -0
- package/dist/hud/WaveLabel.d.ts.map +1 -0
- package/dist/hud/WaveLabel.js +70 -0
- package/dist/hud/WaveLabel.js.map +1 -0
- package/dist/hud/index.d.ts +10 -0
- package/dist/hud/index.d.ts.map +1 -0
- package/dist/hud/index.js +13 -0
- package/dist/hud/index.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/screens/GameOverScreen.d.ts +36 -0
- package/dist/screens/GameOverScreen.d.ts.map +1 -0
- package/dist/screens/GameOverScreen.js +255 -0
- package/dist/screens/GameOverScreen.js.map +1 -0
- package/dist/screens/LoadingScreen.d.ts +21 -0
- package/dist/screens/LoadingScreen.d.ts.map +1 -0
- package/dist/screens/LoadingScreen.js +129 -0
- package/dist/screens/LoadingScreen.js.map +1 -0
- package/dist/screens/LobbyScreen.d.ts +39 -0
- package/dist/screens/LobbyScreen.d.ts.map +1 -0
- package/dist/screens/LobbyScreen.js +266 -0
- package/dist/screens/LobbyScreen.js.map +1 -0
- package/dist/screens/PauseOverlay.d.ts +29 -0
- package/dist/screens/PauseOverlay.d.ts.map +1 -0
- package/dist/screens/PauseOverlay.js +158 -0
- package/dist/screens/PauseOverlay.js.map +1 -0
- package/dist/screens/ScreenManager.d.ts +26 -0
- package/dist/screens/ScreenManager.d.ts.map +1 -0
- package/dist/screens/ScreenManager.js +61 -0
- package/dist/screens/ScreenManager.js.map +1 -0
- package/dist/screens/TitleScreen.d.ts +30 -0
- package/dist/screens/TitleScreen.d.ts.map +1 -0
- package/dist/screens/TitleScreen.js +263 -0
- package/dist/screens/TitleScreen.js.map +1 -0
- package/dist/screens/index.d.ts +7 -0
- package/dist/screens/index.d.ts.map +1 -0
- package/dist/screens/index.js +10 -0
- package/dist/screens/index.js.map +1 -0
- package/dist/theme/ThemeProvider.d.ts +25 -0
- package/dist/theme/ThemeProvider.d.ts.map +1 -0
- package/dist/theme/ThemeProvider.js +51 -0
- package/dist/theme/ThemeProvider.js.map +1 -0
- package/dist/theme/index.d.ts +4 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +7 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/theme/palettes.d.ts +10 -0
- package/dist/theme/palettes.d.ts.map +1 -0
- package/dist/theme/palettes.js +173 -0
- package/dist/theme/palettes.js.map +1 -0
- package/dist/theme/theme.d.ts +24 -0
- package/dist/theme/theme.d.ts.map +1 -0
- package/dist/theme/theme.js +29 -0
- package/dist/theme/theme.js.map +1 -0
- package/dist/transitions/ScreenTransition.d.ts +19 -0
- package/dist/transitions/ScreenTransition.d.ts.map +1 -0
- package/dist/transitions/ScreenTransition.js +105 -0
- package/dist/transitions/ScreenTransition.js.map +1 -0
- package/dist/transitions/index.d.ts +3 -0
- package/dist/transitions/index.d.ts.map +1 -0
- package/dist/transitions/index.js +6 -0
- package/dist/transitions/index.js.map +1 -0
- package/dist/transitions/presets.d.ts +21 -0
- package/dist/transitions/presets.d.ts.map +1 -0
- package/dist/transitions/presets.js +37 -0
- package/dist/transitions/presets.js.map +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// @joydle/ui — Built-in colour palettes
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
/**
|
|
5
|
+
* Ten curated palettes covering a wide range of visual styles — from
|
|
6
|
+
* high-contrast neon arcade to soft pastel candy.
|
|
7
|
+
*
|
|
8
|
+
* Each palette is a complete `ThemeConfig` that can be passed directly to
|
|
9
|
+
* `theme()` or `<ThemeProvider>`.
|
|
10
|
+
*/
|
|
11
|
+
export const palettes = {
|
|
12
|
+
// -- Neon (default) -------------------------------------------------------
|
|
13
|
+
neon: {
|
|
14
|
+
bg: '#06060f',
|
|
15
|
+
primary: '#00f5ff',
|
|
16
|
+
accent: '#ff2d7b',
|
|
17
|
+
secondary: '#7b61ff',
|
|
18
|
+
gold: '#ffd700',
|
|
19
|
+
success: '#00ff88',
|
|
20
|
+
danger: '#ff4444',
|
|
21
|
+
text: '#ffffff',
|
|
22
|
+
textDim: 'rgba(255,255,255,0.5)',
|
|
23
|
+
font: 'Courier New, monospace',
|
|
24
|
+
glowStrength: 'medium',
|
|
25
|
+
borderRadius: 4,
|
|
26
|
+
screenTransition: 'fade',
|
|
27
|
+
},
|
|
28
|
+
// -- Sunset ---------------------------------------------------------------
|
|
29
|
+
sunset: {
|
|
30
|
+
bg: '#1a0f08',
|
|
31
|
+
primary: '#d4a04a',
|
|
32
|
+
accent: '#8b1a2b',
|
|
33
|
+
secondary: '#c47a3a',
|
|
34
|
+
gold: '#ffd700',
|
|
35
|
+
success: '#7ac47a',
|
|
36
|
+
danger: '#cc3333',
|
|
37
|
+
text: '#f5e6d3',
|
|
38
|
+
textDim: 'rgba(245,230,211,0.5)',
|
|
39
|
+
font: 'Georgia, serif',
|
|
40
|
+
glowStrength: 'subtle',
|
|
41
|
+
borderRadius: 4,
|
|
42
|
+
screenTransition: 'fade',
|
|
43
|
+
},
|
|
44
|
+
// -- Retro ----------------------------------------------------------------
|
|
45
|
+
retro: {
|
|
46
|
+
bg: '#2b2b2b',
|
|
47
|
+
primary: '#ffd700',
|
|
48
|
+
accent: '#ff6347',
|
|
49
|
+
secondary: '#4ecdc4',
|
|
50
|
+
gold: '#ffd700',
|
|
51
|
+
success: '#98d8c8',
|
|
52
|
+
danger: '#ff6b6b',
|
|
53
|
+
text: '#f0f0f0',
|
|
54
|
+
textDim: 'rgba(240,240,240,0.5)',
|
|
55
|
+
font: 'Press Start 2P, monospace',
|
|
56
|
+
glowStrength: 'none',
|
|
57
|
+
borderRadius: 0,
|
|
58
|
+
screenTransition: 'fade',
|
|
59
|
+
},
|
|
60
|
+
// -- Arctic ---------------------------------------------------------------
|
|
61
|
+
arctic: {
|
|
62
|
+
bg: '#0a1628',
|
|
63
|
+
primary: '#88ccff',
|
|
64
|
+
accent: '#ffffff',
|
|
65
|
+
secondary: '#4488cc',
|
|
66
|
+
gold: '#ffd700',
|
|
67
|
+
success: '#88eedd',
|
|
68
|
+
danger: '#ff6666',
|
|
69
|
+
text: '#e8f0ff',
|
|
70
|
+
textDim: 'rgba(232,240,255,0.5)',
|
|
71
|
+
font: 'Helvetica Neue, sans-serif',
|
|
72
|
+
glowStrength: 'subtle',
|
|
73
|
+
borderRadius: 4,
|
|
74
|
+
screenTransition: 'fade',
|
|
75
|
+
},
|
|
76
|
+
// -- Jungle ---------------------------------------------------------------
|
|
77
|
+
jungle: {
|
|
78
|
+
bg: '#0a1a0a',
|
|
79
|
+
primary: '#44bb44',
|
|
80
|
+
accent: '#cc8833',
|
|
81
|
+
secondary: '#228822',
|
|
82
|
+
gold: '#ffd700',
|
|
83
|
+
success: '#66dd66',
|
|
84
|
+
danger: '#dd4444',
|
|
85
|
+
text: '#d4e8d4',
|
|
86
|
+
textDim: 'rgba(212,232,212,0.5)',
|
|
87
|
+
font: 'Trebuchet MS, sans-serif',
|
|
88
|
+
glowStrength: 'subtle',
|
|
89
|
+
borderRadius: 4,
|
|
90
|
+
screenTransition: 'fade',
|
|
91
|
+
},
|
|
92
|
+
// -- Vapor ----------------------------------------------------------------
|
|
93
|
+
vapor: {
|
|
94
|
+
bg: '#1a0a2e',
|
|
95
|
+
primary: '#ff71ce',
|
|
96
|
+
accent: '#01cdfe',
|
|
97
|
+
secondary: '#b967ff',
|
|
98
|
+
gold: '#fffb96',
|
|
99
|
+
success: '#05ffa1',
|
|
100
|
+
danger: '#ff6b6b',
|
|
101
|
+
text: '#f5e6ff',
|
|
102
|
+
textDim: 'rgba(245,230,255,0.5)',
|
|
103
|
+
font: 'Futura, sans-serif',
|
|
104
|
+
glowStrength: 'strong',
|
|
105
|
+
borderRadius: 4,
|
|
106
|
+
screenTransition: 'fade',
|
|
107
|
+
},
|
|
108
|
+
// -- Mono -----------------------------------------------------------------
|
|
109
|
+
mono: {
|
|
110
|
+
bg: '#111111',
|
|
111
|
+
primary: '#ffffff',
|
|
112
|
+
accent: '#888888',
|
|
113
|
+
secondary: '#cccccc',
|
|
114
|
+
gold: '#ffffff',
|
|
115
|
+
success: '#aaaaaa',
|
|
116
|
+
danger: '#ff4444',
|
|
117
|
+
text: '#ffffff',
|
|
118
|
+
textDim: 'rgba(255,255,255,0.4)',
|
|
119
|
+
font: 'SF Mono, monospace',
|
|
120
|
+
glowStrength: 'none',
|
|
121
|
+
borderRadius: 4,
|
|
122
|
+
screenTransition: 'fade',
|
|
123
|
+
},
|
|
124
|
+
// -- Candy ----------------------------------------------------------------
|
|
125
|
+
candy: {
|
|
126
|
+
bg: '#fff0f5',
|
|
127
|
+
primary: '#ff69b4',
|
|
128
|
+
accent: '#ffd700',
|
|
129
|
+
secondary: '#ff1493',
|
|
130
|
+
gold: '#ffa500',
|
|
131
|
+
success: '#90ee90',
|
|
132
|
+
danger: '#ff4500',
|
|
133
|
+
text: '#333333',
|
|
134
|
+
textDim: 'rgba(51,51,51,0.5)',
|
|
135
|
+
font: 'Quicksand, sans-serif',
|
|
136
|
+
glowStrength: 'subtle',
|
|
137
|
+
borderRadius: 4,
|
|
138
|
+
screenTransition: 'fade',
|
|
139
|
+
},
|
|
140
|
+
// -- Deep Sea -------------------------------------------------------------
|
|
141
|
+
deepSea: {
|
|
142
|
+
bg: '#040820',
|
|
143
|
+
primary: '#00bbcc',
|
|
144
|
+
accent: '#ff6644',
|
|
145
|
+
secondary: '#0088aa',
|
|
146
|
+
gold: '#ffd700',
|
|
147
|
+
success: '#00ddaa',
|
|
148
|
+
danger: '#ff4444',
|
|
149
|
+
text: '#c0e0f0',
|
|
150
|
+
textDim: 'rgba(192,224,240,0.5)',
|
|
151
|
+
font: 'Gill Sans, sans-serif',
|
|
152
|
+
glowStrength: 'medium',
|
|
153
|
+
borderRadius: 4,
|
|
154
|
+
screenTransition: 'fade',
|
|
155
|
+
},
|
|
156
|
+
// -- Sandstorm ------------------------------------------------------------
|
|
157
|
+
sandstorm: {
|
|
158
|
+
bg: '#1a1408',
|
|
159
|
+
primary: '#c49a3c',
|
|
160
|
+
accent: '#cc3344',
|
|
161
|
+
secondary: '#8b6914',
|
|
162
|
+
gold: '#daa520',
|
|
163
|
+
success: '#8baa44',
|
|
164
|
+
danger: '#cc2222',
|
|
165
|
+
text: '#e8d8c0',
|
|
166
|
+
textDim: 'rgba(232,216,192,0.5)',
|
|
167
|
+
font: 'Palatino, serif',
|
|
168
|
+
glowStrength: 'subtle',
|
|
169
|
+
borderRadius: 4,
|
|
170
|
+
screenTransition: 'fade',
|
|
171
|
+
},
|
|
172
|
+
};
|
|
173
|
+
//# sourceMappingURL=palettes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"palettes.js","sourceRoot":"","sources":["../../src/theme/palettes.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,yCAAyC;AACzC,8EAA8E;AAI9E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAgC;IACnD,4EAA4E;IAC5E,IAAI,EAAE;QACJ,EAAE,EAAE,SAAS;QACb,OAAO,EAAE,SAAS;QAClB,MAAM,EAAE,SAAS;QACjB,SAAS,EAAE,SAAS;QACpB,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,SAAS;QAClB,MAAM,EAAE,SAAS;QACjB,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,uBAAuB;QAChC,IAAI,EAAE,wBAAwB;QAC9B,YAAY,EAAE,QAAQ;QACtB,YAAY,EAAE,CAAC;QACf,gBAAgB,EAAE,MAAM;KACzB;IAED,4EAA4E;IAC5E,MAAM,EAAE;QACN,EAAE,EAAE,S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P,EAAE,EAAE,SAAS;QACb,OAAO,EAAE,SAAS;QAClB,MAAM,EAAE,SAAS;QACjB,SAAS,EAAE,SAAS;QACpB,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,SAAS;QAClB,MAAM,EAAE,SAAS;QACjB,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,uBAAuB;QAChC,IAAI,EAAE,uBAAuB;QAC7B,YAAY,EAAE,QAAQ;QACtB,YAAY,EAAE,CAAC;QACf,gBAAgB,EAAE,MAAM;KACzB;IAED,4EAA4E;IAC5E,SAAS,EAAE;QACT,EAAE,EAAE,SAAS;QACb,OAAO,EAAE,SAAS;QAClB,MAAM,EAAE,SAAS;QACjB,SAAS,EAAE,SAAS;QACpB,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,SAAS;QAClB,MAAM,EAAE,SAAS;QACjB,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,uBAAuB;QAChC,IAAI,EAAE,iBAAiB;QACvB,YAAY,EAAE,QAAQ;QACtB,YAAY,EAAE,CAAC;QACf,gBAAgB,EAAE,MAAM;KACzB;CACO,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ThemeConfig } from '../core/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Default theme — the `neon` palette.
|
|
4
|
+
*
|
|
5
|
+
* Used as the base when merging partial overrides in `theme()`.
|
|
6
|
+
*/
|
|
7
|
+
export declare const DEFAULT_THEME: Readonly<ThemeConfig>;
|
|
8
|
+
/**
|
|
9
|
+
* Create a complete `ThemeConfig` by merging a partial override object on
|
|
10
|
+
* top of the default (neon) palette.
|
|
11
|
+
*
|
|
12
|
+
* ```ts
|
|
13
|
+
* // Use defaults:
|
|
14
|
+
* const t = theme({});
|
|
15
|
+
*
|
|
16
|
+
* // Override only what you need:
|
|
17
|
+
* const t = theme({ primary: '#ff0000', glowStrength: 'strong' });
|
|
18
|
+
*
|
|
19
|
+
* // Start from a different palette and tweak:
|
|
20
|
+
* const t = theme({ ...palettes.vapor, borderRadius: 8 });
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare function theme(partial?: Partial<ThemeConfig>): ThemeConfig;
|
|
24
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/theme/theme.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGpD;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAAiB,CAAC;AAElE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,KAAK,CAAC,OAAO,GAAE,OAAO,CAAC,WAAW,CAAM,GAAG,WAAW,CAErE"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// @joydle/ui — theme() factory
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
import { palettes } from './palettes.js';
|
|
5
|
+
/**
|
|
6
|
+
* Default theme — the `neon` palette.
|
|
7
|
+
*
|
|
8
|
+
* Used as the base when merging partial overrides in `theme()`.
|
|
9
|
+
*/
|
|
10
|
+
export const DEFAULT_THEME = palettes.neon;
|
|
11
|
+
/**
|
|
12
|
+
* Create a complete `ThemeConfig` by merging a partial override object on
|
|
13
|
+
* top of the default (neon) palette.
|
|
14
|
+
*
|
|
15
|
+
* ```ts
|
|
16
|
+
* // Use defaults:
|
|
17
|
+
* const t = theme({});
|
|
18
|
+
*
|
|
19
|
+
* // Override only what you need:
|
|
20
|
+
* const t = theme({ primary: '#ff0000', glowStrength: 'strong' });
|
|
21
|
+
*
|
|
22
|
+
* // Start from a different palette and tweak:
|
|
23
|
+
* const t = theme({ ...palettes.vapor, borderRadius: 8 });
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export function theme(partial = {}) {
|
|
27
|
+
return { ...DEFAULT_THEME, ...partial };
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=theme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../../src/theme/theme.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,gCAAgC;AAChC,8EAA8E;AAG9E,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAA0B,QAAQ,CAAC,IAAI,CAAC;AAElE;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,KAAK,CAAC,UAAgC,EAAE;IACtD,OAAO,EAAE,GAAG,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ComponentChildren } from 'preact';
|
|
2
|
+
export interface ScreenTransitionProps {
|
|
3
|
+
/** Transition preset name or `"none"` to disable. */
|
|
4
|
+
transition?: string;
|
|
5
|
+
/** Override duration in seconds. */
|
|
6
|
+
duration?: number;
|
|
7
|
+
/** A key that changes when the active screen changes. */
|
|
8
|
+
activeKey: string;
|
|
9
|
+
children?: ComponentChildren;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Wraps child content and applies a GSAP-powered enter animation on mount
|
|
13
|
+
* and an exit animation when `activeKey` changes (the exiting content fades
|
|
14
|
+
* out before the new content enters).
|
|
15
|
+
*
|
|
16
|
+
* When GSAP is not available the transition falls back to an instant swap.
|
|
17
|
+
*/
|
|
18
|
+
export declare function ScreenTransition({ transition, duration, activeKey, children, }: ScreenTransitionProps): import("preact").JSX.Element;
|
|
19
|
+
//# sourceMappingURL=ScreenTransition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScreenTransition.d.ts","sourceRoot":"","sources":["../../src/transitions/ScreenTransition.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAehD,MAAM,WAAW,qBAAqB;IACpC,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oCAAoC;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yDAAyD;IACzD,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CAC9B;AAsBD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,UAAmB,EACnB,QAAQ,EACR,SAAS,EACT,QAAQ,GACT,EAAE,qBAAqB,gCAsFvB"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { jsx as _jsx } from "preact/jsx-runtime";
|
|
2
|
+
// ---------------------------------------------------------------------------
|
|
3
|
+
// @joydle/ui — Animated screen transition wrapper
|
|
4
|
+
// ---------------------------------------------------------------------------
|
|
5
|
+
import { useRef, useEffect } from 'preact/hooks';
|
|
6
|
+
import { transitionPresets } from './presets';
|
|
7
|
+
// ---- GSAP helper ----------------------------------------------------------
|
|
8
|
+
function getGsap() {
|
|
9
|
+
try {
|
|
10
|
+
return globalThis.gsap ?? require('gsap').default;
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
// ---- Helpers --------------------------------------------------------------
|
|
17
|
+
/**
|
|
18
|
+
* Converts a `TransitionPreset` phase (enter or exit) into `gsap.fromTo`
|
|
19
|
+
* compatible `from` and `to` objects.
|
|
20
|
+
*/
|
|
21
|
+
function buildFromTo(phase) {
|
|
22
|
+
const from = {};
|
|
23
|
+
const to = {};
|
|
24
|
+
for (const [prop, [f, t]] of Object.entries(phase)) {
|
|
25
|
+
from[prop] = f;
|
|
26
|
+
to[prop] = t;
|
|
27
|
+
}
|
|
28
|
+
return { from, to };
|
|
29
|
+
}
|
|
30
|
+
// ---- Component ------------------------------------------------------------
|
|
31
|
+
/**
|
|
32
|
+
* Wraps child content and applies a GSAP-powered enter animation on mount
|
|
33
|
+
* and an exit animation when `activeKey` changes (the exiting content fades
|
|
34
|
+
* out before the new content enters).
|
|
35
|
+
*
|
|
36
|
+
* When GSAP is not available the transition falls back to an instant swap.
|
|
37
|
+
*/
|
|
38
|
+
export function ScreenTransition({ transition = 'fade', duration, activeKey, children, }) {
|
|
39
|
+
const wrapperRef = useRef(null);
|
|
40
|
+
const prevKeyRef = useRef(activeKey);
|
|
41
|
+
const tlRef = useRef(null);
|
|
42
|
+
// Resolve the preset.
|
|
43
|
+
const preset = transition === 'none' ? null : transitionPresets[transition] ?? transitionPresets['fade'];
|
|
44
|
+
const dur = duration ?? preset?.duration ?? 0.3;
|
|
45
|
+
// Kill any running timeline.
|
|
46
|
+
const killTimeline = () => {
|
|
47
|
+
if (tlRef.current) {
|
|
48
|
+
tlRef.current.kill();
|
|
49
|
+
tlRef.current = null;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
// Enter animation on mount / key change.
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
const el = wrapperRef.current;
|
|
55
|
+
if (!el || !preset)
|
|
56
|
+
return;
|
|
57
|
+
const gsap = getGsap();
|
|
58
|
+
if (!gsap)
|
|
59
|
+
return;
|
|
60
|
+
killTimeline();
|
|
61
|
+
const { from, to } = buildFromTo(preset.enter);
|
|
62
|
+
const tl = gsap.timeline();
|
|
63
|
+
tl.fromTo(el, from, { ...to, duration: dur, ease: 'power2.out' });
|
|
64
|
+
tlRef.current = tl;
|
|
65
|
+
return () => {
|
|
66
|
+
killTimeline();
|
|
67
|
+
};
|
|
68
|
+
// Re-run when activeKey changes.
|
|
69
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
70
|
+
}, [activeKey]);
|
|
71
|
+
// Handle key transitions: exit old, enter new.
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
if (prevKeyRef.current === activeKey)
|
|
74
|
+
return;
|
|
75
|
+
const el = wrapperRef.current;
|
|
76
|
+
if (!el || !preset) {
|
|
77
|
+
prevKeyRef.current = activeKey;
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const gsap = getGsap();
|
|
81
|
+
if (!gsap) {
|
|
82
|
+
prevKeyRef.current = activeKey;
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
killTimeline();
|
|
86
|
+
// Quick exit of previous content.
|
|
87
|
+
const { from: exitFrom, to: exitTo } = buildFromTo(preset.exit);
|
|
88
|
+
const tl = gsap.timeline({
|
|
89
|
+
onComplete: () => {
|
|
90
|
+
prevKeyRef.current = activeKey;
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
tl.fromTo(el, exitFrom, { ...exitTo, duration: dur * 0.4, ease: 'power2.in' });
|
|
94
|
+
tlRef.current = tl;
|
|
95
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
96
|
+
}, [activeKey]);
|
|
97
|
+
// Cleanup on unmount.
|
|
98
|
+
useEffect(() => () => killTimeline(), []);
|
|
99
|
+
const style = {
|
|
100
|
+
width: '100%',
|
|
101
|
+
height: '100%',
|
|
102
|
+
};
|
|
103
|
+
return (_jsx("div", { ref: wrapperRef, style: style, "data-transition": transition, children: children }));
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=ScreenTransition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScreenTransition.js","sourceRoot":"","sources":["../../src/transitions/ScreenTransition.tsx"],"names":[],"mappings":";AAAA,8EAA8E;AAC9E,mDAAmD;AACnD,8EAA8E;AAE9E,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,EAAE,iBAAiB,EAAyB,MAAM,WAAW,CAAC;AAErE,8EAA8E;AAE9E,SAAS,OAAO;IACd,IAAI,CAAC;QACH,OAAQ,UAAkB,CAAC,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC;IAC7D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,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AM,CAAC,IAAI,CAAC,CAAC;QAChE,MAAM,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC;YACvB,UAAU,EAAE,GAAG,EAAE;gBACf,UAAU,CAAC,OAAO,GAAG,SAAS,CAAC;YACjC,CAAC;SACF,CAAC,CAAC;QAEH,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,EAAE,GAAG,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,GAAG,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;QAC/E,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC;QAEnB,uDAAuD;IACzD,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhB,sBAAsB;IACtB,SAAS,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,YAAY,EAAE,EAAE,EAAE,CAAC,CAAC;IAE1C,MAAM,KAAK,GAAoC;QAC7C,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,MAAM;KACf,CAAC;IAEF,OAAO,CACL,cAAK,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,qBAAmB,UAAU,YAC5D,QAAQ,GACL,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/transitions/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,WAAW,CAAC;AAC3F,OAAO,EAAE,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// @joydle/ui/transitions — barrel export
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
export { transitionPresets } from './presets';
|
|
5
|
+
export { ScreenTransition } from './ScreenTransition';
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/transitions/index.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,0CAA0C;AAC1C,8EAA8E;AAE9E,OAAO,EAAE,iBAAiB,EAA+C,MAAM,WAAW,CAAC;AAC3F,OAAO,EAAE,gBAAgB,EAA8B,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Describes how a property animates: `[fromValue, toValue]`.
|
|
3
|
+
*/
|
|
4
|
+
export type TransitionTween = [from: string | number, to: string | number];
|
|
5
|
+
/**
|
|
6
|
+
* A transition preset defines the GSAP-compatible enter/exit property maps
|
|
7
|
+
* and a default duration.
|
|
8
|
+
*/
|
|
9
|
+
export interface TransitionPreset {
|
|
10
|
+
enter: Record<string, TransitionTween>;
|
|
11
|
+
exit: Record<string, TransitionTween>;
|
|
12
|
+
duration: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Built-in transition presets used by `<ScreenTransition>`.
|
|
16
|
+
*
|
|
17
|
+
* Each preset specifies enter/exit tweens (from/to pairs) and a default
|
|
18
|
+
* duration in seconds.
|
|
19
|
+
*/
|
|
20
|
+
export declare const transitionPresets: Record<string, TransitionPreset>;
|
|
21
|
+
//# sourceMappingURL=presets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../../src/transitions/presets.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAE3E;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACvC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACtC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CA8BrD,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// @joydle/ui — Transition animation presets
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
/**
|
|
5
|
+
* Built-in transition presets used by `<ScreenTransition>`.
|
|
6
|
+
*
|
|
7
|
+
* Each preset specifies enter/exit tweens (from/to pairs) and a default
|
|
8
|
+
* duration in seconds.
|
|
9
|
+
*/
|
|
10
|
+
export const transitionPresets = {
|
|
11
|
+
fade: {
|
|
12
|
+
enter: { opacity: [0, 1] },
|
|
13
|
+
exit: { opacity: [1, 0] },
|
|
14
|
+
duration: 0.3,
|
|
15
|
+
},
|
|
16
|
+
slide: {
|
|
17
|
+
enter: { y: ['100%', '0%'] },
|
|
18
|
+
exit: { y: ['0%', '-100%'] },
|
|
19
|
+
duration: 0.4,
|
|
20
|
+
},
|
|
21
|
+
zoom: {
|
|
22
|
+
enter: { scale: [0.8, 1], opacity: [0, 1] },
|
|
23
|
+
exit: { scale: [1, 1.2], opacity: [1, 0] },
|
|
24
|
+
duration: 0.35,
|
|
25
|
+
},
|
|
26
|
+
wipe: {
|
|
27
|
+
enter: { clipPath: ['inset(0 100% 0 0)', 'inset(0)'] },
|
|
28
|
+
exit: { clipPath: ['inset(0)', 'inset(0 0 0 100%)'] },
|
|
29
|
+
duration: 0.4,
|
|
30
|
+
},
|
|
31
|
+
dissolve: {
|
|
32
|
+
enter: { opacity: [0, 1], filter: ['blur(10px)', 'blur(0)'] },
|
|
33
|
+
exit: { opacity: [1, 0], filter: ['blur(0)', 'blur(10px)'] },
|
|
34
|
+
duration: 0.5,
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=presets.js.map
|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E,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,SAAS,EAAE,YAAY,CAAC,EAAE;QAC5D,QAAQ,EAAE,GAAG;KACd;CACO,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@joydle/ui",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js"
|
|
11
|
+
},
|
|
12
|
+
"./hud": {
|
|
13
|
+
"types": "./dist/hud/index.d.ts",
|
|
14
|
+
"import": "./dist/hud/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./controls": {
|
|
17
|
+
"types": "./dist/controls/index.d.ts",
|
|
18
|
+
"import": "./dist/controls/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./theme": {
|
|
21
|
+
"types": "./dist/theme/index.d.ts",
|
|
22
|
+
"import": "./dist/theme/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./screens": {
|
|
25
|
+
"types": "./dist/screens/index.d.ts",
|
|
26
|
+
"import": "./dist/screens/index.js"
|
|
27
|
+
},
|
|
28
|
+
"./transitions": {
|
|
29
|
+
"types": "./dist/transitions/index.d.ts",
|
|
30
|
+
"import": "./dist/transitions/index.js"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"files": ["dist"],
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "tsc",
|
|
36
|
+
"typecheck": "tsc --noEmit",
|
|
37
|
+
"test": "vitest run",
|
|
38
|
+
"test:watch": "vitest",
|
|
39
|
+
"clean": "rm -rf dist"
|
|
40
|
+
},
|
|
41
|
+
"publishConfig": {
|
|
42
|
+
"access": "public"
|
|
43
|
+
},
|
|
44
|
+
"license": "MIT",
|
|
45
|
+
"author": "Joydle <contact@joydle.dev>",
|
|
46
|
+
"homepage": "https://joydle.dev",
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"gsap": "^3.12",
|
|
49
|
+
"preact": "^10.19"
|
|
50
|
+
},
|
|
51
|
+
"peerDependenciesMeta": {
|
|
52
|
+
"gsap": {
|
|
53
|
+
"optional": true
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"jsdom": "^28.1.0",
|
|
58
|
+
"preact": "^10.19.0",
|
|
59
|
+
"typescript": "^5.4.0",
|
|
60
|
+
"vitest": "^2.0.0"
|
|
61
|
+
}
|
|
62
|
+
}
|