valaxy-theme-yun 0.0.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.
- package/LICENSE +21 -0
- package/README.md +33 -0
- package/components/YunAlgoliaSearch.vue +228 -0
- package/components/YunBackToTop.vue +59 -0
- package/components/YunBanner.vue +70 -0
- package/components/YunBase.vue +24 -0
- package/components/YunCard.vue +29 -0
- package/components/YunCategories.vue +45 -0
- package/components/YunCategory.vue +39 -0
- package/components/YunCloud.vue +76 -0
- package/components/YunConfig.vue +24 -0
- package/components/YunGirls.vue +104 -0
- package/components/YunGoDown.vue +46 -0
- package/components/YunLinks.vue +109 -0
- package/components/YunPageHeader.vue +16 -0
- package/components/YunPostCollapse.vue +187 -0
- package/components/YunPostMeta.vue +29 -0
- package/components/YunPostNav.vue +89 -0
- package/components/YunSay.vue +83 -0
- package/components/YunSidebar.vue +111 -0
- package/components/YunSidebarLinks.vue +30 -0
- package/components/YunSidebarNav.vue +95 -0
- package/components/YunSocialLinks.vue +31 -0
- package/components/YunSponsor.vue +75 -0
- package/components/YunWaline.vue +26 -0
- package/composables/index.ts +25 -0
- package/config/index.ts +192 -0
- package/dist/index.d.ts +93 -0
- package/dist/index.js +1 -0
- package/dist/index.mjs +1 -0
- package/index.ts +1 -0
- package/layouts/404.vue +25 -0
- package/layouts/archives.vue +21 -0
- package/layouts/base.vue +64 -0
- package/layouts/categories.vue +66 -0
- package/layouts/default.vue +7 -0
- package/layouts/home.vue +27 -0
- package/layouts/post.vue +22 -0
- package/layouts/tags.vue +83 -0
- package/locales/en.yml +0 -0
- package/locales/zh-CN.yml +0 -0
- package/package.json +25 -0
- package/styles/index.scss +2 -0
- package/styles/layout/index.scss +7 -0
- package/styles/layout/post.scss +86 -0
- package/styles/markdown.scss +31 -0
- package/styles/vars.scss +7 -0
- package/tsup.config.ts +13 -0
- package/utils/index.ts +5 -0
package/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2022 云游君 YunYouJun <me@yunyoujun.cn>
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
<p align='center'>
|
2
|
+
<img width="200" src="https://cdn.jsdelivr.net/gh/YunYouJun/yun/images/meme/yun-good-alpha-compressed.png">
|
3
|
+
</p>
|
4
|
+
|
5
|
+
<p align='center'>
|
6
|
+
Theme-Yun<sup><em>(vue)</em></sup>
|
7
|
+
</p>
|
8
|
+
|
9
|
+
## Usage
|
10
|
+
|
11
|
+
TODO
|
12
|
+
|
13
|
+
### Development
|
14
|
+
|
15
|
+
Just run and visit <http://localhost:3333>
|
16
|
+
|
17
|
+
```bash
|
18
|
+
pnpm dev
|
19
|
+
```
|
20
|
+
|
21
|
+
### Build
|
22
|
+
|
23
|
+
```bash
|
24
|
+
pnpm build
|
25
|
+
```
|
26
|
+
|
27
|
+
## [Sponsors](https://sponsors.yunyoujun.cn)
|
28
|
+
|
29
|
+
<p align="center">
|
30
|
+
<a href="https://cdn.jsdelivr.net/gh/YunYouJun/sponsors/public/sponsors.svg">
|
31
|
+
<img src='https://cdn.jsdelivr.net/gh/YunYouJun/sponsors/public/sponsors.svg'/>
|
32
|
+
</a>
|
33
|
+
</p>
|
@@ -0,0 +1,228 @@
|
|
1
|
+
<script lang="ts" setup>
|
2
|
+
import { ref, watch } from 'vue'
|
3
|
+
import { useMagicKeys } from '@vueuse/core'
|
4
|
+
import { useI18n } from 'vue-i18n'
|
5
|
+
import { useConfig } from 'valaxy'
|
6
|
+
import { useAlgoliaSearch } from '~/composables/search/algolia'
|
7
|
+
|
8
|
+
const { t } = useI18n()
|
9
|
+
|
10
|
+
const config = useConfig()
|
11
|
+
const showPopup = ref(false)
|
12
|
+
|
13
|
+
const { Escape } = useMagicKeys()
|
14
|
+
|
15
|
+
useAlgoliaSearch({
|
16
|
+
...config.value.search.algolia,
|
17
|
+
hits: {
|
18
|
+
per_page: 8,
|
19
|
+
},
|
20
|
+
})
|
21
|
+
|
22
|
+
watch(Escape, () => {
|
23
|
+
showPopup.value = false
|
24
|
+
})
|
25
|
+
|
26
|
+
watch(showPopup, () => {
|
27
|
+
if (showPopup.value)
|
28
|
+
document.documentElement.classList.add('no-scroll')
|
29
|
+
else
|
30
|
+
document.documentElement.classList.remove('no-scroll')
|
31
|
+
})
|
32
|
+
|
33
|
+
</script>
|
34
|
+
|
35
|
+
<template>
|
36
|
+
<button class="search-btn popup-trigger yun-icon-btn" :title="t('menu.search')" @click="showPopup = !showPopup">
|
37
|
+
<div v-if="!showPopup" i-ri-search-line />
|
38
|
+
<div v-else text="!2xl" i-ri-close-line />
|
39
|
+
</button>
|
40
|
+
|
41
|
+
<transition>
|
42
|
+
<div v-show="showPopup" class="search-popup">
|
43
|
+
<div class="search-header" />
|
44
|
+
<div class="search-input-container" />
|
45
|
+
<div class="algolia-results">
|
46
|
+
<div id="algolia-stats" />
|
47
|
+
<div id="algolia-hits" />
|
48
|
+
<div id="algolia-pagination" class="algolia-pagination" />
|
49
|
+
</div>
|
50
|
+
</div>
|
51
|
+
</transition>
|
52
|
+
</template>
|
53
|
+
|
54
|
+
<style lang="scss">
|
55
|
+
@use 'sass:map';
|
56
|
+
@use '~/styles/vars' as *;
|
57
|
+
|
58
|
+
.search-btn {
|
59
|
+
position: fixed;
|
60
|
+
top: 0.6rem;
|
61
|
+
right: 0.8rem;
|
62
|
+
|
63
|
+
color: var(--yun-c-primary);
|
64
|
+
z-index: map.get($z-index, 'search-btn');
|
65
|
+
}
|
66
|
+
|
67
|
+
.search-popup {
|
68
|
+
position: fixed;
|
69
|
+
top: 0;
|
70
|
+
left: 0;
|
71
|
+
width: 100%;
|
72
|
+
height: 100%;
|
73
|
+
|
74
|
+
backdrop-filter: blur(30px);
|
75
|
+
-webkit-backdrop-filter: blur(30px);
|
76
|
+
|
77
|
+
text-align: center;
|
78
|
+
padding-top: 3.5rem;
|
79
|
+
margin: 0;
|
80
|
+
z-index: map.get($z-index, 'search-popup');
|
81
|
+
transition: 0.6s;
|
82
|
+
}
|
83
|
+
|
84
|
+
.search-header {
|
85
|
+
.close-icon {
|
86
|
+
position: fixed;
|
87
|
+
top: 0.6rem;
|
88
|
+
right: 0.8rem;
|
89
|
+
}
|
90
|
+
}
|
91
|
+
|
92
|
+
.search-input {
|
93
|
+
background: transparent;
|
94
|
+
color: var(--yun-c-text);
|
95
|
+
font-size: 1.5rem;
|
96
|
+
border-radius: 3rem;
|
97
|
+
padding: 1rem 1.5rem;
|
98
|
+
border: 1px solid var(--yun-c-gray);
|
99
|
+
box-sizing: border-box;
|
100
|
+
width: 90%;
|
101
|
+
max-width: 800px;
|
102
|
+
font-family: var(--yun-font-serif);
|
103
|
+
font-weight: 900;
|
104
|
+
text-align: center;
|
105
|
+
}
|
106
|
+
|
107
|
+
.popup {
|
108
|
+
.search-icon, .close-icon {
|
109
|
+
display: inline-block;
|
110
|
+
width: 2rem;
|
111
|
+
height: 2rem;
|
112
|
+
padding: 0.5rem;
|
113
|
+
|
114
|
+
.icon {
|
115
|
+
width: 2rem;
|
116
|
+
height: 2rem;
|
117
|
+
}
|
118
|
+
}
|
119
|
+
}
|
120
|
+
|
121
|
+
.ais-Stats {
|
122
|
+
.ais-Stats-text {
|
123
|
+
display: flex;
|
124
|
+
justify-content: center;
|
125
|
+
align-items: center;
|
126
|
+
|
127
|
+
position: relative;
|
128
|
+
|
129
|
+
padding-bottom: 8px;
|
130
|
+
margin-bottom: 8px;
|
131
|
+
font-size: small;
|
132
|
+
}
|
133
|
+
}
|
134
|
+
|
135
|
+
.algolia-powered {
|
136
|
+
position: absolute;
|
137
|
+
top: 0;
|
138
|
+
right: 1rem;
|
139
|
+
|
140
|
+
display: inline-flex;
|
141
|
+
justify-content: center;
|
142
|
+
align-items: center;
|
143
|
+
|
144
|
+
img {
|
145
|
+
width: 1rem;
|
146
|
+
height: 1rem;
|
147
|
+
display: inline-flex;
|
148
|
+
}
|
149
|
+
}
|
150
|
+
|
151
|
+
.algolia-results {
|
152
|
+
position: relative;
|
153
|
+
overflow: auto;
|
154
|
+
padding: 10px 30px 0 30px;
|
155
|
+
|
156
|
+
hr {
|
157
|
+
margin-top: 10px;
|
158
|
+
margin-bottom: 0;
|
159
|
+
}
|
160
|
+
}
|
161
|
+
|
162
|
+
.algolia-hit-item {
|
163
|
+
display: flex;
|
164
|
+
justify-content: center;
|
165
|
+
}
|
166
|
+
|
167
|
+
.algolia-hit-item-link {
|
168
|
+
display: block;
|
169
|
+
width: 100%;
|
170
|
+
padding: 0.5rem;
|
171
|
+
border-bottom: 1px dashed #ccc;
|
172
|
+
font-family: var(--yun-font-serif);
|
173
|
+
font-weight: 900;
|
174
|
+
font-size: 1.2rem;
|
175
|
+
max-width: 800px;
|
176
|
+
|
177
|
+
mark {
|
178
|
+
color: var(--yun-c-danger);
|
179
|
+
font-family: 900;
|
180
|
+
background-color: transparent;
|
181
|
+
text-decoration: underline;
|
182
|
+
}
|
183
|
+
|
184
|
+
small {
|
185
|
+
display: flex;
|
186
|
+
font-size: 12px;
|
187
|
+
justify-content: center;
|
188
|
+
font-family: var(--yun-font-sans);
|
189
|
+
font-weight: normal;
|
190
|
+
line-height: 1;
|
191
|
+
margin-top: -0.2rem;
|
192
|
+
}
|
193
|
+
}
|
194
|
+
|
195
|
+
.algolia-pagination {
|
196
|
+
margin-top: 1rem;
|
197
|
+
.ais-Pagination-list {
|
198
|
+
display: flex;
|
199
|
+
padding-inline-start: 0;
|
200
|
+
}
|
201
|
+
|
202
|
+
.pagination-item {
|
203
|
+
display: inline-flex;
|
204
|
+
list-style-type: none;
|
205
|
+
}
|
206
|
+
|
207
|
+
.page-number {
|
208
|
+
border-top: none;
|
209
|
+
}
|
210
|
+
|
211
|
+
.disabled-item {
|
212
|
+
display: none;
|
213
|
+
}
|
214
|
+
|
215
|
+
.active {
|
216
|
+
.page-number {
|
217
|
+
background: var(--page-btn-active-bg-color);
|
218
|
+
color: var(--yun-c-bg);
|
219
|
+
}
|
220
|
+
}
|
221
|
+
}
|
222
|
+
|
223
|
+
.ais-Hits-list {
|
224
|
+
margin: 0;
|
225
|
+
list-style-type: none;
|
226
|
+
padding-inline-start: 0;
|
227
|
+
}
|
228
|
+
</style>
|
@@ -0,0 +1,59 @@
|
|
1
|
+
<script lang="ts" setup>
|
2
|
+
import { computed } from 'vue'
|
3
|
+
import { useBackToTop } from '~/composables'
|
4
|
+
|
5
|
+
const { show, percentage } = useBackToTop({ offset: 100 })
|
6
|
+
|
7
|
+
const radius = 48
|
8
|
+
const circumference = 2 * radius * Math.PI
|
9
|
+
|
10
|
+
const strokeOffset = computed(() => {
|
11
|
+
// 周长
|
12
|
+
const val = (1 - percentage.value) * circumference
|
13
|
+
return val < 0 ? 0 : val
|
14
|
+
})
|
15
|
+
</script>
|
16
|
+
|
17
|
+
<template>
|
18
|
+
<a href="#" class="back-to-top yun-icon-btn" :class="show && 'show'">
|
19
|
+
<div w="8" h="8" i-ri-arrow-up-s-line />
|
20
|
+
<svg class="progress-circle-container" viewBox="0 0 100 100">
|
21
|
+
<circle :stroke-dasharray="`${circumference} ${circumference}`" :stroke-dashoffset="strokeOffset" class="progress-circle" cx="50" cy="50" :r="radius" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
|
22
|
+
</svg>
|
23
|
+
</a>
|
24
|
+
</template>
|
25
|
+
|
26
|
+
<style lang="scss">
|
27
|
+
@use "sass:map";
|
28
|
+
@use "~/styles/vars" as *;
|
29
|
+
|
30
|
+
.back-to-top {
|
31
|
+
position: relative;
|
32
|
+
position: fixed;
|
33
|
+
right: -0.9rem;
|
34
|
+
bottom: 1.1rem;
|
35
|
+
z-index: map.get($z-index, 'go-up-btn');
|
36
|
+
opacity: 0;
|
37
|
+
color: var(--yun-c-primary);
|
38
|
+
|
39
|
+
&.show {
|
40
|
+
transform: translateX(-30px) rotate(360deg);
|
41
|
+
opacity: 1;
|
42
|
+
}
|
43
|
+
|
44
|
+
.icon {
|
45
|
+
width: 2.5rem;
|
46
|
+
height: 2.5rem;
|
47
|
+
}
|
48
|
+
}
|
49
|
+
|
50
|
+
.progress-circle {
|
51
|
+
transition: 0.3s stroke-dashoffset;
|
52
|
+
transform: rotate(-90deg);
|
53
|
+
transform-origin: 50% 50%;
|
54
|
+
|
55
|
+
&-container {
|
56
|
+
position: absolute;
|
57
|
+
}
|
58
|
+
}
|
59
|
+
</style>
|
@@ -0,0 +1,70 @@
|
|
1
|
+
<script lang="ts" setup>
|
2
|
+
/**
|
3
|
+
* @file 生成首页标语动画
|
4
|
+
* @author YunYouJun <me@yunyoujun.cn>
|
5
|
+
* @description https://github.com/YunYouJun/hexo-theme-yun
|
6
|
+
*/
|
7
|
+
|
8
|
+
import type { CSSProperties } from 'vue'
|
9
|
+
import { computed } from 'vue'
|
10
|
+
import { useThemeConfig } from 'valaxy'
|
11
|
+
import { random } from '~/utils'
|
12
|
+
const themeConfig = useThemeConfig()
|
13
|
+
|
14
|
+
const chars = computed(() => {
|
15
|
+
const arr = []
|
16
|
+
for (let i = 0; i < themeConfig.value.banner.title.length; i++) {
|
17
|
+
const rn = random(1.5, 3.5)
|
18
|
+
arr.push(rn)
|
19
|
+
}
|
20
|
+
return arr
|
21
|
+
})
|
22
|
+
// height of top/bottom line
|
23
|
+
const lineH = computed(() => chars.value.reduce((a, b) => a + b, 0) / 2)
|
24
|
+
|
25
|
+
const lintStyle = computed(() => (
|
26
|
+
{
|
27
|
+
'--banner-line-height': `calc(50vh - ${lineH.value}rem)`,
|
28
|
+
} as CSSProperties
|
29
|
+
))
|
30
|
+
</script>
|
31
|
+
|
32
|
+
<template>
|
33
|
+
<div id="banner">
|
34
|
+
<div class="banner-line vertical-line-top" :style="lintStyle" />
|
35
|
+
<div class="banner-char-container">
|
36
|
+
<div v-for="c, i in themeConfig.banner.title" :key="i" class="char-box">
|
37
|
+
<span
|
38
|
+
:class="[i%2 !== 0 ? 'char-right' : 'char-left']" :style="{
|
39
|
+
'--banner-char-size': `${chars[i]}rem`,
|
40
|
+
} as CSSProperties"
|
41
|
+
>
|
42
|
+
<span class="char">
|
43
|
+
{{ c }}
|
44
|
+
</span>
|
45
|
+
</span>
|
46
|
+
</div>
|
47
|
+
</div>
|
48
|
+
<div class="banner-line vertical-line-bottom" :style="lintStyle" />
|
49
|
+
</div>
|
50
|
+
|
51
|
+
<YunGoDown />
|
52
|
+
</template>
|
53
|
+
|
54
|
+
<style lang="scss">
|
55
|
+
:root {
|
56
|
+
// banner
|
57
|
+
--banner-line-color: black;
|
58
|
+
--banner-char-color: black;
|
59
|
+
--banner-char-bg-color: rgba(white, 0.5);
|
60
|
+
--banner-char-hover-color: white;
|
61
|
+
}
|
62
|
+
|
63
|
+
.dark {
|
64
|
+
// banner
|
65
|
+
--banner-line-color: white;
|
66
|
+
--banner-char-color: white;
|
67
|
+
--banner-char-bg-color: rgba(black, 0.5);
|
68
|
+
--banner-char-hover-color: black;
|
69
|
+
}
|
70
|
+
</style>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<script setup lang="ts">
|
2
|
+
// export layouts/base.vue as components
|
3
|
+
import Base from '../layouts/base.vue'
|
4
|
+
</script>
|
5
|
+
|
6
|
+
<template>
|
7
|
+
<Base>
|
8
|
+
<template #content>
|
9
|
+
<slot name="content" />
|
10
|
+
</template>
|
11
|
+
<template #nav>
|
12
|
+
<slot name="nav" />
|
13
|
+
</template>
|
14
|
+
<template #comment>
|
15
|
+
<slot name="comment" />
|
16
|
+
</template>
|
17
|
+
<template #footer>
|
18
|
+
<slot name="footer" />
|
19
|
+
</template>
|
20
|
+
<template #right-sidebar>
|
21
|
+
<slot name="right-sidebar" />
|
22
|
+
</template>
|
23
|
+
</Base>
|
24
|
+
</template>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="yun-card">
|
3
|
+
<div v-if="$slots.header" class="yun-card-header">
|
4
|
+
<header>
|
5
|
+
<slot name="header" />
|
6
|
+
</header>
|
7
|
+
</div>
|
8
|
+
<slot />
|
9
|
+
<div v-if="$slots.content" class="yun-card-content" w="full">
|
10
|
+
<slot name="content" />
|
11
|
+
</div>
|
12
|
+
</div>
|
13
|
+
</template>
|
14
|
+
|
15
|
+
<style lang="scss">
|
16
|
+
.yun-card {
|
17
|
+
display: flex;
|
18
|
+
justify-content: center;
|
19
|
+
align-items: center;
|
20
|
+
flex-direction: column;
|
21
|
+
|
22
|
+
min-height: 100px;
|
23
|
+
|
24
|
+
margin: auto;
|
25
|
+
|
26
|
+
// todo
|
27
|
+
background-color: var(--yun-c-bg-light);
|
28
|
+
}
|
29
|
+
</style>
|
@@ -0,0 +1,45 @@
|
|
1
|
+
<script lang="ts" setup>
|
2
|
+
import type { Categories } from 'valaxy'
|
3
|
+
|
4
|
+
withDefaults(defineProps<{
|
5
|
+
categories: Categories
|
6
|
+
/**
|
7
|
+
* 当前层级
|
8
|
+
*/
|
9
|
+
level?: number
|
10
|
+
displayCategory: (category: string) => void
|
11
|
+
}>(), {
|
12
|
+
level: 0,
|
13
|
+
})
|
14
|
+
</script>
|
15
|
+
|
16
|
+
<template>
|
17
|
+
<ul v-for="category, key in Object.fromEntries(categories)" :key="key" class="category-list" m="l-4">
|
18
|
+
<YunCategory :name="key.toString()" :category="category" :level="level + 1" :display-category="displayCategory" />
|
19
|
+
</ul>
|
20
|
+
</template>
|
21
|
+
|
22
|
+
<style lang="scss">
|
23
|
+
.post-list-item {
|
24
|
+
a {
|
25
|
+
color: var(--yun-c-text);
|
26
|
+
|
27
|
+
&:hover {
|
28
|
+
color: var(--yun-c-primary);
|
29
|
+
}
|
30
|
+
}
|
31
|
+
}
|
32
|
+
|
33
|
+
.category-list-item {
|
34
|
+
.folder-action {
|
35
|
+
&:hover {
|
36
|
+
color: var(--yun-c-primary);
|
37
|
+
}
|
38
|
+
}
|
39
|
+
.category-name {
|
40
|
+
&:hover {
|
41
|
+
color: var(--yun-c-primary);
|
42
|
+
}
|
43
|
+
}
|
44
|
+
}
|
45
|
+
</style>
|
@@ -0,0 +1,39 @@
|
|
1
|
+
<script lang="ts" setup>
|
2
|
+
import { ref } from 'vue'
|
3
|
+
import type { Category, ParentCategory, PostCategory } from 'valaxy'
|
4
|
+
import { useI18n } from 'vue-i18n'
|
5
|
+
|
6
|
+
defineProps<{
|
7
|
+
name: string
|
8
|
+
// to eliminate the warning
|
9
|
+
category: Category
|
10
|
+
level?: number
|
11
|
+
displayCategory: (category: string) => void
|
12
|
+
}>()
|
13
|
+
|
14
|
+
const showChild = ref(false)
|
15
|
+
const { t } = useI18n()
|
16
|
+
</script>
|
17
|
+
|
18
|
+
<template>
|
19
|
+
<li v-if="category.total" class="category-list-item inline-flex items-center cursor-pointer">
|
20
|
+
<span class="folder-action inline-flex" @click="showChild = !showChild">
|
21
|
+
<div v-if="!showChild" i-ri-folder-add-line />
|
22
|
+
<div v-else style="color:var(--yun-c-primary)" i-ri-folder-reduce-line /></span>
|
23
|
+
<span class="category-name" m="l-1" @click="displayCategory(name)">
|
24
|
+
{{ name === 'Uncategorized' ? t('category.uncategorized') : name }} [{{ category.total }}]
|
25
|
+
</span>
|
26
|
+
</li>
|
27
|
+
|
28
|
+
<template v-if="showChild">
|
29
|
+
<ul v-if="(category as PostCategory).posts">
|
30
|
+
<li v-for="post, i in (category as PostCategory).posts" :key="i" class="post-list-item" m="l-4">
|
31
|
+
<router-link v-if="post.title" :to="post.path" class="inline-flex items-center">
|
32
|
+
<div i-ri-file-text-line />
|
33
|
+
<span m="l-1" font="serif black">{{ post.title }}</span>
|
34
|
+
</router-link>
|
35
|
+
</li>
|
36
|
+
</ul>
|
37
|
+
<YunCategories v-else :categories="(category as ParentCategory).children" :display-category="displayCategory" />
|
38
|
+
</template>
|
39
|
+
</template>
|
@@ -0,0 +1,76 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="cloud">
|
3
|
+
<svg class="waves" viewBox="0 24 150 28" preserveAspectRatio="none" shape-rendering="auto">
|
4
|
+
<defs>
|
5
|
+
<path id="gentle-wave" d="M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z" fill="theme.banner.cloud.color" />
|
6
|
+
</defs>
|
7
|
+
<g class="parallax">
|
8
|
+
<use xlink:href="#gentle-wave" x="48" y="0" opacity="0.7" />
|
9
|
+
<use xlink:href="#gentle-wave" x="48" y="3" opacity="0.5" />
|
10
|
+
<use xlink:href="#gentle-wave" x="48" y="5" opacity="0.3" />
|
11
|
+
<use xlink:href="#gentle-wave" x="48" y="7" />
|
12
|
+
</g>
|
13
|
+
</svg>
|
14
|
+
</div>
|
15
|
+
</template>
|
16
|
+
|
17
|
+
<style lang="scss">
|
18
|
+
.cloud {
|
19
|
+
display: flex;
|
20
|
+
width: 100%;
|
21
|
+
position: absolute;
|
22
|
+
bottom: 0;
|
23
|
+
left: 0;
|
24
|
+
right: 0;
|
25
|
+
z-index: var(--yun-z-cloud);
|
26
|
+
box-sizing: border-box;
|
27
|
+
mix-blend-mode: overlay;
|
28
|
+
|
29
|
+
.waves {
|
30
|
+
display: flex;
|
31
|
+
position: relative;
|
32
|
+
width: 100%;
|
33
|
+
height: 100px;
|
34
|
+
|
35
|
+
@media (max-width: 768px) {
|
36
|
+
height: 40px;
|
37
|
+
}
|
38
|
+
}
|
39
|
+
|
40
|
+
.parallax {
|
41
|
+
> use {
|
42
|
+
animation: move-forever 25s cubic-bezier(0.55, 0.5, 0.45, 0.5) infinite;
|
43
|
+
}
|
44
|
+
|
45
|
+
> use:nth-child(1) {
|
46
|
+
animation-delay: -2s;
|
47
|
+
animation-duration: 7s;
|
48
|
+
}
|
49
|
+
|
50
|
+
> use:nth-child(2) {
|
51
|
+
animation-delay: -3s;
|
52
|
+
animation-duration: 10s;
|
53
|
+
}
|
54
|
+
|
55
|
+
> use:nth-child(3) {
|
56
|
+
animation-delay: -4s;
|
57
|
+
animation-duration: 13s;
|
58
|
+
}
|
59
|
+
|
60
|
+
> use:nth-child(4) {
|
61
|
+
animation-delay: -5s;
|
62
|
+
animation-duration: 20s;
|
63
|
+
}
|
64
|
+
}
|
65
|
+
}
|
66
|
+
|
67
|
+
@keyframes move-forever {
|
68
|
+
0% {
|
69
|
+
transform: translate3d(-90px, 0, 0);
|
70
|
+
}
|
71
|
+
|
72
|
+
100% {
|
73
|
+
transform: translate3d(85px, 0, 0);
|
74
|
+
}
|
75
|
+
}
|
76
|
+
</style>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<script lang="ts" setup>
|
2
|
+
import { useI18n } from 'vue-i18n'
|
3
|
+
import { isDark, toggleDark } from '~/composables'
|
4
|
+
|
5
|
+
const { t, availableLocales, locale } = useI18n()
|
6
|
+
|
7
|
+
const toggleLocales = () => {
|
8
|
+
// change to some real logic
|
9
|
+
const locales = availableLocales
|
10
|
+
locale.value = locales[(locales.indexOf(locale.value) + 1) % locales.length]
|
11
|
+
}
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<template>
|
15
|
+
<div>
|
16
|
+
<button class="yun-icon-btn" :title="t('button.toggle_dark')" :style="{color: isDark ? '' : '#f1cb64'}" @click="toggleDark()">
|
17
|
+
<div i="ri-sun-line dark:ri-moon-line" />
|
18
|
+
</button>
|
19
|
+
|
20
|
+
<a class="yun-icon-btn" :title="t('button.toggle_langs')" style="color:var(--yun-c-text)" @click="toggleLocales">
|
21
|
+
<div i-ri-translate class="transition transform" :class="locale === 'en' ? 'rotate-y-180' : ''" />
|
22
|
+
</a>
|
23
|
+
</div>
|
24
|
+
</template>
|