valaxy-theme-hairy 0.2.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/client/index.ts +1 -0
- package/components/HairyBody.vue +15 -17
- package/components/HairyComment.vue +33 -0
- package/components/HairyContainer.vue +13 -0
- package/components/{HairyUserPopup.vue → HairyDrawer.vue} +14 -13
- package/components/HairyFooter.vue +12 -9
- package/components/HairyHeader.vue +10 -9
- package/components/HairyImage.vue +2 -1
- package/components/HairyImageGroup.vue +12 -16
- package/components/HairyNavbar.vue +56 -0
- package/components/{HairyPostList.vue → HairyPosts.vue} +3 -3
- package/components/{HairyNavSearch.vue → HairySearch.vue} +23 -87
- package/components/{HairyUserCard.vue → HairySidebar.vue} +4 -4
- package/components/{HairyUserTab.vue → HairyTabbar.vue} +27 -11
- package/components/PageTags.vue +48 -0
- package/components/ValaxyMain.vue +3 -3
- package/components/navbar/HairyNav.vue +16 -0
- package/components/navbar/HairyNavExpand.vue +12 -0
- package/components/navbar/HairyNavItem.vue +35 -0
- package/components/navbar/HairyNavbarBackground.vue +7 -0
- package/components/navbar/HairyNavbarSearch.vue +8 -0
- package/components/{HairyNavTitle.vue → navbar/HairyNavbarTitle.vue} +5 -3
- package/components/navbar/HairyNavbarToggleDark.vue +22 -0
- package/components/{HairyBreadcrumb.vue → parts/HairyBreadcrumb.vue} +1 -1
- package/components/{HairyBreadcrumbItem.vue → parts/HairyBreadcrumbItem.vue} +1 -4
- package/components/{lib/fish.js → parts/HairyFootFish.js} +5 -7
- package/components/parts/HairyFootFish.vue +38 -0
- package/components/{HairyPostTitle.vue → parts/HairyHeadHero.vue} +6 -5
- package/components/{HairyWaves.vue → parts/HairyHeadWaves.vue} +5 -5
- package/components/parts/HairyImageGlobal.vue +51 -0
- package/components/{HairyImageViewer.vue → parts/HairyImageViewer.vue} +4 -3
- package/components/parts/HairyLink.vue +21 -0
- package/components/{HairyMenu.vue → parts/HairyMenu.vue} +2 -1
- package/components/{HairyMenuItem.vue → parts/HairyMenuItem.vue} +11 -4
- package/components/parts/HairyOutline.vue +99 -0
- package/components/parts/HairyOutlineItem.vue +48 -0
- package/components/{HairySocialLinks.vue → parts/HairySocialLinks.vue} +2 -2
- package/components/{HairyTimelinePostItem.vue → parts/HairyTimelineContent.vue} +7 -8
- package/components/parts/HairyUserNav.vue +95 -0
- package/components/{article-layout → posts}/HairyArticleImage.vue +18 -19
- package/components/{article-layout → posts}/HairyArticleSeries.vue +8 -5
- package/components/{article-layout → posts}/HairyArticleText.vue +11 -4
- package/components/posts/HairyPostFooter.vue +15 -0
- package/components/{article-layout → posts}/HairyPostImageList.vue +4 -5
- package/components/{article-layout → posts}/HairyPostTextsList.vue +0 -1
- package/components/posts/HairyPostToggleLayout.vue +36 -0
- package/components/third/HairyAlgoliaSearch.vue +17 -0
- package/components/third/HairyFuseSearch.vue +10 -0
- package/components/third/HairyFuseSearchDialog.vue +32 -0
- package/components/third/HairyFuseSearchDropdown.vue +77 -0
- package/components/third/HairyFuseSearchFooter.vue +28 -0
- package/components/third/HairyFuseSearchHeader.vue +30 -0
- package/components/third/HairyFuseSearchHit.vue +52 -0
- package/components/third/HairySearchBtnDisplay.vue +29 -0
- package/components/third/HairySearchBtnInput.vue +20 -0
- package/components/third/HairySearchBtnKeys.vue +19 -0
- package/components/{HairyCarousel.vue → third/HairySwiperCarousel.vue} +6 -6
- package/{hooks/useYearArchives.ts → composables/archives.ts} +4 -3
- package/composables/category.ts +43 -0
- package/composables/config.ts +11 -0
- package/composables/dark.ts +13 -0
- package/composables/fuse.ts +60 -0
- package/composables/index.ts +8 -0
- package/composables/layout.ts +16 -0
- package/composables/outline.ts +49 -0
- package/composables/tags.ts +36 -0
- package/layouts/archive-month.vue +13 -0
- package/layouts/archive-year.vue +13 -0
- package/layouts/archive.vue +11 -0
- package/layouts/categories.vue +11 -4
- package/layouts/default.vue +8 -7
- package/layouts/home.vue +28 -18
- package/layouts/post.vue +41 -35
- package/layouts/tag.vue +8 -4
- package/layouts/tags.vue +11 -4
- package/{modules → library}/loading.ts +18 -6
- package/{modules → library}/scroll.ts +3 -2
- package/locales/zh-CN.yml +0 -2
- package/node/images/default.json +139 -0
- package/node/images/index.ts +46 -0
- package/node/index.ts +2 -0
- package/node/theme/index.ts +78 -0
- package/package.json +22 -28
- package/pages/archives/[year]/[month]/index.vue +15 -16
- package/pages/archives/[year]/index.vue +20 -18
- package/pages/archives/index.vue +10 -8
- package/pages/categories/{[...categories].vue → [...its].vue} +29 -34
- package/pages/index.vue +1 -1
- package/pages/page/[page].vue +2 -2
- package/pages/tags/{[tag].vue → [tag]/index.vue} +12 -12
- package/pages/tags/index.vue +12 -5
- package/setup/main.ts +1 -1
- package/store/index.ts +1 -0
- package/store/modules/global.ts +12 -0
- package/styles/components/index.scss +4 -0
- package/styles/{markdown.scss → components/markdown.scss} +2 -1
- package/styles/components/nprogress.scss +16 -0
- package/styles/css-vars.scss +11 -0
- package/styles/element-plus/tabs.scss +1 -1
- package/styles/element-plus/timeline.scss +1 -1
- package/styles/global.scss +39 -0
- package/styles/index.scss +4 -73
- package/tsconfig.json +27 -0
- package/types/index.d.ts +163 -0
- package/unocss.config.ts +5 -1
- package/utils/index.ts +21 -39
- package/valaxy.config.ts +21 -24
- package/@types/markdown-it.d.ts +0 -1
- package/@types/markdown-toc.d.ts +0 -1
- package/@types/types.d.ts +0 -1
- package/@types/valaxy.d.ts +0 -10
- package/components/HairyAlgoliaSearchBox.vue +0 -118
- package/components/HairyBackToTop.vue +0 -72
- package/components/HairyDivider.vue +0 -0
- package/components/HairyFooterFish.vue +0 -29
- package/components/HairyLayout.vue +0 -28
- package/components/HairyLink.vue +0 -10
- package/components/HairyLinks.vue +0 -69
- package/components/HairyMeting.vue +0 -19
- package/components/HairyNav.vue +0 -42
- package/components/HairyNavBackground.vue +0 -7
- package/components/HairyNavMenu.vue +0 -11
- package/components/HairyNavToggleDark.vue +0 -16
- package/components/HairyPostToggleLayout.vue +0 -33
- package/components/HairyToc.vue +0 -135
- package/components/HairyUserNav.vue +0 -64
- package/components/HairyWaline.vue +0 -44
- package/hooks/setupDefaultDark.ts +0 -11
- package/hooks/useCategory.ts +0 -18
- package/hooks/useCategoryPost.ts +0 -21
- package/hooks/useContext.ts +0 -13
- package/hooks/useHeaderHeight.ts +0 -9
- package/hooks/usePostLayout.ts +0 -16
- package/images.json +0 -140
- package/index.d.ts +0 -100
- package/layouts/archives.vue +0 -11
- package/layouts/hairy.vue +0 -36
- package/layouts/month.vue +0 -6
- package/layouts/year.vue +0 -6
- package/node/addon-hairy.ts +0 -36
- package/node/addon-images.ts +0 -61
- package/node/addon-meting.ts +0 -13
- package/node/addon-statistics.ts +0 -19
- package/node/addon-toc.ts +0 -20
- package/node/utils.ts +0 -20
- package/utils/createContext.ts +0 -40
- package/utils/fonts.ts +0 -15
- /package/components/{HairyUserStats.vue → parts/HairyUserStats.vue} +0 -0
- /package/components/{article-layout → posts}/HairyArticleTop.vue +0 -0
- /package/{modules → library}/loading.scss +0 -0
- /package/{shims.d.ts → node/images/shims.d.ts} +0 -0
- /package/styles/{aplayer.scss → components/aplayer.scss} +0 -0
- /package/styles/{scrollbar.scss → components/scrollbar.scss} +0 -0
@@ -1,39 +1,37 @@
|
|
1
1
|
<script lang="ts" setup>
|
2
2
|
import { computed } from 'vue'
|
3
3
|
import { useI18n } from 'vue-i18n'
|
4
|
-
import { useRouter } from 'vue-router'
|
4
|
+
import { useRoute, useRouter } from 'vue-router'
|
5
5
|
import { useThemeConfig } from 'valaxy'
|
6
6
|
import { ElTimeline, ElTimelineItem } from 'element-plus/es/components/timeline/index'
|
7
|
-
import { useCurrentCategory } from '../../hooks/useCategory'
|
8
|
-
import { useCategoryPost } from '../../hooks/useCategoryPost'
|
9
7
|
|
10
8
|
import type { HairyTheme } from '../..'
|
11
9
|
import 'element-plus/es/components/timeline/style/index'
|
12
10
|
import 'element-plus/es/components/timeline-item/style/index'
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
const
|
17
|
-
const categoriesLayout = computed(() => themeConfig.value.categories?.layout || 'post')
|
11
|
+
import { useCategory, useCategoryPost } from '../../composables'
|
12
|
+
|
13
|
+
const themeConfig = useThemeConfig<HairyTheme.Config>()
|
14
|
+
const layout = computed(() => themeConfig.value.layout?.categories || 'post')
|
18
15
|
|
19
16
|
const router = useRouter()
|
17
|
+
const route = useRoute()
|
20
18
|
|
21
|
-
const
|
22
|
-
const
|
19
|
+
const categories = computed(() => route.params.its as string)
|
20
|
+
const paths = computed(() => categories.value.split('/').filter(Boolean))
|
21
|
+
const current = useCategory(paths)
|
23
22
|
const posts = useCategoryPost(paths)
|
24
23
|
|
25
24
|
const i18n = useI18n()
|
26
25
|
|
27
|
-
|
28
|
-
|
29
|
-
const getBreadcrumbPath = (index: number) => {
|
30
|
-
const paths = props.categories.split('/').filter(Boolean)
|
26
|
+
function getBreadcrumbPath(index: number) {
|
27
|
+
const paths = categories.value.split('/').filter(Boolean)
|
31
28
|
if (paths[index] === paths[paths.length - 1])
|
32
29
|
return ''
|
33
30
|
return `/categories/${paths.slice(0, index + 1).join('/')}`
|
34
31
|
}
|
35
|
-
|
36
|
-
|
32
|
+
|
33
|
+
function displayCategory(key: string) {
|
34
|
+
router.push({ path: `/categories/${[...paths.value, key].join('/')}` })
|
37
35
|
}
|
38
36
|
</script>
|
39
37
|
|
@@ -45,7 +43,7 @@ const displayCategory = (key: string) => {
|
|
45
43
|
<HairyBreadcrumbItem :to="paths.length && '/categories/' || ''">
|
46
44
|
全部
|
47
45
|
</HairyBreadcrumbItem>
|
48
|
-
<HairyBreadcrumbItem v-for="(key, index) in categories.split(
|
46
|
+
<HairyBreadcrumbItem v-for="(key, index) in categories.split('/')" :key="key" :to="getBreadcrumbPath(index)">
|
49
47
|
{{ i18n.t(key) }}
|
50
48
|
</HairyBreadcrumbItem>
|
51
49
|
</HairyBreadcrumb>
|
@@ -53,44 +51,41 @@ const displayCategory = (key: string) => {
|
|
53
51
|
<div class="grid__view dark:text-gray-3 flex-wrap">
|
54
52
|
<template v-for="([key, item]) in current.children" :key="key">
|
55
53
|
<div
|
56
|
-
|
54
|
+
v-if="!key.startsWith('/post')"
|
55
|
+
class="relative flex items-center flex-col cursor-pointer hover:text-primary transition-colors"
|
57
56
|
@click="displayCategory(key)"
|
58
57
|
>
|
59
|
-
<div class="i-
|
58
|
+
<div class="i-material-symbols-folder-open-rounded text-22 lt-sm:text-15" />
|
60
59
|
<div class="text-center leading-normal">
|
61
60
|
{{ i18n.t(key) }}
|
62
61
|
</div>
|
63
|
-
<div class="badge">
|
64
|
-
{{ item.total }}
|
62
|
+
<div class="badge text-12px right-20px top-12px">
|
63
|
+
{{ item.total }} dir
|
65
64
|
</div>
|
66
65
|
</div>
|
67
66
|
</template>
|
68
67
|
</div>
|
69
68
|
<div class="border-t border-gray-200 dark:border-gray-500 mt-5" />
|
70
69
|
|
71
|
-
<
|
72
|
-
<
|
70
|
+
<ElTimeline v-if="layout === 'timeline'" class="pt-5 pl-10">
|
71
|
+
<ElTimelineItem v-for="(item, index) in posts" :key="index" hollow size="large">
|
73
72
|
<HairyTimelinePostItem :post="item" />
|
74
|
-
</
|
75
|
-
</
|
73
|
+
</ElTimelineItem>
|
74
|
+
</ElTimeline>
|
76
75
|
<template v-else>
|
77
|
-
<
|
76
|
+
<HairyPosts :posts="posts" />
|
78
77
|
</template>
|
79
78
|
</template>
|
80
79
|
|
81
80
|
<style lang="scss" scoped>
|
82
81
|
.badge {
|
83
82
|
position: absolute;
|
84
|
-
|
85
|
-
top:
|
86
|
-
padding-
|
87
|
-
padding-
|
88
|
-
padding-bottom: 2px;
|
89
|
-
padding-right: 6px;
|
90
|
-
|
83
|
+
// padding-left: 6px;
|
84
|
+
// padding-top: 2px;
|
85
|
+
// padding-bottom: 2px;
|
86
|
+
// padding-right: 6px;
|
91
87
|
line-height: normal;
|
92
88
|
border-radius: 50%;
|
93
|
-
background-color: #f56c6c;
|
94
89
|
color: #fff;
|
95
90
|
}
|
96
91
|
|
package/pages/index.vue
CHANGED
package/pages/page/[page].vue
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
<script setup lang="ts">
|
2
|
-
|
2
|
+
|
3
3
|
</script>
|
4
4
|
|
5
5
|
<template>
|
6
|
-
<
|
6
|
+
<HairyPosts :pagination="true" :cur-page="parseInt(String($route.params.page))" />
|
7
7
|
</template>
|
8
8
|
|
9
9
|
<route lang="yaml">
|
@@ -1,16 +1,16 @@
|
|
1
1
|
<script lang="ts" setup>
|
2
|
-
import { computed
|
2
|
+
import { computed } from 'vue'
|
3
3
|
import { usePostList } from 'valaxy'
|
4
4
|
import { ElTimeline, ElTimelineItem } from 'element-plus/es/components/timeline/index'
|
5
5
|
import 'element-plus/es/components/timeline/style/index'
|
6
6
|
import 'element-plus/es/components/timeline-item/style/index'
|
7
|
-
|
8
|
-
tag: string
|
9
|
-
}>()
|
7
|
+
import { useRoute } from 'vue-router'
|
10
8
|
|
11
|
-
const
|
9
|
+
const tag = computed(() => useRoute().params.tag)
|
12
10
|
|
13
|
-
const
|
11
|
+
const posts = computed<any[]>(() =>
|
12
|
+
usePostList().value.filter(post => post.tags?.includes(tag.value as string)),
|
13
|
+
)
|
14
14
|
</script>
|
15
15
|
|
16
16
|
<template>
|
@@ -22,16 +22,16 @@ const tagPosts = computed<any[]>(() => posts.value.filter(post => post.tags?.inc
|
|
22
22
|
{{ tag }}
|
23
23
|
</HairyBreadcrumbItem>
|
24
24
|
</HairyBreadcrumb>
|
25
|
-
<
|
26
|
-
<
|
27
|
-
v-for="(item, index) in
|
25
|
+
<ElTimeline>
|
26
|
+
<ElTimelineItem
|
27
|
+
v-for="(item, index) in posts"
|
28
28
|
:key="index"
|
29
29
|
hollow
|
30
30
|
size="large"
|
31
31
|
>
|
32
|
-
<
|
33
|
-
</
|
34
|
-
</
|
32
|
+
<HairyTimelineContent :post="item" />
|
33
|
+
</ElTimelineItem>
|
34
|
+
</ElTimeline>
|
35
35
|
</template>
|
36
36
|
|
37
37
|
<route lang="yaml">
|
package/pages/tags/index.vue
CHANGED
@@ -1,24 +1,31 @@
|
|
1
1
|
<script lang="ts" setup>
|
2
|
-
import { useTags } from 'valaxy'
|
3
2
|
import { useRouter } from 'vue-router'
|
3
|
+
import { useHairyTags } from '../../composables'
|
4
|
+
|
4
5
|
const router = useRouter()
|
5
6
|
|
6
|
-
const {
|
7
|
+
const { getTagStyle, tags } = useHairyTags({
|
7
8
|
primary: '#1bc9a6',
|
8
9
|
})
|
9
10
|
|
10
|
-
|
11
|
+
function displayTag(tag: string) {
|
11
12
|
router.push(`/tags/${tag}`)
|
12
13
|
}
|
13
14
|
</script>
|
14
15
|
|
15
16
|
<template>
|
16
|
-
<div class="
|
17
|
+
<div class="min-h-59vh flex-center flex-col">
|
17
18
|
<div text="center" class="text-size-2.5em pt-10 mb-5">
|
18
19
|
目前共计 {{ Array.from(tags).length }} 个标签
|
19
20
|
</div>
|
20
21
|
<div text="center" class="max-w-7xl flex flex-wrap justify-center items-center gap-2">
|
21
|
-
<a
|
22
|
+
<a
|
23
|
+
v-for="[key, tag] in Array.from(tags).sort()"
|
24
|
+
:key="key" class="post-tag cursor-pointer"
|
25
|
+
:style="getTagStyle(tag.count)"
|
26
|
+
p="1"
|
27
|
+
@click="displayTag(key.toString())"
|
28
|
+
>
|
22
29
|
{{ key }}
|
23
30
|
</a>
|
24
31
|
</div>
|
package/setup/main.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { defineAppSetup } from 'valaxy'
|
2
2
|
|
3
3
|
// import { install as installScroll } from '../modules/scroll'
|
4
|
-
import { install as installLoading } from '../
|
4
|
+
import { install as installLoading } from '../library/loading'
|
5
5
|
|
6
6
|
export default defineAppSetup((ctx) => {
|
7
7
|
// installScroll(ctx)
|
package/store/index.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export * from './modules/global'
|
@@ -1,4 +1,4 @@
|
|
1
|
-
@
|
1
|
+
@forward 'valaxy/client/styles/mixins/index.scss';
|
2
2
|
|
3
3
|
.markdown-body {
|
4
4
|
--c-toc-link: var(--hy-c-text-light);
|
@@ -67,6 +67,7 @@ html.dark {
|
|
67
67
|
.custom-block.tip {
|
68
68
|
background-color: rgba(200, 200, 200, 0.1);
|
69
69
|
border-color: var(--hy-c-primary);
|
70
|
+
padding: 0.5rem 1rem;
|
70
71
|
}
|
71
72
|
|
72
73
|
.markdown-body {
|
package/styles/css-vars.scss
CHANGED
@@ -50,6 +50,8 @@
|
|
50
50
|
--hy-c-indigo-lighter: #c9def1;
|
51
51
|
--hy-c-indigo-dark: #1d2f3f;
|
52
52
|
--hy-c-indigo-darker: #14212e;
|
53
|
+
|
54
|
+
--va-c-bg: #fafafa;
|
53
55
|
}
|
54
56
|
|
55
57
|
.dark {
|
@@ -61,8 +63,10 @@
|
|
61
63
|
--hy-c-primary-dimm-1: rgba(143, 230, 213, 0.5);
|
62
64
|
--hy-c-primary-dimm-2: rgba(143, 230, 213, 0.25);
|
63
65
|
--hy-c-primary-dimm-3: rgba(143, 230, 213, 0.05);
|
66
|
+
--va-c-bg: #1b1b1f;
|
64
67
|
}
|
65
68
|
|
69
|
+
|
66
70
|
:root {
|
67
71
|
--hy-c-waves-dimm: var(--va-c-bg);
|
68
72
|
--hy-c-waves-dimm-1: rgba(255, 255, 255, 0.7);
|
@@ -151,6 +155,13 @@
|
|
151
155
|
--hy-c-text-code: var(--hy-c-indigo-lighter);
|
152
156
|
}
|
153
157
|
|
158
|
+
:root {
|
159
|
+
--va-c-primary-light: var(--hy-c-primary-light);
|
160
|
+
--va-c-primary-lighter: var(--hy-c-primary-lighter);
|
161
|
+
--va-c-primary-dark: var(--hy-c-primary-dark);
|
162
|
+
--va-c-primary: var(--hy-c-primary);
|
163
|
+
}
|
164
|
+
|
154
165
|
/**
|
155
166
|
* element-plus Theme
|
156
167
|
* -------------------------------------------------------------------------- */
|
@@ -0,0 +1,39 @@
|
|
1
|
+
html {
|
2
|
+
color: var(--va-c-text);
|
3
|
+
}
|
4
|
+
|
5
|
+
body {
|
6
|
+
font-family: var(--hy-font-family-seto);
|
7
|
+
color: var(--va-c-text);
|
8
|
+
background-color: var(--va-c-bg);
|
9
|
+
}
|
10
|
+
|
11
|
+
html,
|
12
|
+
body {
|
13
|
+
scroll-behavior: smooth;
|
14
|
+
}
|
15
|
+
|
16
|
+
a {
|
17
|
+
color: var(--hy-c-primary);
|
18
|
+
font-weight: 500;
|
19
|
+
}
|
20
|
+
|
21
|
+
|
22
|
+
@media (min-width: 1200px) {
|
23
|
+
.breakpoint {
|
24
|
+
width: 72.5rem
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
@media (max-width: 1200px) {
|
29
|
+
.breakpoint {
|
30
|
+
padding-left: .5rem;
|
31
|
+
padding-right: .5rem
|
32
|
+
}
|
33
|
+
}
|
34
|
+
|
35
|
+
@media (min-width: 1600px) {
|
36
|
+
.breakpoint {
|
37
|
+
width: 75vw
|
38
|
+
}
|
39
|
+
}
|
package/styles/index.scss
CHANGED
@@ -1,73 +1,4 @@
|
|
1
|
-
@
|
2
|
-
@
|
3
|
-
@
|
4
|
-
@
|
5
|
-
@import "./aplayer.scss";
|
6
|
-
@import "animate.css";
|
7
|
-
|
8
|
-
body {
|
9
|
-
font-family: var(--hy-font-family-seto);
|
10
|
-
@apply transition-colors duration-200;
|
11
|
-
color: var(--va-c-text);
|
12
|
-
}
|
13
|
-
|
14
|
-
#app {
|
15
|
-
@apply transition-none;
|
16
|
-
min-height: 100vh;
|
17
|
-
}
|
18
|
-
|
19
|
-
a {
|
20
|
-
@apply transition-colors;
|
21
|
-
color: var(--hy-c-primary-light);
|
22
|
-
|
23
|
-
&:hover {
|
24
|
-
--un-text-opacity: 1;
|
25
|
-
color: var(--hy-c-primary-dark);
|
26
|
-
}
|
27
|
-
}
|
28
|
-
|
29
|
-
html,
|
30
|
-
body {
|
31
|
-
scroll-behavior: smooth;
|
32
|
-
}
|
33
|
-
|
34
|
-
#nprogress {
|
35
|
-
pointer-events: none;
|
36
|
-
|
37
|
-
.bar {
|
38
|
-
top: 0;
|
39
|
-
// margin-top: -5px;
|
40
|
-
height: 5px;
|
41
|
-
opacity: 0.75;
|
42
|
-
background: var(--hy-c-primary);
|
43
|
-
position: fixed;
|
44
|
-
z-index: 1031;
|
45
|
-
left: 0;
|
46
|
-
width: 100%;
|
47
|
-
border-radius: 5px;
|
48
|
-
}
|
49
|
-
}
|
50
|
-
|
51
|
-
|
52
|
-
@media (min-width: 1200px) {
|
53
|
-
.breakpoint {
|
54
|
-
width: 72.5rem;
|
55
|
-
}
|
56
|
-
}
|
57
|
-
|
58
|
-
@media (max-width: 1200px) {
|
59
|
-
.breakpoint {
|
60
|
-
padding-left: 0.5rem;
|
61
|
-
padding-right: 0.5rem;
|
62
|
-
}
|
63
|
-
}
|
64
|
-
|
65
|
-
@media (min-width: 1600px) {
|
66
|
-
.breakpoint {
|
67
|
-
width: 75vw;
|
68
|
-
}
|
69
|
-
}
|
70
|
-
|
71
|
-
body {
|
72
|
-
// background-image: linear-gradient(to top, #f7f7f7 0, #fdfdfd 20%) no-repeat bottom;
|
73
|
-
}
|
1
|
+
@use './font-face' as *;
|
2
|
+
@use './global' as *;
|
3
|
+
@use './components' as *;
|
4
|
+
@use './element-plus' as *;
|
package/tsconfig.json
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
{
|
2
|
+
// we need tsconfig.json to compile without
|
3
|
+
// error: This is likely not portable. A type annotation is necessary.
|
4
|
+
"compilerOptions": {
|
5
|
+
"target": "ESNext",
|
6
|
+
"jsx": "preserve",
|
7
|
+
"lib": ["DOM", "ESNext"],
|
8
|
+
"baseUrl": ".",
|
9
|
+
"module": "ESNext",
|
10
|
+
"moduleResolution": "node",
|
11
|
+
"resolveJsonModule": true,
|
12
|
+
"types": [
|
13
|
+
"vite/client",
|
14
|
+
"vue/ref-macros",
|
15
|
+
"vite-plugin-pages/client",
|
16
|
+
"vite-plugin-vue-layouts/client"
|
17
|
+
],
|
18
|
+
"allowJs": true,
|
19
|
+
"strict": true,
|
20
|
+
"strictNullChecks": true,
|
21
|
+
"noUnusedLocals": true,
|
22
|
+
"esModuleInterop": true,
|
23
|
+
"forceConsistentCasingInFileNames": true,
|
24
|
+
"skipLibCheck": true
|
25
|
+
},
|
26
|
+
"exclude": ["**/dist/**", "node_modules"]
|
27
|
+
}
|
package/types/index.d.ts
ADDED
@@ -0,0 +1,163 @@
|
|
1
|
+
/* eslint-disable ts/no-use-before-define */
|
2
|
+
export namespace HairyTheme {
|
3
|
+
export type Config = ThemeConfig
|
4
|
+
export type Sidebar = any
|
5
|
+
export type { Layout }
|
6
|
+
}
|
7
|
+
|
8
|
+
/**
|
9
|
+
* Theme Config
|
10
|
+
*/
|
11
|
+
export interface ThemeConfig {
|
12
|
+
/**
|
13
|
+
* default theme mode
|
14
|
+
*
|
15
|
+
* @default 'light'
|
16
|
+
*/
|
17
|
+
theme?: 'dark' | 'light'
|
18
|
+
|
19
|
+
home?: Home
|
20
|
+
|
21
|
+
user?: User
|
22
|
+
|
23
|
+
post?: Post
|
24
|
+
|
25
|
+
/**
|
26
|
+
* colors
|
27
|
+
*/
|
28
|
+
colors?: Colors
|
29
|
+
|
30
|
+
/**
|
31
|
+
* layout
|
32
|
+
*/
|
33
|
+
layout?: Partial<Layout>
|
34
|
+
|
35
|
+
/**
|
36
|
+
* footer
|
37
|
+
*/
|
38
|
+
footer?: Partial<Footer>
|
39
|
+
|
40
|
+
/**
|
41
|
+
* navbar
|
42
|
+
*/
|
43
|
+
nav?: NavItem[]
|
44
|
+
|
45
|
+
/**
|
46
|
+
* meting
|
47
|
+
*/
|
48
|
+
meting?: Partial<Meting>
|
49
|
+
|
50
|
+
/**
|
51
|
+
* Custom header levels of outline in the aside component.
|
52
|
+
*
|
53
|
+
* @default 2
|
54
|
+
*/
|
55
|
+
outline?: number | [number, number] | 'deep' | false
|
56
|
+
}
|
57
|
+
|
58
|
+
export interface NavItem {
|
59
|
+
text: string
|
60
|
+
link: string
|
61
|
+
icon?: string
|
62
|
+
}
|
63
|
+
/**
|
64
|
+
* meting options
|
65
|
+
* @see https://github.com/metowolf/MetingJS#option
|
66
|
+
*/
|
67
|
+
export interface Meting {
|
68
|
+
id: string
|
69
|
+
server: string
|
70
|
+
type: string
|
71
|
+
auto: string
|
72
|
+
fixed: boolean
|
73
|
+
mini: boolean
|
74
|
+
autoplay: boolean
|
75
|
+
theme: string
|
76
|
+
loop: string
|
77
|
+
order: string
|
78
|
+
preload: string
|
79
|
+
volume: number
|
80
|
+
work: string
|
81
|
+
mutex: boolean
|
82
|
+
start: string
|
83
|
+
'lrc-type': number
|
84
|
+
'list-folded': boolean
|
85
|
+
'list-max-height': string
|
86
|
+
'storage-name': string
|
87
|
+
[key: string]: any
|
88
|
+
}
|
89
|
+
|
90
|
+
export interface Layout {
|
91
|
+
post:
|
92
|
+
| 'text'
|
93
|
+
| 'markdown'
|
94
|
+
| 'image'
|
95
|
+
| 'image:slice'
|
96
|
+
| 'image:slice:reverse'
|
97
|
+
categories: 'timeline' | 'post'
|
98
|
+
}
|
99
|
+
|
100
|
+
export interface Footer {
|
101
|
+
/**
|
102
|
+
* 建站于
|
103
|
+
*/
|
104
|
+
since: number
|
105
|
+
|
106
|
+
/**
|
107
|
+
* Icon between year and copyright info.
|
108
|
+
*/
|
109
|
+
icon: {
|
110
|
+
/**
|
111
|
+
* icon name, i-xxx
|
112
|
+
*/
|
113
|
+
name: string
|
114
|
+
animated: boolean
|
115
|
+
color: string
|
116
|
+
url: string
|
117
|
+
title: string
|
118
|
+
}
|
119
|
+
|
120
|
+
/**
|
121
|
+
* Powered by valaxy & valaxy-theme-${name}, default is yun
|
122
|
+
*/
|
123
|
+
powered: boolean
|
124
|
+
|
125
|
+
/**
|
126
|
+
* Chinese Users | 中国用户
|
127
|
+
* 备案 ICP
|
128
|
+
* 国内用户需要在网站页脚展示备案 ICP 号
|
129
|
+
* https://beian.miit.gov.cn/
|
130
|
+
*/
|
131
|
+
beian: {
|
132
|
+
enable: boolean
|
133
|
+
/**
|
134
|
+
* 苏ICP备xxxxxxxx号
|
135
|
+
*/
|
136
|
+
icp: string
|
137
|
+
}
|
138
|
+
}
|
139
|
+
|
140
|
+
export interface Colors {
|
141
|
+
/**
|
142
|
+
* primary color
|
143
|
+
* @default '#0078E7'
|
144
|
+
*/
|
145
|
+
primary: string
|
146
|
+
}
|
147
|
+
export interface Home {
|
148
|
+
headline: string
|
149
|
+
title: string
|
150
|
+
description: string
|
151
|
+
images: string[]
|
152
|
+
}
|
153
|
+
|
154
|
+
export interface Post {
|
155
|
+
images: string[]
|
156
|
+
}
|
157
|
+
|
158
|
+
export interface User {
|
159
|
+
name?: string
|
160
|
+
description?: string
|
161
|
+
}
|
162
|
+
|
163
|
+
export type ThemeUserConfig = Partial<ThemeConfig>
|
package/unocss.config.ts
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import { defineConfig } from 'unocss'
|
2
|
+
|
2
3
|
const safelist = [
|
3
|
-
'i-ri
|
4
|
+
'i-ri-home-2-fill',
|
4
5
|
'i-ri-list-check-2',
|
5
6
|
'i-ri-flow-chart',
|
6
7
|
'i-ri-user-line',
|
@@ -11,6 +12,7 @@ const safelist = [
|
|
11
12
|
'i-fluent-markdown-20-filled',
|
12
13
|
'i-fluent-code-text-16-filled',
|
13
14
|
]
|
15
|
+
|
14
16
|
export default defineConfig({
|
15
17
|
theme: {
|
16
18
|
breakpoints: {
|
@@ -28,6 +30,8 @@ export default defineConfig({
|
|
28
30
|
['font-christmas', { 'font-family': 'var(--hy-font-family-christmas)' }],
|
29
31
|
['font-frederick', { 'font-family': 'var(--hy-font-family-frederick)' }],
|
30
32
|
['text-primary', { color: 'var(--hy-c-primary)' }],
|
33
|
+
['text-primary-dark', { color: 'var(--hy-c-primary-dark)' }],
|
34
|
+
['text-primary-light', { color: 'var(--hy-c-primary-light)' }],
|
31
35
|
['border-primary', { 'border-color': 'var(--hy-c-primary)' }],
|
32
36
|
['bg-primary', { background: 'var(--hy-c-primary)' }],
|
33
37
|
],
|