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
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2022 云游君
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2022 云游君
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/client/index.ts CHANGED
@@ -1 +1 @@
1
- export * from '../composables'
1
+ export * from '../composables'
@@ -1,49 +1,49 @@
1
- <script lang="ts" setup>
2
- </script>
3
-
4
- <template>
5
- <div class="min-h-49vh relative z-5">
6
- <div class="mx-auto container flex z-1 relative">
7
- <div class="relative flex-1 pt-2 main">
8
- <slot />
9
- <HairyComment />
10
- </div>
11
- <div class="ml-4 w-60 lg:block hidden">
12
- <div class="sticky top-3.125rem z-1">
13
- <slot v-if="$slots.slide" name="slide" />
14
- <HairySidebar v-else />
15
- </div>
16
- </div>
17
- </div>
18
-
19
- <div class="HairyBodyBackground" />
20
- </div>
21
- </template>
22
-
23
- <style lang="scss">
24
- .HairyBodyBackground {
25
- @apply absolute top-0 max-h-150vh top-5 bottom-0 w-full;
26
- opacity: 0;
27
- }
28
- .main {
29
- background: linear-gradient(to bottom,#fafafa 0,#fff 20%) no-repeat top;
30
- padding: 1.25rem;
31
- border-radius: 10px
32
- }
33
-
34
- .dark {
35
- .HairyBodyBackground {
36
- opacity: 1;
37
- background-image:
38
- linear-gradient(to bottom, var(--hy-c-waves-dimm) 0%, transparent 60%, var(--hy-c-waves-dimm) 100%), url(./images/bg.jpg);
39
- background-position: center;
40
- opacity: 0.4;
41
- background-repeat: no-repeat;
42
- filter: blur(0px);
43
- background-size: cover;
44
- }
45
- .main {
46
- background: transparent;
47
- }
48
- }
49
- </style>
1
+ <script lang="ts" setup>
2
+ </script>
3
+
4
+ <template>
5
+ <div class="min-h-49vh relative z-5">
6
+ <div class="mx-auto container flex z-1 relative">
7
+ <div class="relative flex-1 pt-2 main">
8
+ <slot />
9
+ <HairyComment />
10
+ </div>
11
+ <div class="ml-4 w-60 lg:block hidden">
12
+ <div class="sticky top-3.125rem z-1">
13
+ <slot v-if="$slots.slide" name="slide" />
14
+ <HairySidebar v-else />
15
+ </div>
16
+ </div>
17
+ </div>
18
+
19
+ <div class="HairyBodyBackground" />
20
+ </div>
21
+ </template>
22
+
23
+ <style lang="scss">
24
+ .HairyBodyBackground {
25
+ @apply absolute top-0 max-h-150vh top-5 bottom-0 w-full;
26
+ opacity: 0;
27
+ }
28
+ .main {
29
+ background: linear-gradient(to bottom,#fafafa 0,#fff 20%) no-repeat top;
30
+ padding: 1.25rem;
31
+ border-radius: 10px
32
+ }
33
+
34
+ .dark {
35
+ .HairyBodyBackground {
36
+ opacity: 1;
37
+ background-image:
38
+ linear-gradient(to bottom, var(--hy-c-waves-dimm) 0%, transparent 60%, var(--hy-c-waves-dimm) 100%), url(./images/bg.jpg);
39
+ background-position: center;
40
+ opacity: 0.4;
41
+ background-repeat: no-repeat;
42
+ filter: blur(0px);
43
+ background-size: cover;
44
+ }
45
+ .main {
46
+ background: transparent;
47
+ }
48
+ }
49
+ </style>
@@ -1,40 +1,40 @@
1
- <script lang="ts" setup>
2
- import { useScriptTag } from '@vueuse/core'
3
- import { defineProps, withDefaults } from 'vue'
4
-
5
- withDefaults(
6
- defineProps<{
7
- height: number | string
8
- defaultTab: string
9
- slugHash: string
10
- user?: string
11
- prefill?: Record<string, any>
12
- title?: string
13
- placeholder?: string
14
- theme?: string
15
- }>(),
16
- {
17
- height: 300,
18
- defaultTab: 'html',
19
- },
20
- )
21
-
22
- useScriptTag('https://cpwebassets.codepen.io/assets/embed/ei.js')
23
- </script>
24
-
25
- <template>
26
- <div
27
- class="codepen"
28
- :data-height="300"
29
- :data-default-tab="defaultTab"
30
- :data-slug-hash="slugHash"
31
- :data-user="user"
32
- :data-prefill="prefill"
33
- :data-pen-title="title"
34
- :data-placeholder="placeholder"
35
- :data-theme-id="theme"
36
- />
37
- </template>
38
-
39
- <style lang="scss" scoped>
40
- </style>
1
+ <script lang="ts" setup>
2
+ import { useScriptTag } from '@vueuse/core'
3
+ import { defineProps, withDefaults } from 'vue'
4
+
5
+ withDefaults(
6
+ defineProps<{
7
+ height: number | string
8
+ defaultTab: string
9
+ slugHash: string
10
+ user?: string
11
+ prefill?: Record<string, any>
12
+ title?: string
13
+ placeholder?: string
14
+ theme?: string
15
+ }>(),
16
+ {
17
+ height: 300,
18
+ defaultTab: 'html',
19
+ },
20
+ )
21
+
22
+ useScriptTag('https://cpwebassets.codepen.io/assets/embed/ei.js')
23
+ </script>
24
+
25
+ <template>
26
+ <div
27
+ class="codepen"
28
+ :data-height="300"
29
+ :data-default-tab="defaultTab"
30
+ :data-slug-hash="slugHash"
31
+ :data-user="user"
32
+ :data-prefill="prefill"
33
+ :data-pen-title="title"
34
+ :data-placeholder="placeholder"
35
+ :data-theme-id="theme"
36
+ />
37
+ </template>
38
+
39
+ <style lang="scss" scoped>
40
+ </style>
@@ -1,33 +1,33 @@
1
- <script lang="ts" setup>
2
- import { useAddonWaline } from 'valaxy-addon-waline'
3
-
4
- const addon = useAddonWaline()
5
- </script>
6
-
7
- <template>
8
- <WalineClient w="full" :options="addon.options" />
9
- </template>
10
-
11
- <style lang="scss">
12
- // 可以在此处覆盖 waline 样式
13
- :root {
14
- --waline-theme-color: var(--hy-c-primary);
15
- --waline-active-color: var(--hy-c-primary-dark)
16
- }
17
-
18
- .wl-editor {
19
- padding: 4px;
20
- width: calc(100% - 1rem - 8px);
21
- }
22
- .wl-emoji-popup {
23
- border-bottom: none !important;
24
- z-index: 1000;
25
- }
26
- .wl-emoji-popup .wl-tabs {
27
- height: auto !important;
28
- overflow-x: auto !important;
29
- padding: 0 !important;
30
- margin-left: -1px;
31
- margin-right: -1px;
32
- }
33
- </style>
1
+ <script lang="ts" setup>
2
+ import { useAddonWaline } from 'valaxy-addon-waline'
3
+
4
+ const addon = useAddonWaline()
5
+ </script>
6
+
7
+ <template>
8
+ <WalineClient w="full" :options="addon.options" />
9
+ </template>
10
+
11
+ <style lang="scss">
12
+ // 可以在此处覆盖 waline 样式
13
+ :root {
14
+ --waline-theme-color: var(--hy-c-primary);
15
+ --waline-active-color: var(--hy-c-primary-dark)
16
+ }
17
+
18
+ .wl-editor {
19
+ padding: 4px;
20
+ width: calc(100% - 1rem - 8px);
21
+ }
22
+ .wl-emoji-popup {
23
+ border-bottom: none !important;
24
+ z-index: 1000;
25
+ }
26
+ .wl-emoji-popup .wl-tabs {
27
+ height: auto !important;
28
+ overflow-x: auto !important;
29
+ padding: 0 !important;
30
+ margin-left: -1px;
31
+ margin-right: -1px;
32
+ }
33
+ </style>
@@ -1,17 +1,17 @@
1
- <script lang="ts" setup>
2
- import { onMounted } from 'vue'
3
- import { setupDefaultDark } from '../composables'
4
-
5
- import 'element-plus/theme-chalk/base.css'
6
- import 'element-plus/theme-chalk/el-timeline.css'
7
- import 'element-plus/theme-chalk/el-timeline-item.css'
8
-
9
- onMounted(setupDefaultDark)
10
- </script>
11
-
12
- <template>
13
- <div class="min-h-80vh">
14
- <slot />
15
- <HairyDrawer />
16
- </div>
17
- </template>
1
+ <script lang="ts" setup>
2
+ import { onMounted } from 'vue'
3
+ import { setupDefaultDark } from '../composables'
4
+
5
+ import 'element-plus/theme-chalk/base.css'
6
+ import 'element-plus/theme-chalk/el-timeline.css'
7
+ import 'element-plus/theme-chalk/el-timeline-item.css'
8
+
9
+ onMounted(setupDefaultDark)
10
+ </script>
11
+
12
+ <template>
13
+ <div class="min-h-80vh">
14
+ <slot />
15
+ <HairyDrawer />
16
+ </div>
17
+ </template>
@@ -1,44 +1,44 @@
1
- <script lang="ts" setup>
2
- import 'element-plus/theme-chalk/el-dialog.css'
3
- import { ElDrawer } from 'element-plus/es/components/drawer/index'
4
- import { useRoute } from 'vue-router'
5
- import { watch } from 'vue'
6
- import { storeToRefs } from 'pinia'
7
- import { useGlobalStore } from '../store'
8
-
9
- const route = useRoute()
10
-
11
- const { showDrawer } = storeToRefs(useGlobalStore())
12
-
13
- watch(() => route.fullPath, () => showDrawer.value = false)
14
- </script>
15
-
16
- <template>
17
- <ElDrawer v-model="showDrawer" direction="ltr" size="auto" @close="showDrawer = false">
18
- <div class="h-24px" />
19
- <HairyTabbar v-if="route.fullPath.includes('/posts/')" />
20
- <HairySidebar v-else />
21
- <div class="dark:hidden absolute inset-0 bg-white bg-opacity-85" />
22
- </ElDrawer>
23
- </template>
24
-
25
- <style lang="scss">
26
- .el-drawer {
27
- background-color: transparent;
28
- .el-drawer__header {
29
- display: none;
30
- }
31
- .el-icon.el-drawer__close {
32
- font-size: 24px;
33
- }
34
- @media (max-width: 375px) {
35
- width: 100% !important;
36
- }
37
- }
38
- .dark {
39
- .el-drawer {
40
- background: radial-gradient(black, transparent);
41
- box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
42
- }
43
- }
44
- </style>
1
+ <script lang="ts" setup>
2
+ import 'element-plus/theme-chalk/el-dialog.css'
3
+ import { ElDrawer } from 'element-plus'
4
+ import { useRoute } from 'vue-router'
5
+ import { watch } from 'vue'
6
+ import { storeToRefs } from 'pinia'
7
+ import { useGlobalStore } from '../store'
8
+
9
+ const route = useRoute()
10
+
11
+ const { showDrawer } = storeToRefs(useGlobalStore())
12
+
13
+ watch(() => route.fullPath, () => showDrawer.value = false)
14
+ </script>
15
+
16
+ <template>
17
+ <ElDrawer v-model="showDrawer" direction="ltr" size="auto" @close="showDrawer = false">
18
+ <div class="h-24px" />
19
+ <HairyTabbar v-if="route.fullPath.includes('/posts/')" />
20
+ <HairySidebar v-else />
21
+ <div class="dark:hidden absolute inset-0 bg-white bg-opacity-85" />
22
+ </ElDrawer>
23
+ </template>
24
+
25
+ <style lang="scss">
26
+ .el-drawer {
27
+ background-color: transparent;
28
+ .el-drawer__header {
29
+ display: none;
30
+ }
31
+ .el-icon.el-drawer__close {
32
+ font-size: 24px;
33
+ }
34
+ @media (max-width: 375px) {
35
+ width: 100% !important;
36
+ }
37
+ }
38
+ .dark {
39
+ .el-drawer {
40
+ background: radial-gradient(black, transparent);
41
+ box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
42
+ }
43
+ }
44
+ </style>
@@ -1,62 +1,62 @@
1
- <script lang="ts" setup>
2
- import { capitalize, computed } from 'vue'
3
- import { useConfig, useSiteConfig, useThemeConfig } from 'valaxy'
4
- import { useI18n } from 'vue-i18n'
5
- import pkg from 'valaxy/package.json'
6
- import type { HairyTheme } from 'valaxy-theme-hairy'
7
-
8
- const { t } = useI18n()
9
-
10
- const config = useConfig()
11
- const sideConfig = useSiteConfig()
12
- const themeConfig = useThemeConfig<HairyTheme.Config>()
13
-
14
- const year = new Date().getFullYear()
15
-
16
- const isThisYear = computed(() => {
17
- return year === themeConfig.value.footer?.since
18
- })
19
-
20
- const poweredHtml = computed(() => t('footer.powered', [`<a href="${pkg.repository}" target="_blank" rel="noopener">Valaxy</a> v${pkg.version}`]))
21
- const footerIcon = computed(() => themeConfig.value.footer?.icon)
22
-
23
- // const frontmatter = useFrontmatter()
24
- </script>
25
-
26
- <template>
27
- <footer v-if="themeConfig.footer" class="va-footer pt-5" text="center sm" style="color:var(--va-c-text-light); overflow-x: hidden;">
28
- <div class="z-5 relative">
29
- <div v-if="themeConfig.footer.beian?.enable && themeConfig.footer.beian.icp" class="beian" m="y-2">
30
- <a href="https://beian.miit.gov.cn/" target="_blank" rel="noopener">
31
- {{ themeConfig.footer.beian.icp }}
32
- </a>
33
- </div>
34
- <div class="copyright flex justify-center items-center" p="1">
35
- <span>
36
- &copy;
37
- <template v-if="!isThisYear">
38
- {{ themeConfig.footer.since }} -
39
- </template>
40
- {{ year }}
41
- </span>
42
-
43
- <a v-if="footerIcon" class="inline-flex animate-pulse ml-2" :href="footerIcon.url" target="_blank" :title="footerIcon.title">
44
- <div :class="footerIcon.name" />
45
- </a>
46
-
47
- <span>{{ sideConfig.author.name }}</span>
48
- <span class="mx-2">|</span>
49
- <span class="flex items-center">
50
- <div class="i-ri-eye-fill mr-1" />
51
- <span class="waline-pageview-count" data-path="/">-</span>
52
- </span>
53
- </div>
54
- <div v-if="themeConfig.footer.powered" class="powered" m="2">
55
- <span v-html="poweredHtml" /> | <span>{{ t('footer.theme') }} - <a :href="themeConfig.pkg.homepage" :title="`valaxy-theme-${config.theme}`" target="_blank">{{ capitalize(config.theme) }}</a> v{{ themeConfig.pkg.version }}</span>
56
- </div>
57
- </div>
58
-
59
- <slot />
60
- <HairyFootFish />
61
- </footer>
62
- </template>
1
+ <script lang="ts" setup>
2
+ import { capitalize, computed } from 'vue'
3
+ import { useConfig, useSiteConfig, useThemeConfig } from 'valaxy'
4
+ import { useI18n } from 'vue-i18n'
5
+ import pkg from 'valaxy/package.json'
6
+ import type { HairyTheme } from 'valaxy-theme-hairy'
7
+
8
+ const { t } = useI18n()
9
+
10
+ const config = useConfig()
11
+ const sideConfig = useSiteConfig()
12
+ const themeConfig = useThemeConfig<HairyTheme.Config>()
13
+
14
+ const year = new Date().getFullYear()
15
+
16
+ const isThisYear = computed(() => {
17
+ return year === themeConfig.value.footer?.since
18
+ })
19
+
20
+ const poweredHtml = computed(() => t('footer.powered', [`<a href="${pkg.repository}" target="_blank" rel="noopener">Valaxy</a> v${pkg.version}`]))
21
+ const footerIcon = computed(() => themeConfig.value.footer?.icon)
22
+
23
+ // const frontmatter = useFrontmatter()
24
+ </script>
25
+
26
+ <template>
27
+ <footer v-if="themeConfig.footer" class="va-footer pt-5" text="center sm" style="color:var(--va-c-text-light); overflow-x: hidden;">
28
+ <div class="z-5 relative">
29
+ <div v-if="themeConfig.footer.beian?.enable && themeConfig.footer.beian.icp" class="beian" m="y-2">
30
+ <a href="https://beian.miit.gov.cn/" target="_blank" rel="noopener">
31
+ {{ themeConfig.footer.beian.icp }}
32
+ </a>
33
+ </div>
34
+ <div class="copyright flex justify-center items-center" p="1">
35
+ <span>
36
+ &copy;
37
+ <template v-if="!isThisYear">
38
+ {{ themeConfig.footer.since }} -
39
+ </template>
40
+ {{ year }}
41
+ </span>
42
+
43
+ <a v-if="footerIcon" class="inline-flex animate-pulse ml-2" :href="footerIcon.url" target="_blank" :title="footerIcon.title">
44
+ <div :class="footerIcon.name" />
45
+ </a>
46
+
47
+ <span>{{ sideConfig.author.name }}</span>
48
+ <span class="mx-2">|</span>
49
+ <span class="flex items-center">
50
+ <div class="i-ri-eye-fill mr-1" />
51
+ <span class="waline-pageview-count" data-path="/">-</span>
52
+ </span>
53
+ </div>
54
+ <div v-if="themeConfig.footer.powered" class="powered" m="2">
55
+ <span v-html="poweredHtml" /> | <span>{{ t('footer.theme') }} - <a :href="themeConfig.pkg.homepage" :title="`valaxy-theme-${config.theme}`" target="_blank">{{ capitalize(config.theme) }}</a> v{{ themeConfig.pkg.version }}</span>
56
+ </div>
57
+ </div>
58
+
59
+ <slot />
60
+ <HairyFootFish />
61
+ </footer>
62
+ </template>
@@ -1,32 +1,32 @@
1
- <script lang="ts" setup>
2
- import { storeToRefs } from 'pinia'
3
- import { useGlobalStore } from '../store'
4
-
5
- defineProps<{
6
- headline?: string
7
- title?: string
8
- description?: string
9
- }>()
10
-
11
- const { headerRef } = storeToRefs(useGlobalStore())
12
- </script>
13
-
14
- <template>
15
- <header ref="headerRef" class="relative animate__animated animate__fadeIn">
16
- <div class="h-30vh lt-md:h-60vh min-h-80 flex-center">
17
- <HairyHeadHero v-if="title || headline || description || $slots.description" class="relative z-2" :title="title" v-bind="$props">
18
- <template #description>
19
- <slot name="description" />
20
- </template>
21
- </HairyHeadHero>
22
- </div>
23
- <HairySwiperCarousel class="inset-0" style="position: absolute" />
24
- <HairyHeadWaves class="relative z-10" />
25
- </header>
26
- </template>
27
-
28
- <style>
29
- .HairyHeader {
30
- position: relative;
31
- }
32
- </style>
1
+ <script lang="ts" setup>
2
+ import { storeToRefs } from 'pinia'
3
+ import { useGlobalStore } from '../store'
4
+
5
+ defineProps<{
6
+ headline?: string
7
+ title?: string
8
+ description?: string
9
+ }>()
10
+
11
+ const { headerRef } = storeToRefs(useGlobalStore())
12
+ </script>
13
+
14
+ <template>
15
+ <header ref="headerRef" class="relative animate__animated animate__fadeIn">
16
+ <div class="h-30vh lt-md:h-60vh min-h-80 flex-center">
17
+ <HairyHeadHero v-if="title || headline || description || $slots.description" class="relative z-2" :title="title" v-bind="$props">
18
+ <template #description>
19
+ <slot name="description" />
20
+ </template>
21
+ </HairyHeadHero>
22
+ </div>
23
+ <HairySwiperCarousel class="inset-0" style="position: absolute" />
24
+ <HairyHeadWaves class="relative z-10" />
25
+ </header>
26
+ </template>
27
+
28
+ <style>
29
+ .HairyHeader {
30
+ position: relative;
31
+ }
32
+ </style>
@@ -1,15 +1,15 @@
1
- <script lang="ts" setup>
2
- import { ElImage, imageProps } from 'element-plus/es/components/image/index'
3
- import 'element-plus/theme-chalk/el-image.css'
4
- import { inject } from 'vue'
5
-
6
- const props = defineProps(imageProps)
7
-
8
- const preview = inject<any>('HairyImageGroup:preview', undefined)
9
- </script>
10
-
11
- <template>
12
- <ElImage v-bind="props" class="HairyImage" :class="[preview && 'cursor-pointer rounded']" @click="preview?.(src)" />
13
- </template>
14
-
15
- <style lang="scss" scoped></style>
1
+ <script lang="ts" setup>
2
+ import { ElImage, imageProps } from 'element-plus'
3
+ import 'element-plus/theme-chalk/el-image.css'
4
+ import { inject } from 'vue'
5
+
6
+ const props = defineProps(imageProps)
7
+
8
+ const preview = inject<any>('HairyImageGroup:preview', undefined)
9
+ </script>
10
+
11
+ <template>
12
+ <ElImage v-bind="props" class="HairyImage" :class="[preview && 'cursor-pointer rounded']" @click="preview?.(src)" />
13
+ </template>
14
+
15
+ <style lang="scss" scoped></style>