valaxy-theme-yun 0.20.3 → 0.20.5

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,4 @@
1
1
  <template>
2
- <!-- empty -->
3
- <div />
2
+ <!-- eslint-disable-next-line vue/no-lone-template empty -->
3
+ <template />
4
4
  </template>
@@ -67,7 +67,7 @@ onMounted(async () => {
67
67
  :title="themeConfig.banner.title"
68
68
  :chars="chars"
69
69
  />
70
- <PrologueSquare v-else class="z-1" />
70
+ <YunPrologueSquare v-else class="z-1" />
71
71
  </template>
72
72
  <template v-if="yun.isStrato">
73
73
  <YunBannerCharContainer
@@ -1,11 +1,11 @@
1
1
  <script lang="ts" setup>
2
- import { ref } from 'vue'
2
+ import { ref, watch } from 'vue'
3
3
  import { useI18n } from 'vue-i18n'
4
4
  import { useFuseSearch } from 'valaxy'
5
5
 
6
6
  import { isClient, onClickOutside, useScrollLock } from '@vueuse/core'
7
7
 
8
- defineProps<{
8
+ const props = defineProps<{
9
9
  open: boolean
10
10
  }>()
11
11
  const emit = defineEmits(['close'])
@@ -14,7 +14,7 @@ const input = ref('')
14
14
 
15
15
  const isLocked = useScrollLock(isClient ? document.documentElement : null)
16
16
  const { t } = useI18n()
17
- const { results } = useFuseSearch(input)
17
+ const { results, fetchFuseListData } = useFuseSearch(input)
18
18
 
19
19
  const searchInputRef = ref<HTMLInputElement>()
20
20
  const searchContainer = ref<HTMLElement>()
@@ -22,6 +22,11 @@ const searchContainer = ref<HTMLElement>()
22
22
  onClickOutside(searchInputRef, () => {
23
23
  // emit('close')
24
24
  })
25
+
26
+ watch(() => props.open, () => {
27
+ if (props.open)
28
+ fetchFuseListData()
29
+ })
25
30
  </script>
26
31
 
27
32
  <template>
@@ -49,8 +49,7 @@ useMotion(itemRef, {
49
49
  <div class="yun-link-left">
50
50
  <div class="yun-link-avatar size-16 overflow-hidden flex-center">
51
51
  <img
52
- class="size-16 object-center object-cover m-0!"
53
- width="64" height="64"
52
+ class="size-full object-center object-cover m-0! max-w-unset!"
54
53
  loading="lazy"
55
54
  :src="link.avatar" :alt="link.name"
56
55
  @error="onError"
@@ -3,7 +3,8 @@ import { computed, ref, watch } from 'vue'
3
3
  import { useFrontmatter } from 'valaxy'
4
4
  import { useI18n } from 'vue-i18n'
5
5
 
6
- import { differenceInMilliseconds, formatDistanceToNow } from 'date-fns'
6
+ import { differenceInMilliseconds } from 'date-fns/differenceInMilliseconds'
7
+ import { formatDistanceToNow } from 'date-fns/formatDistanceToNow'
7
8
 
8
9
  const fm = useFrontmatter()
9
10
  const { t, locale } = useI18n()
@@ -13,15 +13,24 @@ const tags = useTags()
13
13
  <template>
14
14
  <nav class="site-nav" text-xl mt-2>
15
15
  <YunPostClassifyNavItem
16
- to="/archives/" icon="i-ri-archive-line" :title="t('menu.archives')"
16
+ to="/archives/"
17
+ icon="i-ri-archive-line"
18
+ active-icon="i-ri-archive-fill"
19
+ :title="t('menu.archives')"
17
20
  :total="site.postList.length"
18
21
  />
19
22
  <YunPostClassifyNavItem
20
- to="/categories/" icon="i-ri-folder-2-line" :title="t('menu.categories')"
23
+ to="/categories/"
24
+ icon="i-ri-folder-2-line"
25
+ active-icon="i-ri-folder-2-fill"
26
+ :title="t('menu.categories')"
21
27
  :total="Array.from(categories.children).length"
22
28
  />
23
29
  <YunPostClassifyNavItem
24
- to="/tags/" icon="i-ri-price-tag-3-line" :title="t('menu.tags')"
30
+ to="/tags/"
31
+ icon="i-ri-price-tag-3-line"
32
+ active-icon="i-ri-price-tag-3-fill"
33
+ :title="t('menu.tags')"
25
34
  :total="Array.from(tags).length"
26
35
  />
27
36
  </nav>
@@ -5,6 +5,7 @@
5
5
  <template>
6
6
  <YunCard class="p-4 min-h-sm" flex="~ col gap-1">
7
7
  <YunSiteInfo class="text-center" />
8
+ <YunGradientDivider class="my-2 op-20" />
8
9
  <YunPostsInfo />
9
10
  <YunGradientDivider class="my-2 op-20" />
10
11
  <YunSocialLinks />
@@ -9,12 +9,7 @@ const siteConfig = useSiteConfig()
9
9
  <RouterLink
10
10
  class="site-author-avatar inline-flex-center" to="/about"
11
11
  >
12
- <img class="rounded-full" :src="siteConfig.author.avatar" alt="avatar">
13
- <!-- <span
14
- v-if="siteConfig.author.status.emoji"
15
- class="site-author-status absolute"
16
- :title="siteConfig.author.status.message || undefined"
17
- >{{ siteConfig.author.status.emoji }}</span> -->
12
+ <YunAuthorAvatar />
18
13
  </RouterLink>
19
14
  <YunAuthorName />
20
15
  <YunSiteTitle />
@@ -32,38 +27,6 @@ const siteConfig = useSiteConfig()
32
27
  </template>
33
28
 
34
29
  <style lang="scss">
35
- .site-author-avatar {
36
- position: relative;
37
- line-height: 0;
38
-
39
- img {
40
- height: 96px;
41
- width: 96px;
42
- max-width: 100%;
43
- margin: 0;
44
- padding: 4px;
45
- background-color: white;
46
- box-shadow: 0 0 10px rgba(black, 0.2);
47
- transition: 0.4s;
48
-
49
- &:hover {
50
- box-shadow: 0 0 30px rgba(var(--va-c-primary-rgb), 0.2);
51
- }
52
- }
53
- }
54
-
55
- .site-author-status {
56
- height: 1.8rem;
57
- width: 1.8rem;
58
- bottom: 0;
59
- right: 0;
60
- line-height: 1.8rem;
61
- border-radius: 50%;
62
- box-shadow: 0 1px 2px rgb(0 0 0 / 0.2);
63
- background-color: var(--va-c-bg-light);
64
- border: 1px solid rgb(255 255 255 / 0.1);
65
- }
66
-
67
30
  .site-info {
68
31
  &.fix-top {
69
32
  margin-top: -1.5rem;
@@ -5,9 +5,46 @@ const siteConfig = useSiteConfig()
5
5
  </script>
6
6
 
7
7
  <template>
8
- <img
9
- class="rounded-full size-full"
10
- :src="siteConfig.author.avatar"
11
- alt="avatar"
12
- >
8
+ <div class="relative yun-author-avatar">
9
+ <img
10
+ class="rounded-full size-full bg-white dark:bg-white/20 p-1 m-0"
11
+ :src="siteConfig.author.avatar"
12
+ alt="avatar"
13
+ >
14
+ <span
15
+ v-if="siteConfig.author.status.emoji"
16
+ class="site-author-status absolute"
17
+ :title="siteConfig.author.status.message || undefined"
18
+ >{{ siteConfig.author.status.emoji }}</span>
19
+ </div>
13
20
  </template>
21
+
22
+ <style lang="scss">
23
+ .yun-author-avatar {
24
+ width: var(--avatar-size, 96px);
25
+ height: var(--avatar-size, 96px);
26
+ }
27
+
28
+ .site-author-avatar {
29
+ img {
30
+ box-shadow: 0 0 10px rgba(black, 0.2);
31
+ transition: 0.4s;
32
+
33
+ &:hover {
34
+ box-shadow: 0 0 30px rgba(var(--va-c-primary-rgb), 0.2);
35
+ }
36
+ }
37
+ }
38
+
39
+ .site-author-status {
40
+ height: 1.8rem;
41
+ width: 1.8rem;
42
+ bottom: 0;
43
+ right: 0;
44
+ line-height: 1.8rem;
45
+ border-radius: 50%;
46
+ box-shadow: 0 1px 2px rgb(0 0 0 / 0.2);
47
+ background-color: var(--va-c-bg-light);
48
+ border: 1px solid rgb(255 255 255 / 0.1);
49
+ }
50
+ </style>
@@ -1,5 +1,10 @@
1
1
  <script lang="ts" setup>
2
- defineProps<{
2
+ import { computed } from 'vue'
3
+
4
+ import { useRoute } from 'vue-router'
5
+
6
+ const props = defineProps<{
7
+ activeIcon?: string
3
8
  icon: string
4
9
  title: string
5
10
  /**
@@ -8,23 +13,46 @@ defineProps<{
8
13
  total: number
9
14
  to: string
10
15
  }>()
16
+
17
+ const route = useRoute()
18
+ const active = computed(() => route.path === props.to)
19
+
20
+ const icon = computed(() => {
21
+ if (active.value && props.activeIcon)
22
+ return props.activeIcon
23
+ return props.icon
24
+ })
11
25
  </script>
12
26
 
13
27
  <template>
14
28
  <RouterLink
15
29
  flex="~ col center"
16
- class="gap-1 w-20 p-2 rounded transition op-80"
17
- :to="to" :title="title"
30
+ class="post-classify-nav-item gap-1 w-20 p-2 rounded transition op-80"
31
+ :to="to"
32
+ :title="title"
18
33
  hover="bg-$va-c-bg-soft op-100"
19
34
  >
20
35
  <div flex="~ col" class="text-$va-c-text inline-flex-center gap-1">
21
- <div class="text-2xl" :class="icon" />
36
+ <div
37
+ class="text-2xl"
38
+ :class="icon"
39
+ />
22
40
  <span class="text-xs">
23
41
  {{ title }}
24
42
  </span>
25
43
  </div>
26
44
  <span
27
- class="count text-base dark:text-white/80"
28
- >{{ total }}</span>
45
+ class="count text-base text-black/80 dark:text-white/80"
46
+ >
47
+ {{ total }}
48
+ </span>
29
49
  </RouterLink>
30
50
  </template>
51
+
52
+ <style lang="scss">
53
+ .post-classify-nav-item {
54
+ &.router-link-active {
55
+ background-color: rgba(var(--va-c-primary-rgb), 0.08);
56
+ }
57
+ }
58
+ </style>
@@ -29,7 +29,7 @@ const showContent = ref(false)
29
29
  >
30
30
  <div
31
31
  flex="~ col"
32
- class="absolute yun-square bg-$va-c-text square-rotate z-1"
32
+ class="absolute yun-square square-rotate z-1 bg-white/80"
33
33
  >
34
34
  <LineBurstEffects
35
35
  class="absolute top-0 left-0 right-0 bottom-0 size-full scale-200"
@@ -91,7 +91,8 @@ const showContent = ref(false)
91
91
  </div>
92
92
  </template>
93
93
 
94
- <style lang="scss">
94
+ <style lang="scss" scoped>
95
+ // use scoped for css injection
95
96
  @use 'sass:map';
96
97
  @use 'valaxy-theme-yun/styles/vars.scss' as *;
97
98
 
package/layouts/post.vue CHANGED
@@ -4,7 +4,7 @@ import { useFrontmatter, useFullUrl, useSiteConfig } from 'valaxy'
4
4
 
5
5
  import type { Article } from '@unhead/schema-org'
6
6
  import { defineArticle, useSchemaOrg } from '@unhead/schema-org'
7
- import { toDate } from 'date-fns'
7
+ import { toDate } from 'date-fns/toDate'
8
8
 
9
9
  const siteConfig = useSiteConfig()
10
10
  const frontmatter = useFrontmatter()
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "valaxy-theme-yun",
3
3
  "type": "module",
4
- "version": "0.20.3",
4
+ "version": "0.20.5",
5
5
  "author": {
6
6
  "email": "me@yunyoujun.cn",
7
7
  "name": "YunYouJun",
@@ -24,16 +24,16 @@
24
24
  "@ctrl/tinycolor": "^4.1.0",
25
25
  "@explosions/fireworks": "^0.1.0",
26
26
  "@iconify-json/ant-design": "^1.2.2",
27
- "@iconify-json/simple-icons": "^1.2.11",
27
+ "@iconify-json/simple-icons": "^1.2.13",
28
28
  "@vueuse/motion": "^2.2.6",
29
29
  "animejs": "^3.2.2",
30
30
  "gsap": "^3.12.5",
31
- "primevue": "^4.2.1",
32
- "radix-vue": "^1.9.9"
31
+ "primevue": "^4.2.3",
32
+ "radix-vue": "^1.9.10"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/animejs": "^3.1.12",
36
- "valaxy": "0.20.3",
36
+ "valaxy": "0.20.5",
37
37
  "valaxy-addon-waline": "0.2.0"
38
38
  },
39
39
  "scripts": {