valaxy-theme-hairy 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. package/LICENSE +21 -21
  2. package/client/index.ts +1 -1
  3. package/components/HairyBody.vue +49 -49
  4. package/components/HairyCodepen.vue +40 -40
  5. package/components/HairyComment.vue +33 -33
  6. package/components/HairyContainer.vue +17 -17
  7. package/components/HairyDrawer.vue +44 -44
  8. package/components/HairyFooter.vue +62 -62
  9. package/components/HairyHeader.vue +32 -32
  10. package/components/HairyImage.vue +15 -15
  11. package/components/HairyImageGroup.vue +65 -65
  12. package/components/HairyNavbar.vue +56 -56
  13. package/components/HairyPageArchives.vue +59 -59
  14. package/components/HairyPageTags.vue +48 -48
  15. package/components/HairyPosts.vue +54 -54
  16. package/components/HairySearch.vue +201 -201
  17. package/components/HairySidebar.vue +30 -30
  18. package/components/HairyTabbar.vue +56 -56
  19. package/components/PageTags.vue +48 -48
  20. package/components/ValaxyMain.vue +45 -45
  21. package/components/navbar/HairyNav.vue +16 -16
  22. package/components/navbar/HairyNavExpand.vue +12 -12
  23. package/components/navbar/HairyNavItem.vue +35 -35
  24. package/components/navbar/HairyNavbarBackground.vue +7 -7
  25. package/components/navbar/HairyNavbarSearch.vue +8 -8
  26. package/components/navbar/HairyNavbarTitle.vue +15 -15
  27. package/components/navbar/HairyNavbarToggleDark.vue +22 -22
  28. package/components/parts/HairyBreadcrumb.vue +51 -51
  29. package/components/parts/HairyBreadcrumbItem.vue +11 -11
  30. package/components/parts/HairyFootFish.js +352 -352
  31. package/components/parts/HairyFootFish.vue +38 -38
  32. package/components/parts/HairyHeadHero.vue +34 -34
  33. package/components/parts/HairyHeadWaves.vue +67 -67
  34. package/components/parts/HairyImageGlobal.vue +51 -51
  35. package/components/parts/HairyImageViewer.vue +23 -23
  36. package/components/parts/HairyLink.vue +21 -21
  37. package/components/parts/HairyMenu.vue +16 -16
  38. package/components/parts/HairyMenuItem.vue +47 -47
  39. package/components/parts/HairyOutline.vue +99 -99
  40. package/components/parts/HairyOutlineItem.vue +48 -48
  41. package/components/parts/HairySocialLinks.vue +27 -27
  42. package/components/parts/HairyTimelineContent.vue +39 -39
  43. package/components/parts/HairyUserNav.vue +95 -95
  44. package/components/parts/HairyUserStats.vue +18 -18
  45. package/components/posts/HairyArticleImage.vue +126 -126
  46. package/components/posts/HairyArticleSeries.vue +89 -89
  47. package/components/posts/HairyArticleText.vue +43 -43
  48. package/components/posts/HairyPostFooter.vue +15 -15
  49. package/components/posts/HairyPostImageList.vue +27 -27
  50. package/components/posts/HairyPostTextsList.vue +22 -22
  51. package/components/posts/HairyPostToggleLayout.vue +36 -36
  52. package/components/third/HairyAlgoliaSearch.vue +17 -17
  53. package/components/third/HairyFuseSearch.vue +10 -10
  54. package/components/third/HairyFuseSearchDialog.vue +32 -32
  55. package/components/third/HairyFuseSearchDropdown.vue +77 -77
  56. package/components/third/HairyFuseSearchFooter.vue +28 -28
  57. package/components/third/HairyFuseSearchHeader.vue +30 -30
  58. package/components/third/HairyFuseSearchHit.vue +52 -52
  59. package/components/third/HairySearchBtnDisplay.vue +29 -29
  60. package/components/third/HairySearchBtnInput.vue +20 -20
  61. package/components/third/HairySearchBtnKeys.vue +19 -19
  62. package/components/third/HairySwiperCarousel.vue +45 -45
  63. package/composables/archives.ts +48 -48
  64. package/composables/category.ts +43 -43
  65. package/composables/config.ts +11 -11
  66. package/composables/dark.ts +13 -13
  67. package/composables/fuse.ts +60 -60
  68. package/composables/index.ts +7 -7
  69. package/composables/layout.ts +16 -16
  70. package/composables/outline.ts +49 -49
  71. package/composables/tags.ts +36 -36
  72. package/layouts/archive-month.vue +13 -13
  73. package/layouts/archive-year.vue +13 -13
  74. package/layouts/archives.vue +11 -11
  75. package/layouts/categories.vue +13 -13
  76. package/layouts/default.vue +13 -15
  77. package/layouts/home.vue +33 -33
  78. package/layouts/post.vue +54 -54
  79. package/layouts/tag.vue +10 -10
  80. package/layouts/tags.vue +10 -14
  81. package/library/loading.scss +535 -535
  82. package/library/loading.ts +60 -60
  83. package/library/scroll.ts +22 -22
  84. package/locales/en.yml +1 -1
  85. package/locales/zh-CN.yml +1 -1
  86. package/node/images/default.json +139 -139
  87. package/node/images/index.ts +46 -46
  88. package/node/images/shims.d.ts +8 -8
  89. package/node/index.ts +2 -2
  90. package/node/theme/index.ts +78 -78
  91. package/package.json +1 -1
  92. package/pages/archives/[year]/[month]/index.vue +48 -48
  93. package/pages/archives/[year]/index.vue +73 -73
  94. package/pages/archives/index.md +6 -0
  95. package/pages/categories/[...its].vue +108 -108
  96. package/pages/index.vue +8 -8
  97. package/pages/page/[page].vue +12 -12
  98. package/pages/tags/[tag]/index.vue +38 -38
  99. package/pages/tags/index.md +7 -0
  100. package/setup/main.ts +9 -9
  101. package/store/index.ts +1 -1
  102. package/store/modules/global.ts +12 -12
  103. package/styles/components/aplayer.scss +75 -75
  104. package/styles/components/index.scss +3 -3
  105. package/styles/components/markdown.scss +89 -89
  106. package/styles/components/nprogress.scss +15 -15
  107. package/styles/components/scrollbar.scss +25 -25
  108. package/styles/css-vars.scss +171 -171
  109. package/styles/element-plus/index.scss +1 -1
  110. package/styles/element-plus/tabs.scss +25 -25
  111. package/styles/element-plus/timeline.scss +18 -18
  112. package/styles/font-face.scss +19 -19
  113. package/styles/global.scss +38 -38
  114. package/styles/index.scss +3 -3
  115. package/tsconfig.json +27 -27
  116. package/types/index.d.ts +163 -163
  117. package/unocss.config.ts +43 -43
  118. package/utils/index.ts +37 -37
  119. package/valaxy.config.ts +26 -26
  120. package/pages/archives/index.vue +0 -6
  121. package/pages/tags/index.vue +0 -6
