@rpgjs/ui-css 5.0.0-alpha.32 → 5.0.0-alpha.35
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 +28 -1
- package/package.json +1 -1
- package/src/primitives/hotbar.css +115 -36
package/README.md
CHANGED
|
@@ -77,6 +77,12 @@ pnpm add @rpgjs/ui-css
|
|
|
77
77
|
- `.rpg-ui-character-card-stats` - Stats section in card
|
|
78
78
|
- `.rpg-ui-character-card-section` - Card section divider
|
|
79
79
|
- `.rpg-ui-character-card-section-title` - Section title
|
|
80
|
+
- `.rpg-ui-hotbar` - Action bar plate container
|
|
81
|
+
- `.rpg-ui-hotbar-track` - Slot grid wrapper
|
|
82
|
+
- `.rpg-ui-hotbar-slot` - Individual action/item slot
|
|
83
|
+
- `.rpg-ui-hotbar-key` - Keyboard hint label (1-0, etc.)
|
|
84
|
+
- `.rpg-ui-hotbar-count` - Stack quantity (items)
|
|
85
|
+
- `.rpg-ui-hotbar-text` - Fallback text label for slot content
|
|
80
86
|
|
|
81
87
|
### Variants & States
|
|
82
88
|
|
|
@@ -241,6 +247,27 @@ All styling is controlled via CSS custom properties:
|
|
|
241
247
|
</div>
|
|
242
248
|
```
|
|
243
249
|
|
|
250
|
+
### Hotbar / Action Bar
|
|
251
|
+
|
|
252
|
+
```html
|
|
253
|
+
<div class="rpg-ui-hotbar" style="--rpg-ui-hotbar-slots: 10;">
|
|
254
|
+
<div class="rpg-ui-hotbar-track">
|
|
255
|
+
<div class="rpg-ui-hotbar-slot" data-selected="true" data-empty="false" data-type="skill">
|
|
256
|
+
<span class="rpg-ui-hotbar-key">1</span>
|
|
257
|
+
<span class="rpg-ui-hotbar-text">Slash</span>
|
|
258
|
+
</div>
|
|
259
|
+
<div class="rpg-ui-hotbar-slot" data-empty="false" data-type="item">
|
|
260
|
+
<span class="rpg-ui-hotbar-key">2</span>
|
|
261
|
+
<span class="rpg-ui-hotbar-text">Potion</span>
|
|
262
|
+
<span class="rpg-ui-hotbar-count">x3</span>
|
|
263
|
+
</div>
|
|
264
|
+
<div class="rpg-ui-hotbar-slot" data-empty="true">
|
|
265
|
+
<span class="rpg-ui-hotbar-key">3</span>
|
|
266
|
+
</div>
|
|
267
|
+
</div>
|
|
268
|
+
</div>
|
|
269
|
+
```
|
|
270
|
+
|
|
244
271
|
### Dialog Box
|
|
245
272
|
|
|
246
273
|
```html
|
|
@@ -291,4 +318,4 @@ All styling is controlled via CSS custom properties:
|
|
|
291
318
|
- 📋 **Menu system**: Selection indicators, hover effects, and animations
|
|
292
319
|
- 🎯 **Bevel effects**: 3D-style borders with light/dark edge highlighting
|
|
293
320
|
- ✨ **Glow effects**: Subtle glows on hover and selection
|
|
294
|
-
- 🔧 **Full customization**: Every aspect is configurable via CSS tokens
|
|
321
|
+
- 🔧 **Full customization**: Every aspect is configurable via CSS tokens
|
package/package.json
CHANGED
|
@@ -1,42 +1,121 @@
|
|
|
1
1
|
.rpg-ui-hotbar {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
--rpg-ui-hotbar-slots: 10;
|
|
3
|
+
--rpg-ui-hotbar-gap: 6px;
|
|
4
|
+
--rpg-ui-hotbar-size: 52px;
|
|
5
|
+
--rpg-ui-hotbar-padding-x: 10px;
|
|
6
|
+
--rpg-ui-hotbar-padding-y: 10px;
|
|
7
|
+
--rpg-ui-hotbar-padding-bottom: 12px;
|
|
8
|
+
--rpg-ui-hotbar-plate-dark: color-mix(in srgb, var(--rpg-ui-surface), var(--rpg-ui-bg) 35%);
|
|
9
|
+
--rpg-ui-hotbar-plate-mid: color-mix(in srgb, var(--rpg-ui-surface), var(--rpg-ui-border-light) 25%);
|
|
10
|
+
--rpg-ui-hotbar-plate-light: color-mix(in srgb, var(--rpg-ui-surface-light, var(--rpg-ui-surface)), white 12%);
|
|
11
|
+
--rpg-ui-hotbar-slot: color-mix(in srgb, var(--rpg-ui-surface), var(--rpg-ui-border-light) 20%);
|
|
12
|
+
--rpg-ui-hotbar-slot-empty: color-mix(in srgb, var(--rpg-ui-bg), var(--rpg-ui-border-dark) 12%);
|
|
13
|
+
--rpg-ui-hotbar-edge: var(--rpg-ui-border-dark);
|
|
14
|
+
--rpg-ui-hotbar-highlight: var(--rpg-ui-accent);
|
|
15
|
+
position: relative;
|
|
16
|
+
display: block;
|
|
17
|
+
padding: var(--rpg-ui-hotbar-padding-y) var(--rpg-ui-hotbar-padding-x) var(--rpg-ui-hotbar-padding-bottom);
|
|
18
|
+
border-radius: calc(var(--rpg-ui-radius-lg) + 4px);
|
|
19
|
+
border: max(2px, var(--rpg-ui-border-width)) solid var(--rpg-ui-hotbar-edge);
|
|
20
|
+
background:
|
|
21
|
+
linear-gradient(180deg, color-mix(in srgb, #fff, transparent 80%), transparent) 0 0 / 100% 40% no-repeat,
|
|
22
|
+
linear-gradient(180deg, var(--rpg-ui-hotbar-plate-light), var(--rpg-ui-hotbar-plate-mid) 42%, var(--rpg-ui-hotbar-plate-dark));
|
|
23
|
+
box-shadow:
|
|
24
|
+
inset 0 2px 0 color-mix(in srgb, var(--rpg-ui-bevel-light), transparent 25%),
|
|
25
|
+
inset 0 -3px 0 rgba(0, 0, 0, 0.35),
|
|
26
|
+
var(--rpg-ui-shadow-md);
|
|
14
27
|
}
|
|
15
28
|
|
|
16
|
-
.rpg-ui-hotbar
|
|
17
|
-
|
|
18
|
-
|
|
29
|
+
.rpg-ui-hotbar-track {
|
|
30
|
+
display: grid;
|
|
31
|
+
grid-template-columns: repeat(var(--rpg-ui-hotbar-slots), minmax(0, 1fr));
|
|
32
|
+
gap: var(--rpg-ui-hotbar-gap);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.rpg-ui-hotbar-slot {
|
|
36
|
+
position: relative;
|
|
37
|
+
min-height: var(--rpg-ui-hotbar-size);
|
|
38
|
+
aspect-ratio: 1 / 1;
|
|
39
|
+
border-radius: var(--rpg-ui-radius-md);
|
|
40
|
+
border: max(2px, var(--rpg-ui-border-width)) solid var(--rpg-ui-hotbar-edge);
|
|
41
|
+
background: linear-gradient(180deg, color-mix(in srgb, var(--rpg-ui-hotbar-slot), white 10%), var(--rpg-ui-hotbar-slot));
|
|
42
|
+
box-shadow:
|
|
43
|
+
inset 0 2px 0 color-mix(in srgb, var(--rpg-ui-bevel-light), transparent 30%),
|
|
44
|
+
inset 0 -2px 0 rgba(0, 0, 0, 0.3);
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
justify-content: center;
|
|
48
|
+
overflow: hidden;
|
|
49
|
+
color: var(--rpg-ui-text);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.rpg-ui-hotbar-slot[data-empty="true"] {
|
|
53
|
+
background: linear-gradient(180deg, color-mix(in srgb, var(--rpg-ui-hotbar-slot-empty), white 6%), var(--rpg-ui-hotbar-slot-empty));
|
|
54
|
+
box-shadow:
|
|
55
|
+
inset 0 2px 3px rgba(0, 0, 0, 0.35),
|
|
56
|
+
inset 0 -2px 2px rgba(255, 255, 255, 0.08);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.rpg-ui-hotbar-slot[data-selected="true"] {
|
|
60
|
+
border-color: var(--rpg-ui-hotbar-highlight);
|
|
61
|
+
box-shadow:
|
|
62
|
+
inset 0 2px 0 rgba(255, 243, 211, 0.35),
|
|
63
|
+
0 0 0 2px color-mix(in srgb, var(--rpg-ui-hotbar-highlight), transparent 60%);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.rpg-ui-hotbar-slot[data-disabled="true"] {
|
|
67
|
+
filter: grayscale(0.85);
|
|
68
|
+
opacity: 0.58;
|
|
19
69
|
}
|
|
20
70
|
|
|
21
71
|
.rpg-ui-hotbar-key {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
72
|
+
position: absolute;
|
|
73
|
+
top: 2px;
|
|
74
|
+
left: 4px;
|
|
75
|
+
font-size: 9px;
|
|
76
|
+
line-height: 1;
|
|
77
|
+
color: color-mix(in srgb, var(--rpg-ui-text), var(--rpg-ui-text-muted) 35%);
|
|
78
|
+
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.85);
|
|
79
|
+
font-family: var(--rpg-ui-font);
|
|
80
|
+
font-weight: var(--rpg-ui-font-weight-bold);
|
|
81
|
+
pointer-events: none;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.rpg-ui-hotbar-count {
|
|
85
|
+
position: absolute;
|
|
86
|
+
right: 3px;
|
|
87
|
+
bottom: 2px;
|
|
88
|
+
padding: 1px 3px;
|
|
89
|
+
border-radius: 4px;
|
|
90
|
+
font-size: 9px;
|
|
91
|
+
line-height: 1;
|
|
92
|
+
color: var(--rpg-ui-text);
|
|
93
|
+
background: color-mix(in srgb, var(--rpg-ui-bg), transparent 28%);
|
|
94
|
+
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.85);
|
|
95
|
+
font-family: var(--rpg-ui-font);
|
|
96
|
+
font-weight: var(--rpg-ui-font-weight-bold);
|
|
97
|
+
pointer-events: none;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.rpg-ui-hotbar-text {
|
|
101
|
+
font-size: 9px;
|
|
102
|
+
line-height: 1.1;
|
|
103
|
+
text-align: center;
|
|
104
|
+
color: var(--rpg-ui-text);
|
|
105
|
+
text-shadow: var(--rpg-ui-text-shadow);
|
|
106
|
+
font-family: var(--rpg-ui-font);
|
|
107
|
+
max-width: 100%;
|
|
108
|
+
overflow: hidden;
|
|
109
|
+
text-overflow: ellipsis;
|
|
110
|
+
pointer-events: none;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
@media (max-width: 768px) {
|
|
114
|
+
.rpg-ui-hotbar {
|
|
115
|
+
--rpg-ui-hotbar-gap: 4px;
|
|
116
|
+
--rpg-ui-hotbar-padding-x: 6px;
|
|
117
|
+
--rpg-ui-hotbar-padding-y: 8px;
|
|
118
|
+
--rpg-ui-hotbar-padding-bottom: 9px;
|
|
119
|
+
--rpg-ui-hotbar-size: 42px;
|
|
120
|
+
}
|
|
121
|
+
}
|