@uxfront/ui 0.1.0 → 0.2.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 +2 -2
- package/package.json +1 -1
- package/src/components/UxFinale.vue +30 -3
- package/src/components/UxHeader.vue +62 -5
package/README.md
CHANGED
|
@@ -85,9 +85,9 @@ const scene = [
|
|
|
85
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
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
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`.
|
|
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
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.
|
|
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) and a GitHub link. |
|
|
91
91
|
| `UxHud` | Particle count and fps, the chapter counter and progress, and the Motion toggle. |
|
|
92
92
|
| `UxAnchor` | A label pinned to a formation anchor, like `plates:0`: `callout`, `tag` or `button` (put buttons in the `controls` slot). |
|
|
93
93
|
| `UxPillLink`, `UxErrorPage`, icons | The scrambled pill link, a full error page, and `UxArrowIcon`, `UxGithubIcon`, `UxFrameworkLogo`, `UxFrontMark`. |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxfront/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.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
|
|
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-
|
|
212
|
-
margin-
|
|
238
|
+
.ux-finale__grid {
|
|
239
|
+
margin-top: 2rem;
|
|
213
240
|
}
|
|
214
241
|
|
|
215
242
|
.ux-finale__grid strong {
|
|
@@ -20,17 +20,37 @@ 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
|
+
}>();
|
|
34
|
+
|
|
23
35
|
const { state } = useExperience();
|
|
24
36
|
</script>
|
|
25
37
|
|
|
26
38
|
<template>
|
|
27
39
|
<header class="ux-header">
|
|
28
|
-
<
|
|
29
|
-
<
|
|
30
|
-
|
|
31
|
-
|
|
40
|
+
<div class="ux-header__start">
|
|
41
|
+
<a
|
|
42
|
+
class="ux-header__brand"
|
|
43
|
+
:href="homeHref"
|
|
44
|
+
:aria-label="homeLabel ?? `${brand}, back to top`"
|
|
32
45
|
>
|
|
33
|
-
|
|
46
|
+
<slot v-if="$slots.mark" name="mark" />
|
|
47
|
+
<UxFrontMark v-else class="ux-header__mark" />
|
|
48
|
+
<span
|
|
49
|
+
><slot name="brand">{{ brand }}</slot></span
|
|
50
|
+
>
|
|
51
|
+
</a>
|
|
52
|
+
<span v-if="$slots.byline" class="ux-header__byline"><slot name="byline" /></span>
|
|
53
|
+
</div>
|
|
34
54
|
<nav v-if="nav.length" class="ux-header__nav" :aria-label="navLabel">
|
|
35
55
|
<ul>
|
|
36
56
|
<li v-for="item in nav" :key="item.href">
|
|
@@ -87,6 +107,43 @@ const { state } = useExperience();
|
|
|
87
107
|
height: 1.5rem;
|
|
88
108
|
}
|
|
89
109
|
|
|
110
|
+
.ux-header__start {
|
|
111
|
+
display: flex;
|
|
112
|
+
align-items: center;
|
|
113
|
+
gap: 0.75rem;
|
|
114
|
+
min-width: 0;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.ux-header__byline {
|
|
118
|
+
display: inline-flex;
|
|
119
|
+
align-items: center;
|
|
120
|
+
gap: 0.35rem;
|
|
121
|
+
font-size: 0.8125rem;
|
|
122
|
+
white-space: nowrap;
|
|
123
|
+
color: var(--ux-fg-3);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.ux-header__byline :slotted(a) {
|
|
127
|
+
display: inline-flex;
|
|
128
|
+
align-items: center;
|
|
129
|
+
gap: 0.3rem;
|
|
130
|
+
min-height: 2.75rem;
|
|
131
|
+
font-weight: 500;
|
|
132
|
+
letter-spacing: -0.02em;
|
|
133
|
+
color: var(--ux-fg-2);
|
|
134
|
+
text-decoration: none;
|
|
135
|
+
transition: color 0.3s var(--ux-ease-out);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.ux-header__byline :slotted(a:hover) {
|
|
139
|
+
color: var(--ux-fg);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.ux-header__byline :slotted(svg) {
|
|
143
|
+
width: 0.875rem;
|
|
144
|
+
height: 0.875rem;
|
|
145
|
+
}
|
|
146
|
+
|
|
90
147
|
.ux-header__nav ul {
|
|
91
148
|
display: flex;
|
|
92
149
|
gap: clamp(1rem, 2.4vw, 2.5rem);
|