@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.
Files changed (34) hide show
  1. package/README.md +46 -46
  2. package/package.json +4 -4
  3. package/src/components/UxAnchor.vue +100 -100
  4. package/src/components/UxChapter.vue +157 -157
  5. package/src/components/UxChips.vue +32 -32
  6. package/src/components/UxCode.vue +42 -42
  7. package/src/components/UxErrorPage.vue +37 -37
  8. package/src/components/UxFeatures.vue +70 -70
  9. package/src/components/UxFinale.vue +148 -148
  10. package/src/components/UxHeader.vue +171 -171
  11. package/src/components/UxHero.vue +179 -179
  12. package/src/components/UxHeroLine.vue +18 -18
  13. package/src/components/UxHud.vue +139 -137
  14. package/src/components/UxPillLink.vue +41 -41
  15. package/src/components/UxPillars.vue +22 -22
  16. package/src/components/UxSection.vue +60 -60
  17. package/src/components/UxSite.vue +52 -48
  18. package/src/components/UxSpec.vue +21 -21
  19. package/src/components/UxSplit.vue +138 -138
  20. package/src/components/UxStage.vue +40 -38
  21. package/src/components/UxStageFallback.vue +28 -28
  22. package/src/components/UxTraits.vue +55 -55
  23. package/src/components/UxVideo.vue +50 -40
  24. package/src/components/icons/UxArrowIcon.vue +4 -4
  25. package/src/components/icons/UxFrameworkLogo.vue +4 -4
  26. package/src/components/icons/UxFrontMark.vue +10 -10
  27. package/src/components/icons/UxGithubIcon.vue +6 -6
  28. package/src/components/icons/UxStarIcon.vue +6 -6
  29. package/src/composables/experience.ts +58 -53
  30. package/src/directives/scramble.ts +41 -37
  31. package/src/frameworks.ts +12 -12
  32. package/src/styles/base.css +88 -88
  33. package/src/styles/tokens.css +28 -28
  34. package/src/types.ts +26 -26
@@ -4,22 +4,22 @@ import { computed } from "vue";
4
4
  import { useExperience } from "../composables/experience";
5
5
 
6
6
  const {
7
- motionLabel = "Motion",
8
- particlesLabel = "particles",
9
- loadingLabel = "Warming up the GPU",
10
- fallbackLabel = "Static mode",
11
- locale = "en-US",
7
+ motionLabel = "Motion",
8
+ particlesLabel = "particles",
9
+ loadingLabel = "Warming up the GPU",
10
+ fallbackLabel = "Static mode",
11
+ locale = "en-US",
12
12
  } = defineProps<{
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;
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
- if (state.status === "ready") {
31
- return `${state.particles.toLocaleString(locale)} ${particlesLabel} · ${state.fps} fps`;
32
- }
33
- if (state.status === "fallback") return fallbackLabel;
34
- return loadingLabel;
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
- <div class="ux-hud">
40
- <p class="ux-hud__stats" aria-hidden="true">
41
- <span class="ux-hud__led" :data-status="state.status" />
42
- {{ stats }}
43
- </p>
44
- <p class="ux-hud__chapter" aria-hidden="true">
45
- <span>{{ pad(state.chapter + 1) }} / {{ pad(labels.length) }}</span>
46
- <span class="ux-hud__bar"><span class="ux-hud__fill" data-progress /></span>
47
- <span class="ux-hud__label">{{ labels[state.chapter] }}</span>
48
- </p>
49
- <button
50
- type="button"
51
- class="ux-hud__motion"
52
- :aria-pressed="state.motion"
53
- @click="setMotion(!state.motion)"
54
- >
55
- <span class="ux-hud__wave" :data-on="state.motion" aria-hidden="true">
56
- <i v-for="n in 4" :key="n" />
57
- </span>
58
- {{ motionLabel }}
59
- </button>
60
- </div>
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
- position: fixed;
66
- inset: auto 0 0;
67
- z-index: 20;
68
- display: grid;
69
- grid-template-columns: 1fr auto 1fr;
70
- align-items: center;
71
- gap: 1rem;
72
- padding: 0.75rem var(--ux-gutter) 1rem;
73
- font-family: var(--font-ux-mono);
74
- font-size: 0.75rem;
75
- letter-spacing: 0.04em;
76
- color: var(--ux-fg-2);
77
- background: linear-gradient(0deg, rgb(5 5 7 / 0.8), rgb(5 5 7 / 0));
78
- pointer-events: none;
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
- display: flex;
83
- align-items: center;
84
- gap: 0.75rem;
85
- margin: 0;
86
- white-space: nowrap;
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
- width: 6px;
91
- height: 6px;
92
- border-radius: 50%;
93
- background: var(--ux-fg-3);
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
- background: #7dffb2;
98
- box-shadow: 0 0 10px #7dffb2;
99
+ background: #7dffb2;
100
+ box-shadow: 0 0 10px #7dffb2;
99
101
  }
100
102
 
