valaxy-theme-yun 0.20.0-beta.10 → 0.20.0-beta.11
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/components/YunLayoutPostTag.vue +1 -0
- package/components/YunNotice.vue +6 -5
- package/components/YunPagination.vue +4 -0
- package/components/YunPostList.vue +8 -7
- package/components/YunPrologue.vue +1 -1
- package/components/animation/LineBurstEffects.vue +8 -5
- package/components/author/YunAuthorAvatar.vue +2 -1
- package/components/prologue/PrologueSquare.vue +78 -107
- package/components/prologue/YunAEFrame.vue +1 -1
- package/composables/animation.ts +5 -1
- package/layouts/home.vue +2 -2
- package/package.json +1 -1
- package/styles/animations/index.scss +8 -0
- package/styles/css-vars.scss +1 -1
package/components/YunNotice.vue
CHANGED
@@ -5,16 +5,17 @@ defineProps<{
|
|
5
5
|
</script>
|
6
6
|
|
7
7
|
<template>
|
8
|
-
<div class="
|
9
|
-
<
|
10
|
-
|
8
|
+
<div class="w-full px-4 flex-center">
|
9
|
+
<div class="yun-notice w-full">
|
10
|
+
<span v-html="content" />
|
11
|
+
<slot />
|
12
|
+
</div>
|
11
13
|
</div>
|
12
14
|
</template>
|
13
15
|
|
14
16
|
<style>
|
15
17
|
.yun-notice {
|
16
18
|
border: 1px solid var(--va-c-text);
|
17
|
-
width: calc(100% - 2rem);
|
18
19
|
display: flex;
|
19
20
|
flex-direction: column;
|
20
21
|
justify-content: center;
|
@@ -23,6 +24,6 @@ defineProps<{
|
|
23
24
|
font-weight: bold;
|
24
25
|
padding: 1rem;
|
25
26
|
max-width: var(--yun-post-card-max-width);
|
26
|
-
background-color:
|
27
|
+
background-color: rgb(200 200 200 / 0.1);
|
27
28
|
}
|
28
29
|
</style>
|
@@ -1,15 +1,15 @@
|
|
1
1
|
<script setup lang="ts">
|
2
|
-
import { computed } from 'vue'
|
2
|
+
import { computed, ref } from 'vue'
|
3
3
|
import { useSiteConfig, useSiteStore } from 'valaxy'
|
4
4
|
import type { Post } from 'valaxy/types'
|
5
5
|
|
6
6
|
const props = withDefaults(defineProps<{
|
7
7
|
type?: string
|
8
8
|
posts?: Post[]
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
}>(), {})
|
10
|
+
|
11
|
+
const paginationRef = ref()
|
12
|
+
const curPage = computed(() => paginationRef.value?.curPage || 1)
|
13
13
|
|
14
14
|
const site = useSiteStore()
|
15
15
|
const siteConfig = useSiteConfig()
|
@@ -21,8 +21,8 @@ const posts = computed(() => (
|
|
21
21
|
|
22
22
|
const displayedPosts = computed(() =>
|
23
23
|
posts.value.slice(
|
24
|
-
(
|
25
|
-
|
24
|
+
(curPage.value - 1) * pageSize.value,
|
25
|
+
curPage.value * pageSize.value,
|
26
26
|
),
|
27
27
|
)
|
28
28
|
</script>
|
@@ -39,6 +39,7 @@ const displayedPosts = computed(() =>
|
|
39
39
|
</div>
|
40
40
|
|
41
41
|
<YunPagination
|
42
|
+
ref="paginationRef"
|
42
43
|
class="mt-5"
|
43
44
|
:total="posts.length" :page-size="pageSize"
|
44
45
|
/>
|
@@ -1,16 +1,19 @@
|
|
1
1
|
<script setup lang="ts">
|
2
2
|
// 播放完销毁 css 动画
|
3
|
+
import { sleep } from 'valaxy'
|
3
4
|
import { onMounted, ref } from 'vue'
|
4
5
|
|
5
6
|
const props = defineProps<{
|
7
|
+
delay: number
|
6
8
|
duration: number
|
7
9
|
}>()
|
8
10
|
|
9
|
-
const destroy = ref(
|
10
|
-
onMounted(() => {
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
const destroy = ref(true)
|
12
|
+
onMounted(async () => {
|
13
|
+
await sleep(props.delay)
|
14
|
+
destroy.value = false
|
15
|
+
await sleep(props.duration)
|
16
|
+
destroy.value = true
|
14
17
|
})
|
15
18
|
</script>
|
16
19
|
|
@@ -1,64 +1,10 @@
|
|
1
1
|
<script setup lang="ts">
|
2
|
-
import { useMotion } from '@vueuse/motion'
|
3
2
|
import { ref } from 'vue'
|
4
|
-
import { cubicBezier } from '../../client/constants'
|
5
3
|
import { useThemeConfig } from '../../composables'
|
6
4
|
|
7
5
|
const themeConfig = useThemeConfig()
|
8
6
|
|
9
7
|
const showContent = ref(false)
|
10
|
-
const avatarRef = ref<HTMLElement>()
|
11
|
-
const motionInstance = useMotion(avatarRef, {
|
12
|
-
initial: {
|
13
|
-
borderRadius: '0%',
|
14
|
-
width: 'var(--total-char-height)',
|
15
|
-
height: 'var(--total-char-height)',
|
16
|
-
rotate: 135,
|
17
|
-
y: '0%',
|
18
|
-
},
|
19
|
-
enter: {
|
20
|
-
borderRadius: '50%',
|
21
|
-
rotate: 0,
|
22
|
-
y: '0%',
|
23
|
-
width: '120px',
|
24
|
-
height: '120px',
|
25
|
-
boxShadow: 'none',
|
26
|
-
transition: {
|
27
|
-
type: 'keyframes',
|
28
|
-
ease: cubicBezier.easeIn,
|
29
|
-
duration: 800,
|
30
|
-
onComplete: () => {
|
31
|
-
motionInstance.variant.value = 'leave'
|
32
|
-
showContent.value = true
|
33
|
-
},
|
34
|
-
},
|
35
|
-
},
|
36
|
-
leave: {
|
37
|
-
// y: '-50%',
|
38
|
-
boxShadow: '0 5px 100px rgba(0, 0, 0, 0.15)',
|
39
|
-
transition: {
|
40
|
-
type: 'keyframes',
|
41
|
-
ease: cubicBezier.easeInOut,
|
42
|
-
duration: 500,
|
43
|
-
},
|
44
|
-
},
|
45
|
-
})
|
46
|
-
|
47
|
-
const introRef = ref<HTMLElement>()
|
48
|
-
useMotion(introRef, {
|
49
|
-
initial: {
|
50
|
-
y: '0%',
|
51
|
-
},
|
52
|
-
enter: {
|
53
|
-
y: 'calc(-50%)',
|
54
|
-
transition: {
|
55
|
-
delay: 800,
|
56
|
-
type: 'keyframes',
|
57
|
-
ease: cubicBezier.easeInOut,
|
58
|
-
duration: 400,
|
59
|
-
},
|
60
|
-
},
|
61
|
-
})
|
62
8
|
</script>
|
63
9
|
|
64
10
|
<template>
|
@@ -72,69 +18,77 @@ useMotion(introRef, {
|
|
72
18
|
<slot />
|
73
19
|
|
74
20
|
<div
|
75
|
-
ref="introRef"
|
76
21
|
flex="~ col center"
|
77
|
-
class="info relative"
|
22
|
+
class="info relative duration-800 transition-cubic-bezier-ease-in"
|
23
|
+
:class="{
|
24
|
+
'translate-y--1/2': showContent,
|
25
|
+
}"
|
78
26
|
>
|
79
|
-
<
|
80
|
-
|
27
|
+
<Transition
|
28
|
+
enter-from-class="enter-from"
|
29
|
+
enter-to-class="enter-to"
|
30
|
+
appear
|
31
|
+
@after-appear="showContent = true"
|
81
32
|
>
|
82
|
-
<
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
33
|
+
<div
|
34
|
+
flex="~ col"
|
35
|
+
class="absolute yun-square bg-$va-c-text square-rotate w-full z-1"
|
36
|
+
>
|
37
|
+
<LineBurstEffects
|
38
|
+
class="absolute top-0 left-0 right-0 bottom-0 size-full scale-200"
|
39
|
+
:delay="1000"
|
40
|
+
:duration="600"
|
41
|
+
/>
|
42
|
+
<Transition
|
43
|
+
enter-from-class="op-0"
|
44
|
+
enter-to-class="op-100"
|
45
|
+
enter-active-class="transition-400 delay-400"
|
46
|
+
appear
|
47
|
+
>
|
48
|
+
<YunAuthorAvatar />
|
49
|
+
</Transition>
|
50
|
+
</div>
|
51
|
+
</Transition>
|
88
52
|
|
89
|
-
<
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
opacity: 0,
|
94
|
-
y: '0',
|
95
|
-
}"
|
96
|
-
:enter="{
|
97
|
-
opacity: 1,
|
98
|
-
y: 'calc(50% + 60px)',
|
99
|
-
transition: {
|
100
|
-
type: 'keyframes',
|
101
|
-
ease: cubicBezier.easeInOut,
|
102
|
-
duration: 400,
|
103
|
-
},
|
104
|
-
}"
|
53
|
+
<Transition
|
54
|
+
enter-from-class="translate-y-0"
|
55
|
+
enter-active-class="duration-800 transition-cubic-bezier-ease-in"
|
56
|
+
appear
|
105
57
|
>
|
106
|
-
<
|
107
|
-
|
58
|
+
<div v-if="showContent" class="translate-y-[calc(50%+50px)] animate-fade-in">
|
59
|
+
<YunAuthorName class="mt-3" />
|
60
|
+
<YunAuthorIntro />
|
108
61
|
|
109
|
-
|
62
|
+
<YunDivider />
|
110
63
|
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
64
|
+
<div flex="~ col" class="gap-2 items-center justify-center">
|
65
|
+
<YunSiteTitle />
|
66
|
+
<YunSiteSubtitle />
|
67
|
+
<YunSiteDescription />
|
68
|
+
</div>
|
116
69
|
|
117
|
-
|
70
|
+
<YunDivider />
|
118
71
|
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
72
|
+
<div
|
73
|
+
class="mt-4 flex-center w-64 md:w-100 m-auto gap-2"
|
74
|
+
flex="~ wrap"
|
75
|
+
p="x-$rect-margin"
|
76
|
+
>
|
77
|
+
<YunSiteLinkItem
|
78
|
+
:page="{
|
79
|
+
name: '博客文章',
|
80
|
+
icon: 'i-ri-article-line',
|
81
|
+
url: '/posts/',
|
82
|
+
}"
|
83
|
+
/>
|
84
|
+
<slot />
|
85
|
+
<YunSiteLinkItem
|
86
|
+
v-for="item, i in themeConfig.pages"
|
87
|
+
:key="i" :page="item"
|
88
|
+
/>
|
89
|
+
</div>
|
136
90
|
</div>
|
137
|
-
</
|
91
|
+
</Transition>
|
138
92
|
</div>
|
139
93
|
</div>
|
140
94
|
</template>
|
@@ -142,4 +96,21 @@ useMotion(introRef, {
|
|
142
96
|
<style lang="scss">
|
143
97
|
@use 'sass:map';
|
144
98
|
@use 'valaxy-theme-yun/styles/vars.scss' as *;
|
99
|
+
|
100
|
+
.yun-square {
|
101
|
+
transition: all 0.8s map.get($cubic-bezier, 'ease-in');
|
102
|
+
border-radius: 50%;
|
103
|
+
transform: rotate(0deg) translateY(0%);
|
104
|
+
width: 100px;
|
105
|
+
height: 100px;
|
106
|
+
box-shadow: 0 5px 100px rgb(0 0 0 / 0.15);
|
107
|
+
|
108
|
+
&.enter-from {
|
109
|
+
border-radius: 0%;
|
110
|
+
width: var(--total-char-height);
|
111
|
+
height: var(--total-char-height);
|
112
|
+
transform: rotate(135deg) translateY(0%);
|
113
|
+
box-shadow: none;
|
114
|
+
}
|
115
|
+
}
|
145
116
|
</style>
|
package/composables/animation.ts
CHANGED
@@ -12,6 +12,10 @@ export function useYunSpringAnimation(target: MaybeRef<HTMLElement | undefined>,
|
|
12
12
|
i: number
|
13
13
|
y?: number
|
14
14
|
duration?: number
|
15
|
+
/**
|
16
|
+
* delay in ms
|
17
|
+
*/
|
18
|
+
delay?: number
|
15
19
|
}) {
|
16
20
|
useMotion(target, {
|
17
21
|
initial: {
|
@@ -22,7 +26,7 @@ export function useYunSpringAnimation(target: MaybeRef<HTMLElement | undefined>,
|
|
22
26
|
opacity: 1,
|
23
27
|
y: 0,
|
24
28
|
transition: {
|
25
|
-
delay: options.i * 50,
|
29
|
+
delay: options.i * (options.delay || 50),
|
26
30
|
type: 'spring',
|
27
31
|
ease: cubicBezier.easeIn,
|
28
32
|
damping: 8,
|
package/layouts/home.vue
CHANGED
@@ -16,7 +16,7 @@ const showNotice = computed(() => {
|
|
16
16
|
|
17
17
|
<template>
|
18
18
|
<YunLayoutWrapper
|
19
|
-
class="items-center
|
19
|
+
class="items-center flex-col"
|
20
20
|
:class="{
|
21
21
|
'mt-0!': !isPage,
|
22
22
|
}"
|
@@ -29,7 +29,7 @@ const showNotice = computed(() => {
|
|
29
29
|
|
30
30
|
<YunNotice
|
31
31
|
v-if="showNotice"
|
32
|
-
class="mb-
|
32
|
+
class="mb-2 md:mb-6"
|
33
33
|
:class="{
|
34
34
|
'mt-4': !isPage,
|
35
35
|
}"
|
package/package.json
CHANGED
@@ -4,6 +4,14 @@
|
|
4
4
|
@use 'sass:map';
|
5
5
|
@use '../vars.scss' as *;
|
6
6
|
|
7
|
+
.transition-cubic-bezier-ease-in {
|
8
|
+
transition-timing-function: map.get($cubic-bezier, 'ease-in');
|
9
|
+
}
|
10
|
+
|
11
|
+
.transition-cubic-bezier-ease-in-out {
|
12
|
+
transition-timing-function: map.get($cubic-bezier, 'ease-in-out');
|
13
|
+
}
|
14
|
+
|
7
15
|
.v-enter-active,
|
8
16
|
.v-leave-active {
|
9
17
|
transition: opacity .2s map.get($cubic-bezier, 'ease-in');
|