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.
Files changed (153) hide show
  1. package/client/index.ts +1 -0
  2. package/components/HairyBody.vue +15 -17
  3. package/components/HairyComment.vue +33 -0
  4. package/components/HairyContainer.vue +13 -0
  5. package/components/{HairyUserPopup.vue → HairyDrawer.vue} +14 -13
  6. package/components/HairyFooter.vue +12 -9
  7. package/components/HairyHeader.vue +10 -9
  8. package/components/HairyImage.vue +2 -1
  9. package/components/HairyImageGroup.vue +12 -16
  10. package/components/HairyNavbar.vue +56 -0
  11. package/components/{HairyPostList.vue → HairyPosts.vue} +3 -3
  12. package/components/{HairyNavSearch.vue → HairySearch.vue} +23 -87
  13. package/components/{HairyUserCard.vue → HairySidebar.vue} +4 -4
  14. package/components/{HairyUserTab.vue → HairyTabbar.vue} +27 -11
  15. package/components/PageTags.vue +48 -0
  16. package/components/ValaxyMain.vue +3 -3
  17. package/components/navbar/HairyNav.vue +16 -0
  18. package/components/navbar/HairyNavExpand.vue +12 -0
  19. package/components/navbar/HairyNavItem.vue +35 -0
  20. package/components/navbar/HairyNavbarBackground.vue +7 -0
  21. package/components/navbar/HairyNavbarSearch.vue +8 -0
  22. package/components/{HairyNavTitle.vue → navbar/HairyNavbarTitle.vue} +5 -3
  23. package/components/navbar/HairyNavbarToggleDark.vue +22 -0
  24. package/components/{HairyBreadcrumb.vue → parts/HairyBreadcrumb.vue} +1 -1
  25. package/components/{HairyBreadcrumbItem.vue → parts/HairyBreadcrumbItem.vue} +1 -4
  26. package/components/{lib/fish.js → parts/HairyFootFish.js} +5 -7
  27. package/components/parts/HairyFootFish.vue +38 -0
  28. package/components/{HairyPostTitle.vue → parts/HairyHeadHero.vue} +6 -5
  29. package/components/{HairyWaves.vue → parts/HairyHeadWaves.vue} +5 -5
  30. package/components/parts/HairyImageGlobal.vue +51 -0
  31. package/components/{HairyImageViewer.vue → parts/HairyImageViewer.vue} +4 -3
  32. package/components/parts/HairyLink.vue +21 -0
  33. package/components/{HairyMenu.vue → parts/HairyMenu.vue} +2 -1
  34. package/components/{HairyMenuItem.vue → parts/HairyMenuItem.vue} +11 -4
  35. package/components/parts/HairyOutline.vue +99 -0
  36. package/components/parts/HairyOutlineItem.vue +48 -0
  37. package/components/{HairySocialLinks.vue → parts/HairySocialLinks.vue} +2 -2
  38. package/components/{HairyTimelinePostItem.vue → parts/HairyTimelineContent.vue} +7 -8
  39. package/components/parts/HairyUserNav.vue +95 -0
  40. package/components/{article-layout → posts}/HairyArticleImage.vue +18 -19
  41. package/components/{article-layout → posts}/HairyArticleSeries.vue +8 -5
  42. package/components/{article-layout → posts}/HairyArticleText.vue +11 -4
  43. package/components/posts/HairyPostFooter.vue +15 -0
  44. package/components/{article-layout → posts}/HairyPostImageList.vue +4 -5
  45. package/components/{article-layout → posts}/HairyPostTextsList.vue +0 -1
  46. package/components/posts/HairyPostToggleLayout.vue +36 -0
  47. package/components/third/HairyAlgoliaSearch.vue +17 -0
  48. package/components/third/HairyFuseSearch.vue +10 -0
  49. package/components/third/HairyFuseSearchDialog.vue +32 -0
  50. package/components/third/HairyFuseSearchDropdown.vue +77 -0
  51. package/components/third/HairyFuseSearchFooter.vue +28 -0
  52. package/components/third/HairyFuseSearchHeader.vue +30 -0
  53. package/components/third/HairyFuseSearchHit.vue +52 -0
  54. package/components/third/HairySearchBtnDisplay.vue +29 -0
  55. package/components/third/HairySearchBtnInput.vue +20 -0
  56. package/components/third/HairySearchBtnKeys.vue +19 -0
  57. package/components/{HairyCarousel.vue → third/HairySwiperCarousel.vue} +6 -6
  58. package/{hooks/useYearArchives.ts → composables/archives.ts} +4 -3
  59. package/composables/category.ts +43 -0
  60. package/composables/config.ts +11 -0
  61. package/composables/dark.ts +13 -0
  62. package/composables/fuse.ts +60 -0
  63. package/composables/index.ts +8 -0
  64. package/composables/layout.ts +16 -0
  65. package/composables/outline.ts +49 -0
  66. package/composables/tags.ts +36 -0
  67. package/layouts/archive-month.vue +13 -0
  68. package/layouts/archive-year.vue +13 -0
  69. package/layouts/archive.vue +11 -0
  70. package/layouts/categories.vue +11 -4
  71. package/layouts/default.vue +8 -7
  72. package/layouts/home.vue +28 -18
  73. package/layouts/post.vue +41 -35
  74. package/layouts/tag.vue +8 -4
  75. package/layouts/tags.vue +11 -4
  76. package/{modules → library}/loading.ts +18 -6
  77. package/{modules → library}/scroll.ts +3 -2
  78. package/locales/zh-CN.yml +0 -2
  79. package/node/images/default.json +139 -0
  80. package/node/images/index.ts +46 -0
  81. package/node/index.ts +2 -0
  82. package/node/theme/index.ts +78 -0
  83. package/package.json +22 -28
  84. package/pages/archives/[year]/[month]/index.vue +15 -16
  85. package/pages/archives/[year]/index.vue +20 -18
  86. package/pages/archives/index.vue +10 -8
  87. package/pages/categories/{[...categories].vue → [...its].vue} +29 -34
  88. package/pages/index.vue +1 -1
  89. package/pages/page/[page].vue +2 -2
  90. package/pages/tags/{[tag].vue → [tag]/index.vue} +12 -12
  91. package/pages/tags/index.vue +12 -5
  92. package/setup/main.ts +1 -1
  93. package/store/index.ts +1 -0
  94. package/store/modules/global.ts +12 -0
  95. package/styles/components/index.scss +4 -0
  96. package/styles/{markdown.scss → components/markdown.scss} +2 -1
  97. package/styles/components/nprogress.scss +16 -0
  98. package/styles/css-vars.scss +11 -0
  99. package/styles/element-plus/tabs.scss +1 -1
  100. package/styles/element-plus/timeline.scss +1 -1
  101. package/styles/global.scss +39 -0
  102. package/styles/index.scss +4 -73
  103. package/tsconfig.json +27 -0
  104. package/types/index.d.ts +163 -0
  105. package/unocss.config.ts +5 -1
  106. package/utils/index.ts +21 -39
  107. package/valaxy.config.ts +21 -24
  108. package/@types/markdown-it.d.ts +0 -1
  109. package/@types/markdown-toc.d.ts +0 -1
  110. package/@types/types.d.ts +0 -1
  111. package/@types/valaxy.d.ts +0 -10
  112. package/components/HairyAlgoliaSearchBox.vue +0 -118
  113. package/components/HairyBackToTop.vue +0 -72
  114. package/components/HairyDivider.vue +0 -0
  115. package/components/HairyFooterFish.vue +0 -29
  116. package/components/HairyLayout.vue +0 -28
  117. package/components/HairyLink.vue +0 -10
  118. package/components/HairyLinks.vue +0 -69
  119. package/components/HairyMeting.vue +0 -19
  120. package/components/HairyNav.vue +0 -42
  121. package/components/HairyNavBackground.vue +0 -7
  122. package/components/HairyNavMenu.vue +0 -11
  123. package/components/HairyNavToggleDark.vue +0 -16
  124. package/components/HairyPostToggleLayout.vue +0 -33
  125. package/components/HairyToc.vue +0 -135
  126. package/components/HairyUserNav.vue +0 -64
  127. package/components/HairyWaline.vue +0 -44
  128. package/hooks/setupDefaultDark.ts +0 -11
  129. package/hooks/useCategory.ts +0 -18
  130. package/hooks/useCategoryPost.ts +0 -21
  131. package/hooks/useContext.ts +0 -13
  132. package/hooks/useHeaderHeight.ts +0 -9
  133. package/hooks/usePostLayout.ts +0 -16
  134. package/images.json +0 -140
  135. package/index.d.ts +0 -100
  136. package/layouts/archives.vue +0 -11
  137. package/layouts/hairy.vue +0 -36
  138. package/layouts/month.vue +0 -6
  139. package/layouts/year.vue +0 -6
  140. package/node/addon-hairy.ts +0 -36
  141. package/node/addon-images.ts +0 -61
  142. package/node/addon-meting.ts +0 -13
  143. package/node/addon-statistics.ts +0 -19
  144. package/node/addon-toc.ts +0 -20
  145. package/node/utils.ts +0 -20
  146. package/utils/createContext.ts +0 -40
  147. package/utils/fonts.ts +0 -15
  148. /package/components/{HairyUserStats.vue → parts/HairyUserStats.vue} +0 -0
  149. /package/components/{article-layout → posts}/HairyArticleTop.vue +0 -0
  150. /package/{modules → library}/loading.scss +0 -0
  151. /package/{shims.d.ts → node/images/shims.d.ts} +0 -0
  152. /package/styles/{aplayer.scss → components/aplayer.scss} +0 -0
  153. /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
