valaxy-theme-hairy 0.2.2 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) 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 +17 -0
  5. package/components/{HairyUserPopup.vue → HairyDrawer.vue} +16 -16
  6. package/components/HairyFooter.vue +12 -9
  7. package/components/HairyHeader.vue +10 -9
  8. package/components/HairyImage.vue +3 -2
  9. package/components/HairyImageGroup.vue +12 -16
  10. package/components/HairyNavbar.vue +56 -0
  11. package/components/HairyPageArchives.vue +59 -0
  12. package/components/HairyPageTags.vue +48 -0
  13. package/components/{HairyPostList.vue → HairyPosts.vue} +3 -3
  14. package/components/{HairyNavSearch.vue → HairySearch.vue} +23 -87
  15. package/components/{HairyUserCard.vue → HairySidebar.vue} +4 -4
  16. package/components/HairyTabbar.vue +56 -0
  17. package/components/PageTags.vue +48 -0
  18. package/components/ValaxyMain.vue +3 -3
  19. package/components/navbar/HairyNav.vue +16 -0
  20. package/components/navbar/HairyNavExpand.vue +12 -0
  21. package/components/navbar/HairyNavItem.vue +35 -0
  22. package/components/navbar/HairyNavbarBackground.vue +7 -0
  23. package/components/navbar/HairyNavbarSearch.vue +8 -0
  24. package/components/{HairyNavTitle.vue → navbar/HairyNavbarTitle.vue} +5 -3
  25. package/components/navbar/HairyNavbarToggleDark.vue +22 -0
  26. package/components/{HairyBreadcrumb.vue → parts/HairyBreadcrumb.vue} +2 -2
  27. package/components/{HairyBreadcrumbItem.vue → parts/HairyBreadcrumbItem.vue} +1 -4
  28. package/components/{lib/fish.js → parts/HairyFootFish.js} +5 -7
  29. package/components/parts/HairyFootFish.vue +38 -0
  30. package/components/{HairyPostTitle.vue → parts/HairyHeadHero.vue} +6 -5
  31. package/components/{HairyWaves.vue → parts/HairyHeadWaves.vue} +5 -5
  32. package/components/parts/HairyImageGlobal.vue +51 -0
  33. package/components/{HairyImageViewer.vue → parts/HairyImageViewer.vue} +5 -4
  34. package/components/parts/HairyLink.vue +21 -0
  35. package/components/{HairyMenu.vue → parts/HairyMenu.vue} +2 -1
  36. package/components/{HairyMenuItem.vue → parts/HairyMenuItem.vue} +11 -4
  37. package/components/parts/HairyOutline.vue +99 -0
  38. package/components/parts/HairyOutlineItem.vue +48 -0
  39. package/components/{HairySocialLinks.vue → parts/HairySocialLinks.vue} +2 -2
  40. package/components/{HairyTimelinePostItem.vue → parts/HairyTimelineContent.vue} +7 -8
  41. package/components/parts/HairyUserNav.vue +95 -0
  42. package/components/{article-layout → posts}/HairyArticleImage.vue +18 -19
  43. package/components/{article-layout → posts}/HairyArticleSeries.vue +8 -5
  44. package/components/{article-layout → posts}/HairyArticleText.vue +11 -4
  45. package/components/posts/HairyPostFooter.vue +15 -0
  46. package/components/{article-layout → posts}/HairyPostImageList.vue +4 -5
  47. package/components/{article-layout → posts}/HairyPostTextsList.vue +0 -1
  48. package/components/posts/HairyPostToggleLayout.vue +36 -0
  49. package/components/third/HairyAlgoliaSearch.vue +17 -0
  50. package/components/third/HairyFuseSearch.vue +10 -0
  51. package/components/third/HairyFuseSearchDialog.vue +32 -0
  52. package/components/third/HairyFuseSearchDropdown.vue +77 -0
  53. package/components/third/HairyFuseSearchFooter.vue +28 -0
  54. package/components/third/HairyFuseSearchHeader.vue +30 -0
  55. package/components/third/HairyFuseSearchHit.vue +52 -0
  56. package/components/third/HairySearchBtnDisplay.vue +29 -0
  57. package/components/third/HairySearchBtnInput.vue +20 -0
  58. package/components/third/HairySearchBtnKeys.vue +19 -0
  59. package/components/{HairyCarousel.vue → third/HairySwiperCarousel.vue} +6 -6
  60. package/{hooks/useYearArchives.ts → composables/archives.ts} +4 -3
  61. package/composables/category.ts +43 -0
  62. package/composables/config.ts +11 -0
  63. package/composables/dark.ts +13 -0
  64. package/composables/fuse.ts +60 -0
  65. package/composables/index.ts +8 -0
  66. package/composables/layout.ts +16 -0
  67. package/composables/outline.ts +49 -0
  68. package/composables/tags.ts +36 -0
  69. package/layouts/archive-month.vue +13 -0
  70. package/layouts/archive-year.vue +13 -0
  71. package/layouts/archives.vue +9 -9
  72. package/layouts/categories.vue +11 -4
  73. package/layouts/default.vue +9 -3
  74. package/layouts/home.vue +28 -18
  75. package/layouts/post.vue +42 -36
  76. package/layouts/tag.vue +8 -4
  77. package/layouts/tags.vue +12 -4
  78. package/{modules → library}/loading.ts +18 -6
  79. package/{modules → library}/scroll.ts +3 -2
  80. package/locales/zh-CN.yml +0 -2
  81. package/node/images/default.json +139 -0
  82. package/node/images/index.ts +46 -0
  83. package/node/index.ts +2 -0
  84. package/node/theme/index.ts +78 -0
  85. package/package.json +22 -28
  86. package/pages/archives/[year]/[month]/index.vue +15 -18
  87. package/pages/archives/[year]/index.vue +20 -20
  88. package/pages/archives/index.vue +1 -54
  89. package/pages/categories/{[...categories].vue → [...its].vue} +29 -36
  90. package/pages/index.vue +1 -1
  91. package/pages/page/[page].vue +2 -2
  92. package/pages/tags/[tag]/index.vue +38 -0
  93. package/pages/tags/index.vue +1 -36
  94. package/setup/main.ts +1 -1
  95. package/store/index.ts +1 -0
  96. package/store/modules/global.ts +12 -0
  97. package/styles/components/index.scss +4 -0
  98. package/styles/{markdown.scss → components/markdown.scss} +2 -1
  99. package/styles/components/nprogress.scss +16 -0
  100. package/styles/css-vars.scss +11 -0
  101. package/styles/element-plus/tabs.scss +1 -1
  102. package/styles/element-plus/timeline.scss +1 -1
  103. package/styles/global.scss +39 -0
  104. package/styles/index.scss +4 -73
  105. package/tsconfig.json +27 -0
  106. package/types/index.d.ts +163 -0
  107. package/unocss.config.ts +5 -1
  108. package/utils/index.ts +21 -39
  109. package/valaxy.config.ts +21 -24
  110. package/@types/markdown-it.d.ts +0 -1
  111. package/@types/markdown-toc.d.ts +0 -1
  112. package/@types/types.d.ts +0 -1
  113. package/@types/valaxy.d.ts +0 -10
  114. package/components/HairyAlgoliaSearchBox.vue +0 -118
  115. package/components/HairyBackToTop.vue +0 -72
  116. package/components/HairyDivider.vue +0 -0
  117. package/components/HairyFooterFish.vue +0 -29
  118. package/components/HairyLayout.vue +0 -28
  119. package/components/HairyLink.vue +0 -10
  120. package/components/HairyLinks.vue +0 -69
  121. package/components/HairyMeting.vue +0 -19
  122. package/components/HairyNav.vue +0 -42
  123. package/components/HairyNavBackground.vue +0 -7
  124. package/components/HairyNavMenu.vue +0 -11
  125. package/components/HairyNavToggleDark.vue +0 -16
  126. package/components/HairyPostToggleLayout.vue +0 -33
  127. package/components/HairyToc.vue +0 -135
  128. package/components/HairyUserNav.vue +0 -64
  129. package/components/HairyUserTab.vue +0 -40
  130. package/components/HairyWaline.vue +0 -44
  131. package/hooks/setupDefaultDark.ts +0 -11
  132. package/hooks/useCategory.ts +0 -18
  133. package/hooks/useCategoryPost.ts +0 -21
  134. package/hooks/useContext.ts +0 -13
  135. package/hooks/useHeaderHeight.ts +0 -9
  136. package/hooks/usePostLayout.ts +0 -16
  137. package/images.json +0 -140
  138. package/index.d.ts +0 -100
  139. package/layouts/hairy.vue +0 -36
  140. package/layouts/month.vue +0 -6
  141. package/layouts/year.vue +0 -6
  142. package/node/addon-hairy.ts +0 -36
  143. package/node/addon-images.ts +0 -61
  144. package/node/addon-meting.ts +0 -13
  145. package/node/addon-statistics.ts +0 -19
  146. package/node/addon-toc.ts +0 -20
  147. package/node/utils.ts +0 -20
  148. package/pages/tags/[tag].vue +0 -40
  149. package/utils/createContext.ts +0 -40
  150. package/utils/fonts.ts +0 -15
  151. /package/components/{HairyUserStats.vue → parts/HairyUserStats.vue} +0 -0
  152. /package/components/{article-layout → posts}/HairyArticleTop.vue +0 -0
  153. /package/{modules → library}/loading.scss +0 -0
  154. /package/{shims.d.ts → node/images/shims.d.ts} +0 -0
  155. /package/styles/{aplayer.scss → components/aplayer.scss} +0 -0
  156. /package/styles/{scrollbar.scss → components/scrollbar.scss} +0 -0
