valaxy-theme-hairy 1.0.4 → 1.0.6

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.
@@ -1,6 +1,6 @@
1
1
  <script lang="ts" setup>
2
2
  import { capitalize, computed } from 'vue'
3
- import { useConfig, useSiteConfig, useThemeConfig, useRuntimeConfig } from 'valaxy'
3
+ import { useConfig, useRuntimeConfig, useSiteConfig, useThemeConfig } from 'valaxy'
4
4
  import { useI18n } from 'vue-i18n'
5
5
  import pkg from 'valaxy/package.json'
6
6
  import type { HairyTheme } from 'valaxy-theme-hairy'
@@ -52,7 +52,6 @@ const addonWaline = computed(() => runtimeConfig.value.addons['valaxy-addon-wali
52
52
  <span class="waline-pageview-count" data-path="/" />
53
53
  </span>
54
54
  </template>
55
-
56
55
  </div>
57
56
  <div v-if="themeConfig.footer.powered" class="powered" m="2">
58
57
  <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>
@@ -2,8 +2,8 @@
2
2
  import { computed, provide, useCssVars, useSlots } from 'vue'
3
3
  import { renderOverlay } from '@overlastic/vue'
4
4
  import type { ImageViewerProps } from 'element-plus'
5
+ import { atWillToUnit } from '../utils'
5
6
  import HairyImageViewer from './parts/HairyImageViewer.vue'
6
- import { atWillToUnit } from '../utils';
7
7
 
8
8
  const props = withDefaults(defineProps<{
9
9
  row?: string | number
@@ -0,0 +1,69 @@
1
+ <script lang="ts" setup>
2
+ import { defineProps } from 'vue'
3
+ defineProps<{
4
+ links?: {
5
+ name: string
6
+ url: string
7
+ image: string
8
+ color: string
9
+ desc?: string
10
+ }[]
11
+ }>()
12
+ </script>
13
+
14
+ <template>
15
+ <div class="min-h-30vh">
16
+ <div class="links">
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
+ >
21
+ <a :href="item.url" class="w-4rem h-4rem">
22
+ <HairyImage class="w-full h-full rounded-xl" :src="item.image" />
23
+ </a>
24
+ <div class="pl-1rem flex-1">
25
+ <a :href="item.url" class="font-bold text-lg title">
26
+ {{ item.name }}
27
+ </a>
28
+ <div class="max-w-180px text-sm my-0.5rem truncate desc">
29
+ {{ item.desc }}
30
+ </div>
31
+ </div>
32
+ </div>
33
+ </div>
34
+ </div>
35
+ </template>
36
+
37
+ <style lang="scss" scoped>
38
+ .link-block {
39
+ border: 0.0625rem solid #f7f7f7;
40
+ box-shadow: 0 0.625rem 1.875rem -0.9375rem rgba(0, 0, 0, 0.1);
41
+ --bg-color: var(--block-color, #666);
42
+ @apply transition-all duration-200;
43
+
44
+ .title {
45
+ color: var(--block-color);
46
+ }
47
+ }
48
+
49
+ .dark .link-block {
50
+ background: rgba($color: #989898, $alpha: 0.1);
51
+ }
52
+
53
+ .links .link-block:hover {
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
+ }
62
+ }
63
+
64
+ .links {
65
+ display: grid;
66
+ grid-template-columns: repeat(auto-fill, 300px);
67
+ gap: 24px;
68
+ }
69
+ </style>
@@ -21,7 +21,7 @@ function displayTag(tag: string) {
21
21
  <div text="center" class="max-w-7xl flex flex-wrap justify-center items-center gap-2">
22
22
  <a
23
23
  v-for="[key, tag] in Array.from(tags).sort()"
24
- :key="key" class="post-tag cursor-pointer"
24
+ :key="key" class="post-tag cursor-pointer transition-all duration-200"
25
25
  :style="getTagStyle(tag.count)"
26
26
  p="1"
27
27
  @click="displayTag(key.toString())"
@@ -2,8 +2,8 @@
2
2
  import { provide, useCssVars } from 'vue'
3
3
  import { renderOverlay } from '@overlastic/vue'
4
4
  import type { ImageViewerProps } from 'element-plus'
5
+ import { atWillToUnit } from '../../utils'
5
6
  import HairyImageViewer from './HairyImageViewer.vue'
6
- import { atWillToUnit } from '../../utils';
7
7
 
8
8
  const props = withDefaults(defineProps<{
9
9
  row?: string | number
@@ -7,7 +7,7 @@ defineProps<{
7
7
 
8
8
  <template>
9
9
  <a
10
- class="cursor-pointer" :class="[
10
+ class="cursor-pointer transition-colors" :class="[
11
11
  type === 'white'
12
12
  ? 'text-black hover:text-primary dark:text-white'
13
13
  : 'text:text-primary-light hover:text-primary-dark',
@@ -85,7 +85,7 @@ function displayCategory(keys: string | string[] = []) {
85
85
 
86
86
  .dark {
87
87
  .post-image {
88
- @apply opacity-75 hover:opacity-90 ;
88
+ @apply opacity-75 hover:opacity-90 duration-200;
89
89
  }
90
90
  }
91
91
 
@@ -24,7 +24,7 @@ export function useHairyTags(options: {
24
24
  const range = max - min
25
25
  const percent = (count - min) / range
26
26
  return {
27
- '--yun-tag-color': gray.mix(primaryColor, percent * 100).toString(),
27
+ '--yun-tag-color': gray.mix(primaryColor, (percent || 0) * 100).toString(),
28
28
  'fontSize': `${percent * 36 + 12}px`,
29
29
  }
30
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valaxy-theme-hairy",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "packageManager": "pnpm@8.10.5",
5
5
  "author": {
6
6
  "email": "wwu710632@gmail.com",
@@ -21,16 +21,16 @@
21
21
  "main": "client/index.ts",
22
22
  "types": "types/index.d.ts",
23
23
  "dependencies": {
24
+ "@iconify-json/ant-design": "^1.1.3",
25
+ "@iconify-json/fluent": "^1.1.18",
26
+ "@iconify-json/material-symbols": "^1.1.83",
27
+ "@iconify-json/simple-icons": "^1.1.19",
24
28
  "@overlastic/vue": "^0.4.7",
25
29
  "element-plus": "^2.7.6",
26
30
  "pinia": "^2.1.7",
27
31
  "swiper": "^11.0.5"
28
32
  },
29
33
  "devDependencies": {
30
- "@iconify-json/ant-design": "^1.1.3",
31
- "@iconify-json/fluent": "^1.1.18",
32
- "@iconify-json/material-symbols": "^1.1.83",
33
- "@iconify-json/simple-icons": "^1.1.19",
34
34
  "valaxy": "^0.19.1",
35
35
  "valaxy-addon-algolia": "^0.0.3",
36
36
  "valaxy-addon-meting": "^0.1.3",
package/utils/index.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export * from './size'
2
- export * from './util'
2
+ export * from './util'
package/utils/size.ts CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  function isString(val: any) {
3
2
  return typeof val === 'string'
4
3
  }
@@ -14,8 +13,8 @@ export function atWillToUnit(value: any, unit = 'px') {
14
13
  }
15
14
 
16
15
  /** size 转换配置 */
17
- export type AtWillSize = any | [any, any] | { width: any; height: any }
18
- export interface Size { width: string; height: string }
16
+ export type AtWillSize = any | [any, any] | { width: any, height: any }
17
+ export interface Size { width: string, height: string }
19
18
 
20
19
  /**
21
20
  * 将 size 转换为宽高,用于元素宽高
package/valaxy.config.ts CHANGED
@@ -16,6 +16,9 @@ export default defineTheme<ThemeConfig>((options) => {
16
16
  },
17
17
  outline: 2,
18
18
  theme: 'dark',
19
+ layout: {
20
+ post: 'image:slice:reverse',
21
+ },
19
22
  },
20
23
  }
21
24