- const props = defineProps<{
14
- categories: string
15
- }>()
16
- const themeConfig = useThemeConfig<HairyTheme>()
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 paths = computed(() => props.categories.split('/').filter(Boolean))
22
- const current = useCurrentCategory(paths)
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
- const s = '/'
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
- const displayCategory = (key: string) => {
36
- router.push({ path: `/categories/${[key, ...paths.value].reverse().join('/')}` })
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(s)" :key="key" :to="getBreadcrumbPath(index)">
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
- class="relative flex items-center flex-col cursor-pointer hover:text-primary transition-color"
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-ri-folder-open-line text-22 lt-sm:text-15" />
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
- <el-timeline v-if="categoriesLayout === 'timeline'" class="pt-5 pl-10">
72
- <el-timeline-item v-for="(item, index) in posts" :key="index" hollow size="large">
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
- </el-timeline-item>
75
- </el-timeline>
73
+ </ElTimelineItem>
74
+ </ElTimeline>
76
75
  <template v-else>
77
- <HairyPostList :posts="posts" />
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
- right: 0.8rem;
85
- top: 0.5rem;
86
- padding-left: 6px;
87
- padding-top: 2px;
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
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <HairyPostList :pagination="true" />
2
+ <HairyPosts pagination />
3
3
  </template>
4
4
 
5
5
  <route lang="yaml">
@@ -1,9 +1,9 @@
1
1
  <script setup lang="ts">
2
- defineProps<{ page: string }>()
2
+
3
3
  </script>
4
4
 
5
5
  <template>
6
- <HairyPostList :pagination="true" :cur-page="parseInt(page)" />
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, defineProps } from 'vue'
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
- const props = defineProps<{
8
- tag: string
9
- }>()
7
+ import { useRoute } from 'vue-router'
10
8
 