@@ -1,21 +1,18 @@
1
1
  <script lang="ts" setup>
2
2
  import { ElTimeline, ElTimelineItem } from 'element-plus/es/components/timeline/index'
3
- import 'element-plus/es/components/timeline/style/index'
4
- import 'element-plus/es/components/timeline-item/style/index'
5
- import { computed, defineProps } from 'vue'
6
- import { useYearArchives } from '../../../../hooks/useYearArchives'
3
+ import { computed } from 'vue'
4
+ import { useRoute } from 'vue-router'
5
+ import { useYearArchives } from '../../../../composables'
7
6
  import { getArchiveLink } from '../../../../utils'
8
7
 
9
- const props = defineProps<{
10
- year: string
11
- month: string
12
- }>()
8
+ const year = computed(() => useRoute().params.year as string)
9
+ const month = computed(() => useRoute().params.month as string)
13
10
 
14
11
  const activities = useYearArchives()
15
12
  const months = computed(() =>
16
13
  activities.value
17
- .filter(item => item.year === props.year)
18
- .filter(item => item.month === props.month),
14
+ .filter(item => item.year === year.value)
15
+ .filter(item => item.month === month.value),
19
16
  )
20
17
  const count = computed(() => months.value.reduce((total, value) => total + value.count, 0))
