valaxy-theme-hairy 0.0.13 → 0.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,7 +11,7 @@ const showWaline = computed(() => route.path.includes('/posts/') || fr.value.wal
11
11
  <template>
12
12
  <div class="HairyBody min-h-49vh relative">
13
13
  <div class="mx-auto breakpoint flex z-1 relative">
14
- <div class="relative flex-1 pt-2">
14
+ <div class="relative flex-1 pt-2 w-0">
15
15
  <slot />
16
16
  <HairyWaline v-if="showWaline" />
17
17
  </div>
@@ -21,7 +21,7 @@ const footerIcon = computed(() => themeConfig.value.footer.icon)
21
21
  </script>
22
22
 
23
23
  <template>
24
- <footer v-if="themeConfig.footer" class="va-footer p-4 pb-10" text="center sm" style="color:var(--va-c-text-light)">
24
+ <footer v-if="themeConfig.footer" class="va-footer p-4 pt-5 pb-14" text="center sm" style="color:var(--va-c-text-light)">
25
25
  <div v-if="themeConfig.footer.beian?.enable && themeConfig.footer.beian.icp" class="beian" m="y-2">
26
26
  <a href="https://beian.miit.gov.cn/" target="_blank" rel="noopener">
27
27
  {{ themeConfig.footer.beian.icp }}
@@ -41,7 +41,12 @@ const footerIcon = computed(() => themeConfig.value.footer.icon)
41
41
  <div :class="footerIcon.name" />
42
42
  </a>
43
43
 
44
- <span class="ml-2">{{ config.author.name }}</span>
44
+ <span>{{ config.author.name }}</span>
45
+ <span class="mx-2">|</span>
46
+ <span v-if="config.comment.waline" class="flex items-center">
47
+ <div class="i-ri-eye-fill mr-1" />
48
+ <span class="waline-pageview-count" data-path="/">1</span>
49
+ </span>
45
50
  </div>
46
51
 
47
52
  <div v-if="themeConfig.footer.powered" class="powered" m="2">
@@ -9,7 +9,7 @@ defineProps<{
9
9
  </script>
10
10
 
11
11
  <template>
12
- <div class="HairyLayout min-h-100vh">
12
+ <div class="HairyLayout min-h-80vh">
13
13
  <HairyNav />
14
14
  <HairyHeader v-bind="header">
15
15
  <template #description>
@@ -14,7 +14,10 @@ defineProps<{
14
14
  <template>
15
15
  <div class="min-h-30vh">
16
16
  <div class="links">
17
- <div v-for="(item, index) in links" :key="index" class="link-block flex items-center py-0.5rem px-1rem rounded-lg" :style="{ '--block-color': item.color }">
17
+ <div
18
+ v-for="(item, index) in links" :key="index" class="link-block flex items-center py-0.5rem px-1rem rounded-lg"
19
+ :style="{ '--block-color': item.color }"
20
+ >
18
21
  <a :href="item.url" class="w-4rem h-4rem">
19
22
  <HairyImage class="w-full h-full rounded-xl" :src="item.image" />
20
23
  </a>
@@ -22,7 +25,7 @@ defineProps<{
22
25
  <a :href="item.url" class="font-bold text-lg title">
23
26
  {{ item.name }}
24
27
  </a>
25
- <div class="max-w-180px text-sm my-0.5rem truncate">
28
+ <div class="max-w-180px text-sm my-0.5rem truncate desc">
26
29
  {{ item.desc }}
27
30
  </div>
28
31
  </div>
@@ -34,23 +37,28 @@ defineProps<{
34
37
  <style lang="scss" scoped>
35
38
  .link-block {
36
39
  border: 0.0625rem solid #f7f7f7;
37
- box-shadow: 0 0.625rem 1.875rem -0.9375rem rgba(0,0,0,0.1);
40
+ box-shadow: 0 0.625rem 1.875rem -0.9375rem rgba(0, 0, 0, 0.1);
38
41
  --bg-color: var(--block-color, #666);
39
42
  @apply transition-all;
43
+
40
44
  .title {
41
45
  color: var(--block-color);
42
46
  }
43
47
  }
48
+
44
49
  .dark .link-block {
45
50
  background: rgba($color: #989898, $alpha: 0.1);
46
51
  }
52
+
47
53
  .links .link-block:hover {
48
- background-color: var(--bg-color);
49
- box-shadow: 0 0.125rem 1.25rem var(--bg-color);
50
- border-color: var(--bg-color);
51
- .title {
52
- color: #fff;
53
- }
54
+ background-color: var(--bg-color);
55
+ box-shadow: 0 0.125rem 1.25rem var(--bg-color);
56
+ border-color: var(--bg-color);
57
+
58
+ .title,
59
+ .desc {
60
+ color: #fff;
61
+ }
54
62
  }
55
63
 
56
64
  .links {
@@ -6,6 +6,10 @@ const config = useConfig()
6
6
  // 挂载 Waline
7
7
  useWaline({
8
8
  el: '#waline',
9
+ emoji: [
10
+ '//unpkg.com/@waline/emojis@1.0.1/weibo',
11
+ '//unpkg.com/@waline/emojis@1.0.1/bilibili',
12
+ ],
9
13
  ...config.value.comment.waline,
10
14
  })
11
15
  </script>
@@ -26,4 +30,15 @@ useWaline({
26
30
  padding: 4px;
27
31
  width: calc(100% - 1rem - 8px);
28
32
  }
33
+ .wl-emoji-popup {
34
+ border-bottom: none !important;
35
+ z-index: 1000;
36
+ }
37
+ .wl-emoji-popup .wl-tabs {
38
+ height: auto !important;
39
+ overflow-x: auto !important;
40
+ padding: 0 !important;
41
+ margin-left: -1px;
42
+ margin-right: -1px;
43
+ }
29
44
  </style>
package/layouts/hairy.vue CHANGED
@@ -1,11 +1,20 @@
1
1
  <script lang="ts" setup>
2
- import { computed } from 'vue'
2
+ import { computed, onMounted } from 'vue'
3
3
  import { useRoute } from 'vue-router'
4
+ import { pageviewCount } from '@waline/client'
5
+ import { useConfig } from 'valaxy'
4
6
 
5
7
  const route = useRoute()
6
8
  const meta = computed(() => route.meta)
7
9
  const type = computed(() => meta.value.type || '')
8
- console.log(type.value)
10
+ const config = useConfig()
11
+
12
+ onMounted(() => {
13
+ pageviewCount({
14
+ serverURL: config.value.comment.waline.serverURL,
15
+ path: window.location.pathname,
16
+ })
17
+ })
9
18
  </script>
10
19
 
11
20
  <template>
package/layouts/post.vue CHANGED
@@ -1,8 +1,16 @@
1
1
  <script lang="ts" setup>
2
2
  import { useFrontmatter } from 'valaxy'
3
+ import { ElTag } from 'element-plus/es/components/tag/index'
4
+ import 'element-plus/es/components/tag/style/index'
3
5
  import dayjs from 'dayjs'
6
+ import { useRouter } from 'vue-router'
7
+ const router = useRouter()
4
8
 
5
9
  const post = useFrontmatter()
10
+
11
+ const displayTag = (tag: string) => {
12
+ router.push(`/tags/${tag}`)
13
+ }
6
14
  </script>
7
15
 
8
16
  <template>
@@ -16,11 +24,25 @@ const post = useFrontmatter()
16
24
  <span>本文字数 {{ (post.length / 1000).toFixed(1) }}k 字</span>
17
25
  <span>阅读时长 {{ post.durations.minutes.toFixed(2) }} 分钟</span>
18
26
  </div>
27
+ <div v-if="post.tags?.length" class="tags flex-center gap-2 mt-2">
28
+ <el-tag v-for="(tag) in post.tags" :key="tag" class="dark:bg-dark-50 cursor-pointer" @click="displayTag(tag)">
29
+ {{ tag }}
30
+ </el-tag>
31
+ </div>
19
32
  </template>
20
33
  <router-view />
34
+ <div class="mb-15">
35
+ <div class="border-t border-gray-200 dark:border-gray-600"></div>
36
+ <div class="flex items-center justify-end mt-2">
37
+ <div class="i-ri-eye-fill mr-2" />
38
+ 阅读次数 <span class="waline-pageview-count mx-2">1</span> 次
39
+ </div>
40
+ </div>
21
41
  <template #body-slide>
22
42
  <HairyUserTab />
23
43
  </template>
24
44
  </HairyLayout>
25
45
  </template>
26
46
 
47
+ <style lang="scss">
48
+ </style>
@@ -1,10 +1,11 @@
1
1
  .hy-loading {
2
- position: absolute;
2
+ position: fixed;
3
3
  top: 0;
4
4
  left: 0;
5
+ bottom: 0;
6
+ right: 0;
5
7
  z-index: 100;
6
- width: 100vw;
7
- height: 100%;
8
+
8
9
  background: #eee;
9
10
 
10
11
  transition: opacity 0.5s;
@@ -14,10 +15,10 @@
14
15
  height: 50px;
15
16
  position: fixed;
16
17
  top: 50%;
17
- left: 50%;
18
- margin-left: -50px;
18
+ margin: auto;
19
19
  margin-top: -50px;
20
-
20
+ left: 0;
21
+ right: 0;
21
22
  }
22
23
 
23
24
  #preloader {
@@ -30,6 +30,8 @@ function showFullLoading() {
30
30
  el = createElement()
31
31
  el.style.opacity = '0'
32
32
  document.body.appendChild(el)
33
+ document.body.style.overflow = 'hidden'
34
+
33
35
  setTimeout(() => el.style.opacity = '1')
34
36
  isLoading.value = true
35
37
  }
@@ -38,6 +40,7 @@ function hideFullLoading() {
38
40
  if (!el)
39
41
  return
40
42
  el.style.opacity = '0'
43
+ document.body.style.overflow = ''
41
44
  setTimeout(() => {
42
45
  isLoading.value = true
43
46
  el.remove()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valaxy-theme-hairy",
3
- "version": "0.0.13",
3
+ "version": "0.0.16",
4
4
  "packageManager": "pnpm@7.5.0",
5
5
  "author": {
6
6
  "email": "wwu710632@gmail.com",
package/styles/index.scss CHANGED
@@ -8,6 +8,7 @@
8
8
  body {
9
9
  font-family: var(--hy-font-family-seto);
10
10
  @apply transition-colors duration-200;
11
+ color: var(--va-c-text);
11
12
  }
12
13
 
13
14
  #app {
@@ -48,6 +48,16 @@ html.dark {
48
48
  max-width: calc(100vw - 56px);
49
49
  }
50
50
 
51
+ .markdown-body div[class*=language-] {
52
+ width: 100%;
53
+ }
54
+
55
+ @media screen and (max-width: 640px) {
56
+ .markdown-body div[class*=language-] {
57
+ margin: auto;
58
+ }
59
+ }
60
+
51
61
 
52
62
  .prose :where(:not(pre) > code):not(:where(.not-prose, .not-prose *))::before,
53
63
  .prose :where(:not(pre) > code):not(:where(.not-prose, .not-prose *))::after {
@@ -57,4 +67,23 @@ html.dark {
57
67
  .custom-block.tip {
58
68
  background-color: rgba(200, 200, 200, 0.1);
59
69
  border-color: var(--hy-c-primary);
70
+ }
71
+
72
+ .markdown-body {
73
+ --un-prose-borders: var(--hy-c-primary);
74
+ }
75
+
76
+ .markdown-body div[class*=language-] pre {
77
+ max-width: none;
78
+ }
79
+
80
+ .prose :where(blockquote):not(:where(.not-prose, .not-prose *)) {
81
+ background: rgba(200, 200, 200, 0.1);
82
+ @apply py-1px;
83
+
84
+ font-size: 15px;
85
+
86
+ >p {
87
+ margin: 0.5rem 0;
88
+ }
60
89
  }