11
- const posts = usePostList()
9
+ const tag = computed(() => useRoute().params.tag)
12
10
 
13
- const tagPosts = computed<any[]>(() => posts.value.filter(post => post.tags?.includes(props.tag)))
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
- <el-timeline>
26
- <el-timeline-item
27
- v-for="(item, index) in tagPosts"
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
- <HairyTimelinePostItem :post="item" />
33
- </el-timeline-item>
34
- </el-timeline>
32
+ <HairyTimelineContent :post="item" />
33
+ </ElTimelineItem>
34
+ </ElTimeline>
35
35
  </template>
36
36
 
37
37
  <route lang="yaml">
@@ -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 { tags, getTagStyle } = useTags({
7
+ const { getTagStyle, tags } = useHairyTags({
7
8
  primary: '#1bc9a6',
8
9
  })
9
10
 
10
- const displayTag = (tag: string) => {
11
+ function displayTag(tag: string) {
11
12
  router.push(`/tags/${tag}`)
12
13
  }
13
14
  </script>
14
15
 
15
16
  <template>
16
- <div class="inset-0 h-full flex-center flex-col">
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 v-for="[key, tag] in Array.from(tags).sort()" :key="key" class="post-tag cursor-pointer" :style="getTagStyle(tag.count)" p="1" @click="displayTag(key.toString())">
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 '../modules/loading'
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'
@@ -0,0 +1,12 @@
1
+ import { defineStore } from 'pinia'
2
+ import { ref } from 'vue'
3
+
4
+ export const useGlobalStore = defineStore('global', () => {
5
+ const headerRef = ref<HTMLDivElement>()
6
+ const showDrawer = ref(false)
7
+
8
+ return {
9
+ headerRef,
10
+ showDrawer,
11
+ }
12
+ })
@@ -0,0 +1,4 @@
1
+ @import "./aplayer.scss";
2
+ @import "./scrollbar.scss";
3
+ @import "./markdown.scss";
4
+ @import "./nprogress.scss";
@@ -1,4 +1,4 @@
1
- @use "valaxy/client/styles/mixins" as *;
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 {
@@ -0,0 +1,16 @@
1
+ #nprogress {
2
+ pointer-events: none;
3
+
4
+ .bar {
5
+ top: 0;
6
+ // margin-top: -5px;
7
+ height: 5px;
8
+ opacity: 0.75;
9
+ background: var(--hy-c-primary);
10
+ position: fixed;
11
+ z-index: 1031;
12
+ left: 0;
13
+ width: 100%;
14
+ border-radius: 5px;
15
+ }
16
+ }
@@ -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
  * -------------------------------------------------------------------------- */
@@ -14,7 +14,7 @@
14
14
  }
15
15
 
16
16
  .el-tabs__item {
17
- @apply transition-colors;
17
+ // @apply transition-colors;
18
18
  padding: 0 10px;
19
19
  }
20
20
 
@@ -1,7 +1,7 @@
1
1
  .el-timeline {
2
2
  .el-timeline-item__content {
3
3
  display: inline-block;
4
- color: initial;
4
+ color: var(--va-c-text) !important;
5
5
  line-height: 1;
6
6
  font-size: 1.5rem;
7
7
 
@@ -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
- @import "./font-face.scss";
2
- @import "./markdown.scss";
3
- @import "./element-plus/index.scss";
4
- @import "./scrollbar.scss";
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
+ }
@@ -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:home-2-fill',
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
  ],