21
18
  const post = computed(() => months.value.flatMap(item => item.posts))
@@ -33,19 +30,19 @@ const post = computed(() => months.value.flatMap(item => item.posts))
33
30
  {{ month }}月
34
31
  </HairyBreadcrumbItem>
35
32
  </HairyBreadcrumb>
36
- <el-timeline>
37
- <el-timeline-item
33
+ <ElTimeline>
34
+ <ElTimelineItem
38
35
  v-for="(item, index) in post"
39
36
  :key="index"
40
37
  hollow
41
38
  size="large"
42
39
  >
43
- <HairyTimelinePostItem :post="item" />
44
- </el-timeline-item>
45
- </el-timeline>
40
+ <HairyTimelineContent :post="item" />
41
+ </ElTimelineItem>
42
+ </ElTimeline>
46
43
  </template>
47
44
 
48
45
  <route lang="yaml">
49
- meta:
50
- layout: month
51
- </route>
46
+ meta:
47
+ layout: archive-month
48
+ </route>
@@ -1,25 +1,25 @@
1
1
  <script lang="ts" setup>
2
2
  import { ElTimeline, ElTimelineItem } from 'element-plus/es/components/timeline/index'
3
- import 'element-plus/es/components/timeline/style/index'
4
- import 'element-plus/es/components/timeline-item/style/index'
5
3
  import { computed } from 'vue'
6
4
  import type { Post } from 'valaxy'
