@uxfront/ui 0.3.0 → 0.4.1
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 +11 -11
- package/package.json +2 -2
- package/src/components/UxHeader.vue +34 -1
- package/src/components/icons/UxStarIcon.vue +8 -0
- package/src/index.ts +1 -0
package/README.md
CHANGED
|
@@ -80,17 +80,17 @@ const scene = [
|
|
|
80
80
|
|
|
81
81
|
## Components
|
|
82
82
|
|
|
83
|
-
| Component | Role
|
|
84
|
-
| -------------------------------------------- |
|
|
85
|
-
| `UxSite` | The page root. Takes the `scene` (one formation per section), starts it on mount and brings the base styles. Slots: `header`, `hud` (defaults to `UxHud`), `anchors`, `controls`, `fallback` and the sections.
|
|
86
|
-
| `UxHero` | The first section: kicker (with an optional `badge`, like "New"), a title in `UxHeroLine`s (with `title` for assistive technology), a lead, an index of sections for small screens and a scroll cue.
|
|
87
|
-
| `UxChapter` | A pinned section: eyebrow (`index`, `role`), `title`, `lead` slot, details and a link. `align="end"` puts the copy on the right, `valign="end"` at the bottom, `steps` highlights details one by one.
|
|
88
|
-
| `UxFinale` | The closing section: a large `mark` slot, kicker, `title`, `lead`, an `actions` slot (buttons), a grid of link `cards` and a `footer`.
|
|
89
|
-
| `UxPillars`, `UxChips`, `UxTraits`, `UxSpec` | Chapter details that light up one after another (set `steps` on the chapter to their count).
|
|
90
|
-
| `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. |
|
|
91
|
-
| `UxHud` | Particle count and fps, the chapter counter and progress, and the Motion toggle.
|
|
92
|
-
| `UxAnchor` | A label pinned to a formation anchor, like `plates:0`: `callout`, `tag` or `button` (put buttons in the `controls` slot).
|
|
93
|
-
| `UxPillLink`, `UxErrorPage`, icons | The scrambled pill link, a full error page, and `UxArrowIcon`, `UxGithubIcon`, `UxFrameworkLogo`, `UxFrontMark`.
|
|
83
|
+
| Component | Role |
|
|
84
|
+
| -------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
85
|
+
| `UxSite` | The page root. Takes the `scene` (one formation per section), starts it on mount and brings the base styles. Slots: `header`, `hud` (defaults to `UxHud`), `anchors`, `controls`, `fallback` and the sections. |
|
|
86
|
+
| `UxHero` | The first section: kicker (with an optional `badge`, like "New"), a title in `UxHeroLine`s (with `title` for assistive technology), a lead, an index of sections for small screens and a scroll cue. |
|
|
87
|
+
| `UxChapter` | A pinned section: eyebrow (`index`, `role`), `title`, `lead` slot, details and a link. `align="end"` puts the copy on the right, `valign="end"` at the bottom, `steps` highlights details one by one. |
|
|
88
|
+
| `UxFinale` | The closing section: a large `mark` slot, kicker, `title`, `lead`, an `actions` slot (buttons), a grid of link `cards` and a `footer`. |
|
|
89
|
+
| `UxPillars`, `UxChips`, `UxTraits`, `UxSpec` | Chapter details that light up one after another (set `steps` on the chapter to their count). |
|
|
90
|
+
| `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). |
|
|
91
|
+
| `UxHud` | Particle count and fps, the chapter counter and progress, and the Motion toggle. |
|
|
92
|
+
| `UxAnchor` | A label pinned to a formation anchor, like `plates:0`: `callout`, `tag` or `button` (put buttons in the `controls` slot). |
|
|
93
|
+
| `UxPillLink`, `UxErrorPage`, icons | The scrambled pill link, a full error page, and `UxArrowIcon`, `UxGithubIcon`, `UxStarIcon`, `UxFrameworkLogo`, `UxFrontMark`. |
|
|
94
94
|
|
|
95
95
|
Also exported: `useExperience()` (the scene's reactive state inside a `UxSite`), the `v-scramble` directive, `FRAMEWORKS` and their logos, and `uxRenderHookKey`.
|
|
96
96
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxfront/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
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",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@uxfront/scene": "^0.
|
|
42
|
+
"@uxfront/scene": "^0.2.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@uxfront/typescript-config": "0.1.0",
|
|
@@ -3,6 +3,7 @@ import { useExperience } from "../composables/experience";
|
|
|
3
3
|
import type { UxNavItem } from "../types";
|
|
4
4
|
import UxFrontMark from "./icons/UxFrontMark.vue";
|
|
5
5
|
import UxGithubIcon from "./icons/UxGithubIcon.vue";
|
|
6
|
+
import UxStarIcon from "./icons/UxStarIcon.vue";
|
|
6
7
|
|
|
7
8
|
const {
|
|
8
9
|
homeHref = "#top",
|
|
@@ -18,6 +19,8 @@ const {
|
|
|
18
19
|
navLabel?: string;
|
|
19
20
|
/** A GitHub URL, linked at the end of the header. */
|
|
20
21
|
github?: string;
|
|
22
|
+
/** The repository's star count, shown beside the GitHub link. Leave it out to hide it. */
|
|
23
|
+
githubStars?: number;
|
|
21
24
|
}>();
|
|
22
25
|
|
|
23
26
|
defineSlots<{
|
|
@@ -35,6 +38,9 @@ defineSlots<{
|
|
|
35
38
|
}>();
|
|
36
39
|
|
|
37
40
|
const { state } = useExperience();
|
|
41
|
+
|
|
42
|
+
const compact = new Intl.NumberFormat("en", { notation: "compact" });
|
|
43
|
+
const full = new Intl.NumberFormat("en");
|
|
38
44
|
</script>
|
|
39
45
|
|
|
40
46
|
<template>
|
|
@@ -70,9 +76,18 @@ const { state } = useExperience();
|
|
|
70
76
|
</nav>
|
|
71
77
|
<div v-if="$slots.actions || github" class="ux-header__end">
|
|
72
78
|
<slot name="actions" />
|
|
73
|
-
<a
|
|
79
|
+
<a
|
|
80
|
+
v-if="github"
|
|
81
|
+
class="ux-header__github"
|
|
82
|
+
:href="github"
|
|
83
|
+
:aria-label="githubStars == null ? undefined : `GitHub, ${full.format(githubStars)} stars`"
|
|
84
|
+
>
|
|
74
85
|
<UxGithubIcon />
|
|
75
86
|
<span>GitHub</span>
|
|
87
|
+
<span v-if="githubStars != null" class="ux-header__stars">
|
|
88
|
+
<UxStarIcon />
|
|
89
|
+
{{ compact.format(githubStars) }}
|
|
90
|
+
</span>
|
|
76
91
|
</a>
|
|
77
92
|
</div>
|
|
78
93
|
</header>
|
|
@@ -222,6 +237,24 @@ const { state } = useExperience();
|
|
|
222
237
|
height: 1.125rem;
|
|
223
238
|
}
|
|
224
239
|
|
|
240
|
+
.ux-header__stars {
|
|
241
|
+
display: inline-flex;
|
|
242
|
+
align-items: center;
|
|
243
|
+
gap: 0.25rem;
|
|
244
|
+
padding: 0.125rem 0.5rem;
|
|
245
|
+
border: 1px solid var(--ux-line-strong);
|
|
246
|
+
border-radius: 999px;
|
|
247
|
+
font-family: var(--font-ux-mono);
|
|
248
|
+
font-size: 0.75rem;
|
|
249
|
+
font-variant-numeric: tabular-nums;
|
|
250
|
+
color: var(--ux-fg-2);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.ux-header__github .ux-header__stars svg {
|
|
254
|
+
width: 0.75rem;
|
|
255
|
+
height: 0.75rem;
|
|
256
|
+
}
|
|
257
|
+
|
|
225
258
|
@media (max-width: 960px) {
|
|
226
259
|
.ux-header__nav {
|
|
227
260
|
display: none;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg viewBox="0 0 16 16" aria-hidden="true" focusable="false">
|
|
3
|
+
<path
|
|
4
|
+
fill="currentColor"
|
|
5
|
+
d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Z"
|
|
6
|
+
/>
|
|
7
|
+
</svg>
|
|
8
|
+
</template>
|
package/src/index.ts
CHANGED
|
@@ -18,6 +18,7 @@ export { default as UxArrowIcon } from "./components/icons/UxArrowIcon.vue";
|
|
|
18
18
|
export { default as UxFrameworkLogo } from "./components/icons/UxFrameworkLogo.vue";
|
|
19
19
|
export { default as UxFrontMark } from "./components/icons/UxFrontMark.vue";
|
|
20
20
|
export { default as UxGithubIcon } from "./components/icons/UxGithubIcon.vue";
|
|
21
|
+
export { default as UxStarIcon } from "./components/icons/UxStarIcon.vue";
|
|
21
22
|
export { provideExperience, useExperience } from "./composables";
|
|
22
23
|
export type { ExperienceContext, ExperienceHost, StageElements } from "./composables";
|
|
23
24
|
export { vScramble } from "./directives";
|