valaxy-theme-yun 1.3.0 → 1.3.1

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/App.vue CHANGED
@@ -9,12 +9,18 @@ import { useThemeConfig } from './composables'
9
9
  import { useYunAppStore } from './stores'
10
10
 
11
11
  const appStore = useAppStore()
12
+ const themeConfig = useThemeConfig()
13
+ const route = useRoute()
12
14
 
13
15
  // Use a safe default for SSR; real themeColor is applied after mount
14
16
  // to avoid hydration mismatch when user prefers dark mode.
15
17
  const safeThemeColor = computed(() => appStore.themeColor)
16
18
 
17
19
  const loadSerifFont = shallowRef(false)
20
+ const showSerifFont = computed(() => {
21
+ const scope = themeConfig.value.serifFont
22
+ return loadSerifFont.value && scope !== 'off' && (scope !== 'except-home' || route.meta.layout !== 'home')
23
+ })
18
24
  function loadFonts() {
19
25
  loadSerifFont.value = true
20
26
  }
@@ -23,7 +29,7 @@ function loadFonts() {
23
29
  useEventListener('load', loadFonts, { once: true })
24
30
 
25
31
  useHead(() => ({
26
- link: loadSerifFont.value
32
+ link: showSerifFont.value
27
33
  ? [{
28
34
  rel: 'stylesheet',
29
35
  href: 'https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@900&display=swap',
@@ -42,11 +48,8 @@ useHead(() => ({
42
48
  ],
43
49
  }))
44
50
 
45
- const themeConfig = useThemeConfig()
46
-
47
51
  const app = useAppStore()
48
52
  const yun = useYunAppStore()
49
- const route = useRoute()
50
53
 
51
54
  watch(
52
55
  () => route.meta.layout,
@@ -18,7 +18,7 @@ const grouped = computed(() => themeConfig.value.banner?.prologue === 'grouped')
18
18
  <div
19
19
  flex="~ col"
20
20
  class="yun-square-container items-center justify-center text-center max-w-2xl"
21
- :class="{ 'is-grouped': grouped, 'is-intro-complete': props.introComplete }"
21
+ :class="{ 'is-grouped': grouped }"
22
22
  >
23
23
  <slot />
24
24
 
@@ -84,42 +84,12 @@ const grouped = computed(() => themeConfig.value.banner?.prologue === 'grouped')
84
84
 
85
85
  .yun-square-container {
86
86
  --avatar-size: 100px;
87
- --yun-reveal-ease: cubic-bezier(0.22, 1, 0.36, 1);
88
87
 
89
88
  .info {
90
89
  position: relative;
91
90
  }
92
91
  }
93
92
 
94
- @media (width > 768px) {
95
- .yun-square-container {
96
- .yun-square {
97
- transition: opacity 640ms var(--yun-reveal-ease), transform 640ms var(--yun-reveal-ease);
98
- }
99
-
100
- .info > * {
101
- transition: opacity 640ms var(--yun-reveal-ease), transform 720ms var(--yun-reveal-ease);
102
- transition-delay: calc(300ms + var(--yun-reveal-delay, 0ms));
103
- }
104
-
105
- .prologue-introduction { --yun-reveal-delay: 70ms; }
106
- .prologue-social { --yun-reveal-delay: 140ms; }
107
- .prologue-navigation { --yun-reveal-delay: 210ms; }
108
-
109
- &:not(.is-intro-complete) {
110
- .yun-square {
111
- opacity: 0;
112
- transform: translateY(20px) rotate(-6deg);
113
- }
114
-
115
- .info > * {
116
- opacity: 0;
117
- transform: translateY(18px);
118
- }
119
- }
120
- }
121
- }
122
-
123
93
  .yun-square-container.is-grouped {
124
94
  .prologue-divider {
125
95
  position: relative;
package/layouts/home.vue CHANGED
@@ -19,7 +19,7 @@ const showNotice = computed(() => {
19
19
 
20
20
  <template>
21
21
  <YunLayoutWrapper :no-margin="!isPage">
22
- <div class="w-full flex flex-col items-center pb-4">
22
+ <div class="yun-home-layout w-full flex flex-col items-center pb-4">
23
23
  <template v-if="themeConfig.banner?.enable">
24
24
  <template v-if="!isPage">
25
25
  <div class="w-full">
@@ -33,7 +33,6 @@ const showNotice = computed(() => {
33
33
  <div
34
34
  v-if="yun.isNimbo"
35
35
  class="yun-home-prologue-content absolute top-0 left-5 right-5 bottom-0 flex-center"
36
- :class="{ 'is-intro-complete': yun.bannerAnimationDone }"
37
36
  >
38
37
  <YunPrologueSquare class="z-1" :intro-complete="yun.bannerAnimationDone" />
39
38
  </div>
@@ -64,21 +63,6 @@ const showNotice = computed(() => {
64
63
  </template>
65
64
 
66
65
  <style scoped>
67
- @media (width > 768px) {
68
- .yun-home-prologue-content {
69
- visibility: hidden;
70
- opacity: 0;
71
- scale: 0.6;
72
- transition: opacity 800ms var(--yun-ease-in-out), scale 300ms var(--yun-ease-in-out);
73
- }
74
-
75
- .yun-home-prologue-content.is-intro-complete {
76
- visibility: visible;
77
- opacity: 1;
78
- scale: 1;
79
- }
80
- }
81
-
82
66
  @media (width <= 768px) {
83
67
  .yun-home-prologue :deep(#yun-banner),
84
68
  .yun-home-prologue :deep(#yun-banner-placeholder) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "valaxy-theme-yun",
3
3
  "type": "module",
4
- "version": "1.3.0",
4
+ "version": "1.3.1",
5
5
  "description": "Default theme (Yun) for Valaxy — a Vite & Vue powered static blog generator",
6
6
  "author": {
7
7
  "email": "me@yunyoujun.cn",
@@ -41,7 +41,7 @@
41
41
  "valaxy-addon-girls": "0.1.0"
42
42
  },
43
43
  "devDependencies": {
44
- "valaxy": "1.3.0",
44
+ "valaxy": "1.3.1",
45
45
  "valaxy-addon-waline": "0.2.1"
46
46
  },
47
47
  "scripts": {
package/types/index.d.ts CHANGED
@@ -163,6 +163,9 @@ export interface ThemeConfig extends DefaultTheme.Config {
163
163
  */
164
164
  banner: YunTheme.Banner
165
165
 
166
+ /** Where to load the optional Noto Serif SC web font. @default 'all' */
167
+ serifFont?: 'all' | 'except-home' | 'off'
168
+
166
169
  /** Post list presentation; per-post title classes take precedence. */
167
170
  postCard?: {
168
171
  /** Show the bottom excerpt gradient. @default true */