valaxy-theme-yun 0.28.11 → 1.0.0-beta.2

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.
@@ -1,4 +1,9 @@
1
1
  <template>
2
- <!-- eslint-disable-next-line vue/no-lone-template empty -->
3
- <template />
2
+ <!--
3
+ Empty placeholder, meant to be overridden by the user (see demo/yun/components/YunAdBoard.vue).
4
+ `v-if="false"` renders a comment node instead of a real element: this avoids the SSR hydration
5
+ crash a raw `<template>` causes (#711), while still adding no gap to the parent flex layout,
6
+ which an empty `<div>` would (ab57216f).
7
+ -->
8
+ <template v-if="false" />
4
9
  </template>
@@ -1,10 +1,8 @@
1
1
  <script setup lang="ts">
2
2
  import type { LinkType } from '../types'
3
- import { yunSpringVariants } from '../composables/animation'
4
3
  import { onImgError } from '../utils'
5
4
 
6
5
  const props = defineProps<{
7
- i: number
8
6
  errorImg?: string
9
7
  link: LinkType
10
8
  }>()
@@ -13,34 +11,38 @@ function onError(e: Event) {
13
11
  onImgError(e, props.errorImg)
14
12
  }
15
13
 
16
- const motionVariants = yunSpringVariants({ i: props.i })
14
+ function getLinkLabel(link: LinkType) {
15
+ return [link.name, link.blog, link.desc].filter(Boolean).join(' · ')
16
+ }
17
17
  </script>
18
18
 
19
19
  <template>
20
20
  <li
21
- v-motion="motionVariants"
22
- class="yun-link-item inline-flex"
21
+ class="yun-link-item"
23
22
  :style="{
24
23
  '--primary-color': link.color,
25
24
  }"
26
25
  >
27
26
  <a
28
- class="yun-link-url" p="x-4 y-2"
27
+ class="yun-link-url"
29
28
  :href="link.url" :title="link.name"
30
- alt="portrait" rel="friend" target="_blank"
29
+ :aria-label="getLinkLabel(link)"
30
+ rel="friend noopener noreferrer" target="_blank"
31
31
  >
32
32
  <div class="yun-link-left">
33
- <div class="yun-link-avatar size-16 overflow-hidden flex-center">
33
+ <div class="yun-link-avatar">
34
34
  <img
35
- class="size-full object-center object-cover m-0! max-w-unset!"
35
+ class="yun-link-avatar-img"
36
+ alt=""
37
+ decoding="async"
36
38
  loading="lazy"
37
- :src="link.avatar" :alt="link.name"
39
+ :src="link.avatar"
38
40
  @error="onError"
39
41
  >
40
42
  </div>
41
43
  </div>
42
- <div class="yun-link-info" m="l-2">
43
- <div class="yun-link-blog" font="serif black">{{ link.blog }}</div>
44
+ <div class="yun-link-info">
45
+ <div class="yun-link-blog">{{ link.blog }}</div>
44
46
  <div class="yun-link-desc">{{ link.desc }}</div>
45
47
  </div>
46
48
  </a>
@@ -35,19 +35,19 @@ const isUrlSource = computed(() => typeof props.links === 'string')
35
35
  hydration mismatch (SSG renders empty list, client fills it).
36
36
  -->
37
37
  <ClientOnly v-if="isUrlSource">
38
- <ul class="yun-link-items" flex="center wrap">
38
+ <ul class="yun-link-items">
39
39
  <YunLinkItem
40
- v-for="link, i in data"
40
+ v-for="link in data"
41
41
  :key="link.url"
42
- :i="i" :link="link" :error-img="errorImg"
42
+ :link="link" :error-img="errorImg"
43
43
  />
44
44
  </ul>
45
45
  </ClientOnly>
46
- <ul v-else class="yun-link-items" flex="center wrap">
46
+ <ul v-else class="yun-link-items">
47
47
  <YunLinkItem
48
- v-for="link, i in data"
48
+ v-for="link in data"
49
49
  :key="link.url"