@@ -1,45 +1,45 @@
1
- <script lang="ts" setup>
2
- import type { PageData, Post } from 'valaxy'
3
- import { useSiteConfig } from 'valaxy'
4
-
5
- defineProps<{
6
- frontmatter: Post
7
- data?: PageData
8
- }>()
9
- const siteConfig = useSiteConfig()
10
- </script>
11
-
12
- <template>
13
- <main>
14
- <div w="full" flex="~">
15
- <slot name="main">
16
- <div class="content" flex="~ col grow" w="full" p="l-4 lt-md:0">
17
- <slot name="main-header" />
18
- <slot name="main-header-after" />
19
-
20
- <slot name="main-content">
21
- <div class="markdown-body prose max-w-none pb-8">
22
- <ValaxyMd :frontmatter="frontmatter">
23
- <slot name="main-content-md" />
24
- <slot />
25
- </ValaxyMd>
26
- </div>
27
- <slot name="main-content-after" />
28
- </slot>
29
- </div>
30
-
31
- <slot name="main-nav-before" />
32
-
33
- <slot name="main-nav" />
34
-
35
- <slot name="main-nav-after" />
36
-
37
- <slot v-if="siteConfig.comment.enable && frontmatter.comment !== false" name="comment" />
38
-
39
- <slot name="footer" />
40
- </slot>
41
- </div>
42
-
43
- <slot name="aside" />
44
- </main>
45
- </template>
1
+ <script lang="ts" setup>
2
+ import type { PageData, Post } from 'valaxy'
3
+ import { useSiteConfig } from 'valaxy'
4
+
5
+ defineProps<{
6
+ frontmatter: Post
7
+ data?: PageData
8
+ }>()
9
+ const siteConfig = useSiteConfig()
10
+ </script>
11
+
12
+ <template>
13
+ <main>
14
+ <div w="full" flex="~">
15
+ <slot name="main">
16
+ <div class="content" flex="~ col grow" w="full" p="l-4 lt-md:0">
17
+ <slot name="main-header" />
18
+ <slot name="main-header-after" />
19
+
20
+ <slot name="main-content">
21
+ <div class="markdown-body prose max-w-none pb-8">
22
+ <ValaxyMd :frontmatter="frontmatter">
23
+ <slot name="main-content-md" />
24
+ <slot />
25
+ </ValaxyMd>
26
+ </div>
27
+ <slot name="main-content-after" />
28
+ </slot>
29
+ </div>
30
+
31
+ <slot name="main-nav-before" />
32
+
33
+ <slot name="main-nav" />
34
+
35
+ <slot name="main-nav-after" />
36
+
37
+ <slot v-if="siteConfig.comment.enable && frontmatter.comment !== false" name="comment" />
38
+
39
+ <slot name="footer" />
40
+ </slot>
41
+ </div>
42
+
43
+ <slot name="aside" />
44
+ </main>
45
+ </template>
@@ -1,16 +1,16 @@
1
- <script lang="ts" setup>
2
- import type { HairyTheme } from 'valaxy-theme-hairy'
3
- import { useThemeConfig } from 'valaxy'
4
- import { computed } from 'vue'
5
-
6
- const themeConfig = useThemeConfig<HairyTheme.Config>()
7
- const nav = computed(() => themeConfig.value.nav || [])
8
- </script>
9
-
10
- <template>
11
- <div class="flex items-center h-12.5">
12
- <HairyNavItem v-for="(item, index) in nav" :key="index" :item="item" />
13
- </div>
14
- </template>
15
-
16
- <style lang="scss" scoped></style>
1
+ <script lang="ts" setup>
2
+ import type { HairyTheme } from 'valaxy-theme-hairy'
3
+ import { useThemeConfig } from 'valaxy'
4
+ import { computed } from 'vue'
5
+
6
+ const themeConfig = useThemeConfig<HairyTheme.Config>()
7
+ const nav = computed(() => themeConfig.value.nav || [])
8
+ </script>
9
+
10
+ <template>
11
+ <div class="flex items-center h-12.5">
12
+ <HairyNavItem v-for="(item, index) in nav" :key="index" :item="item" />
13
+ </div>
14
+ </template>
15
+
16
+ <style lang="scss" scoped></style>
@@ -1,12 +1,12 @@
1
- <script lang="ts" setup>
2
- import { storeToRefs } from 'pinia'
3
- import { useGlobalStore } from '../../store'
4
-
5
- const { showDrawer } = storeToRefs(useGlobalStore())
6
- </script>
7
-
8
- <template>
9
- <button class="yun-icon-btn lt-sm:text-size-xl" @click="showDrawer = !showDrawer">
10
- <div i="ri-menu-fill" />
11
- </button>
12
- </template>
1
+ <script lang="ts" setup>
2
+ import { storeToRefs } from 'pinia'
3
+ import { useGlobalStore } from '../../store'
4
+
5
+ const { showDrawer } = storeToRefs(useGlobalStore())
6
+ </script>
7
+
8
+ <template>
9
+ <button class="yun-icon-btn lt-sm:text-size-xl" @click="showDrawer = !showDrawer">
10
+ <div i="ri-menu-fill" />
11
+ </button>
12
+ </template>
@@ -1,35 +1,35 @@
1
- <script lang="ts" setup>
2
- import type { NavItem } from 'valaxy-theme-hairy'
3
- import { computed } from 'vue'
4
- import { useRoute } from 'vue-router'
5
-
6
- const props = defineProps<{
7
- item: NavItem
8
- }>()
9
- const urlReg = /^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-]([^!@#$%^&*?.\s]{0,63}[^!@#$%^&*?.\s])?\.)+[a-z]{2,6}\/?/
10
- const isLink = computed(() => urlReg.test(props.item?.link || ''))
11
- const isPointer = computed(() => Boolean(props.item.link) || isLink.value)
12
-
13
- const route = useRoute()
14
-
15
- const active = computed(() => {
16
- return !isLink.value && (
17
- props.item.link === '/'
18
- ? route.path === props.item.link
19
- : route.path.includes(props.item.link!)
20
- )
21
- })
22
- </script>
23
-
24
- <template>
25
- <a href="" class="px-2.5 HairyMenuItem" :class="[isPointer ? 'cursor-pointer' : 'select-none', active && 'text-primary active']">
26
- <HairyLink class="flex items-center" type="white" :href="item.link" :target="isLink ? '__blank' : ''">
27
- <div v-if="item.icon" class="mr-1 icon" :class="item.icon" />
28
- <div class="question">
29
- {{ item.text }}
30
- </div>
31
- </HairyLink>
32
- </a>
33
- </template>
34
-
35
- <style lang="scss" scoped></style>
1
+ <script lang="ts" setup>
2
+ import type { NavItem } from 'valaxy-theme-hairy'
3
+ import { computed } from 'vue'
4
+ import { useRoute } from 'vue-router'
5
+
6
+ const props = defineProps<{
7
+ item: NavItem
8
+ }>()
9
+ const urlReg = /^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-]([^!@#$%^&*?.\s]{0,63}[^!@#$%^&*?.\s])?\.)+[a-z]{2,6}\/?/
10
+ const isLink = computed(() => urlReg.test(props.item?.link || ''))
11
+ const isPointer = computed(() => Boolean(props.item.link) || isLink.value)
12
+
13
+ const route = useRoute()
14
+
15
+ const active = computed(() => {
16
+ return !isLink.value && (
17
+ props.item.link === '/'
18
+ ? route.path === props.item.link
19
+ : route.path.includes(props.item.link!)
20
+ )
21
+ })
22
+ </script>
23
+
24
+ <template>
25
+ <a href="" class="px-2.5 HairyMenuItem" :class="[isPointer ? 'cursor-pointer' : 'select-none', active && 'text-primary active']">
26
+ <HairyLink class="flex items-center" type="white" :href="item.link" :target="isLink ? '__blank' : ''">
27
+ <div v-if="item.icon" class="mr-1 icon" :class="item.icon" />
28
+ <div class="question">
29
+ {{ item.text }}
30
+ </div>
31
+ </HairyLink>
32
+ </a>
33
+ </template>
34
+
35
+ <style lang="scss" scoped></style>
@@ -1,7 +1,7 @@
1
- <template>
2
- <div class="HairyNavBackground absolute inset-0 bg-white bg-opacity-85 dark:bg-black dark:bg-opacity-80 blur-4" />
3
- </template>
4
-
5
- <style>
6
-
7
- </style>
1
+ <template>
2
+ <div class="HairyNavBackground absolute inset-0 bg-white bg-opacity-85 dark:bg-black dark:bg-opacity-80 blur-4" />
3
+ </template>
4
+
5
+ <style>
6
+
7
+ </style>
@@ -1,8 +1,8 @@
1
- <script lang="ts" setup>
2
- </script>
3
-
4
- <template>
5
- <div />
6
- </template>
7
-
8
- <style lang="scss" scoped></style>
1
+ <script lang="ts" setup>
2
+ </script>
3
+
4
+ <template>
5
+ <div />
6
+ </template>
7
+
8
+ <style lang="scss" scoped></style>
@@ -1,15 +1,15 @@
1
- <script lang="ts" setup>
2
- import { useSiteConfig } from 'valaxy'
3
-
4
- const config = useSiteConfig()
5
-
6
- function hrefToUrl() {
7
- location.href = config.value.url
8
- }
9
- </script>
10
-
11
- <template>
12
- <div class="px-2.5">
13
- <span class="cursor-pointer hover:text-primary" @click="hrefToUrl">{{ config.title }}</span>
14
- </div>
15
- </template>
1
+ <script lang="ts" setup>
2
+ import { useSiteConfig } from 'valaxy'
3
+
4
+ const config = useSiteConfig()
5
+
6
+ function hrefToUrl() {
7
+ location.href = config.value.url
8
+ }
9
+ </script>
10
+
11
+ <template>
12
+ <div class="px-2.5">
13
+ <span class="cursor-pointer hover:text-primary" @click="hrefToUrl">{{ config.title }}</span>
14
+ </div>
15
+ </template>
@@ -1,22 +1,22 @@
1
- <script lang="ts" setup>
2
- import { useI18n } from 'vue-i18n'
3
- import { computed } from 'vue'
4
- import { useAppStore } from 'valaxy'
5
-
6
- const { t } = useI18n()
7
- const appStore = useAppStore()
8
- const dark = computed(() => appStore.isDark)
9
-
10
- const themeTitle = computed(() => {
11
- return dark.value ? t('button.toggle_light') : t('button.toggle_dark')
12
- })
13
- </script>
14
-
15
- <template>
16
- <button
17
- class="yun-icon-btn bg-light-1 p-1 dark:bg-transparent rounded-5 lt-sm:text-size-xl"
18
- :title="themeTitle" :style="{ color: dark ? '' : '#f1cb64' }" @click="($event) => appStore.toggleDarkWithTransition($event, { duration: 600, easing: 'ease-in-out' })"
19
- >
20
- <div i="ri-sun-line dark:ri-moon-line" />
21
- </button>
22
- </template>
1
+ <script lang="ts" setup>
2
+ import { useI18n } from 'vue-i18n'
3
+ import { computed } from 'vue'
4
+ import { useAppStore } from 'valaxy'
5
+
6
+ const { t } = useI18n()
7
+ const appStore = useAppStore()
8
+ const dark = computed(() => appStore.isDark)
9
+
10
+ const themeTitle = computed(() => {
11
+ return dark.value ? t('button.toggle_light') : t('button.toggle_dark')
12
+ })
13
+ </script>
14
+
15
+ <template>
16
+ <button
17
+ class="yun-icon-btn bg-light-1 p-1 dark:bg-transparent rounded-5 lt-sm:text-size-xl"
18
+ :title="themeTitle" :style="{ color: dark ? '' : '#f1cb64' }" @click="($event) => appStore.toggleDarkWithTransition($event, { duration: 600, easing: 'ease-in-out' })"
19
+ >
20
+ <div i="ri-sun-line dark:ri-moon-line" />
21
+ </button>
22
+ </template>
@@ -1,51 +1,51 @@
1
- <script lang="ts" setup>
2
- import { ElBreadcrumb, breadcrumbProps } from 'element-plus/es/components/breadcrumb/index'
3
- import 'element-plus/theme-chalk/el-breadcrumb.css'
4
- import type { PropType } from 'vue'
5
- import { computed } from 'vue'
6
-
7
- const props = defineProps({
8
- ...breadcrumbProps,
9
- size: String as PropType<'default' | 'large'>,
10
- after: String,
11
- })
12
- const text = computed(() => `"${props.after || ''}"`)
13
- </script>
14
-
15
- <template>
16
- <ElBreadcrumb :class="[size]" :style="{ '--after-text': text }" v-bind="$props">
17
- <slot />
18
- </ElBreadcrumb>
19
- </template>
20
-
21
- <style lang="scss">
22
- .el-breadcrumb {
23
- overflow: hidden;
24
- display: inline-block;
25
- position: relative;
26
- }
27
- .el-breadcrumb .el-breadcrumb__inner,
28
- .el-breadcrumb .el-breadcrumb__item:last-child .el-breadcrumb__inner {
29
- color: var(--va-c-text);
30
- }
31
- .el-breadcrumb .el-breadcrumb__inner.is-link {
32
- @apply border-b border-dashed hover:border-primary hover:text-primary transition-all cursor-pointer;
33
- font-weight: normal;
34
- }
35
-
36
- .el-breadcrumb::after {
37
- @apply text-gray-5 text-size-5;
38
- content: var(--after-text);
39
- clear: none;
40
- transform: translateX(2px);
41
- }
42
- .el-breadcrumb.large {
43
- margin-top: 3rem;
44
- font-size: 2.5em;
45
- @apply lt-md:text-3xl lt-sm:text-xl;
46
- .el-breadcrumb__separator {
47
- @apply text-size-5 text-gray-5;
48
- font-weight: normal;
49
- }
50
- }
51
- </style>
1
+ <script lang="ts" setup>
2
+ import { ElBreadcrumb, breadcrumbProps } from 'element-plus'
3
+ import 'element-plus/theme-chalk/el-breadcrumb.css'
4
+ import type { PropType } from 'vue'
5
+ import { computed } from 'vue'
6
+
7
+ const props = defineProps({
8
+ ...breadcrumbProps,
9
+ size: String as PropType<'default' | 'large'>,
10
+ after: String,
11
+ })
12
+ const text = computed(() => `"${props.after || ''}"`)
13
+ </script>
14
+
15
+ <template>
16
+ <ElBreadcrumb :class="[size]" :style="{ '--after-text': text }" v-bind="$props">
17
+ <slot />
18
+ </ElBreadcrumb>
19
+ </template>
20
+
21
+ <style lang="scss">
22
+ .el-breadcrumb {
23
+ overflow: hidden;
24
+ display: inline-block;
25
+ position: relative;
26
+ }
27
+ .el-breadcrumb .el-breadcrumb__inner,
28
+ .el-breadcrumb .el-breadcrumb__item:last-child .el-breadcrumb__inner {
29
+ color: var(--va-c-text);
30
+ }
31
+ .el-breadcrumb .el-breadcrumb__inner.is-link {
32
+ @apply border-b border-dashed hover:border-primary hover:text-primary transition-all cursor-pointer;
33
+ font-weight: normal;
34
+ }
35
+
36
+ .el-breadcrumb::after {
37
+ @apply text-gray-5 text-size-5;
38
+ content: var(--after-text);
39
+ clear: none;
40
+ transform: translateX(2px);
41
+ }
42
+ .el-breadcrumb.large {
43
+ margin-top: 3rem;
44
+ font-size: 2.5em;
45
+ @apply lt-md:text-3xl lt-sm:text-xl;
46
+ .el-breadcrumb__separator {
47
+ @apply text-size-5 text-gray-5;
48
+ font-weight: normal;
49
+ }
50
+ }
51
+ </style>
@@ -1,11 +1,11 @@
1
- <script lang="ts" setup>
2
- import { ElBreadcrumbItem, breadcrumbItemProps } from 'element-plus/es/components/breadcrumb/index'
3
-
4
- defineProps(breadcrumbItemProps)
5
- </script>
6
-
7
- <template>
8
- <ElBreadcrumbItem v-bind="$props">
9
- <slot />
10
- </ElBreadcrumbItem>
11
- </template>
1
+ <script lang="ts" setup>
2
+ import { ElBreadcrumbItem, breadcrumbItemProps } from 'element-plus'
3
+
4
+ defineProps(breadcrumbItemProps)
5
+ </script>
6
+
7
+ <template>
8
+ <ElBreadcrumbItem v-bind="$props">
9
+ <slot />
10
+ </ElBreadcrumbItem>
11
+ </template>