@uxfront/ui 0.8.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
@@ -93,7 +93,7 @@ const scene = [
93
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`. |
94
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. |
95
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). |
96
- | `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). |
97
97
  | `UxAnchor` | A label pinned to a formation anchor, like `plates:0`: `callout`, `tag` or `button` (put buttons in the `controls` slot). |
98
98
  | `UxPillLink`, `UxErrorPage`, icons | The scrambled pill link, a full error page, and `UxArrowIcon`, `UxGithubIcon`, `UxStarIcon`, `UxFrameworkLogo`, `UxFrontMark`. |
99
99
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxfront/ui",
3
- "version": "0.8.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",
@@ -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>