anentrypoint-design 0.0.169 → 0.0.170

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anentrypoint-design",
3
- "version": "0.0.169",
3
+ "version": "0.0.170",
4
4
  "description": "247420 design system SDK — webjsx + modified ripple-ui, single-file ESM bundle for reproducible use of the AnEntrypoint design.",
5
5
  "type": "module",
6
6
  "main": "./dist/247420.js",
@@ -17,6 +17,8 @@
17
17
  },
18
18
  "./kits/spoint/loading-screen.js": "./src/kits/spoint/loading-screen.js",
19
19
  "./kits/spoint/loading-screen.css": "./src/kits/spoint/loading-screen.css",
20
+ "./kits/spoint/game-hud.js": "./src/kits/spoint/game-hud.js",
21
+ "./kits/spoint/game-hud.css": "./src/kits/spoint/game-hud.css",
20
22
  "./kits/os": {
21
23
  "import": "./src/kits/os/index.js",
22
24
  "default": "./src/kits/os/index.js"
package/src/index.js CHANGED
@@ -76,6 +76,7 @@ export const applyDiff = webjsx.applyDiff;
76
76
 
77
77
  // spoint kit paint surfaces (loading screen, HUD, editor chrome).
78
78
  export { renderLoadingScreen } from './kits/spoint/loading-screen.js';
79
+ export { renderGameHud } from './kits/spoint/game-hud.js';
79
80
 
80
81
  // Re-export freddie helpers so consumers can `import { FREDDIE_PAGES } from
81
82
  // 'anentrypoint-design'` directly.
@@ -0,0 +1,59 @@
1
+ /* Game-HUD kit styles. Scoped under .ds-247420 at build time.
2
+ Colors from semantic tokens (no raw literals) per the token-lint gate. */
3
+ .sp-hud { pointer-events: none; font-family: var(--ff-mono); }
4
+ .sp-hud-crosshair {
5
+ position: fixed;
6
+ top: 50%;
7
+ left: 50%;
8
+ transform: translate(-50%, -50%);
9
+ font-size: 24px;
10
+ color: var(--fg);
11
+ text-shadow: 0 0 2px var(--bg);
12
+ }
13
+ .sp-hud-ammo {
14
+ position: fixed;
15
+ bottom: 50px;
16
+ right: 20px;
17
+ font-size: 24px;
18
+ font-weight: bold;
19
+ color: var(--fg);
20
+ text-shadow: 0 0 4px var(--bg);
21
+ }
22
+ .sp-hud-ammo-reloading { color: var(--warn); }
23
+ .sp-hud-health {
24
+ position: fixed;
25
+ bottom: 20px;
26
+ left: 50%;
27
+ transform: translateX(-50%);
28
+ width: 200px;
29
+ height: 20px;
30
+ background: var(--bg-3);
31
+ border-radius: 4px;
32
+ overflow: hidden;
33
+ }
34
+ .sp-hud-health-fill {
35
+ height: 100%;
36
+ transition: width var(--dur-snap) var(--ease);
37
+ }
38
+ .sp-hud-hp-high { background: var(--success); }
39
+ .sp-hud-hp-mid { background: var(--warn); }
40
+ .sp-hud-hp-low { background: var(--danger); }
41
+ .sp-hud-health-num {
42
+ position: absolute;
43
+ width: 100%;
44
+ text-align: center;
45
+ color: var(--fg);
46
+ font-size: 12px;
47
+ line-height: 20px;
48
+ }
49
+ .sp-hud-boost {
50
+ position: fixed;
51
+ top: 80px;
52
+ right: 20px;
53
+ padding: 8px 16px;
54
+ background: var(--accent);
55
+ color: var(--accent-fg);
56
+ font-weight: bold;
57
+ border-radius: 6px;
58
+ font-size: 14px;
59
+ }
@@ -0,0 +1,32 @@
1
+ // Game-HUD paint surface for the spoint TPS client (webjsx vnode tree).
2
+ // renderGameHud(h, { hp, ammo, magazine, reloading, reloadProgress, boostSec })
3
+ // -> a vnode the consumer mounts. Pure presentation; the app owns all state.
4
+ // `h` is the consumer's createElement (webjsx) so the tree composes into the
5
+ // app's existing render() return.
6
+
7
+ export function renderGameHud(h, state = {}) {
8
+ const {
9
+ hp = 100,
10
+ ammo = 0,
11
+ magazine = 30,
12
+ reloading = false,
13
+ reloadProgress = 0,
14
+ boostSec = 0,
15
+ } = state
16
+
17
+ const hpClass = hp > 60 ? 'sp-hud-hp-high' : hp > 30 ? 'sp-hud-hp-mid' : 'sp-hud-hp-low'
18
+
19
+ return h('div', { class: 'sp-hud' },
20
+ h('div', { class: 'sp-hud-crosshair' }, '+'),
21
+ h('div', { class: 'sp-hud-ammo' },
22
+ reloading
23
+ ? h('span', { class: 'sp-hud-ammo-reloading' }, `RELOADING ${reloadProgress}%`)
24
+ : h('span', null, `${ammo}/${magazine}`)
25
+ ),
26
+ h('div', { class: 'sp-hud-health' },
27
+ h('div', { class: `sp-hud-health-fill ${hpClass}`, style: `width:${hp}%` }),
28
+ h('span', { class: 'sp-hud-health-num' }, String(hp))
29
+ ),
30
+ boostSec > 0 ? h('div', { class: 'sp-hud-boost' }, `BOOSTED ${boostSec}s`) : null
31
+ )
32
+ }
@@ -4,5 +4,7 @@
4
4
  // through the main bundle entry so spoint can import directly from unpkg.
5
5
 
6
6
  export { renderLoadingScreen } from './loading-screen.js';
7
+ export { renderGameHud } from './game-hud.js';
7
8
 
8
9
  export const themeUrl = new URL('./loading-screen.css', import.meta.url).href;
10
+ export const gameHudCssUrl = new URL('./game-hud.css', import.meta.url).href;