valaxy-theme-yun 0.19.13 → 0.20.0-beta.10
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 +30 -4
- package/bump.config.ts +7 -0
- package/client/constants/index.ts +13 -0
- package/components/ValaxyMain.vue +47 -58
- package/components/YunAdBoard.vue +4 -0
- package/components/YunAlbum.vue +13 -3
- package/components/YunAlbumList.vue +5 -11
- package/components/YunAside.vue +66 -43
- package/components/YunBackToTop.vue +11 -4
- package/components/YunBanner.vue +31 -15
- package/components/YunBg.vue +2 -0
- package/components/YunCard.vue +5 -1
- package/components/YunCategories.vue +15 -34
- package/components/YunCategory.vue +57 -40
- package/components/YunCategoryChildItem.vue +49 -0
- package/components/YunClassifyPopover.vue +59 -0
- package/components/YunCloud.vue +5 -10
- package/components/YunConfig.vue +2 -19
- package/components/YunDebug.vue +47 -0
- package/components/YunDock.vue +223 -0
- package/components/YunFooter.vue +56 -4
- package/components/YunFullscreenMenu.vue +57 -0
- package/components/YunGirlItem.vue +98 -0
- package/components/YunGirls.vue +2 -73
- package/components/YunGoDown.vue +8 -15
- package/components/YunLayoutPostTag.vue +11 -1
- package/components/YunLinkItem.vue +62 -0
- package/components/YunLinks.vue +15 -47
- package/components/YunNavMenu.vue +125 -0
- package/components/YunOutline.vue +1 -2
- package/components/YunOverlay.vue +31 -0
- package/components/YunOverview.vue +2 -79
- package/components/YunPageHeader.vue +1 -1
- package/components/YunPagination.vue +108 -0
- package/components/YunPostCard.vue +32 -3
- package/components/YunPostCategories.vue +3 -3
- package/components/YunPostCollapse.vue +12 -75
- package/components/YunPostCollapseItem.vue +137 -0
- package/components/YunPostDateMeta.vue +30 -0
- package/components/YunPostList.vue +6 -11
- package/components/YunPostMeta.vue +31 -39
- package/components/YunPostTags.vue +2 -2
- package/components/YunPostsInfo.vue +41 -0
- package/components/YunPrologue.vue +24 -0
- package/components/YunSearchBtn.vue +8 -6
- package/components/YunSelect.vue +1 -11
- package/components/YunSidebar.vue +7 -4
- package/components/YunSidebarCard.vue +10 -0
- package/components/YunSidebarNav.vue +0 -1
- package/components/YunSiteInfo.vue +72 -0
- package/components/YunSponsor.vue +21 -6
- package/components/animation/LineBurstEffects.vue +75 -0
- package/components/author/YunAuthorAvatar.vue +12 -0
- package/components/author/YunAuthorIntro.vue +11 -0
- package/components/author/YunAuthorName.vue +14 -0
- package/components/config/YunToggleDark.vue +37 -0
- package/components/layout/YunLayoutLeft.vue +12 -0
- package/components/layout/YunLayoutRight.vue +21 -0
- package/components/layout/YunLayoutWrapper.vue +13 -0
- package/components/menu/YunNavMenuItem.vue +22 -0
- package/components/menu/YunNavMenuTitle.vue +86 -0
- package/components/menu/YunPostClassifyNavItem.vue +30 -0
- package/components/page/YunPageHeaderGradient.vue +38 -0
- package/components/project/YunProjectCard.vue +120 -0
- package/components/project/YunProjectCollection.vue +15 -0
- package/components/project/YunProjectLinkItem.vue +60 -0
- package/components/project/YunProjectToggleButton.vue +17 -0
- package/components/project/YunProjects.vue +48 -0
- package/components/prologue/PrologueSocialIcon.vue +58 -0
- package/components/prologue/PrologueSocialLinks.vue +16 -0
- package/components/prologue/PrologueSquare.vue +145 -0
- package/components/prologue/YunAEFrame.vue +138 -0
- package/components/prologue/YunAERect.vue +127 -0
- package/components/site/YunFullscreenMenuItem.vue +26 -0
- package/components/site/YunFullscreenMenuList.vue +19 -0
- package/components/site/YunSiteDescription.vue +11 -0
- package/components/site/YunSiteLinkItem.vue +26 -0
- package/components/site/YunSiteLinks.vue +19 -0
- package/components/site/YunSiteSubtitle.vue +14 -0
- package/components/site/YunSiteTitle.vue +59 -0
- package/components/third/YunWalineMeta.vue +17 -5
- package/components/ui/YunDivider.vue +3 -0
- package/composables/animation.ts +33 -0
- package/docs/zh-CN/config.md +0 -3
- package/layouts/404.vue +1 -3
- package/layouts/albums.vue +25 -24
- package/layouts/archives.vue +32 -21
- package/layouts/categories.vue +47 -31
- package/layouts/default.vue +10 -5
- package/layouts/empty.vue +3 -0
- package/layouts/gallery.vue +31 -30
- package/layouts/home.vue +13 -12
- package/layouts/post.vue +23 -20
- package/layouts/posts.vue +10 -0
- package/layouts/projects.vue +25 -0
- package/layouts/tags.vue +51 -41
- package/node/config.ts +2 -5
- package/package.json +16 -7
- package/pages/page/[page].vue +3 -6
- package/pages/posts/index.vue +11 -0
- package/setup/main.ts +51 -9
- package/stores/app.ts +25 -3
- package/styles/animations/index.scss +73 -0
- package/styles/common/markdown.scss +4 -0
- package/styles/css-vars.scss +19 -1
- package/styles/global.scss +8 -0
- package/styles/index.scss +1 -0
- package/styles/layout/index.scss +2 -4
- package/styles/modules/prologue.scss +1 -0
- package/styles/primevue/index.ts +7 -0
- package/styles/primevue/tooltip.scss +55 -0
- package/styles/primevue/tooltip.ts +14 -0
- package/styles/vars.scss +23 -2
- package/styles/widgets/banner.scss +26 -6
- package/types/index.d.ts +53 -5
- package/types/projects.ts +48 -0
- package/unocss.config.ts +1 -2
- package/utils/animation.ts +35 -0
- package/utils/index.ts +2 -0
- package/valaxy.config.ts +1 -0
@@ -1,37 +1,10 @@
|
|
1
1
|
<script lang="ts" setup>
|
2
|
-
|
3
|
-
import { useRouter } from 'vue-router'
|
4
|
-
|
5
|
-
const siteConfig = useSiteConfig()
|
6
|
-
const router = useRouter()
|
2
|
+
// overview
|
7
3
|
</script>
|
8
4
|
|
9
5
|
<template>
|
10
6
|
<div class="sidebar-panel" p="2">
|
11
|
-
<
|
12
|
-
<RouterLink class="site-author-avatar" to="/about">
|
13
|
-
<img class="rounded-full" :src="siteConfig.author.avatar" alt="avatar">
|
14
|
-
<span v-if="siteConfig.author.status.emoji" class="site-author-status" :title="siteConfig.author.status.message || undefined">{{ siteConfig.author.status.emoji }}</span>
|
15
|
-
</RouterLink>
|
16
|
-
<div
|
17
|
-
class="site-author-name leading-6"
|
18
|
-
m="t-0 b-4"
|
19
|
-
>
|
20
|
-
<RouterLink to="/about">
|
21
|
-
{{ siteConfig.author.name }}
|
22
|
-
</RouterLink>
|
23
|
-
</div>
|
24
|
-
<RouterLink v-if="router.hasRoute('/about/site')" to="/about/site" class="site-name">
|
25
|
-
{{ siteConfig.title }}
|
26
|
-
</RouterLink>
|
27
|
-
<span v-else class="site-name">{{ siteConfig.title }}</span>
|
28
|
-
<h4 v-if="siteConfig.subtitle" class="site-subtitle block" text="xs">
|
29
|
-
{{ siteConfig.subtitle }}
|
30
|
-
</h4>
|
31
|
-
<div v-if="siteConfig.description" class="site-description my-1">
|
32
|
-
{{ siteConfig.description }}
|
33
|
-
</div>
|
34
|
-
</div>
|
7
|
+
<YunSiteInfo />
|
35
8
|
|
36
9
|
<YunSidebarNav />
|
37
10
|
<hr m="t-4 b-2" op="20">
|
@@ -47,59 +20,9 @@ const router = useRouter()
|
|
47
20
|
<style lang="scss">
|
48
21
|
@use "valaxy/client/styles/mixins/index.scss" as *;
|
49
22
|
|
50
|
-
.site-info {
|
51
|
-
&.fix-top {
|
52
|
-
margin-top: -1.5rem;
|
53
|
-
}
|
54
|
-
}
|
55
|
-
|
56
|
-
.site-author-avatar {
|
57
|
-
display: inline-block;
|
58
|
-
line-height: 0;
|
59
|
-
position: relative;
|
60
|
-
|
61
|
-
img {
|
62
|
-
height: 96px;
|
63
|
-
width: 96px;
|
64
|
-
max-width: 100%;
|
65
|
-
margin: 0;
|
66
|
-
padding: 4px;
|
67
|
-
background-color: white;
|
68
|
-
box-shadow: 0 0 10px rgba(black, 0.2);
|
69
|
-
transition: 0.4s;
|
70
|
-
|
71
|
-
&:hover {
|
72
|
-
box-shadow: 0 0 30px rgba(var(--va-c-primary-rgb), 0.2);
|
73
|
-
}
|
74
|
-
}
|
75
|
-
}
|
76
|
-
|
77
|
-
.site-author-status {
|
78
|
-
position: absolute;
|
79
|
-
height: 1.8rem;
|
80
|
-
width: 1.8rem;
|
81
|
-
bottom: 0;
|
82
|
-
right: 0;
|
83
|
-
line-height: 1.8rem;
|
84
|
-
border-radius: 50%;
|
85
|
-
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
|
86
|
-
background-color: var(--va-c-bg-light);
|
87
|
-
border: 1px solid rgba(255, 255, 255, 0.1);
|
88
|
-
}
|
89
|
-
|
90
23
|
.site-name {
|
91
24
|
color: var(--va-c-text);
|
92
25
|
font-family: get-css-var('font-serif');
|
93
26
|
font-weight: 900;
|
94
27
|
}
|
95
|
-
|
96
|
-
.site-subtitle {
|
97
|
-
color: get-css-var('c-gray');
|
98
|
-
display: block;
|
99
|
-
}
|
100
|
-
|
101
|
-
.site-description {
|
102
|
-
color: var(--va-c-text);
|
103
|
-
font-size: 0.8rem;
|
104
|
-
}
|
105
28
|
</style>
|
@@ -0,0 +1,108 @@
|
|
1
|
+
<script lang="ts" setup>
|
2
|
+
import { usePagination } from 'valaxy'
|
3
|
+
|
4
|
+
const props = defineProps<{
|
5
|
+
/**
|
6
|
+
* Total Pages
|
7
|
+
*/
|
8
|
+
total: number
|
9
|
+
/**
|
10
|
+
* Page Size
|
11
|
+
*/
|
12
|
+
pageSize: number
|
13
|
+
}>()
|
14
|
+
|
15
|
+
const { curPage, totalPages, showPage, getTo, surLen, prevTo, nextTo, showPrev, showNext } = usePagination({
|
16
|
+
total: props.total,
|
17
|
+
pageSize: props.pageSize,
|
18
|
+
})
|
19
|
+
</script>
|
20
|
+
|
21
|
+
<template>
|
22
|
+
<nav class="pagination">
|
23
|
+
<RouterLink v-if="showPrev" class="page-number" :to="prevTo" aria-label="prev">
|
24
|
+
<div i-ri-arrow-left-s-line />
|
25
|
+
</RouterLink>
|
26
|
+
|
27
|
+
<template v-for="i in totalPages">
|
28
|
+
<RouterLink
|
29
|
+
v-if="showPage(i)" :key="i" class="page-number"
|
30
|
+
:class="curPage === i && 'active'"
|
31
|
+
:to="getTo(i)"
|
32
|
+
>
|
33
|
+
{{ i }}
|
34
|
+
</RouterLink>
|
35
|
+
<span v-else-if="i === curPage - surLen" :key="`prev-space-${i}`" class="space" disabled>
|
36
|
+
...
|
37
|
+
</span>
|
38
|
+
<span v-else-if="i === curPage + surLen" :key="`next-space-${i}`" class="space" disabled>
|
39
|
+
...
|
40
|
+
</span>
|
41
|
+
</template>
|
42
|
+
|
43
|
+
<RouterLink v-if="showNext" class="page-number" :to="nextTo" aria-label="next">
|
44
|
+
<div i-ri-arrow-right-s-line />
|
45
|
+
</RouterLink>
|
46
|
+
</nav>
|
47
|
+
</template>
|
48
|
+
|
49
|
+
<style lang="scss">
|
50
|
+
:root {
|
51
|
+
--page-btn-bg-color: rgb(255 255 255 / 0.5);
|
52
|
+
--page-btn-hover-bg-color: var(--va-c-primary-lighter);
|
53
|
+
--page-btn-active-bg-color: var(--va-c-primary-light);
|
54
|
+
}
|
55
|
+
|
56
|
+
.dark {
|
57
|
+
--page-btn-bg-color: var(--va-c-bg-light);
|
58
|
+
}
|
59
|
+
|
60
|
+
.pagination {
|
61
|
+
display: flex;
|
62
|
+
justify-content: center;
|
63
|
+
align-items: center;
|
64
|
+
|
65
|
+
.prev, .next, .page-number, .space {
|
66
|
+
display: inline-flex;
|
67
|
+
justify-content: center;
|
68
|
+
align-items: center;
|
69
|
+
width: 2rem;
|
70
|
+
height: 2rem;
|
71
|
+
margin: 0;
|
72
|
+
|
73
|
+
// disabled attr
|
74
|
+
&[disabled] {
|
75
|
+
color: var(--va-c-text-light);
|
76
|
+
background-color: var(--va-c-bg-mute);
|
77
|
+
}
|
78
|
+
}
|
79
|
+
|
80
|
+
.prev, .next, .page-number {
|
81
|
+
cursor: pointer;
|
82
|
+
color: var(--va-c-text);
|
83
|
+
text-decoration: none;
|
84
|
+
background-color: var(--page-btn-bg-color);
|
85
|
+
|
86
|
+
&:hover {
|
87
|
+
// color: var(--va-c-bg);
|
88
|
+
color: white;
|
89
|
+
background: var(--page-btn-hover-bg-color);
|
90
|
+
}
|
91
|
+
|
92
|
+
&:active {
|
93
|
+
// color: var(--va-c-bg);
|
94
|
+
color: white;
|
95
|
+
background: var(--page-btn-active-bg-color);
|
96
|
+
}
|
97
|
+
|
98
|
+
&.active {
|
99
|
+
// color: var(--va-c-bg);
|
100
|
+
color: white;
|
101
|
+
font-weight: normal;
|
102
|
+
background: var(--page-btn-active-bg-color);
|
103
|
+
cursor: default;
|
104
|
+
}
|
105
|
+
|
106
|
+
}
|
107
|
+
}
|
108
|
+
</style>
|
@@ -1,7 +1,6 @@
|
|
1
1
|
<script lang="ts" setup>
|
2
2
|
import { useI18n } from 'vue-i18n'
|
3
3
|
import type { Post } from 'valaxy'
|
4
|
-
import type { StyleValue } from 'vue'
|
5
4
|
import { usePostProperty } from '../composables'
|
6
5
|
|
7
6
|
const props = defineProps<{
|
@@ -14,7 +13,12 @@ const { icon, styles } = usePostProperty(props.post.type)
|
|
14
13
|
</script>
|
15
14
|
|
16
15
|
<template>
|
17
|
-
<YunCard
|
16
|
+
<YunCard
|
17
|
+
class="w-full"
|
18
|
+
m="auto"
|
19
|
+
:class="post.cover ? 'post-card-image' : 'post-card'"
|
20
|
+
overflow="hidden" :style="styles"
|
21
|
+
>
|
18
22
|
<div class="flex flex-1 of-hidden justify-start items-start post-card-info" w="full">
|
19
23
|
<img
|
20
24
|
v-if="post.cover"
|
@@ -67,7 +71,7 @@ const { icon, styles } = usePostProperty(props.post.type)
|
|
67
71
|
<div
|
68
72
|
w="full" class="yun-card-actions flex justify-between"
|
69
73
|
min-h="10"
|
70
|
-
|
74
|
+
text="sm"
|
71
75
|
>
|
72
76
|
<div class="post-categories inline-flex" flex="wrap 1" items="center">
|
73
77
|
<YunPostCategories m="l-1" :categories="post.categories" />
|
@@ -77,3 +81,28 @@ const { icon, styles } = usePostProperty(props.post.type)
|
|
77
81
|
</div>
|
78
82
|
</YunCard>
|
79
83
|
</template>
|
84
|
+
|
85
|
+
<style lang="scss">
|
86
|
+
.post-card {
|
87
|
+
// safari not support
|
88
|
+
// animation: card-appear 0.6s ease-in-out forwards, card-appear 0.6s ease-in-out forwards reverse;
|
89
|
+
// animation-timeline: view();
|
90
|
+
// animation-range: entry, exit;
|
91
|
+
}
|
92
|
+
|
93
|
+
@keyframes card-appear {
|
94
|
+
0% {
|
95
|
+
opacity: 0;
|
96
|
+
transform: scale(0.8) translateY(20px);
|
97
|
+
}
|
98
|
+
|
99
|
+
100% {
|
100
|
+
opacity: 1;
|
101
|
+
transform: scale(1) translateY(0);
|
102
|
+
}
|
103
|
+
}
|
104
|
+
|
105
|
+
.yun-card-actions {
|
106
|
+
border-top: 1px solid rgb(122 122 122 / 0.05);
|
107
|
+
}
|
108
|
+
</style>
|
@@ -12,14 +12,14 @@ defineProps<{
|
|
12
12
|
path: '/categories',
|
13
13
|
query: { category: Array.isArray(categories) ? categories.join('/') : categories },
|
14
14
|
}"
|
15
|
-
class="transition post-category inline-flex-center text-xs border-$va-c-divider
|
15
|
+
class="transition post-category inline-flex-center text-xs border-$va-c-divider"
|
16
16
|
px-2 h="7"
|
17
17
|
border rounded-full
|
18
|
-
|
18
|
+
hover="bg-blue-500 text-white"
|
19
19
|
>
|
20
20
|
<div m="x-1" inline-flex i-ri-folder-2-line />
|
21
21
|
<span>
|
22
|
-
{{ Array.isArray(categories) ? categories.join('
|
22
|
+
{{ Array.isArray(categories) ? categories.join(' / ') : categories }}
|
23
23
|
</span>
|
24
24
|
</RouterLink>
|
25
25
|
</template>
|
@@ -44,10 +44,12 @@ const sortedYears = computed(() => {
|
|
44
44
|
</script>
|
45
45
|
|
46
46
|
<template>
|
47
|
-
<div class="post-collapse px-10 lt-sm:px-5" relative>
|
48
|
-
<
|
49
|
-
|
50
|
-
|
47
|
+
<div class="post-collapse px-10 lt-sm:px-5 max-w-3xl" relative>
|
48
|
+
<Transition appear enter-active-class="animate-fade-in animate-duration-400">
|
49
|
+
<div w="full" text="center" class="yun-text-light" p="2">
|
50
|
+
{{ t('counter.archives', posts.length) }}
|
51
|
+
</div>
|
52
|
+
</Transition>
|
51
53
|
|
52
54
|
<div class="post-collapse-action" text="center">
|
53
55
|
<button class="yun-icon-btn shadow hover:shadow-md" @click="isDesc = !isDesc">
|
@@ -63,23 +65,12 @@ const sortedYears = computed(() => {
|
|
63
65
|
</h2>
|
64
66
|
</div>
|
65
67
|
|
66
|
-
<
|
67
|
-
v-for="post, j in sortByDate(postListByYear[year], isDesc)"
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
<time v-if="post.date" class="post-time" font="mono" opacity="80">{{
|
73
|
-
formatDate(post.date, 'MM-dd') }}
|
74
|
-
</time>
|
75
|
-
</div>
|
76
|
-
<h2 class="post-title" inline-flex items-center font="serif black">
|
77
|
-
<RouterLink :to="post.path || ''" class="post-title-link">
|
78
|
-
{{ post.title }}
|
79
|
-
</RouterLink>
|
80
|
-
</h2>
|
81
|
-
</header>
|
82
|
-
</article>
|
68
|
+
<YunPostCollapseItem
|
69
|
+
v-for="post, j in sortByDate(postListByYear[year], isDesc)"
|
70
|
+
:key="j"
|
71
|
+
:post="post"
|
72
|
+
:i="j"
|
73
|
+
/>
|
83
74
|
</div>
|
84
75
|
</div>
|
85
76
|
</template>
|
@@ -116,59 +107,5 @@ const sortedYears = computed(() => {
|
|
116
107
|
}
|
117
108
|
}
|
118
109
|
}
|
119
|
-
|
120
|
-
.post-item {
|
121
|
-
&::before {
|
122
|
-
content: '';
|
123
|
-
position: absolute;
|
124
|
-
width: 2px;
|
125
|
-
height: 100%;
|
126
|
-
background: rgba(var(--va-c-primary-rgb), 0.3);
|
127
|
-
}
|
128
|
-
}
|
129
|
-
|
130
|
-
.post-header {
|
131
|
-
border-bottom: 1px solid rgba(var(--va-c-primary-rgb), 0.3);
|
132
|
-
|
133
|
-
&::before {
|
134
|
-
content: '';
|
135
|
-
position: absolute;
|
136
|
-
left: 0;
|
137
|
-
width: 10px;
|
138
|
-
height: 10px;
|
139
|
-
margin-left: -4px;
|
140
|
-
border-radius: 50%;
|
141
|
-
border: 1px solid var(--va-c-primary);
|
142
|
-
background-color: var(--va-c-bg-light);
|
143
|
-
z-index: 1;
|
144
|
-
transition: background var(--va-transition-duration);
|
145
|
-
}
|
146
|
-
|
147
|
-
&:hover {
|
148
|
-
&::before {
|
149
|
-
background: var(--va-c-primary);
|
150
|
-
}
|
151
|
-
}
|
152
|
-
|
153
|
-
.post-title {
|
154
|
-
margin-left: 0.1rem;
|
155
|
-
padding: 0;
|
156
|
-
font-size: 1rem;
|
157
|
-
|
158
|
-
.post-title-link {
|
159
|
-
.icon {
|
160
|
-
width: 1.1rem;
|
161
|
-
height: 1.1rem;
|
162
|
-
margin-right: 0.3rem;
|
163
|
-
}
|
164
|
-
}
|
165
|
-
}
|
166
|
-
|
167
|
-
.post-meta {
|
168
|
-
font-size: 1rem;
|
169
|
-
margin: 1rem 0 1rem 1.2rem;
|
170
|
-
white-space: nowrap;
|
171
|
-
}
|
172
|
-
}
|
173
110
|
}
|
174
111
|
</style>
|
@@ -0,0 +1,137 @@
|
|
1
|
+
<script setup lang="ts">
|
2
|
+
import { useMotion } from '@vueuse/motion'
|
3
|
+
import type { Post } from 'valaxy'
|
4
|
+
import { formatDate } from 'valaxy'
|
5
|
+
import { ref } from 'vue'
|
6
|
+
|
7
|
+
const props = defineProps<{
|
8
|
+
i: number
|
9
|
+
post: Post
|
10
|
+
}>()
|
11
|
+
|
12
|
+
const show = ref(false)
|
13
|
+
|
14
|
+
const itemRef = ref<HTMLElement>()
|
15
|
+
useMotion(itemRef, {
|
16
|
+
initial: { opacity: 0, y: 20 },
|
17
|
+
enter: {
|
18
|
+
opacity: 1,
|
19
|
+
y: 0,
|
20
|
+
transition: {
|
21
|
+
duration: 200,
|
22
|
+
delay: props.i * 50,
|
23
|
+
onComplete() {
|
24
|
+
show.value = true
|
25
|
+
},
|
26
|
+
},
|
27
|
+
},
|
28
|
+
})
|
29
|
+
</script>
|
30
|
+
|
31
|
+
<template>
|
32
|
+
<article
|
33
|
+
ref="itemRef"
|
34
|
+
class="post-item relative"
|
35
|
+
:class="{ show }"
|
36
|
+
>
|
37
|
+
<header
|
38
|
+
class="post-header cursor-pointer w-full" flex="~" items-center relative
|
39
|
+
hover="bg-black/1"
|
40
|
+
:class="{ show }"
|
41
|
+
>
|
42
|
+
<div class="post-meta">
|
43
|
+
<time v-if="post.date" class="post-time" font="mono" opacity="80">{{
|
44
|
+
formatDate(post.date, 'MM-dd') }}
|
45
|
+
</time>
|
46
|
+
</div>
|
47
|
+
<h2 class="post-title w-full" inline-flex items-center font="serif black">
|
48
|
+
<RouterLink :to="post.path || ''" class="post-title-link">
|
49
|
+
{{ post.title }}
|
50
|
+
</RouterLink>
|
51
|
+
</h2>
|
52
|
+
</header>
|
53
|
+
</article>
|
54
|
+
</template>
|
55
|
+
|
56
|
+
<style lang="scss">
|
57
|
+
@use 'sass:map';
|
58
|
+
@use 'valaxy-theme-yun/styles/vars.scss' as *;
|
59
|
+
|
60
|
+
.post-collapse {
|
61
|
+
.post-header {
|
62
|
+
&::before {
|
63
|
+
content: '';
|
64
|
+
position: absolute;
|
65
|
+
left: 0;
|
66
|
+
width: 10px;
|
67
|
+
height: 10px;
|
68
|
+
margin-left: -4px;
|
69
|
+
border-radius: 50%;
|
70
|
+
border: 1px solid var(--va-c-primary);
|
71
|
+
background-color: var(--va-c-bg-light);
|
72
|
+
z-index: 1;
|
73
|
+
transition: background var(--va-transition-duration);
|
74
|
+
}
|
75
|
+
|
76
|
+
&::after {
|
77
|
+
content: '';
|
78
|
+
position: absolute;
|
79
|
+
bottom: 0;
|
80
|
+
left: 0;
|
81
|
+
width: 0;
|
82
|
+
height: 1px;
|
83
|
+
background-color: rgba(var(--va-c-primary-rgb), 0.3);
|
84
|
+
transition: width 800ms map.get($cubic-bezier, 'ease-in');
|
85
|
+
}
|
86
|
+
|
87
|
+
&.show {
|
88
|
+
&::after {
|
89
|
+
width: 100%;
|
90
|
+
}
|
91
|
+
}
|
92
|
+
|
93
|
+
&:hover {
|
94
|
+
&::before {
|
95
|
+
background: var(--va-c-primary);
|
96
|
+
}
|
97
|
+
}
|
98
|
+
|
99
|
+
.post-title {
|
100
|
+
margin-left: 0.1rem;
|
101
|
+
padding: 0;
|
102
|
+
font-size: 1rem;
|
103
|
+
|
104
|
+
.post-title-link {
|
105
|
+
.icon {
|
106
|
+
width: 1.1rem;
|
107
|
+
height: 1.1rem;
|
108
|
+
margin-right: 0.3rem;
|
109
|
+
}
|
110
|
+
}
|
111
|
+
}
|
112
|
+
|
113
|
+
.post-meta {
|
114
|
+
font-size: 1rem;
|
115
|
+
margin: 1rem 0 1rem 1.2rem;
|
116
|
+
white-space: nowrap;
|
117
|
+
}
|
118
|
+
}
|
119
|
+
|
120
|
+
.post-item {
|
121
|
+
&::before {
|
122
|
+
content: '';
|
123
|
+
position: absolute;
|
124
|
+
width: 2px;
|
125
|
+
height: 0;
|
126
|
+
background: rgba(var(--va-c-primary-rgb), 0.3);
|
127
|
+
transition: height 600ms map.get($cubic-bezier, 'ease-in');
|
128
|
+
}
|
129
|
+
|
130
|
+
&.show {
|
131
|
+
&::before {
|
132
|
+
height: 100%;
|
133
|
+
}
|
134
|
+
}
|
135
|
+
}
|
136
|
+
}
|
137
|
+
</style>
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<script lang="ts" setup>
|
2
|
+
import type { Post } from 'valaxy'
|
3
|
+
import { formatDate } from 'valaxy'
|
4
|
+
import { useI18n } from 'vue-i18n'
|
5
|
+
import { formatTimestamp } from '../utils'
|
6
|
+
|
7
|
+
defineProps<{
|
8
|
+
// FrontMatter
|
9
|
+
frontmatter: Post
|
10
|
+
}>()
|
11
|
+
|
12
|
+
const { t } = useI18n()
|
13
|
+
</script>
|
14
|
+
|
15
|
+
<template>
|
16
|
+
<div v-if="frontmatter.date" class="post-time flex items-center gap-4">
|
17
|
+
<span class="posted-time inline-flex-center gap-1" :title="t('post.posted') + formatTimestamp(frontmatter.date)">
|
18
|
+
<div class="inline-block" i-ri-calendar-line />
|
19
|
+
<time class="op-80">{{ formatDate(frontmatter.date) }}</time>
|
20
|
+
</span>
|
21
|
+
|
22
|
+
<span
|
23
|
+
v-if="frontmatter.updated && frontmatter.updated !== frontmatter.date"
|
24
|
+
class="edited-time inline-flex-center gap-1" :title="t('post.edited') + formatTimestamp(frontmatter.updated)"
|
25
|
+
>
|
26
|
+
<div i-ri-calendar-2-line />
|
27
|
+
<time class="op-80">{{ formatDate(frontmatter.updated) }}</time>
|
28
|
+
</span>
|
29
|
+
</div>
|
30
|
+
</template>
|
@@ -28,23 +28,18 @@ const displayedPosts = computed(() =>
|
|
28
28
|
</script>
|
29
29
|
|
30
30
|
<template>
|
31
|
-
<div class="yun-post-list" w="full" p="x-4 lt-sm:0">
|
31
|
+
<div flex="~ col" class="yun-post-list gap-4" w="full" p="x-4 lt-sm:0">
|
32
32
|
<template v-if="!displayedPosts.length">
|
33
33
|
<div py2 op50 text-center>
|
34
34
|
博主还什么都没写哦~
|
35
35
|
</div>
|
36
36
|
</template>
|
37
37
|
|
38
|
-
<
|
39
|
-
<YunPostCard v-for="route, i in displayedPosts" :key="i" :post="route" />
|
40
|
-
</TransitionGroup>
|
38
|
+
<YunPostCard v-for="route, i in displayedPosts" :key="i" :post="route" />
|
41
39
|
</div>
|
42
40
|
|
43
|
-
<
|
41
|
+
<YunPagination
|
42
|
+
class="mt-5"
|
43
|
+
:total="posts.length" :page-size="pageSize"
|
44
|
+
/>
|
44
45
|
</template>
|
45
|
-
|
46
|
-
<style>
|
47
|
-
.yun-card-actions {
|
48
|
-
border-top: 1px solid rgba(122, 122, 122, 0.15);
|
49
|
-
}
|
50
|
-
</style>
|