101
103
  .ux-hud__led[data-status="loading"] {
102
- background: #ffd27d;
103
- animation: blink 1s steps(2) infinite;
104
+ background: #ffd27d;
105
+ animation: blink 1s steps(2) infinite;
104
106
  }
105
107
 
106
108
  .ux-hud__chapter {
107
- justify-self: center;
108
- text-transform: uppercase;
109
+ justify-self: center;
110
+ text-transform: uppercase;
109
111
  }
110
112
 
111
113
  .ux-hud__bar {
112
- position: relative;
113
- width: clamp(4rem, 12vw, 10rem);
114
- height: 1px;
115
- background: var(--ux-line-strong);
116
- overflow: hidden;
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
- position: absolute;
121
- inset: 0;
122
- background: var(--ux-fg);
123
- transform: scaleX(var(--ux-progress, 0));
124
- transform-origin: left;
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
- color: var(--ux-fg);
130
+ color: var(--ux-fg);
129
131
  }
130
132
 
131
133
  .ux-hud__motion {
132
- justify-self: end;
133
- display: inline-flex;
134
- align-items: center;
135
- gap: 0.6rem;
136
- min-height: 2.75rem;
137
- padding: 0 0.25rem;
138
- font: inherit;
139
- letter-spacing: inherit;
140
- text-transform: uppercase;
141
- color: var(--ux-fg-2);
142
- background: none;
143
- border: 0;
144
- cursor: pointer;
145
- pointer-events: auto;
146
- transition: color 0.3s var(--ux-ease-out);
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
- color: var(--ux-fg);
153
+ color: var(--ux-fg);
152
154
  }
153
155
 
154
156
  .ux-hud__wave {
155
- display: inline-flex;
156
- align-items: flex-end;
157
- gap: 2px;
158
- height: 12px;
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
- width: 2px;
163
- height: 100%;
164
- background: currentColor;
165
- transform-origin: bottom;
166
- transform: scaleY(0.25);
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
- animation: wave 1.1s var(--ux-ease-in-out) infinite alternate;
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
- animation-delay: -0.3s;
176
+ animation-delay: -0.3s;
175
177
  }
176
178
 
177
179
  .ux-hud__wave i:nth-child(3) {
178
- animation-delay: -0.6s;
180
+ animation-delay: -0.6s;
179
181
  }
180
182
 
181
183
  .ux-hud__wave i:nth-child(4) {
182
- animation-delay: -0.9s;
184
+ animation-delay: -0.9s;
183
185
  }
184
186
 
185
187
  @keyframes wave {
186
- to {
187
- transform: scaleY(1);
188
- }
188
+ to {
189
+ transform: scaleY(1);
190
+ }
189
191
  }
190
192
 
191
193
  @keyframes blink {
192
- 50% {
193
- opacity: 0.2;
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
- .ux-hud {
200
- padding-top: 1.5rem;
201
- background: linear-gradient(0deg, rgb(5 5 7 / 0.96), rgb(5 5 7 / 0.9) 55%, rgb(5 5 7 / 0));
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
- .ux-hud {
207
- grid-template-columns: 1fr auto;
208
- }
208
+ .ux-hud {
209
+ grid-template-columns: 1fr auto;
210
+ }
209
211
 
210
- .ux-hud__stats {
211
- display: none !important;
212
- }
212
+ .ux-hud__stats {
213
+ display: none !important;
214
+ }
213
215
 
214
- .ux-hud__chapter {
215
- justify-self: start;
216
- }
216
+ .ux-hud__chapter {
217
+ justify-self: start;
218
+ }
217
219
 
218
- .ux-hud__bar {
219
- display: none;
220
- }
220
+ .ux-hud__bar {
221
+ display: none;
222
+ }
221
223
  }
222
224
 
223
225
  @media (prefers-reduced-motion: reduce) {
224
- .ux-hud__wave i,
225
- .ux-hud__led {
226
- animation: none !important;
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
- variant = "outline",
7
- arrow = true,
8
- scramble = true,
6
+ variant = "outline",
7
+ arrow = true,
8
+ scramble = true,
9
9
  } = defineProps<{
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;
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
- /** In place of the arrow, sized like it, like `UxStarIcon`. */
22
- icon?(): unknown;
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
- <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>
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
- 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);
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
- width: 1rem;
59
- height: 1rem;
58
+ width: 1rem;
59
+ height: 1rem;
60
60
  }
61
61
 
62
62
  .ux-pill-link__arrow {
63
- transition: transform 0.4s var(--ux-ease-out);
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
- color: var(--ux-bg);
70
- background: var(--ux-fg);
71
- border-color: var(--ux-fg);
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
- transform: translate(2px, -2px);
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
- <!-- 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>
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
- display: grid;
22
+ display: grid;
23
23
  }
24
24
 
25
25
  .ux-pillar {
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));
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
- padding-top: 0.2rem;
36
+ padding-top: 0.2rem;
37
37
  }
38
38
 
39
39
  .ux-pillar dt,
40
40
  .ux-pillar strong {
41
- font-weight: 500;
42
- color: color-mix(in srgb, var(--ux-fg) calc(var(--active, 0) * 100%), var(--ux-fg-2));
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>