7
- import { useYearArchives } from '../../../hooks/useYearArchives'
5
+ import { useRoute } from 'vue-router'
8
6
  import { getArchiveLink } from '../../../utils'
9
- interface TimeLineItem extends Post {
7
+ import { useYearArchives } from '../../../composables'
8
+
9
+ interface TimeLineByPost extends Post {
10
10
  type: 'link' | 'post'
11
11
  month: string
12
12
  link: string
13
13
  count: number
14
14
  }
15
- const props = defineProps<{
16
- year: string
17
- }>()
18
15
 
19
16
  const activities = useYearArchives()
20
- const filterYear = computed(() => activities.value.filter(item => item.year === props.year))
17
+
18
+ const year = computed(() => useRoute().params.year as string)
19
+
20
+ const filterYear = computed(() => activities.value.filter(item => item.year === year.value))
21
21
  const timelines = computed(() => {
22
- const timeLines: Partial<TimeLineItem>[] = []
22
+ const timeLines: Partial<TimeLineByPost>[] = []
23
23
  for (const { year, count, month, posts } of filterYear.value) {
24
24
  timeLines.push({
25
25
  type: 'link',
@@ -30,7 +30,7 @@ const timelines = computed(() => {
30
30
  for (const post of posts)
31
31
  timeLines.push({ ...post, type: 'post' })
32
32
  }
33
- return timeLines as TimeLineItem[]
33
+ return timeLines as TimeLineByPost[]
34
34
  })
35
35
  </script>
36
36
 
@@ -44,9 +44,9 @@ const timelines = computed(() => {
44
44
  </HairyBreadcrumbItem>
45
45
  </HairyBreadcrumb>
46
46
 
47
- <el-timeline>
47
+ <ElTimeline>
48
48
  <template v-for="(item, index) in timelines" :key="index">
49
- <el-timeline-item
49
+ <ElTimelineItem
50
50
  v-if="item.type === 'link'"
51
51
  hollow
52
52
  :index="index"
@@ -55,19 +55,19 @@ const timelines = computed(() => {
55
55
  <HairyLink @click="$router.push(getArchiveLink(year, item.month))">
56
56
  {{ item.month }}月
57
57
  </HairyLink>
58
- </el-timeline-item>
59
- <el-timeline-item
58
+ </ElTimelineItem>
59
+ <ElTimelineItem
60
60
  v-else
61
61
  hollow
62
62
  size="normal"
63
63
  >
64
- <HairyTimelinePostItem :post="item" />
65
- </el-timeline-item>
64
+ <HairyTimelineContent :post="item" />
65
+ </ElTimelineItem>
66
66
  </template>
67
- </el-timeline>
67
+ </ElTimeline>
68
68
  </template>
69
69
 
70
70
  <route lang="yaml">
71
- meta:
72
- layout: year
73
- </route>
71
+ meta:
72
+ layout: archive-year
73
+ </route>
@@ -1,59 +1,6 @@
1
- <script lang="ts" setup>
2
- import { ElTimeline, ElTimelineItem } from 'element-plus/es/components/timeline/index'
3
- import { usePostList } from 'valaxy'
4
- import 'element-plus/es/components/timeline/style/index'
5
- import 'element-plus/es/components/timeline-item/style/index'
6
- import { useYearArchives } from '../../hooks/useYearArchives'
7
- import { getArchiveLink } from '../../utils'
8
- const activities = useYearArchives()
9
- const posts = usePostList()
10
- </script>
11
-
12
- <template>
13
- <HairyBreadcrumb class="mb-5" size="large" after="归档">
14
- <HairyBreadcrumbItem to="/">
15
- 首页
16
- </HairyBreadcrumbItem>
17
- <HairyBreadcrumbItem>
18
- 目前共计 {{ posts.length }} 篇文章
19
- </HairyBreadcrumbItem>
20
- </HairyBreadcrumb>
21
- <el-timeline>
22
- <el-timeline-item
23
- v-for="(activity, index) in activities"
24
- :key="index"
25
- hollow
26
- size="large"
27
- >
28
- <div class="activity inline-flex items-center">
29
- <HairyLink class="text-size-8" @click="$router.push(getArchiveLink(activity.year))">
30
- {{ activity.year }}
31
- </HairyLink>
32
- <span class="text-gray-5 mx-2">/</span>
33
- <HairyLink class="text-size-8" @click="$router.push(getArchiveLink(activity.year, activity.month))">
34
- {{ activity.month }}
35
- </HairyLink>
36
- <span class="text-gray-5 text-size-5 ml-1">({{ activity.count }}篇)</span>
37
- </div>
38
- <HairyTimelinePostItem v-for="(item, index) in activity.posts.slice(0, 2)" :key="index" :post="item" />
39
- <div v-if="activity.posts.length > 2">
40
- <HairyLink @click="$router.push(getArchiveLink(activity.year))">
41
- ....
42
- </HairyLink>
43
- </div>
44
- </el-timeline-item>
45
- </el-timeline>
46
- </template>
1
+ <template></template>
47
2
 
48
3
  <route lang="yaml">
49
4
  meta:
50
5
  layout: archives
51
6
  </route>
52
-
53
- <style lang="scss" scoped>
54
- .activity:hover {
55
- .HairyLink {
56
- color: var(--hy-c-primary);
57
- }
58
- }
59
- </style>
@@ -1,39 +1,35 @@
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
- import 'element-plus/es/components/timeline/style/index'
12
- 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')
9
+ import { useCategory, useCategoryPost } from '../../composables'
10
+
11
+ const themeConfig = useThemeConfig<HairyTheme.Config>()
12
+ const layout = computed(() => themeConfig.value.layout?.categories || 'post')
18
13
 
19
14
  const router = useRouter()
15
+ const route = useRoute()
20
16
 
21
- const paths = computed(() => props.categories.split('/').filter(Boolean))
22
- const current = useCurrentCategory(paths)
17
+ const categories = computed(() => route.params.its as string)
18
+ const paths = computed(() => categories.value.split('/').filter(Boolean))
19
+ const current = useCategory(paths)
23
20
  const posts = useCategoryPost(paths)
24
21
 
25
22
  const i18n = useI18n()
26
23
 
27
- const s = '/'
28
-
29
- const getBreadcrumbPath = (index: number) => {
30
- const paths = props.categories.split('/').filter(Boolean)
24
+ function getBreadcrumbPath(index: number) {
25
+ const paths = categories.value.split('/').filter(Boolean)
31
26
  if (paths[index] === paths[paths.length - 1])
32
27
  return ''
33
28
  return `/categories/${paths.slice(0, index + 1).join('/')}`
34
29
  }
35
- const displayCategory = (key: string) => {
36
- router.push({ path: `/categories/${[key, ...paths.value].reverse().join('/')}` })
30
+
31
+ function displayCategory(key: string) {
32
+ router.push({ path: `/categories/${[...paths.value, key].join('/')}` })
37
33
  }
38
34
  </script>
39
35
 
@@ -45,7 +41,7 @@ const displayCategory = (key: string) => {
45
41
  <HairyBreadcrumbItem :to="paths.length && '/categories/' || ''">
46
42
  全部
47
43
  </HairyBreadcrumbItem>
48
- <HairyBreadcrumbItem v-for="(key, index) in categories.split(s)" :key="key" :to="getBreadcrumbPath(index)">
44
+ <HairyBreadcrumbItem v-for="(key, index) in categories.split('/')" :key="key" :to="getBreadcrumbPath(index)">
49
45
  {{ i18n.t(key) }}
50
46
  </HairyBreadcrumbItem>
51
47
  </HairyBreadcrumb>
@@ -53,44 +49,41 @@ const displayCategory = (key: string) => {
53
49
  <div class="grid__view dark:text-gray-3 flex-wrap">
54
50
  <template v-for="([key, item]) in current.children" :key="key">
55
51
  <div
56
- class="relative flex items-center flex-col cursor-pointer hover:text-primary transition-color"
52
+ v-if="!key.startsWith('/post')"
53
+ class="relative flex items-center flex-col cursor-pointer hover:text-primary transition-colors"
57
54
  @click="displayCategory(key)"
58
55
  >
59
- <div class="i-ri-folder-open-line text-22 lt-sm:text-15" />
56
+ <div class="i-material-symbols-folder-open-rounded text-22 lt-sm:text-15" />
60
57
  <div class="text-center leading-normal">
61
58
  {{ i18n.t(key) }}
62
59
  </div>
63
- <div class="badge">
64
- {{ item.total }}
60
+ <div class="badge text-12px right-20px top-12px">
61
+ {{ item.total }} dir
65
62
  </div>
66
63
  </div>
67
64
  </template>
68
65
  </div>
69
66
  <div class="border-t border-gray-200 dark:border-gray-500 mt-5" />
70
67
 
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">
68
+ <ElTimeline v-if="layout === 'timeline'" class="pt-5 pl-10">
69
+ <ElTimelineItem v-for="(item, index) in posts" :key="index" hollow size="large">
73
70
  <HairyTimelinePostItem :post="item" />
74
- </el-timeline-item>
75
- </el-timeline>
71
+ </ElTimelineItem>
72
+ </ElTimeline>
76
73
  <template v-else>
77
- <HairyPostList :posts="posts" />
74
+ <HairyPosts :posts="posts" />
78
75
  </template>
79
76
  </template>
80
77
 
81
78
  <style lang="scss" scoped>
82
79
  .badge {
83
80
  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
-
81
+ // padding-left: 6px;
82
+ // padding-top: 2px;
83
+ // padding-bottom: 2px;
84
+ // padding-right: 6px;
91
85
  line-height: normal;
92
86
  border-radius: 50%;
93
- background-color: #f56c6c;
94
87
  color: #fff;
95
88
  }
96
89
 
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">
@@ -0,0 +1,38 @@
1
+ <script lang="ts" setup>
2
+ import { computed } from 'vue'
3
+ import { usePostList } from 'valaxy'
4
+ import { ElTimeline, ElTimelineItem } from 'element-plus/es/components/timeline/index'
5
+ import { useRoute } from 'vue-router'
6
+
7
+ const tag = computed(() => useRoute().params.tag)
8
+
9
+ const posts = computed<any[]>(() =>
10
+ usePostList().value.filter(post => post.tags?.includes(tag.value as string)),
11
+ )
12
+ </script>
13
+
14
+ <template>
15
+ <HairyBreadcrumb class="mb-5" size="large" after="标签">
16
+ <HairyBreadcrumbItem to="/">
17
+ 首页
18
+ </HairyBreadcrumbItem>
19
+ <HairyBreadcrumbItem>
20
+ {{ tag }}
21
+ </HairyBreadcrumbItem>
22
+ </HairyBreadcrumb>
23
+ <ElTimeline>
24
+ <ElTimelineItem
25
+ v-for="(item, index) in posts"
26
+ :key="index"
27
+ hollow
28
+ size="large"
29
+ >
30
+ <HairyTimelineContent :post="item" />
31
+ </ElTimelineItem>
32
+ </ElTimeline>
33
+ </template>
34
+
35
+ <route lang="yaml">
36
+ meta:
37
+ layout: tag
38
+ </route>
@@ -1,41 +1,6 @@
1
- <script lang="ts" setup>
2
- import { useTags } from 'valaxy'
3
- import { useRouter } from 'vue-router'
4
- const router = useRouter()
5
-
6
- const { tags, getTagStyle } = useTags({
7
- primary: '#1bc9a6',
8
- })
9
-
10
- const displayTag = (tag: string) => {
11
- router.push(`/tags/${tag}`)
12
- }
13
- </script>
14
-
15
- <template>
16
- <div class="inset-0 h-full flex-center flex-col">
17
- <div text="center" class="text-size-2.5em pt-10 mb-5">
18
- 目前共计 {{ Array.from(tags).length }} 个标签
19
- </div>
20
- <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
- {{ key }}
23
- </a>
24
- </div>
25
- </div>
26
- </template>
1
+ <template></template>
27
2
 
28
3
  <route lang="yaml">
29
4
  meta:
30
5
  layout: tags
31
6
  </route>
32
-
33
- <style lang="scss" scoped>
34
- a {
35
- color: var(--yun-tag-color);
36
- &:hover {
37
- --un-text-opacity: 1;
38
- color: var(--hy-c-primary-dark);
39
- }
40
- }
41
- </style>
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 *;