anentrypoint-design 0.0.168 → 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/dist/247420.css +61 -0
- package/dist/247420.js +21 -11
- package/package.json +3 -1
- package/src/index.js +1 -0
- package/src/kits/spoint/game-hud.css +59 -0
- package/src/kits/spoint/game-hud.js +32 -0
- package/src/kits/spoint/index.js +2 -0
- package/src/page-html.js +14 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "anentrypoint-design",
|
|
3
|
-
"version": "0.0.
|
|
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
|
+
}
|
package/src/kits/spoint/index.js
CHANGED
|
@@ -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;
|
package/src/page-html.js
CHANGED
|
@@ -115,6 +115,16 @@ a.row:hover .ds-row-arrow { opacity: 1 }
|
|
|
115
115
|
.ds-hero-stat { display: flex; align-items: baseline; gap: var(--space-2, 8px) }
|
|
116
116
|
.ds-hero-stat-n { font-family: var(--ff-body); font-weight: 700; font-size: var(--fs-lg, 18px); color: var(--fg) }
|
|
117
117
|
.ds-hero-stat-l { font-size: var(--fs-sm, 15px); color: var(--fg-3) }
|
|
118
|
+
/* feature rows — single-column stack with a rail accent (the dashboard .row grid
|
|
119
|
+
forces a 3-col code/title/meta layout that mangles title+desc+benefit) */
|
|
120
|
+
.ds-feature { position: relative; padding: var(--space-3, 16px) var(--space-4, 24px); background: var(--bg, #fff); border-radius: var(--r-2, 14px); display: grid; gap: var(--space-1, 4px) }
|
|
121
|
+
.ds-feature::before { content: ''; position: absolute; left: 0; top: var(--space-2, 8px); bottom: var(--space-2, 8px); width: 3px; border-radius: 3px; background: var(--rail-color, var(--rule-strong)) }
|
|
122
|
+
.ds-feature.rail-green { --rail-color: var(--green) } .ds-feature.rail-purple { --rail-color: var(--purple) } .ds-feature.rail-mascot { --rail-color: var(--mascot) }
|
|
123
|
+
.ds-feature.rail-sun { --rail-color: var(--sun) } .ds-feature.rail-flame { --rail-color: var(--flame) } .ds-feature.rail-sky { --rail-color: var(--sky) }
|
|
124
|
+
.ds-feature + .ds-feature { margin-top: var(--space-2, 8px) }
|
|
125
|
+
.ds-feature-title { font-weight: 600; font-size: var(--fs-lg, 18px); color: var(--fg) }
|
|
126
|
+
.ds-feature-desc { font-size: var(--fs-sm, 15px); color: var(--fg-2); line-height: 1.5 }
|
|
127
|
+
.ds-feature-benefit { font-style: italic; font-size: var(--fs-sm, 15px); color: var(--fg-3); margin-top: var(--space-1, 4px) }
|
|
118
128
|
</style>
|
|
119
129
|
<script id="__site__" type="application/json">${JSON.stringify(pageData).replace(/</g, '\\u003c')}</script>
|
|
120
130
|
${headExtra}
|
|
@@ -155,10 +165,10 @@ function sectionNode(sec, idx) {
|
|
|
155
165
|
const rail = RAILS[idx % RAILS.length];
|
|
156
166
|
const features = sec.features || sec.items || [];
|
|
157
167
|
const rows = features.map((f, i) => {
|
|
158
|
-
const kids = [h('
|
|
159
|
-
if (f.desc) kids.push(h('div', { key: 'd', class: '
|
|
160
|
-
if (f.benefit) kids.push(h('div', { key: 'b', class: '
|
|
161
|
-
return h('div', { key: i, class: '
|
|
168
|
+
const kids = [h('div', { key: 't', class: 'ds-feature-title' }, String(f.name || ''))];
|
|
169
|
+
if (f.desc) kids.push(h('div', { key: 'd', class: 'ds-feature-desc', innerHTML: String(f.desc).replace(/\`([^\`]+)\`/g, '<code>$1</code>') }));
|
|
170
|
+
if (f.benefit) kids.push(h('div', { key: 'b', class: 'ds-feature-benefit' }, String(f.benefit)));
|
|
171
|
+
return h('div', { key: i, class: 'ds-feature ' + rail }, ...kids);
|
|
162
172
|
});
|
|
163
173
|
return C.Section({
|
|
164
174
|
title: sec.name || sec.title || sec.id,
|