valaxy-theme-yun 0.1.0 → 0.2.0
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/YunAlgoliaSearch.vue +10 -10
- package/components/YunBackToTop.vue +2 -3
- package/components/YunBase.vue +3 -0
- package/components/YunBoard.vue +23 -0
- package/components/YunCard.vue +1 -1
- package/components/YunCategories.vue +4 -4
- package/components/YunCategory.vue +1 -1
- package/components/YunConfig.vue +2 -2
- package/components/YunGirls.vue +2 -3
- package/components/YunGoDown.vue +3 -3
- package/components/YunPostCollapse.vue +10 -10
- package/components/YunPostNav.vue +2 -2
- package/components/YunSay.vue +6 -5
- package/components/YunSidebar.vue +5 -5
- package/components/YunSidebarNav.vue +4 -4
- package/components/YunSponsor.vue +2 -2
- package/components/YunTwikoo.vue +14 -0
- package/components/YunWaline.vue +3 -5
- package/composables/index.ts +6 -3
- package/config/index.ts +16 -5
- package/dist/index.d.ts +17 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/index.ts +31 -0
- package/layouts/base.vue +7 -4
- package/layouts/home.vue +5 -1
- package/layouts/post.vue +3 -1
- package/layouts/tags.vue +7 -3
- package/locales/en.yml +1 -0
- package/locales/zh-CN.yml +1 -0
- package/package.json +3 -3
- package/styles/css-vars.scss +17 -0
- package/styles/layout/index.scss +2 -2
- package/styles/layout/post.scss +5 -6
- package/styles/markdown.scss +2 -22
- package/styles/vars.scss +32 -6
@@ -60,8 +60,8 @@ watch(showPopup, () => {
|
|
60
60
|
top: 0.6rem;
|
61
61
|
right: 0.8rem;
|
62
62
|
|
63
|
-
color: var(--
|
64
|
-
z-index:
|
63
|
+
color: var(--va-c-primary);
|
64
|
+
z-index: var(--yun-z-search-btn);
|
65
65
|
}
|
66
66
|
|
67
67
|
.search-popup {
|
@@ -77,7 +77,7 @@ watch(showPopup, () => {
|
|
77
77
|
text-align: center;
|
78
78
|
padding-top: 3.5rem;
|
79
79
|
margin: 0;
|
80
|
-
z-index:
|
80
|
+
z-index: var(--yun-z-search-popup);
|
81
81
|
transition: 0.6s;
|
82
82
|
}
|
83
83
|
|
@@ -91,15 +91,15 @@ watch(showPopup, () => {
|
|
91
91
|
|
92
92
|
.search-input {
|
93
93
|
background: transparent;
|
94
|
-
color: var(--
|
94
|
+
color: var(--va-c-text);
|
95
95
|
font-size: 1.5rem;
|
96
96
|
border-radius: 3rem;
|
97
97
|
padding: 1rem 1.5rem;
|
98
|
-
border: 1px solid var(--
|
98
|
+
border: 1px solid var(--va-c-gray);
|
99
99
|
box-sizing: border-box;
|
100
100
|
width: 90%;
|
101
101
|
max-width: 800px;
|
102
|
-
font-family: var(--
|
102
|
+
font-family: var(--va-font-serif);
|
103
103
|
font-weight: 900;
|
104
104
|
text-align: center;
|
105
105
|
}
|
@@ -169,13 +169,13 @@ watch(showPopup, () => {
|
|
169
169
|
width: 100%;
|
170
170
|
padding: 0.5rem;
|
171
171
|
border-bottom: 1px dashed #ccc;
|
172
|
-
font-family: var(--
|
172
|
+
font-family: var(--va-font-serif);
|
173
173
|
font-weight: 900;
|
174
174
|
font-size: 1.2rem;
|
175
175
|
max-width: 800px;
|
176
176
|
|
177
177
|
mark {
|
178
|
-
color: var(--
|
178
|
+
color: var(--va-c-danger);
|
179
179
|
font-family: 900;
|
180
180
|
background-color: transparent;
|
181
181
|
text-decoration: underline;
|
@@ -185,7 +185,7 @@ watch(showPopup, () => {
|
|
185
185
|
display: flex;
|
186
186
|
font-size: 12px;
|
187
187
|
justify-content: center;
|
188
|
-
font-family: var(--
|
188
|
+
font-family: var(--va-font-sans);
|
189
189
|
font-weight: normal;
|
190
190
|
line-height: 1;
|
191
191
|
margin-top: -0.2rem;
|
@@ -215,7 +215,7 @@ watch(showPopup, () => {
|
|
215
215
|
.active {
|
216
216
|
.page-number {
|
217
217
|
background: var(--page-btn-active-bg-color);
|
218
|
-
color: var(--
|
218
|
+
color: var(--va-c-bg);
|
219
219
|
}
|
220
220
|
}
|
221
221
|
}
|
@@ -25,16 +25,15 @@ const strokeOffset = computed(() => {
|
|
25
25
|
|
26
26
|
<style lang="scss">
|
27
27
|
@use "sass:map";
|
28
|
-
@use "~/styles/vars" as *;
|
29
28
|
|
30
29
|
.back-to-top {
|
31
30
|
position: relative;
|
32
31
|
position: fixed;
|
33
32
|
right: -0.9rem;
|
34
33
|
bottom: 1.1rem;
|
35
|
-
z-index:
|
34
|
+
z-index: var(--yun-z-go-up-btn);
|
36
35
|
opacity: 0;
|
37
|
-
color: var(--
|
36
|
+
color: var(--va-c-primary);
|
38
37
|
|
39
38
|
&.show {
|
40
39
|
transform: translateX(-30px) rotate(360deg);
|
package/components/YunBase.vue
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="yun-board">
|
3
|
+
<slot />
|
4
|
+
</div>
|
5
|
+
</template>
|
6
|
+
|
7
|
+
<style>
|
8
|
+
.yun-board {
|
9
|
+
border: 1px solid var(--va-c-text);
|
10
|
+
width: calc(100% - 2rem);
|
11
|
+
|
12
|
+
display: flex;
|
13
|
+
flex-direction: column;
|
14
|
+
justify-content: center;
|
15
|
+
align-items: center;
|
16
|
+
font-family: var(--va-font-serif);
|
17
|
+
font-weight: bold;
|
18
|
+
padding: 1rem;
|
19
|
+
margin: 1rem auto;
|
20
|
+
max-width: var(--yun-post-card-max-width);
|
21
|
+
background-color: rgba(200, 200, 200, 0.1);
|
22
|
+
}
|
23
|
+
</style>
|
package/components/YunCard.vue
CHANGED
@@ -22,10 +22,10 @@ withDefaults(defineProps<{
|
|
22
22
|
<style lang="scss">
|
23
23
|
.post-list-item {
|
24
24
|
a {
|
25
|
-
color: var(--
|
25
|
+
color: var(--va-c-text);
|
26
26
|
|
27
27
|
&:hover {
|
28
|
-
color: var(--
|
28
|
+
color: var(--va-c-primary);
|
29
29
|
}
|
30
30
|
}
|
31
31
|
}
|
@@ -33,12 +33,12 @@ withDefaults(defineProps<{
|
|
33
33
|
.category-list-item {
|
34
34
|
.folder-action {
|
35
35
|
&:hover {
|
36
|
-
color: var(--
|
36
|
+
color: var(--va-c-primary);
|
37
37
|
}
|
38
38
|
}
|
39
39
|
.category-name {
|
40
40
|
&:hover {
|
41
|
-
color: var(--
|
41
|
+
color: var(--va-c-primary);
|
42
42
|
}
|
43
43
|
}
|
44
44
|
}
|
@@ -19,7 +19,7 @@ const { t } = useI18n()
|
|
19
19
|
<li v-if="category.total" class="category-list-item inline-flex items-center cursor-pointer">
|
20
20
|
<span class="folder-action inline-flex" @click="showChild = !showChild">
|
21
21
|
<div v-if="!showChild" i-ri-folder-add-line />
|
22
|
-
<div v-else style="color:var(--
|
22
|
+
<div v-else style="color:var(--va-c-primary)" i-ri-folder-reduce-line /></span>
|
23
23
|
<span class="category-name" m="l-1" @click="displayCategory(name)">
|
24
24
|
{{ name === 'Uncategorized' ? t('category.uncategorized') : name }} [{{ category.total }}]
|
25
25
|
</span>
|
package/components/YunConfig.vue
CHANGED
@@ -17,8 +17,8 @@ const toggleLocales = () => {
|
|
17
17
|
<div i="ri-sun-line dark:ri-moon-line" />
|
18
18
|
</button>
|
19
19
|
|
20
|
-
<
|
20
|
+
<button class="yun-icon-btn" :title="t('button.toggle_langs')" style="color:var(--va-c-text)" @click="toggleLocales">
|
21
21
|
<div i-ri-translate class="transition transform" :class="locale === 'en' ? 'rotate-y-180' : ''" />
|
22
|
-
</
|
22
|
+
</button>
|
23
23
|
</div>
|
24
24
|
</template>
|
package/components/YunGirls.vue
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
<script lang="ts" setup>
|
3
2
|
import { useRandomData } from 'valaxy-theme-yun/composables'
|
4
3
|
import { onImgError } from '../utils'
|
@@ -87,9 +86,9 @@ const { data } = useRandomData(props.girls, props.random)
|
|
87
86
|
|
88
87
|
&-from {
|
89
88
|
font-size: 12px;
|
90
|
-
font-family: var(--
|
89
|
+
font-family: var(--va-font-serif);
|
91
90
|
font-weight: bold;
|
92
|
-
color: var(--
|
91
|
+
color: var(--va-c-text-light);
|
93
92
|
|
94
93
|
&::before {
|
95
94
|
content: '「';
|
package/components/YunGoDown.vue
CHANGED
@@ -18,12 +18,12 @@
|
|
18
18
|
animation: float 2s ease-in-out infinite;
|
19
19
|
|
20
20
|
font-size: 2.5rem;
|
21
|
-
color: var(--
|
21
|
+
color: var(--va-c-primary);
|
22
22
|
|
23
|
-
transition: color var(--
|
23
|
+
transition: color var(--va-transition-duration);
|
24
24
|
|
25
25
|
&:hover {
|
26
|
-
color: rgba(var(--
|
26
|
+
color: rgba(var(--va-c-primary-rgb), 0.6);
|
27
27
|
}
|
28
28
|
}
|
29
29
|
|
@@ -85,7 +85,7 @@ const sortedYears = computed(() => {
|
|
85
85
|
.collection-title {
|
86
86
|
position: relative;
|
87
87
|
margin: 0;
|
88
|
-
border-bottom: 2px solid rgba(var(--
|
88
|
+
border-bottom: 2px solid rgba(var(--va-c-primary-rgb), 0.6);
|
89
89
|
|
90
90
|
&::before {
|
91
91
|
content: '';
|
@@ -93,11 +93,11 @@ const sortedYears = computed(() => {
|
|
93
93
|
top: 50%;
|
94
94
|
width: 2px;
|
95
95
|
height: 50%;
|
96
|
-
background: rgba(var(--
|
96
|
+
background: rgba(var(--va-c-primary-rgb), 0.3);
|
97
97
|
}
|
98
98
|
|
99
99
|
.archive-year {
|
100
|
-
color: var(--
|
100
|
+
color: var(--va-c-primary);
|
101
101
|
margin: 0 1.5rem;
|
102
102
|
|
103
103
|
&::before {
|
@@ -109,7 +109,7 @@ const sortedYears = computed(() => {
|
|
109
109
|
margin-top: -4px;
|
110
110
|
width: 1.5rem;
|
111
111
|
height: 1.5rem;
|
112
|
-
background: var(--
|
112
|
+
background: var(--va-c-primary);
|
113
113
|
border-radius: 50%;
|
114
114
|
}
|
115
115
|
}
|
@@ -123,7 +123,7 @@ const sortedYears = computed(() => {
|
|
123
123
|
position: absolute;
|
124
124
|
width: 2px;
|
125
125
|
height: 100%;
|
126
|
-
background: rgba(var(--
|
126
|
+
background: rgba(var(--va-c-primary-rgb), 0.3);
|
127
127
|
}
|
128
128
|
}
|
129
129
|
|
@@ -132,7 +132,7 @@ const sortedYears = computed(() => {
|
|
132
132
|
align-items: center;
|
133
133
|
|
134
134
|
position: relative;
|
135
|
-
border-bottom: 1px solid rgba(var(--
|
135
|
+
border-bottom: 1px solid rgba(var(--va-c-primary-rgb), 0.3);
|
136
136
|
display: flex;
|
137
137
|
|
138
138
|
&::before {
|
@@ -143,15 +143,15 @@ const sortedYears = computed(() => {
|
|
143
143
|
height: 10px;
|
144
144
|
margin-left: -4px;
|
145
145
|
border-radius: 50%;
|
146
|
-
border: 1px solid var(--
|
147
|
-
background-color: var(--
|
146
|
+
border: 1px solid var(--va-c-primary);
|
147
|
+
background-color: var(--va-c-bg-light);
|
148
148
|
z-index: 1;
|
149
|
-
transition: background var(--
|
149
|
+
transition: background var(--va-transition-duration);
|
150
150
|
}
|
151
151
|
|
152
152
|
&:hover {
|
153
153
|
&::before {
|
154
|
-
background: var(--
|
154
|
+
background: var(--va-c-primary);
|
155
155
|
}
|
156
156
|
}
|
157
157
|
|
@@ -33,7 +33,7 @@ const [prev, next] = usePrevNext()
|
|
33
33
|
justify-content: center;
|
34
34
|
align-items: center;
|
35
35
|
|
36
|
-
color: var(--
|
36
|
+
color: var(--va-c-primary);
|
37
37
|
|
38
38
|
outline: none;
|
39
39
|
font-size: 1.5rem;
|
@@ -44,7 +44,7 @@ const [prev, next] = usePrevNext()
|
|
44
44
|
transition: 0.4s;
|
45
45
|
|
46
46
|
&:hover {
|
47
|
-
background-color: rgba(var(--
|
47
|
+
background-color: rgba(var(--va-c-primary-rgb), 0.1);
|
48
48
|
box-shadow: 0 0 15px rgba(black, 0.1);
|
49
49
|
}
|
50
50
|
}
|
package/components/YunSay.vue
CHANGED
@@ -13,7 +13,8 @@ const sayFrom = ref('')
|
|
13
13
|
*/
|
14
14
|
function fetchApiToSay() {
|
15
15
|
const api = themeConfig.value.say.hitokoto.enable ? themeConfig.value.say.hitokoto.api : themeConfig.value.say.api
|
16
|
-
if (!api)
|
16
|
+
if (!api)
|
17
|
+
return
|
17
18
|
|
18
19
|
fetch(api)
|
19
20
|
.then((res) => {
|
@@ -63,14 +64,14 @@ onMounted(() => {
|
|
63
64
|
|
64
65
|
<style lang="scss">
|
65
66
|
.say {
|
66
|
-
color: var(--
|
67
|
+
color: var(--va-c-text);
|
67
68
|
display: block;
|
68
69
|
text-align: center;
|
69
|
-
font-family: var(--
|
70
|
+
font-family: var(--va-font-serif);
|
70
71
|
font-weight: bold;
|
71
72
|
padding: 0.5rem;
|
72
|
-
border-top: var(--
|
73
|
-
border-bottom: var(--
|
73
|
+
border-top: var(--va-border-width) solid var(--va-c-text-light);
|
74
|
+
border-bottom: var(--va-border-width) solid var(--va-c-text-light);
|
74
75
|
|
75
76
|
.say-content {
|
76
77
|
display: block;
|
@@ -9,7 +9,7 @@ const router = useRouter()
|
|
9
9
|
<template>
|
10
10
|
<div class="sidebar-panel">
|
11
11
|
<div class="site-info" m="t-6">
|
12
|
-
<a class="site-author-avatar">
|
12
|
+
<a class="site-author-avatar" href="/about">
|
13
13
|
<img class="rounded-full" :src="config.author.avatar" alt="avatar">
|
14
14
|
<span class="site-author-status">{{ config.author.status.emoji }}</span>
|
15
15
|
</a>
|
@@ -68,7 +68,7 @@ const router = useRouter()
|
|
68
68
|
transition: 0.4s;
|
69
69
|
|
70
70
|
&:hover {
|
71
|
-
box-shadow: 0 0 30px rgba(var(--
|
71
|
+
box-shadow: 0 0 30px rgba(var(--va-c-primary-rgb), 0.2);
|
72
72
|
}
|
73
73
|
}
|
74
74
|
}
|
@@ -88,13 +88,13 @@ const router = useRouter()
|
|
88
88
|
line-height: 1.8rem;
|
89
89
|
border-radius: 50%;
|
90
90
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
|
91
|
-
background-color: var(--
|
91
|
+
background-color: var(--va-c-bg-light);
|
92
92
|
|
93
93
|
border: 1px solid rgba(255, 255, 255, 0.1);
|
94
94
|
}
|
95
95
|
|
96
96
|
.site-name {
|
97
|
-
color: var(--
|
97
|
+
color: var(--va-c-text);
|
98
98
|
font-family: get-css-var('font-serif');
|
99
99
|
font-weight: get-css-var('font-serif-weight');
|
100
100
|
}
|
@@ -105,7 +105,7 @@ const router = useRouter()
|
|
105
105
|
}
|
106
106
|
|
107
107
|
.site-description {
|
108
|
-
color: var(--
|
108
|
+
color: var(--va-c-text);
|
109
109
|
font-size: 0.8rem;
|
110
110
|
}
|
111
111
|
</style>
|
@@ -55,7 +55,7 @@ const tags = useTag()
|
|
55
55
|
|
56
56
|
flex-direction: column;
|
57
57
|
|
58
|
-
color: var(--
|
58
|
+
color: var(--va-c-text);
|
59
59
|
|
60
60
|
&:first-child, &:last-child {
|
61
61
|
line-height: 1;
|
@@ -76,8 +76,8 @@ const tags = useTag()
|
|
76
76
|
}
|
77
77
|
|
78
78
|
.count {
|
79
|
-
color: var(--
|
80
|
-
font-family: var(--
|
79
|
+
color: var(--va-c-text);
|
80
|
+
font-family: var(--va-font-sans);
|
81
81
|
display: block;
|
82
82
|
text-align: center;
|
83
83
|
font-size: 1rem;
|
@@ -88,7 +88,7 @@ const tags = useTag()
|
|
88
88
|
height: 1.5rem;
|
89
89
|
|
90
90
|
&:hover {
|
91
|
-
color: var(--
|
91
|
+
color: var(--va-c-primary-light);
|
92
92
|
}
|
93
93
|
}
|
94
94
|
}
|
@@ -39,7 +39,7 @@ const showQr = ref(false)
|
|
39
39
|
|
40
40
|
div {
|
41
41
|
transform: scale(1.1);
|
42
|
-
transition: transform var(--
|
42
|
+
transition: transform var(--va-transition-duration) ease-in-out;
|
43
43
|
}
|
44
44
|
&:hover {
|
45
45
|
background-color: rgba(255, 255, 255, 0.9);
|
@@ -60,7 +60,7 @@ const showQr = ref(false)
|
|
60
60
|
overflow: hidden;
|
61
61
|
height: 0;
|
62
62
|
|
63
|
-
transition: height var(--
|
63
|
+
transition: height var(--va-transition-duration) ease-in-out;
|
64
64
|
|
65
65
|
&.show {
|
66
66
|
height: 220px;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<script lang="ts" setup>
|
2
|
+
import { useConfig, useTwikoo } from 'valaxy'
|
3
|
+
|
4
|
+
const config = useConfig()
|
5
|
+
useTwikoo(config.value.comment.twikoo)
|
6
|
+
</script>
|
7
|
+
|
8
|
+
<template>
|
9
|
+
<div id="tcomment" w="full" />
|
10
|
+
</template>
|
11
|
+
|
12
|
+
<style lang="scss">
|
13
|
+
// custom twikoo style
|
14
|
+
</style>
|
package/components/YunWaline.vue
CHANGED
@@ -2,9 +2,7 @@
|
|
2
2
|
import { useConfig, useWaline } from 'valaxy'
|
3
3
|
|
4
4
|
const config = useConfig()
|
5
|
-
useWaline(
|
6
|
-
serverURL: config.value.comment.waline.serverURL,
|
7
|
-
})
|
5
|
+
useWaline(config.value.comment.waline)
|
8
6
|
</script>
|
9
7
|
|
10
8
|
<template>
|
@@ -13,8 +11,8 @@ useWaline({
|
|
13
11
|
|
14
12
|
<style lang="scss">
|
15
13
|
#waline {
|
16
|
-
--waline-theme-color: var(--
|
17
|
-
--waline-active-color: var(--
|
14
|
+
--waline-theme-color: var(--va-c-primary);
|
15
|
+
--waline-active-color: var(--va-c-primary-light);
|
18
16
|
|
19
17
|
.v[data-class=v] {
|
20
18
|
.veditor {
|
package/composables/index.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import { ref, watch } from 'vue'
|
2
|
+
import { isClient } from '@vueuse/core'
|
2
3
|
|
3
4
|
/**
|
4
5
|
* fetch data from source, and random
|
@@ -11,10 +12,12 @@ export function useRandomData<T>(source: string | T[], random = false) {
|
|
11
12
|
|
12
13
|
watch(() => source, async() => {
|
13
14
|
let rawData: T[]
|
14
|
-
if (typeof source === 'string')
|
15
|
+
if (typeof source === 'string') {
|
16
|
+
if (!isClient)
|
17
|
+
return
|
15
18
|
rawData = await fetch(source).then(res => res.json()) as T[]
|
16
|
-
|
17
|
-
|
19
|
+
}
|
20
|
+
else { rawData = source }
|
18
21
|
|
19
22
|
data.value = random ? Array.from(rawData).sort(() => Math.random() - 0.5) : rawData
|
20
23
|
}, { immediate: true })
|
package/config/index.ts
CHANGED
@@ -4,6 +4,14 @@ export const anonymousImage = 'https://cdn.jsdelivr.net/gh/YunYouJun/cdn/img/ava
|
|
4
4
|
* Theme Config
|
5
5
|
*/
|
6
6
|
export interface ThemeConfig {
|
7
|
+
colors: {
|
8
|
+
/**
|
9
|
+
* primary color
|
10
|
+
* @default '#0078E7'
|
11
|
+
*/
|
12
|
+
primary: string
|
13
|
+
}
|
14
|
+
|
7
15
|
/**
|
8
16
|
* 首页标语
|
9
17
|
*/
|
@@ -100,6 +108,9 @@ export type ThemeUserConfig = Partial<ThemeConfig>
|
|
100
108
|
* Default Config
|
101
109
|
*/
|
102
110
|
export const defaultThemeConfig: ThemeConfig = {
|
111
|
+
colors: {
|
112
|
+
primary: '#0078E7',
|
113
|
+
},
|
103
114
|
banner: {
|
104
115
|
enable: true,
|
105
116
|
title: '云游君的小站',
|
@@ -128,9 +139,9 @@ export const defaultThemeConfig: ThemeConfig = {
|
|
128
139
|
icon: {
|
129
140
|
name: 'i-ri-cloud-line',
|
130
141
|
animated: true,
|
131
|
-
color: 'var(--
|
142
|
+
color: 'var(--va-c-primary)',
|
132
143
|
url: 'https://sponsors.yunyoujun.cn',
|
133
|
-
title: '',
|
144
|
+
title: 'Sponsor YunYouJun',
|
134
145
|
},
|
135
146
|
|
136
147
|
powered: true,
|
@@ -143,7 +154,7 @@ export const defaultThemeConfig: ThemeConfig = {
|
|
143
154
|
|
144
155
|
types: {
|
145
156
|
'link': {
|
146
|
-
color: 'var(--
|
157
|
+
color: 'var(--va-c-primary)',
|
147
158
|
icon: 'i-ri-external-link-line',
|
148
159
|
},
|
149
160
|
'bilibili': {
|
@@ -155,7 +166,7 @@ export const defaultThemeConfig: ThemeConfig = {
|
|
155
166
|
icon: 'i-ri-douban-line',
|
156
167
|
},
|
157
168
|
'github': {
|
158
|
-
color: 'var(--
|
169
|
+
color: 'var(--va-c-text)',
|
159
170
|
icon: 'i-ri-github-line',
|
160
171
|
},
|
161
172
|
'netease-cloud-music': {
|
@@ -163,7 +174,7 @@ export const defaultThemeConfig: ThemeConfig = {
|
|
163
174
|
icon: 'i-ri-netease-cloud-music-line',
|
164
175
|
},
|
165
176
|
'notion': {
|
166
|
-
color: 'var(--
|
177
|
+
color: 'var(--va-c-text)',
|
167
178
|
icon: 'i-simple-icons-notion',
|
168
179
|
},
|
169
180
|
'twitter': {
|
package/dist/index.d.ts
CHANGED
@@ -1,8 +1,17 @@
|
|
1
|
+
import { Plugin } from 'vite';
|
2
|
+
|
1
3
|
declare const anonymousImage = "https://cdn.jsdelivr.net/gh/YunYouJun/cdn/img/avatar/none.jpg";
|
2
4
|
/**
|
3
5
|
* Theme Config
|
4
6
|
*/
|
5
7
|
interface ThemeConfig {
|
8
|
+
colors: {
|
9
|
+
/**
|
10
|
+
* primary color
|
11
|
+
* @default '#0078E7'
|
12
|
+
*/
|
13
|
+
primary: string;
|
14
|
+
};
|
6
15
|
/**
|
7
16
|
* 首页标语
|
8
17
|
*/
|
@@ -90,4 +99,11 @@ declare type ThemeUserConfig = Partial<ThemeConfig>;
|
|
90
99
|
*/
|
91
100
|
declare const defaultThemeConfig: ThemeConfig;
|
92
101
|
|
93
|
-
|
102
|
+
interface UserOptions {
|
103
|
+
colors: {
|
104
|
+
primary: string;
|
105
|
+
};
|
106
|
+
}
|
107
|
+
declare function yunPlugin(userOptions?: Partial<ThemeConfig>): Plugin;
|
108
|
+
|
109
|
+
export { ThemeConfig, ThemeUserConfig, UserOptions, anonymousImage, yunPlugin as default, defaultThemeConfig, yunPlugin };
|
package/dist/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var t="https://cdn.jsdelivr.net/gh/YunYouJun/cdn/img/avatar/none.jpg",e= exports.defaultThemeConfig ={colors:{primary:"#0078E7"},banner:{enable:!0,title:"\u4E91\u6E38\u541B\u7684\u5C0F\u7AD9"},bg_image:{enable:!0,url:"https://cdn.jsdelivr.net/gh/YunYouJun/cdn/img/bg/stars-timing-0-blur-30px.jpg",dark:"https://cdn.jsdelivr.net/gh/YunYouJun/cdn/img/bg/galaxy.jpg",opacity:1},say:{enable:!0,api:"https://el-bot-api.vercel.app/api/words/young",hitokoto:{enable:!1,api:"https://v1.hitokoto.cn"}},pages:[],footer:{since:2022,icon:{name:"i-ri-cloud-line",animated:!0,color:"var(--va-c-primary)",url:"https://sponsors.yunyoujun.cn",title:"Sponsor YunYouJun"},powered:!0,beian:{enable:!1,icp:""}},types:{link:{color:"var(--va-c-primary)",icon:"i-ri-external-link-line"},bilibili:{color:"#FF8EB3",icon:"i-ri-bilibili-line"},douban:{color:"#007722",icon:"i-ri-douban-line"},github:{color:"var(--va-c-text)",icon:"i-ri-github-line"},"netease-cloud-music":{color:"#C10D0C",icon:"i-ri-netease-cloud-music-line"},notion:{color:"var(--va-c-text)",icon:"i-simple-icons-notion"},twitter:{color:"#1da1f2",icon:"i-ri-twitter-line"},wechat:{color:"#1AAD19",icon:"i-ri-wechat-2-line"},weibo:{color:"#E6162D",icon:"i-ri-weibo-line"},yuque:{color:"#25b864",icon:"i-ant-design-yuque-outlined"},zhihu:{color:"#0084FF",icon:"i-ri-zhihu-line"}}};function r(n=e){return{name:"valaxy-theme-yun",enforce:"pre",config(){var i;return{css:{preprocessorOptions:{scss:{additionalData:`$c-primary: ${((i=n.colors)==null?void 0:i.primary)||"#0078E7"} !default;`}}}}}}}var c=r;exports.anonymousImage = t; exports.default = c; exports.defaultThemeConfig = e; exports.yunPlugin = r;
|
package/dist/index.mjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
var
|
1
|
+
var a="https://cdn.jsdelivr.net/gh/YunYouJun/cdn/img/avatar/none.jpg",e={colors:{primary:"#0078E7"},banner:{enable:!0,title:"\u4E91\u6E38\u541B\u7684\u5C0F\u7AD9"},bg_image:{enable:!0,url:"https://cdn.jsdelivr.net/gh/YunYouJun/cdn/img/bg/stars-timing-0-blur-30px.jpg",dark:"https://cdn.jsdelivr.net/gh/YunYouJun/cdn/img/bg/galaxy.jpg",opacity:1},say:{enable:!0,api:"https://el-bot-api.vercel.app/api/words/young",hitokoto:{enable:!1,api:"https://v1.hitokoto.cn"}},pages:[],footer:{since:2022,icon:{name:"i-ri-cloud-line",animated:!0,color:"var(--va-c-primary)",url:"https://sponsors.yunyoujun.cn",title:"Sponsor YunYouJun"},powered:!0,beian:{enable:!1,icp:""}},types:{link:{color:"var(--va-c-primary)",icon:"i-ri-external-link-line"},bilibili:{color:"#FF8EB3",icon:"i-ri-bilibili-line"},douban:{color:"#007722",icon:"i-ri-douban-line"},github:{color:"var(--va-c-text)",icon:"i-ri-github-line"},"netease-cloud-music":{color:"#C10D0C",icon:"i-ri-netease-cloud-music-line"},notion:{color:"var(--va-c-text)",icon:"i-simple-icons-notion"},twitter:{color:"#1da1f2",icon:"i-ri-twitter-line"},wechat:{color:"#1AAD19",icon:"i-ri-wechat-2-line"},weibo:{color:"#E6162D",icon:"i-ri-weibo-line"},yuque:{color:"#25b864",icon:"i-ant-design-yuque-outlined"},zhihu:{color:"#0084FF",icon:"i-ri-zhihu-line"}}};function t(n=e){return{name:"valaxy-theme-yun",enforce:"pre",config(){var i;return{css:{preprocessorOptions:{scss:{additionalData:`$c-primary: ${((i=n.colors)==null?void 0:i.primary)||"#0078E7"} !default;`}}}}}}}var s=t;export{a as anonymousImage,s as default,e as defaultThemeConfig,t as yunPlugin};
|
package/index.ts
CHANGED
@@ -1 +1,32 @@
|
|
1
|
+
import type { Plugin } from 'vite'
|
2
|
+
import type { ThemeConfig } from './config'
|
3
|
+
import { defaultThemeConfig } from './config'
|
4
|
+
|
1
5
|
export * from './config'
|
6
|
+
|
7
|
+
export interface UserOptions {
|
8
|
+
colors: {
|
9
|
+
primary: string
|
10
|
+
}
|
11
|
+
}
|
12
|
+
|
13
|
+
export function yunPlugin(userOptions: Partial<ThemeConfig> = defaultThemeConfig): Plugin {
|
14
|
+
return {
|
15
|
+
name: 'valaxy-theme-yun',
|
16
|
+
enforce: 'pre',
|
17
|
+
|
18
|
+
config() {
|
19
|
+
return {
|
20
|
+
css: {
|
21
|
+
preprocessorOptions: {
|
22
|
+
scss: {
|
23
|
+
additionalData: `$c-primary: ${userOptions.colors?.primary || '#0078E7'} !default;`,
|
24
|
+
},
|
25
|
+
},
|
26
|
+
},
|
27
|
+
}
|
28
|
+
},
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
export default yunPlugin
|
package/layouts/base.vue
CHANGED
@@ -8,7 +8,9 @@ const { styles, icon, color } = usePostProperty(frontmatter.value.type)
|
|
8
8
|
</script>
|
9
9
|
|
10
10
|
<template>
|
11
|
-
<ValaxySidebar
|
11
|
+
<ValaxySidebar>
|
12
|
+
<slot name="sidebar" />
|
13
|
+
</ValaxySidebar>
|
12
14
|
|
13
15
|
<main class="yun-main flex lt-md:ml-0">
|
14
16
|
<div flex="~ 1 col" w="full" p="l-4 lt-md:0">
|
@@ -30,8 +32,9 @@ const { styles, icon, color } = usePostProperty(frontmatter.value.type)
|
|
30
32
|
</slot>
|
31
33
|
|
32
34
|
<slot v-if="frontmatter.comment !== false" name="comment">
|
33
|
-
<YunCard
|
34
|
-
<YunWaline />
|
35
|
+
<YunCard w="full" p="4" class="comment sm:p-8 lg:px-12 xl:px-16" :class="frontmatter.nav === false ? 'mt-4' : 0">
|
36
|
+
<YunWaline v-if="config.comment.waline.enable" />
|
37
|
+
<YunTwikoo v-if="config.comment.twikoo.enable" />
|
35
38
|
</YunCard>
|
36
39
|
</slot>
|
37
40
|
|
@@ -58,7 +61,7 @@ const { styles, icon, color } = usePostProperty(frontmatter.value.type)
|
|
58
61
|
@include xl {
|
59
62
|
.page-card {
|
60
63
|
// 8px scrollbar width
|
61
|
-
max-width: calc(100vw - 2 * var(--
|
64
|
+
max-width: calc(100vw - 2 * var(--va-sidebar-width-mobile) - 2rem - 8px);
|
62
65
|
}
|
63
66
|
}
|
64
67
|
</style>
|
package/layouts/home.vue
CHANGED
package/layouts/post.vue
CHANGED
@@ -13,7 +13,9 @@ const url = useFullUrl()
|
|
13
13
|
<slot name="header">
|
14
14
|
<YunPostMeta :frontmatter="frontmatter" />
|
15
15
|
</slot>
|
16
|
-
<
|
16
|
+
<Transition appear>
|
17
|
+
<router-view />
|
18
|
+
</Transition>
|
17
19
|
<YunSponsor v-if="frontmatter.sponsor || config.sponsor.enable" />
|
18
20
|
<ValaxyCopyright v-if="frontmatter.copyright || config.license.enabled" :url="url" m="y-4" />
|
19
21
|
</main>
|
package/layouts/tags.vue
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
<script lang="ts" setup>
|
2
|
-
import { useFrontmatter, useInvisibleElement, usePostList, useTags } from 'valaxy'
|
2
|
+
import { useFrontmatter, useInvisibleElement, usePostList, useTags, useThemeConfig } from 'valaxy'
|
3
3
|
import { useI18n } from 'vue-i18n'
|
4
4
|
import { computed, ref } from 'vue'
|
5
5
|
import { useRoute, useRouter } from 'vue-router'
|
@@ -7,9 +7,13 @@ import { useRoute, useRouter } from 'vue-router'
|
|
7
7
|
const route = useRoute()
|
8
8
|
const router = useRouter()
|
9
9
|
|
10
|
+
const themeConfig = useThemeConfig()
|
11
|
+
|
10
12
|
const { t } = useI18n()
|
11
13
|
const frontmatter = useFrontmatter()
|
12
|
-
const { tags, getTagStyle } = useTags(
|
14
|
+
const { tags, getTagStyle } = useTags({
|
15
|
+
primary: themeConfig.value.colors.primary,
|
16
|
+
})
|
13
17
|
|
14
18
|
const postList = usePostList()
|
15
19
|
const curTag = computed(() => route.query.tag as string || '')
|
@@ -77,7 +81,7 @@ const displayTag = (tag: string) => {
|
|
77
81
|
color: var(--yun-tag-color);
|
78
82
|
|
79
83
|
&:hover {
|
80
|
-
color: var(--
|
84
|
+
color: var(--va-c-primary);
|
81
85
|
}
|
82
86
|
}
|
83
87
|
</style>
|
package/locales/en.yml
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
valaxy_theme_yun: Valaxy Theme Yun
|
package/locales/zh-CN.yml
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
valaxy_theme_yun: Valaxy 主题 云
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "valaxy-theme-yun",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.2.0",
|
4
4
|
"main": "dist/index.js",
|
5
5
|
"types": "dist/index.d.ts",
|
6
6
|
"repository": {
|
@@ -10,7 +10,7 @@
|
|
10
10
|
"homepage": "https://valaxy.yyj.moe/",
|
11
11
|
"dependencies": {
|
12
12
|
"@iconify-json/ant-design": "^1.1.1",
|
13
|
-
"@iconify-json/simple-icons": "^1.1.
|
13
|
+
"@iconify-json/simple-icons": "^1.1.7"
|
14
14
|
},
|
15
15
|
"author": {
|
16
16
|
"email": "me@yunyoujun.cn",
|
@@ -18,7 +18,7 @@
|
|
18
18
|
"url": "https://www.yunyoujun.cn"
|
19
19
|
},
|
20
20
|
"devDependencies": {
|
21
|
-
"valaxy": "0.
|
21
|
+
"valaxy": "0.2.0"
|
22
22
|
},
|
23
23
|
"scripts": {
|
24
24
|
"build": "tsup",
|
@@ -0,0 +1,17 @@
|
|
1
|
+
@use './vars' as *;
|
2
|
+
@use '~/styles/mixins' as * with(
|
3
|
+
$namespace: 'yun'
|
4
|
+
);
|
5
|
+
|
6
|
+
:root {
|
7
|
+
@include set-css-var-from-map($common);
|
8
|
+
@include set-css-var-from-map($z-index, 'z');
|
9
|
+
}
|
10
|
+
|
11
|
+
:root {
|
12
|
+
@include set-css-var-from-map($light);
|
13
|
+
}
|
14
|
+
|
15
|
+
html.dark {
|
16
|
+
@include set-css-var-from-map($dark);
|
17
|
+
}
|
package/styles/layout/index.scss
CHANGED
package/styles/layout/post.scss
CHANGED
@@ -1,10 +1,8 @@
|
|
1
|
-
@use 'sass:map';
|
2
1
|
@use '~/styles/mixins' as *;
|
3
|
-
@use '~/styles/palette.scss' as *;
|
4
2
|
|
5
3
|
.post-card {
|
6
4
|
position: relative;
|
7
|
-
max-width:
|
5
|
+
max-width: var(--yun-post-card-max-width);
|
8
6
|
}
|
9
7
|
|
10
8
|
|
@@ -21,7 +19,8 @@
|
|
21
19
|
.post-title-link {
|
22
20
|
position: relative;
|
23
21
|
padding: 0.7rem 1.2rem;
|
24
|
-
color: var(--card-c-primary, var(--
|
22
|
+
color: var(--card-c-primary, var(--va-c-link));
|
23
|
+
font-weight: 900;
|
25
24
|
|
26
25
|
.icon {
|
27
26
|
width: 1.6rem;
|
@@ -64,7 +63,7 @@
|
|
64
63
|
position: absolute;
|
65
64
|
top: 1rem;
|
66
65
|
right: 1rem;
|
67
|
-
color: var(--
|
66
|
+
color: var(--va-c-warning);
|
68
67
|
font-size: 1.2rem;
|
69
68
|
}
|
70
69
|
|
@@ -78,7 +77,7 @@
|
|
78
77
|
|
79
78
|
margin-top: -0.2rem;
|
80
79
|
|
81
|
-
transition: box-shadow var(--
|
80
|
+
transition: box-shadow var(--va-transition-duration);
|
82
81
|
|
83
82
|
&:before {
|
84
83
|
content: none;
|
package/styles/markdown.scss
CHANGED
@@ -1,31 +1,11 @@
|
|
1
1
|
@use "~/styles/mixins" as *;
|
2
2
|
|
3
3
|
.markdown-body {
|
4
|
-
--
|
5
|
-
|
6
|
-
--c-toc-link: var(--yun-c-text-light);
|
4
|
+
--c-toc-link: var(--va-c-text-light);
|
7
5
|
}
|
8
6
|
|
9
7
|
html.dark {
|
10
8
|
.markdown-body {
|
11
|
-
--
|
12
|
-
|
13
|
-
--c-toc-link: var(--yun-c-text-dark);
|
14
|
-
}
|
15
|
-
}
|
16
|
-
|
17
|
-
.markdown-body {
|
18
|
-
ul {
|
19
|
-
> li {
|
20
|
-
list-style-type: disc;
|
21
|
-
|
22
|
-
li {
|
23
|
-
list-style-type: circle;
|
24
|
-
|
25
|
-
li {
|
26
|
-
list-style-type: square;
|
27
|
-
}
|
28
|
-
}
|
29
|
-
}
|
9
|
+
--c-toc-link: var(--va-c-text-dark);
|
30
10
|
}
|
31
11
|
}
|
package/styles/vars.scss
CHANGED
@@ -1,7 +1,33 @@
|
|
1
|
-
:
|
2
|
-
--yun-sidebar-bg-image: url("https://cdn.jsdelivr.net/gh/YunYouJun/cdn@master/img/bg/alpha-stars-timing-1.webp")
|
3
|
-
}
|
1
|
+
@use 'sass:map';
|
4
2
|
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
// palette
|
4
|
+
$light: () !default;
|
5
|
+
$light: map.merge((
|
6
|
+
'bg-image': url('https://cdn.jsdelivr.net/gh/YunYouJun/cdn/img/bg/stars-timing-0-blur-30px.jpg'),
|
7
|
+
'sidebar-bg-color': var(--va-c-bg-light),
|
8
|
+
'sidebar-bg-image': url("https://cdn.jsdelivr.net/gh/YunYouJun/cdn@master/img/bg/alpha-stars-timing-1.webp")
|
9
|
+
), $light);
|
10
|
+
|
11
|
+
$dark: () !default;
|
12
|
+
$dark: map.merge((
|
13
|
+
'bg-image': none,
|
14
|
+
'sidebar-bg-image': none
|
15
|
+
), $dark);
|
16
|
+
|
17
|
+
// common
|
18
|
+
$common: () !default;
|
19
|
+
$common: map.merge((
|
20
|
+
'post-card-max-width': 900px
|
21
|
+
), $common);
|
22
|
+
|
23
|
+
$z-index: () !default;
|
24
|
+
$z-index: map.merge((
|
25
|
+
'cloud': 8,
|
26
|
+
'go-down': 9,
|
27
|
+
'sidebar': 10,
|
28
|
+
'fireworks': 11,
|
29
|
+
'menu-btn': 20,
|
30
|
+
'go-up-btn': 20,
|
31
|
+
'search-popup': 30,
|
32
|
+
'search-btn': 31,
|
33
|
+
), $z-index);
|