@uxfront/ui 0.1.0 → 0.3.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
@@ -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: kicker, `title`, `lead`, 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; `brand` slot to style the name), section nav (marks the one held) 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. |
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`. |
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.1.0",
3
+ "version": "0.3.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",
@@ -10,8 +10,12 @@ const { id = "build", cards = [] } = defineProps<{
10
10
  }>();
11
11
 
12
12
  defineSlots<{
13
+ /** Above the kicker, drawn large, like `UxFrontMark`. */
14
+ mark?(): unknown;
13
15
  title(): unknown;
14
16
  lead?(): unknown;
17
+ /** Below the lead, like a `UxPillLink` to the docs. */
18
+ actions?(): unknown;
15
19
  /** The page's footer, pinned to the bottom of the screen. Links in it are styled. */
16
20
  footer?(): unknown;
17
21
  }>();
@@ -21,9 +25,11 @@ defineSlots<{
21
25
  <section :id="id" class="ux-finale" data-stage :aria-labelledby="`${id}-title`">
22
26
  <div class="ux-finale__pin">
23
27
  <div class="ux-finale__body" data-reveal>
28
+ <div v-if="$slots.mark" class="ux-finale__mark"><slot name="mark" /></div>
24
29
  <p v-if="kicker" class="ux-finale__kicker ux-mono">{{ kicker }}</p>
25
30
  <h2 :id="`${id}-title`" class="ux-finale__title"><slot name="title" /></h2>
26
31
  <p v-if="$slots.lead" class="ux-finale__lead"><slot name="lead" /></p>
32
+ <div v-if="$slots.actions" class="ux-finale__actions"><slot name="actions" /></div>
27
33
  <ul v-if="cards.length" class="ux-finale__grid">
28
34
  <li v-for="card in cards" :key="card.href">
29
35
  <a :href="card.href">
@@ -78,6 +84,18 @@ defineSlots<{
78
84
  background: radial-gradient(closest-side, rgb(5 5 7 / 0.7), rgb(5 5 7 / 0));
79
85
  }
80
86
 
87
+ .ux-finale__mark {
88
+ display: flex;
89
+ margin-bottom: clamp(1.75rem, 1rem + 2vw, 3rem);
90
+ color: var(--ux-fg);
91
+ }
92
+
93
+ .ux-finale__mark :slotted(svg) {
94
+ width: clamp(4.5rem, 2.5rem + 6vw, 8.5rem);
95
+ height: auto;
96
+ filter: drop-shadow(0 0 1.5rem rgb(255 255 255 / 0.25));
97
+ }
98
+
81
99
  .ux-finale__kicker {
82
100
  margin-bottom: 1.5rem;
83
101
  color: var(--ux-fg-2);
@@ -93,17 +111,26 @@ defineSlots<{
93
111
 
94
112
  .ux-finale__lead {
95
113
  max-width: 32rem;
96
- margin: 1.75rem 0 3rem;
114
+ margin-top: 1.75rem;
97
115
  font-size: clamp(1.0625rem, 0.95rem + 0.4vw, 1.25rem);
98
116
  line-height: 1.45;
99
117
  color: var(--ux-fg-2);
100
118
  }
101
119
 
120
+ .ux-finale__actions {
121
+ display: flex;
122
+ flex-wrap: wrap;
123
+ justify-content: center;
124
+ gap: 0.75rem;
125
+ margin-top: 2.5rem;
126
+ }
127
+
102
128
  .ux-finale__grid {
103
129
  display: grid;
104
130
  grid-template-columns: repeat(4, minmax(0, 1fr));
105
131
  gap: 1px;
106
132
  width: 100%;
133
+ margin-top: 3rem;
107
134
  padding: 0;
108
135
  list-style: none;
109
136
  text-align: left;
@@ -208,8 +235,8 @@ defineSlots<{
208
235
  }
209
236
 
210
237
  @media (max-width: 760px) {
211
- .ux-finale__lead {
212
- margin-bottom: 2rem;
238
+ .ux-finale__grid {
239
+ margin-top: 2rem;
213
240
  }
214
241
 
215
242
  .ux-finale__grid strong {
@@ -20,17 +20,39 @@ const {
20
20
  github?: string;
21
21
  }>();
22
22
 
23
+ defineSlots<{
24
+ /** Before the name. Defaults to `UxFrontMark`; pass an empty slot to leave the mark out. */
25
+ mark?(): unknown;
26
+ /** Restyles the name, like `<strong>UX</strong>Front`. */
27
+ brand?(): unknown;
28
+ /**
29
+ * Beside the brand link, not inside it, so it can hold links of its own,
30
+ * like "by <a>UXFront</a>". Smaller and muted.
31
+ */
32
+ byline?(): unknown;
33
+ /** Extra links at the end of the header, before the GitHub link. */
34
+ actions?(): unknown;
35
+ }>();
36
+
23
37
  const { state } = useExperience();
24
38
  </script>
25
39
 
26
40
  <template>
27
41
  <header class="ux-header">
28
- <a class="ux-header__brand" :href="homeHref" :aria-label="homeLabel ?? `${brand}, back to top`">
29
- <slot name="mark"><UxFrontMark class="ux-header__mark" /></slot>
30
- <span
31
- ><slot name="brand">{{ brand }}</slot></span
42
+ <div class="ux-header__start">
43
+ <a
44
+ class="ux-header__brand"
45
+ :href="homeHref"
46
+ :aria-label="homeLabel ?? `${brand}, back to top`"
32
47
  >
33
- </a>
48
+ <slot v-if="$slots.mark" name="mark" />
49
+ <UxFrontMark v-else class="ux-header__mark" />
50
+ <span
51
+ ><slot name="brand">{{ brand }}</slot></span
52
+ >
53
+ </a>
54
+ <span v-if="$slots.byline" class="ux-header__byline"><slot name="byline" /></span>
55
+ </div>
34
56
  <nav v-if="nav.length" class="ux-header__nav" :aria-label="navLabel">
35
57
  <ul>
36
58
  <li v-for="item in nav" :key="item.href">
@@ -46,10 +68,13 @@ const { state } = useExperience();
46
68
  </li>
47
69
  </ul>
48
70
  </nav>
49
- <a v-if="github" class="ux-header__github" :href="github">
50
- <UxGithubIcon />
51
- <span>GitHub</span>
52
- </a>
71
+ <div v-if="$slots.actions || github" class="ux-header__end">
72
+ <slot name="actions" />
73
+ <a v-if="github" class="ux-header__github" :href="github">
74
+ <UxGithubIcon />
75
+ <span>GitHub</span>
76
+ </a>
77
+ </div>
53
78
  </header>
54
79
  </template>
55
80
 
@@ -87,6 +112,43 @@ const { state } = useExperience();
87
112
  height: 1.5rem;
88
113
  }
89
114
 
115
+ .ux-header__start {
116
+ display: flex;
117
+ align-items: center;
118
+ gap: 0.75rem;
119
+ min-width: 0;
120
+ }
121
+
122
+ .ux-header__byline {
123
+ display: inline-flex;
124
+ align-items: center;
125
+ gap: 0.35rem;
126
+ font-size: 0.8125rem;
127
+ white-space: nowrap;
128
+ color: var(--ux-fg-3);
129
+ }
130
+
131
+ .ux-header__byline :slotted(a) {
132
+ display: inline-flex;
133
+ align-items: center;
134
+ gap: 0.3rem;
135
+ min-height: 2.75rem;
136
+ font-weight: 500;
137
+ letter-spacing: -0.02em;
138
+ color: var(--ux-fg-2);
139
+ text-decoration: none;
140
+ transition: color 0.3s var(--ux-ease-out);
141
+ }
142
+
143
+ .ux-header__byline :slotted(a:hover) {
144
+ color: var(--ux-fg);
145
+ }
146
+
147
+ .ux-header__byline :slotted(svg) {
148
+ width: 0.875rem;
149
+ height: 0.875rem;
150
+ }
151
+
90
152
  .ux-header__nav ul {
91
153
  display: flex;
92
154
  gap: clamp(1rem, 2.4vw, 2.5rem);
@@ -133,6 +195,23 @@ const { state } = useExperience();
133
195
  color: var(--ux-fg-3);
134
196
  }
135
197
 
198
+ .ux-header__end {
199
+ display: flex;
200
+ align-items: center;
201
+ gap: 1.5rem;
202
+ }
203
+
204
+ .ux-header__end :slotted(a) {
205
+ gap: 0.5rem;
206
+ font-size: 0.875rem;
207
+ color: var(--ux-fg-2);
208
+ transition: color 0.3s var(--ux-ease-out);
209
+ }
210
+
211
+ .ux-header__end :slotted(a:hover) {
212
+ color: var(--ux-fg);
213
+ }
214
+
136
215
  .ux-header__github {
137
216
  gap: 0.5rem;
138
217
  font-size: 0.875rem;