@uxfront/ui 0.6.0 → 0.7.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 -0
- package/package.json +1 -1
- package/src/components/UxPillLink.vue +23 -6
package/README.md
CHANGED
|
@@ -98,6 +98,8 @@ const scene = [
|
|
|
98
98
|
|
|
99
99
|
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
100
|
|
|
101
|
+
`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.
|
|
102
|
+
|
|
101
103
|
Also exported: `useExperience()` (the scene's reactive state inside a `UxSite`), the `v-scramble` directive, `FRAMEWORKS` and their logos, and `uxRenderHookKey`.
|
|
102
104
|
|
|
103
105
|
## Styles
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxfront/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.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",
|
|
@@ -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>
|