@uxfront/ui 0.9.1 → 0.9.2
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 +46 -46
- package/package.json +4 -4
- package/src/components/UxAnchor.vue +100 -100
- package/src/components/UxChapter.vue +157 -157
- package/src/components/UxChips.vue +32 -32
- package/src/components/UxCode.vue +42 -42
- package/src/components/UxErrorPage.vue +37 -37
- package/src/components/UxFeatures.vue +70 -70
- package/src/components/UxFinale.vue +148 -148
- package/src/components/UxHeader.vue +171 -171
- package/src/components/UxHero.vue +179 -179
- package/src/components/UxHeroLine.vue +18 -18
- package/src/components/UxHud.vue +139 -137
- package/src/components/UxPillLink.vue +41 -41
- package/src/components/UxPillars.vue +22 -22
- package/src/components/UxSection.vue +60 -60
- package/src/components/UxSite.vue +52 -48
- package/src/components/UxSpec.vue +21 -21
- package/src/components/UxSplit.vue +138 -138
- package/src/components/UxStage.vue +40 -38
- package/src/components/UxStageFallback.vue +28 -28
- package/src/components/UxTraits.vue +55 -55
- package/src/components/UxVideo.vue +50 -40
- package/src/components/icons/UxArrowIcon.vue +4 -4
- package/src/components/icons/UxFrameworkLogo.vue +4 -4
- package/src/components/icons/UxFrontMark.vue +10 -10
- package/src/components/icons/UxGithubIcon.vue +6 -6
- package/src/components/icons/UxStarIcon.vue +6 -6
- package/src/composables/experience.ts +58 -53
- package/src/directives/scramble.ts +41 -37
- package/src/frameworks.ts +12 -12
- package/src/styles/base.css +88 -88
- package/src/styles/tokens.css +28 -28
- package/src/types.ts +26 -26
package/src/components/UxHud.vue
CHANGED
|
@@ -4,22 +4,22 @@ import { computed } from "vue";
|
|
|
4
4
|
import { useExperience } from "../composables/experience";
|
|
5
5
|
|
|
6
6
|
const {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
motionLabel = "Motion",
|
|
8
|
+
particlesLabel = "particles",
|
|
9
|
+
loadingLabel = "Warming up the GPU",
|
|
10
|
+
fallbackLabel = "Static mode",
|
|
11
|
+
locale = "en-US",
|
|
12
12
|
} = defineProps<{
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
/** The Motion toggle's label. */
|
|
14
|
+
motionLabel?: string;
|
|
15
|
+
/** After the particle count, like "1,024 particles". */
|
|
16
|
+
particlesLabel?: string;
|
|
17
|
+
/** While the scene loads. */
|
|
18
|
+
loadingLabel?: string;
|
|
19
|
+
/** Once the scene has fallen back to the static page. */
|
|
20
|
+
fallbackLabel?: string;
|
|
21
|
+
/** BCP 47 locale for the particle count, like "fr-FR". */
|
|
22
|
+
locale?: string;
|
|
23
23
|
}>();
|
|
24
24
|
|
|
25
25
|
const { state, labels, setMotion } = useExperience();
|
|
@@ -27,203 +27,205 @@ const { state, labels, setMotion } = useExperience();
|
|
|
27
27
|
const pad = (n: number) => String(n).padStart(2, "0");
|
|
28
28
|
|
|
29
29
|
const stats = computed(() => {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
if (state.status === "ready") {
|
|
31
|
+
return `${state.particles.toLocaleString(locale)} ${particlesLabel} · ${state.fps} fps`;
|
|
32
|
+
}
|
|
33
|
+
if (state.status === "fallback") {
|
|
34
|
+
return fallbackLabel;
|
|
35
|
+
}
|
|
36
|
+
return loadingLabel;
|
|
35
37
|
});
|
|
36
38
|
</script>
|
|
37
39
|
|
|
38
40
|
<template>
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
41
|
+
<div class="ux-hud">
|
|
42
|
+
<p class="ux-hud__stats" aria-hidden="true">
|
|
43
|
+
<span class="ux-hud__led" :data-status="state.status" />
|
|
44
|
+
{{ stats }}
|
|
45
|
+
</p>
|
|
46
|
+
<p class="ux-hud__chapter" aria-hidden="true">
|
|
47
|
+
<span>{{ pad(state.chapter + 1) }} / {{ pad(labels.length) }}</span>
|
|
48
|
+
<span class="ux-hud__bar"><span class="ux-hud__fill" data-progress /></span>
|
|
49
|
+
<span class="ux-hud__label">{{ labels[state.chapter] }}</span>
|
|
50
|
+
</p>
|
|
51
|
+
<button
|
|
52
|
+
type="button"
|
|
53
|
+
class="ux-hud__motion"
|
|
54
|
+
:aria-pressed="state.motion"
|
|
55
|
+
@click="setMotion(!state.motion)"
|
|
56
|
+
>
|
|
57
|
+
<span class="ux-hud__wave" :data-on="state.motion" aria-hidden="true">
|
|
58
|
+
<i v-for="n in 4" :key="n" />
|
|
59
|
+
</span>
|
|
60
|
+
{{ motionLabel }}
|
|
61
|
+
</button>
|
|
62
|
+
</div>
|
|
61
63
|
</template>
|
|
62
64
|
|
|
63
65
|
<style scoped>
|
|
64
66
|
.ux-hud {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
67
|
+
position: fixed;
|
|
68
|
+
inset: auto 0 0;
|
|
69
|
+
z-index: 20;
|
|
70
|
+
display: grid;
|
|
71
|
+
grid-template-columns: 1fr auto 1fr;
|
|
72
|
+
align-items: center;
|
|
73
|
+
gap: 1rem;
|
|
74
|
+
padding: 0.75rem var(--ux-gutter) 1rem;
|
|
75
|
+
font-family: var(--font-ux-mono);
|
|
76
|
+
font-size: 0.75rem;
|
|
77
|
+
letter-spacing: 0.04em;
|
|
78
|
+
color: var(--ux-fg-2);
|
|
79
|
+
background: linear-gradient(0deg, rgb(5 5 7 / 0.8), rgb(5 5 7 / 0));
|
|
80
|
+
pointer-events: none;
|
|
79
81
|
}
|
|
80
82
|
|
|
81
83
|
.ux-hud p {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
display: flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
gap: 0.75rem;
|
|
87
|
+
margin: 0;
|
|
88
|
+
white-space: nowrap;
|
|
87
89
|
}
|
|
88
90
|
|
|
89
91
|
.ux-hud__led {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
width: 6px;
|
|
93
|
+
height: 6px;
|
|
94
|
+
border-radius: 50%;
|
|
95
|
+
background: var(--ux-fg-3);
|
|
94
96
|
}
|
|
95
97
|
|
|
96
98
|
.ux-hud__led[data-status="ready"] {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
+
background: #7dffb2;
|
|
100
|
+
box-shadow: 0 0 10px #7dffb2;
|
|
99
101
|
}
|
|
100
102
|
|
|
101
103
|
.ux-hud__led[data-status="loading"] {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
+
background: #ffd27d;
|
|
105
|
+
animation: blink 1s steps(2) infinite;
|
|
104
106
|
}
|
|
105
107
|
|
|
106
108
|
.ux-hud__chapter {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
+
justify-self: center;
|
|
110
|
+
text-transform: uppercase;
|
|
109
111
|
}
|
|
110
112
|
|
|
111
113
|
.ux-hud__bar {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
114
|
+
position: relative;
|
|
115
|
+
width: clamp(4rem, 12vw, 10rem);
|
|
116
|
+
height: 1px;
|
|
117
|
+
background: var(--ux-line-strong);
|
|
118
|
+
overflow: hidden;
|
|
117
119
|
}
|
|
118
120
|
|
|
119
121
|
.ux-hud__fill {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
122
|
+
position: absolute;
|
|
123
|
+
inset: 0;
|
|
124
|
+
background: var(--ux-fg);
|
|
125
|
+
transform: scaleX(var(--ux-progress, 0));
|
|
126
|
+
transform-origin: left;
|
|
125
127
|
}
|
|
126
128
|
|
|
127
129
|
.ux-hud__label {
|
|
128
|
-
|
|
130
|
+
color: var(--ux-fg);
|
|
129
131
|
}
|
|
130
132
|
|
|
131
133
|
.ux-hud__motion {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
134
|
+
justify-self: end;
|
|
135
|
+
display: inline-flex;
|
|
136
|
+
align-items: center;
|
|
137
|
+
gap: 0.6rem;
|
|
138
|
+
min-height: 2.75rem;
|
|
139
|
+
padding: 0 0.25rem;
|
|
140
|
+
font: inherit;
|
|
141
|
+
letter-spacing: inherit;
|
|
142
|
+
text-transform: uppercase;
|
|
143
|
+
color: var(--ux-fg-2);
|
|
144
|
+
background: none;
|
|
145
|
+
border: 0;
|
|
146
|
+
cursor: pointer;
|
|
147
|
+
pointer-events: auto;
|
|
148
|
+
transition: color 0.3s var(--ux-ease-out);
|
|
147
149
|
}
|
|
148
150
|
|
|
149
151
|
.ux-hud__motion:hover,
|
|
150
152
|
.ux-hud__motion[aria-pressed="true"] {
|
|
151
|
-
|
|
153
|
+
color: var(--ux-fg);
|
|
152
154
|
}
|
|
153
155
|
|
|
154
156
|
.ux-hud__wave {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
157
|
+
display: inline-flex;
|
|
158
|
+
align-items: flex-end;
|
|
159
|
+
gap: 2px;
|
|
160
|
+
height: 12px;
|
|
159
161
|
}
|
|
160
162
|
|
|
161
163
|
.ux-hud__wave i {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
164
|
+
width: 2px;
|
|
165
|
+
height: 100%;
|
|
166
|
+
background: currentColor;
|
|
167
|
+
transform-origin: bottom;
|
|
168
|
+
transform: scaleY(0.25);
|
|
167
169
|
}
|
|
168
170
|
|
|
169
171
|
.ux-hud__wave[data-on="true"] i {
|
|
170
|
-
|
|
172
|
+
animation: wave 1.1s var(--ux-ease-in-out) infinite alternate;
|
|
171
173
|
}
|
|
172
174
|
|
|
173
175
|
.ux-hud__wave i:nth-child(2) {
|
|
174
|
-
|
|
176
|
+
animation-delay: -0.3s;
|
|
175
177
|
}
|
|
176
178
|
|
|
177
179
|
.ux-hud__wave i:nth-child(3) {
|
|
178
|
-
|
|
180
|
+
animation-delay: -0.6s;
|
|
179
181
|
}
|
|
180
182
|
|
|
181
183
|
.ux-hud__wave i:nth-child(4) {
|
|
182
|
-
|
|
184
|
+
animation-delay: -0.9s;
|
|
183
185
|
}
|
|
184
186
|
|
|
185
187
|
@keyframes wave {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
188
|
+
to {
|
|
189
|
+
transform: scaleY(1);
|
|
190
|
+
}
|
|
189
191
|
}
|
|
190
192
|
|
|
191
193
|
@keyframes blink {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
194
|
+
50% {
|
|
195
|
+
opacity: 0.2;
|
|
196
|
+
}
|
|
195
197
|
}
|
|
196
198
|
|
|
197
199
|
/* Where the copy scrolls under the HUD (see UxHeader), a solid band. */
|
|
198
200
|
@media (max-width: 1099px), (max-aspect-ratio: 5/4) {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
201
|
+
.ux-hud {
|
|
202
|
+
padding-top: 1.5rem;
|
|
203
|
+
background: linear-gradient(0deg, rgb(5 5 7 / 0.96), rgb(5 5 7 / 0.9) 55%, rgb(5 5 7 / 0));
|
|
204
|
+
}
|
|
203
205
|
}
|
|
204
206
|
|
|
205
207
|
@media (max-width: 760px) {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
208
|
+
.ux-hud {
|
|
209
|
+
grid-template-columns: 1fr auto;
|
|
210
|
+
}
|
|
209
211
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
212
|
+
.ux-hud__stats {
|
|
213
|
+
display: none !important;
|
|
214
|
+
}
|
|
213
215
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
216
|
+
.ux-hud__chapter {
|
|
217
|
+
justify-self: start;
|
|
218
|
+
}
|
|
217
219
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
220
|
+
.ux-hud__bar {
|
|
221
|
+
display: none;
|
|
222
|
+
}
|
|
221
223
|
}
|
|
222
224
|
|
|
223
225
|
@media (prefers-reduced-motion: reduce) {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
226
|
+
.ux-hud__wave i,
|
|
227
|
+
.ux-hud__led {
|
|
228
|
+
animation: none !important;
|
|
229
|
+
}
|
|
228
230
|
}
|
|
229
231
|
</style>
|
|
@@ -3,75 +3,75 @@ import { vScramble } from "../directives/scramble";
|
|
|
3
3
|
import UxArrowIcon from "./icons/UxArrowIcon.vue";
|
|
4
4
|
|
|
5
5
|
const {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
variant = "outline",
|
|
7
|
+
arrow = true,
|
|
8
|
+
scramble = true,
|
|
9
9
|
} = defineProps<{
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
href: string;
|
|
11
|
+
label: string;
|
|
12
|
+
/** An outline pill that fills on hover, or a pill filled from the start. */
|
|
13
|
+
variant?: "outline" | "filled";
|
|
14
|
+
/** An arrow pointing out of the page, nudged on hover. */
|
|
15
|
+
arrow?: boolean;
|
|
16
|
+
/** Decodes the label through random glyphs on hover and focus. */
|
|
17
|
+
scramble?: boolean;
|
|
18
18
|
}>();
|
|
19
19
|
|
|
20
20
|
defineSlots<{
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
/** In place of the arrow, sized like it, like `UxStarIcon`. */
|
|
22
|
+
icon?(): unknown;
|
|
23
23
|
}>();
|
|
24
24
|
</script>
|
|
25
25
|
|
|
26
26
|
<template>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
<a class="ux-pill-link" :class="{ 'ux-pill-link--filled': variant === 'filled' }" :href="href">
|
|
28
|
+
<span v-if="scramble" v-scramble>{{ label }}</span>
|
|
29
|
+
<span v-else>{{ label }}</span>
|
|
30
|
+
<slot name="icon"><UxArrowIcon v-if="arrow" class="ux-pill-link__arrow" /></slot>
|
|
31
|
+
</a>
|
|
32
32
|
</template>
|
|
33
33
|
|
|
34
34
|
<style scoped>
|
|
35
35
|
/* `a.` outranks the reveal transition on `[data-reveal] > *`, so a revealed
|
|
36
36
|
link keeps its own hover transitions. */
|
|
37
37
|
a.ux-pill-link {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
38
|
+
display: inline-flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
gap: 0.75rem;
|
|
41
|
+
min-height: 3rem;
|
|
42
|
+
padding: 0 1.25rem;
|
|
43
|
+
font-family: var(--font-ux-mono);
|
|
44
|
+
font-size: 0.8125rem;
|
|
45
|
+
letter-spacing: 0.04em;
|
|
46
|
+
color: var(--ux-fg);
|
|
47
|
+
text-decoration: none;
|
|
48
|
+
border: 1px solid var(--ux-line-strong);
|
|
49
|
+
border-radius: 999px;
|
|
50
|
+
transition:
|
|
51
|
+
background 0.4s var(--ux-ease-out),
|
|
52
|
+
color 0.4s var(--ux-ease-out),
|
|
53
|
+
border-color 0.4s var(--ux-ease-out);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
.ux-pill-link__arrow,
|
|
57
57
|
.ux-pill-link :slotted(svg) {
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
width: 1rem;
|
|
59
|
+
height: 1rem;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
.ux-pill-link__arrow {
|
|
63
|
-
|
|
63
|
+
transition: transform 0.4s var(--ux-ease-out);
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
/* A filled pill wears the outline pill's hover colours, at rest and on hover. */
|
|
67
67
|
.ux-pill-link:hover,
|
|
68
68
|
a.ux-pill-link--filled {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
color: var(--ux-bg);
|
|
70
|
+
background: var(--ux-fg);
|
|
71
|
+
border-color: var(--ux-fg);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
.ux-pill-link:hover .ux-pill-link__arrow {
|
|
75
|
-
|
|
75
|
+
transform: translate(2px, -2px);
|
|
76
76
|
}
|
|
77
77
|
</style>
|
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { UxPillar } from "../types";
|
|
3
3
|
|
|
4
|
-
defineProps<{ items: UxPillar
|
|
4
|
+
defineProps<{ items: Array<UxPillar> }>();
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
7
|
<template>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
8
|
+
<!-- Rows that light up one after another (set `steps` on the UxChapter). -->
|
|
9
|
+
<dl class="ux-pillars">
|
|
10
|
+
<div v-for="(item, i) in items" :key="item.code" class="ux-pillar" :data-step-item="i">
|
|
11
|
+
<dt class="ux-mono">{{ item.code }}</dt>
|
|
12
|
+
<dd>
|
|
13
|
+
<strong>{{ item.title }}</strong>
|
|
14
|
+
<p>{{ item.text }}</p>
|
|
15
|
+
</dd>
|
|
16
|
+
</div>
|
|
17
|
+
</dl>
|
|
18
18
|
</template>
|
|
19
19
|
|
|
20
20
|
<style scoped>
|
|
21
21
|
.ux-pillars {
|
|
22
|
-
|
|
22
|
+
display: grid;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
.ux-pillar {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
display: grid;
|
|
27
|
+
grid-template-columns: 3rem 1fr;
|
|
28
|
+
gap: 1rem;
|
|
29
|
+
padding: 0.9rem 0;
|
|
30
|
+
border-top: 1px solid
|
|
31
|
+
color-mix(in srgb, var(--ux-fg) calc(10% + var(--active, 0) * 45%), transparent);
|
|
32
|
+
color: color-mix(in srgb, var(--ux-fg) calc(var(--active, 0) * 100%), var(--ux-fg-3));
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
.ux-pillar dt {
|
|
36
|
-
|
|
36
|
+
padding-top: 0.2rem;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
.ux-pillar dt,
|
|
40
40
|
.ux-pillar strong {
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
font-weight: 500;
|
|
42
|
+
color: color-mix(in srgb, var(--ux-fg) calc(var(--active, 0) * 100%), var(--ux-fg-2));
|
|
43
43
|
}
|
|
44
44
|
</style>
|