@uxfront/ui 0.7.0 → 0.9.0

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 CHANGED
@@ -89,10 +89,11 @@ const scene = [
89
89
  | `UxSplit` | A chapter with its code or a picture beside the copy: `UxChapter`'s eyebrow, `title`, `lead` slot, details, link and `steps`, plus an `aside` slot. Side by side, the copy takes `UxChapter`'s width and the aside centres on the frame's three-quarter line, at most `52rem` wide; on stacked screens the aside goes below the copy. `align="center"` centres the copy in one column, for a split with no aside. |
90
90
  | `UxSection` | A section with a chapter's heading (`index`, `role`, `title`, `lead` slot) over a `72rem` panel, for wide content like plans or an FAQ. |
91
91
  | `UxPillars`, `UxChips`, `UxTraits`, `UxSpec` | Chapter details that light up one after another (set `steps` on the chapter to their count). |
92
+ | `UxFeatures` | A full-width strip of title-and-text columns that goes after a section. It takes `UxTrait` `items` and stays static, so it has no `steps`. An item with an `href` is a link, with no arrow. |
92
93
  | `UxCode` | A code panel captioned with its `title`, for a split's aside. Pass plain text as `code`, or highlighted markup, like Shiki's, in the default slot: it takes the dark theme's colours and scrolls past `70svh`. |
93
94
  | `UxVideo` | A muted, looping video (`src`, `poster`, `width`, `height`, `label`) that loads and plays once it scrolls into view and pauses out of view. With reduced motion, or Motion off in the HUD, it pauses and shows its controls. It takes its container's width, and a class on it sets another. |
94
95
  | `UxHeader` | Brand (`mark` slot, `UxFrontMark` by default, empty for none; `brand` slot to style the name), a `byline` slot beside it for links like "by UXFront", section nav (marks the one held), an `actions` slot for extra links and a GitHub link (with an optional `githubStars` count). |
95
- | `UxHud` | Particle count and fps, the chapter counter and progress, and the Motion toggle. |
96
+ | `UxHud` | Particle count and fps, the chapter counter and progress, and the Motion toggle. Its words are props, so a page in another language can translate them: `motionLabel`, `particlesLabel`, `loadingLabel`, `fallbackLabel` and the count's `locale` (`en-US` by default). |
96
97
  | `UxAnchor` | A label pinned to a formation anchor, like `plates:0`: `callout`, `tag` or `button` (put buttons in the `controls` slot). |
97
98
  | `UxPillLink`, `UxErrorPage`, icons | The scrambled pill link, a full error page, and `UxArrowIcon`, `UxGithubIcon`, `UxStarIcon`, `UxFrameworkLogo`, `UxFrontMark`. |
98
99
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxfront/ui",
3
- "version": "0.7.0",
3
+ "version": "0.9.0",
4
4
  "description": "Vue components for the uxfront.com family of homepages: a scroll-driven WebGL scene with pinned chapters, a HUD, a header and a finale, in one look.",
5
5
  "keywords": [
6
6
  "components",
@@ -0,0 +1,121 @@
1
+ <script setup lang="ts">
2
+ import type { UxTrait } from "../types";
3
+
4
+ defineProps<{ items: UxTrait[] }>();
5
+ </script>
6
+
7
+ <template>
8
+ <!-- A strip of features: columns of a title over muted text, split by
9
+ hairlines, on a scrim that keeps it legible over the scene. A cell with
10
+ `href` is a link. -->
11
+ <ul class="ux-features">
12
+ <template v-for="item in items" :key="item.title">
13
+ <li v-if="item.href" class="ux-features__linked">
14
+ <a class="ux-features__link" :href="item.href">
15
+ <strong>{{ item.title }}</strong>
16
+ <span>{{ item.text }}</span>
17
+ </a>
18
+ </li>
19
+ <li v-else>
20
+ <strong>{{ item.title }}</strong>
21
+ <span>{{ item.text }}</span>
22
+ </li>
23
+ </template>
24
+ </ul>
25
+ </template>
26
+
27
+ <style scoped>
28
+ .ux-features {
29
+ --ux-features-inset: clamp(1rem, 2.5vw, 3rem);
30
+ display: grid;
31
+ grid-template-columns: repeat(3, minmax(0, 1fr));
32
+ row-gap: 2rem;
33
+ padding: 3rem var(--ux-gutter);
34
+ list-style: none;
35
+ background: rgb(5 5 7 / 0.82);
36
+ backdrop-filter: blur(12px);
37
+ text-shadow: none;
38
+ }
39
+
40
+ /* The hairline, and the inset after it. The first cell of a row has neither,
41
+ so its text starts at the gutter, under the section's heading. */
42
+ .ux-features li {
43
+ --ux-features-start: var(--ux-features-inset);
44
+ border-left: 1px solid var(--ux-line);
45
+ }
46
+
47
+ .ux-features li:nth-child(3n + 1) {
48
+ --ux-features-start: 0;
49
+ border-left: 0;
50
+ }
51
+
52
+ .ux-features li,
53
+ .ux-features__link {
54
+ display: grid;
55
+ align-content: start;
56
+ gap: 0.4rem;
57
+ padding: 0.25rem var(--ux-features-inset) 0.25rem var(--ux-features-start);
58
+ font-size: 0.875rem;
59
+ line-height: 1.45;
60
+ color: var(--ux-fg-3);
61
+ }
62
+
63
+ /* A linked cell is the link, edge to edge. */
64
+ .ux-features .ux-features__linked {
65
+ display: block;
66
+ padding: 0;
67
+ }
68
+
69
+ .ux-features__link {
70
+ height: 100%;
71
+ text-decoration: none;
72
+ }
73
+
74
+ .ux-features strong {
75
+ font-size: 1rem;
76
+ font-weight: 500;
77
+ letter-spacing: -0.01em;
78
+ color: var(--ux-fg);
79
+ }
80
+
81
+ .ux-features span {
82
+ text-wrap: pretty;
83
+ transition: color 0.3s var(--ux-ease-out);
84
+ }
85
+
86
+ .ux-features__link:hover span {
87
+ color: var(--ux-fg-2);
88
+ }
89
+
90
+ /* STACKED_QUERY in @uxfront/scene: two columns, on the screens the scene
91
+ stacks. */
92
+ @media (max-aspect-ratio: 5/4), (max-width: 1099px) and (max-aspect-ratio: 8/5) {
93
+ .ux-features {
94
+ grid-template-columns: repeat(2, minmax(0, 1fr));
95
+ }
96
+
97
+ .ux-features li:nth-child(n) {
98
+ --ux-features-start: var(--ux-features-inset);
99
+ border-left: 1px solid var(--ux-line);
100
+ }
101
+
102
+ .ux-features li:nth-child(2n + 1) {
103
+ --ux-features-start: 0;
104
+ border-left: 0;
105
+ }
106
+ }
107
+
108
+ /* Six cells have to stay short on a phone, so the spacing tightens. */
109
+ @media (max-width: 760px) {
110
+ .ux-features {
111
+ --ux-features-inset: 0;
112
+ grid-template-columns: minmax(0, 1fr);
113
+ row-gap: 1rem;
114
+ padding-block: 2rem;
115
+ }
116
+
117
+ .ux-features li:nth-child(n) {
118
+ border-left: 0;
119
+ }
120
+ }
121
+ </style>
@@ -3,16 +3,35 @@ import { computed } from "vue";
3
3
 
4
4
  import { useExperience } from "../composables/experience";
5
5
 
6
+ const {
7
+ motionLabel = "Motion",
8
+ particlesLabel = "particles",
9
+ loadingLabel = "Warming up the GPU",
10
+ fallbackLabel = "Static mode",
11
+ locale = "en-US",
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;
23
+ }>();
24
+
6
25
  const { state, labels, setMotion } = useExperience();
7
26
 
8
27
  const pad = (n: number) => String(n).padStart(2, "0");
9
28
 
10
29
  const stats = computed(() => {
11
30
  if (state.status === "ready") {
12
- return `${state.particles.toLocaleString("en-US")} particles · ${state.fps} fps`;
31
+ return `${state.particles.toLocaleString(locale)} ${particlesLabel} · ${state.fps} fps`;
13
32
  }
14
- if (state.status === "fallback") return "Static mode";
15
- return "Warming up the GPU";
33
+ if (state.status === "fallback") return fallbackLabel;
34
+ return loadingLabel;
16
35
  });
17
36
  </script>
18
37
 
@@ -36,7 +55,7 @@ const stats = computed(() => {
36
55
  <span class="ux-hud__wave" :data-on="state.motion" aria-hidden="true">
37
56
  <i v-for="n in 4" :key="n" />
38
57
  </span>
39
- Motion
58
+ {{ motionLabel }}
40
59
  </button>
41
60
  </div>
42
61
  </template>
package/src/index.ts CHANGED
@@ -3,6 +3,7 @@ export { default as UxChapter } from "./components/UxChapter.vue";
3
3
  export { default as UxChips } from "./components/UxChips.vue";
4
4
  export { default as UxCode } from "./components/UxCode.vue";
5
5
  export { default as UxErrorPage } from "./components/UxErrorPage.vue";
6
+ export { default as UxFeatures } from "./components/UxFeatures.vue";
6
7
  export { default as UxFinale } from "./components/UxFinale.vue";
7
8
  export { default as UxHeader } from "./components/UxHeader.vue";
8
9
  export { default as UxHero } from "./components/UxHero.vue";
package/src/types.ts CHANGED
@@ -26,7 +26,7 @@ export interface UxChip {
26
26
  export interface UxTrait {
27
27
  title: string;
28
28
  text: string;
29
- /** Makes the cell a link, with an arrow after its title. A plain `<a>`, so it loads the page. */
29
+ /** Makes the cell a link, and `UxTraits` adds an arrow. A plain `<a>`, so it loads the page. */
30
30
  href?: string;
31
31
  }
32
32