@uxfront/ui 0.6.0 → 0.8.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 +3 -0
- package/package.json +1 -1
- package/src/components/UxFeatures.vue +121 -0
- package/src/components/UxPillLink.vue +23 -6
- package/src/index.ts +1 -0
- package/src/types.ts +1 -1
package/README.md
CHANGED
|
@@ -89,6 +89,7 @@ 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). |
|
|
@@ -98,6 +99,8 @@ const scene = [
|
|
|
98
99
|
|
|
99
100
|
A `UxTraits` item with an `href` is a link, with an arrow after its title. It's a plain `<a>`, so it loads the page rather than navigating in the app.
|
|
100
101
|
|
|
102
|
+
`UxPillLink` is an outline pill that fills on hover. Set `variant="filled"` to fill it from the start, so the one action you want people to take, like "Get started", stands out from the links around it. The arrow after the label can give way to another icon through the `#icon` slot, sized to the arrow's 16 × 16px: `<template #icon><UxStarIcon /></template>`. Set `:arrow="false"` to show the label alone.
|
|
103
|
+
|
|
101
104
|
Also exported: `useExperience()` (the scene's reactive state inside a `UxSite`), the `v-scramble` directive, `FRAMEWORKS` and their logos, and `uxRenderHookKey`.
|
|
102
105
|
|
|
103
106
|
## Styles
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxfront/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.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>
|
|
@@ -2,21 +2,32 @@
|
|
|
2
2
|
import { vScramble } from "../directives/scramble";
|
|
3
3
|
import UxArrowIcon from "./icons/UxArrowIcon.vue";
|
|
4
4
|
|
|
5
|
-
const {
|
|
5
|
+
const {
|
|
6
|
+
variant = "outline",
|
|
7
|
+
arrow = true,
|
|
8
|
+
scramble = true,
|
|
9
|
+
} = defineProps<{
|
|
6
10
|
href: string;
|
|
7
11
|
label: string;
|
|
12
|
+
/** An outline pill that fills on hover, or a pill filled from the start. */
|
|
13
|
+
variant?: "outline" | "filled";
|
|
8
14
|
/** An arrow pointing out of the page, nudged on hover. */
|
|
9
15
|
arrow?: boolean;
|
|
10
16
|
/** Decodes the label through random glyphs on hover and focus. */
|
|
11
17
|
scramble?: boolean;
|
|
12
18
|
}>();
|
|
19
|
+
|
|
20
|
+
defineSlots<{
|
|
21
|
+
/** In place of the arrow, sized like it, like `UxStarIcon`. */
|
|
22
|
+
icon?(): unknown;
|
|
23
|
+
}>();
|
|
13
24
|
</script>
|
|
14
25
|
|
|
15
26
|
<template>
|
|
16
|
-
<a class="ux-pill-link" :href="href">
|
|
27
|
+
<a class="ux-pill-link" :class="{ 'ux-pill-link--filled': variant === 'filled' }" :href="href">
|
|
17
28
|
<span v-if="scramble" v-scramble>{{ label }}</span>
|
|
18
29
|
<span v-else>{{ label }}</span>
|
|
19
|
-
<UxArrowIcon v-if="arrow"
|
|
30
|
+
<slot name="icon"><UxArrowIcon v-if="arrow" class="ux-pill-link__arrow" /></slot>
|
|
20
31
|
</a>
|
|
21
32
|
</template>
|
|
22
33
|
|
|
@@ -42,19 +53,25 @@ a.ux-pill-link {
|
|
|
42
53
|
border-color 0.4s var(--ux-ease-out);
|
|
43
54
|
}
|
|
44
55
|
|
|
45
|
-
.ux-pill-
|
|
56
|
+
.ux-pill-link__arrow,
|
|
57
|
+
.ux-pill-link :slotted(svg) {
|
|
46
58
|
width: 1rem;
|
|
47
59
|
height: 1rem;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.ux-pill-link__arrow {
|
|
48
63
|
transition: transform 0.4s var(--ux-ease-out);
|
|
49
64
|
}
|
|
50
65
|
|
|
51
|
-
|
|
66
|
+
/* A filled pill wears the outline pill's hover colours, at rest and on hover. */
|
|
67
|
+
.ux-pill-link:hover,
|
|
68
|
+
a.ux-pill-link--filled {
|
|
52
69
|
color: var(--ux-bg);
|
|
53
70
|
background: var(--ux-fg);
|
|
54
71
|
border-color: var(--ux-fg);
|
|
55
72
|
}
|
|
56
73
|
|
|
57
|
-
.ux-pill-link:hover
|
|
74
|
+
.ux-pill-link:hover .ux-pill-link__arrow {
|
|
58
75
|
transform: translate(2px, -2px);
|
|
59
76
|
}
|
|
60
77
|
</style>
|
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,
|
|
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
|
|