50
- :i="i" :link="link" :error-img="errorImg"
50
+ :link="link" :error-img="errorImg"
51
51
  />
52
52
  </ul>
53
53
  </div>
@@ -56,59 +56,172 @@ const isUrlSource = computed(() => typeof props.links === 'string')
56
56
  <style lang="scss">
57
57
  .yun-links {
58
58
  .yun-link-items {
59
+ display: grid;
60
+ grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
61
+ gap: 1rem;
62
+ margin: 1.5rem 0;
59
63
  padding-left: 0;
64
+ list-style: none;
65
+ }
66
+
67
+ .yun-link-item {
68
+ display: flex;
69
+ min-width: 0;
60
70
  }
61
71
 
62
72
  .yun-link-url {
63
- --smc-link-color: var(--primary-color);
73
+ --yun-link-accent: var(--primary-color, var(--va-c-primary));
64
74
 
65
- display: inline-flex;
66
- text-align: center;
67
- justify-self: center;
75
+ position: relative;
76
+ display: flex;
77
+ align-items: center;
78
+ gap: 0.875rem;
79
+ box-sizing: border-box;
80
+ width: 100%;
81
+ min-width: 0;
82
+ min-height: 5.5rem;
83
+ padding: 0.875rem 1rem;
84
+ overflow: hidden;
85
+ color: var(--va-c-text);
86
+ text-align: left;
68
87
  line-height: 1.5;
69
- margin: 0.5rem;
70
- transition: var(--va-transition-duration-fast);
71
- color: var(--primary-color, black);
72
- border: 1px solid var(--primary-color, gray);
88
+ background-color: var(--va-c-bg-light);
89
+ border: 1px solid var(--va-c-border);
90
+ border-radius: 0.75rem;
91
+ box-shadow: inset 3px 0 0 var(--yun-link-accent);
92
+ isolation: isolate;
93
+ transition:
94
+ transform var(--va-transition-duration-fast) ease,
95
+ border-color var(--va-transition-duration-fast) ease,
96
+ background-color var(--va-transition-duration-fast) ease,
97
+ box-shadow var(--va-transition-duration-fast) ease;
98
+
99
+ &::before {
100
+ position: absolute;
101
+ z-index: 0;
102
+ inset: 0;
103
+ pointer-events: none;
104
+ background:
105
+ radial-gradient(
106
+ circle at 3.25rem 50%,
107
+ color-mix(in srgb, var(--yun-link-accent) 18%, transparent) 0,
108
+ color-mix(in srgb, var(--yun-link-accent) 7%, transparent) 42%,
109
+ transparent 74%
110
+ );
111
+ content: '';
112
+ opacity: 0;
113
+ transition: opacity var(--va-transition-duration-fast) ease;
114
+ }
73
115
 
74
116
  &:hover {
75
- color: white;
76
- background-color: var(--primary-color, gray);
77
- box-shadow: 0 2px 20px var(--primary-color, gray);
117
+ color: var(--va-c-text);
118
+ background-color: var(--va-c-bg-soft);
119
+ box-shadow:
120
+ inset 3px 0 0 var(--yun-link-accent),
121
+ 0 10px 28px rgb(0 0 0 / 0.1);
122
+ transform: translateY(-2px);
123
+ }
124
+
125
+ &:hover::before,
126
+ &:focus-visible::before {
127
+ opacity: 1;
128
+ }
129
+
130
+ &:hover:not(:focus-visible) {
131
+ border-color: var(--yun-link-accent);
132
+ }
133
+
134
+ &:focus-visible {
135
+ color: var(--va-c-text);
136
+ border-color: var(--va-c-border);
137
+ outline: 2px solid var(--va-c-primary);
138
+ outline-offset: 2px;
139
+ }
140
+
141
+ &:active {
142
+ transform: scale(0.985);
78
143
  }
79
144
 
80
145
  .yun-link {
81
146
  &-left {
147
+ position: relative;
148
+ z-index: 1;
149
+ flex: 0 0 auto;
82
150
  line-height: 0;
83
151
  }
84
152
 
85
153
  &-avatar {
86
- margin: 0;
87
- display: inline-flex;
154
+ display: flex;
155
+ align-items: center;
156
+ justify-content: center;
157
+ width: 3.5rem;
158
+ height: 3.5rem;
159
+ overflow: hidden;
88
160
  border-radius: 50%;
89
161
  background-color: #fff;
90
- border: 1px solid var(--primary-color, gray);
91
- transition: var(--va-transition-duration-moderate);
162
+ border: 2px solid var(--yun-link-accent);
163
+ transition: transform var(--va-transition-duration-fast) ease;
164
+ }
92
165
 
93
- &:hover {
94
- box-shadow: 0 0 20px rgb(0 0 0 / 0.1);
95
- }
166
+ &-avatar-img {
167
+ width: 100%;
168
+ height: 100%;
169
+ margin: 0 !important;
170
+ object-fit: cover;
171
+ object-position: center;
96
172
  }
97
173
 
98
- &-desc {
99
- font-size: 0.8rem;
100
- width: 10rem;
101
- white-space: nowrap;
174
+ &-blog {
175
+ overflow: hidden;
176
+ color: var(--va-c-text);
177
+ font-family: var(--va-font-serif);
178
+ font-size: 1rem;
179
+ font-weight: 700;
102
180
  text-overflow: ellipsis;
181
+ white-space: nowrap;
182
+ }
183
+
184
+ &-desc {
185
+ display: -webkit-box;
103
186
  overflow: hidden;
187
+ color: var(--va-c-text-light);
188
+ font-size: 0.875rem;
189
+ line-height: 1.4;
190
+ -webkit-box-orient: vertical;
191
+ -webkit-line-clamp: 2;
104
192
  }
105
193
  }
194
+
195
+ &:hover .yun-link-avatar {
196
+ transform: scale(1.04);
197
+ }
106
198
  }
107
199
 
108
200
  .yun-link-info {
109
- display: inline-flex;
201
+ position: relative;
202
+ z-index: 1;
203
+ display: flex;
110
204
  flex-direction: column;
111
205
  justify-content: center;
206
+ gap: 0.125rem;
207
+ min-width: 0;
208
+ flex: 1;
209
+ }
210
+ }
211
+
212
+ @media (prefers-reduced-motion: reduce) {
213
+ .yun-links {
214
+ .yun-link-url,
215
+ .yun-link-avatar,
216
+ .yun-link-url::before {
217
+ transition-duration: 0.01ms;
218
+ }
219
+
220
+ .yun-link-url:hover,
221
+ .yun-link-url:active,
222
+ .yun-link-url:hover .yun-link-avatar {
223
+ transform: none;
224
+ }
112
225
  }
113
226
  }
114
227
  </style>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "valaxy-theme-yun",
3
3
  "type": "module",
4
- "version": "0.28.11",
4
+ "version": "1.0.0-beta.2",
5
5
  "description": "Default theme (Yun) for Valaxy — a Vite & Vue powered static blog generator",
6
6
  "author": {
7
7
  "email": "me@yunyoujun.cn",
@@ -32,16 +32,16 @@
32
32
  "dependencies": {
33
33
  "@ctrl/tinycolor": "^4.2.0",
34
34
  "@explosions/fireworks": "^0.2.0",
35
- "@iconify-json/ant-design": "^1.2.5",
36
- "@iconify-json/simple-icons": "^1.2.81",
35
+ "@iconify-json/ant-design": "^1.2.7",
36
+ "@iconify-json/simple-icons": "^1.2.88",
37
37
  "@vueuse/motion": "^3.0.3",
38
- "animejs": "^4.4.1",
38
+ "animejs": "^4.5.0",
39
39
  "gsap": "^3.15.0",
40
- "reka-ui": "^2.9.7"
40
+ "reka-ui": "^2.10.1"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/animejs": "^3.1.13",
44
- "valaxy": "0.28.11",
44
+ "valaxy": "1.0.0-beta.2",
45
45
  "valaxy-addon-waline": "0.2.1"
46
46
  },
47
47
  "scripts": {