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/types/index.d.ts CHANGED
@@ -1,163 +1,163 @@
1
- /* eslint-disable ts/no-use-before-define */
2
- export namespace HairyTheme {
3
- export type Config = ThemeConfig
4
- export type Sidebar = any
5
- export type { Layout }
6
- }
7
-
8
- /**
9
- * Theme Config
10
- */
11
- export interface ThemeConfig {
12
- /**
13
- * default theme mode
14
- *
15
- * @default 'light'
16
- */
17
- theme?: 'dark' | 'light'
18
-
19
- home?: Home
20
-
21
- user?: User
22
-
23
- post?: Post
24
-
25
- /**
26
- * colors
27
- */
28
- colors?: Colors
29
-
30
- /**
31
- * layout
32
- */
33
- layout?: Partial<Layout>
34
-
35
- /**
36
- * footer
37
- */
38
- footer?: Partial<Footer>
39
-
40
- /**
41
- * navbar
42
- */
43
- nav?: NavItem[]
44
-
45
- /**
46
- * meting
47
- */
48
- meting?: Partial<Meting>
49
-
50
- /**
51
- * Custom header levels of outline in the aside component.
52
- *
53
- * @default 2
54
- */
55
- outline?: number | [number, number] | 'deep' | false
56
- }
57
-
58
- export interface NavItem {
59
- text: string
60
- link: string
61
- icon?: string
62
- }
63
- /**
64
- * meting options
65
- * @see https://github.com/metowolf/MetingJS#option
66
- */
67
- export interface Meting {
68
- id: string
69
- server: string
70
- type: string
71
- auto: string
72
- fixed: boolean
73
- mini: boolean
74
- autoplay: boolean
75
- theme: string
76
- loop: string
77
- order: string
78
- preload: string
79
- volume: number
80
- work: string
81
- mutex: boolean
82
- start: string
83
- 'lrc-type': number
84
- 'list-folded': boolean
85
- 'list-max-height': string
86
- 'storage-name': string
87
- [key: string]: any
88
- }
89
-
90
- export interface Layout {
91
- post:
92
- | 'text'
93
- | 'markdown'
94
- | 'image'
95
- | 'image:slice'
96
- | 'image:slice:reverse'
97
- categories: 'timeline' | 'post'
98
- }
99
-
100
- export interface Footer {
101
- /**
102
- * 建站于
103
- */
104
- since: number
105
-
106
- /**
107
- * Icon between year and copyright info.
108
- */
109
- icon: {
110
- /**
111
- * icon name, i-xxx
112
- */
113
- name: string
114
- animated: boolean
115
- color: string
116
- url: string
117
- title: string
118
- }
119
-
120
- /**
121
- * Powered by valaxy & valaxy-theme-${name}, default is yun
122
- */
123
- powered: boolean
124
-
125
- /**
126
- * Chinese Users | 中国用户
127
- * 备案 ICP
128
- * 国内用户需要在网站页脚展示备案 ICP 号
129
- * https://beian.miit.gov.cn/
130
- */
131
- beian: {
132
- enable: boolean
133
- /**
134
- * 苏ICP备xxxxxxxx号
135
- */
136
- icp: string
137
- }
138
- }
139
-
140
- export interface Colors {
141
- /**
142
- * primary color
143
- * @default '#0078E7'
144
- */
145
- primary: string
146
- }
147
- export interface Home {
148
- headline: string
149
- title: string
150
- description: string
151
- images: string[]
152
- }
153
-
154
- export interface Post {
155
- images: string[]
156
- }
157
-
158
- export interface User {
159
- name?: string
160
- description?: string
161
- }
162
-
163
- export type ThemeUserConfig = Partial<ThemeConfig>
1
+ /* eslint-disable ts/no-use-before-define */
2
+ export namespace HairyTheme {
3
+ export type Config = ThemeConfig
4
+ export type Sidebar = any
5
+ export type { Layout }
6
+ }
7
+
8
+ /**
9
+ * Theme Config
10
+ */
11
+ export interface ThemeConfig {
12
+ /**
13
+ * default theme mode
14
+ *
15
+ * @default 'light'
16
+ */
17
+ theme?: 'dark' | 'light'
18
+
19
+ home?: Home
20
+
21
+ user?: User
22
+
23
+ post?: Post
24
+
25
+ /**
26
+ * colors
27
+ */
28
+ colors?: Colors
29
+
30
+ /**
31
+ * layout
32
+ */
33
+ layout?: Partial<Layout>
34
+
35
+ /**
36
+ * footer
37
+ */
38
+ footer?: Partial<Footer>
39
+
40
+ /**
41
+ * navbar
42
+ */
43
+ nav?: NavItem[]
44
+
45
+ /**
46
+ * meting
47
+ */
48
+ meting?: Partial<Meting>
49
+
50
+ /**
51
+ * Custom header levels of outline in the aside component.
52
+ *
53
+ * @default 2
54
+ */
55
+ outline?: number | [number, number] | 'deep' | false
56
+ }
57
+
58
+ export interface NavItem {
59
+ text: string
60
+ link: string
61
+ icon?: string
62
+ }
63
+ /**
64
+ * meting options
65
+ * @see https://github.com/metowolf/MetingJS#option
66
+ */
67
+ export interface Meting {
68
+ id: string
69
+ server: string
70
+ type: string
71
+ auto: string
72
+ fixed: boolean
73
+ mini: boolean
74
+ autoplay: boolean
75
+ theme: string
76
+ loop: string
77
+ order: string
78
+ preload: string
79
+ volume: number
80
+ work: string
81
+ mutex: boolean
82
+ start: string
83
+ 'lrc-type': number
84
+ 'list-folded': boolean
85
+ 'list-max-height': string
86
+ 'storage-name': string
87
+ [key: string]: any
88
+ }
89
+
90
+ export interface Layout {
91
+ post:
92
+ | 'text'
93
+ | 'markdown'
94
+ | 'image'
95
+ | 'image:slice'
96
+ | 'image:slice:reverse'
97
+ categories: 'timeline' | 'post'
98
+ }
99
+
100
+ export interface Footer {
101
+ /**
102
+ * 建站于
103
+ */
104
+ since: number
105
+
106
+ /**
107
+ * Icon between year and copyright info.
108
+ */
109
+ icon: {
110
+ /**
111
+ * icon name, i-xxx
112
+ */
113
+ name: string
114
+ animated: boolean
115
+ color: string
116
+ url: string
117
+ title: string
118
+ }
119
+
120
+ /**
121
+ * Powered by valaxy & valaxy-theme-${name}, default is yun
122
+ */
123
+ powered: boolean
124
+
125
+ /**
126
+ * Chinese Users | 中国用户
127
+ * 备案 ICP
128
+ * 国内用户需要在网站页脚展示备案 ICP 号
129
+ * https://beian.miit.gov.cn/
130
+ */
131
+ beian: {
132
+ enable: boolean
133
+ /**
134
+ * 苏ICP备xxxxxxxx号
135
+ */
136
+ icp: string
137
+ }
138
+ }
139
+
140
+ export interface Colors {
141
+ /**
142
+ * primary color
143
+ * @default '#0078E7'
144
+ */
145
+ primary: string
146
+ }
147
+ export interface Home {
148
+ headline: string
149
+ title: string
150
+ description: string
151
+ images: string[]
152
+ }
153
+
154
+ export interface Post {
155
+ images: string[]
156
+ }
157
+
158
+ export interface User {
159
+ name?: string
160
+ description?: string
161
+ }
162
+
163
+ export type ThemeUserConfig = Partial<ThemeConfig>
package/unocss.config.ts CHANGED
@@ -1,43 +1,43 @@
1
- import { defineConfig } from 'unocss'
2
-
3
- const safelist = [
4
- 'i-ri-home-2-fill',
5
- 'i-ri-list-check-2',
6
- 'i-ri-flow-chart',
7
- 'i-ri-user-line',
8
-
9
- 'i-fluent-text-align-distributed-24-filled',
10
- 'i-fluent-text-align-left-16-filled',
11
- 'i-fluent-text-align-justify-20-filled',
12
- 'i-fluent-markdown-20-filled',
13
- 'i-fluent-code-text-16-filled',
14
- ]
15
-
16
- export default defineConfig({
17
- theme: {
18
- breakpoints: {
19
- 'sm': '640px',
20
- 'md': '768px',
21
- 'lg': '1024px',
22
- 'xl': '1280px',
23
- '2xl': '1600px',
24
- },
25
- },
26
-
27
- rules: [
28
- ['font-seto', { 'font-family': 'var(--hy-font-family-seto)' }],
29
- ['font-modesty', { 'font-family': 'var(--hy-font-family-modesty)' }],
30
- ['font-christmas', { 'font-family': 'var(--hy-font-family-christmas)' }],
31
- ['font-frederick', { 'font-family': 'var(--hy-font-family-frederick)' }],
32
- ['text-primary', { color: 'var(--hy-c-primary)' }],
33
- ['text-primary-dark', { color: 'var(--hy-c-primary-dark)' }],
34
- ['text-primary-light', { color: 'var(--hy-c-primary-light)' }],
35
- ['border-primary', { 'border-color': 'var(--hy-c-primary)' }],
36
- ['bg-primary', { background: 'var(--hy-c-primary)' }],
37
- ],
38
- shortcuts: [
39
- ['flex-center', 'flex justify-center items-center'],
40
- ['inline-flex-center', 'inline-flex justify-center items-center'],
41
- ],
42
- safelist,
43
- })
1
+ import { defineConfig } from 'unocss'
2
+
3
+ const safelist = [
4
+ 'i-ri-home-2-fill',
5
+ 'i-ri-list-check-2',
6
+ 'i-ri-flow-chart',
7
+ 'i-ri-user-line',
8
+
9
+ 'i-fluent-text-align-distributed-24-filled',
10
+ 'i-fluent-text-align-left-16-filled',
11
+ 'i-fluent-text-align-justify-20-filled',
12
+ 'i-fluent-markdown-20-filled',
13
+ 'i-fluent-code-text-16-filled',
14
+ ]
15
+
16
+ export default defineConfig({
17
+ theme: {
18
+ breakpoints: {
19
+ 'sm': '640px',
20
+ 'md': '768px',
21
+ 'lg': '1024px',
22
+ 'xl': '1280px',
23
+ '2xl': '1600px',
24
+ },
25
+ },
26
+
27
+ rules: [
28
+ ['font-seto', { 'font-family': 'var(--hy-font-family-seto)' }],
29
+ ['font-modesty', { 'font-family': 'var(--hy-font-family-modesty)' }],
30
+ ['font-christmas', { 'font-family': 'var(--hy-font-family-christmas)' }],
31
+ ['font-frederick', { 'font-family': 'var(--hy-font-family-frederick)' }],
32
+ ['text-primary', { color: 'var(--hy-c-primary)' }],
33
+ ['text-primary-dark', { color: 'var(--hy-c-primary-dark)' }],
34
+ ['text-primary-light', { color: 'var(--hy-c-primary-light)' }],
35
+ ['border-primary', { 'border-color': 'var(--hy-c-primary)' }],
36
+ ['bg-primary', { background: 'var(--hy-c-primary)' }],
37
+ ],
38
+ shortcuts: [
39
+ ['flex-center', 'flex justify-center items-center'],
40
+ ['inline-flex-center', 'inline-flex justify-center items-center'],
41
+ ],
42
+ safelist,
43
+ })
package/utils/index.ts CHANGED
@@ -1,37 +1,37 @@
1
- export function ejectWindow(url: string) {
2
- const link = document.createElement('a')
3
- link.href = url
4
- link.target = '_blank'
5
- link.click()
6
- link.remove()
7
- }
8
-
9
- export function riposte<T>(...args: [cond: boolean, value: T][]) {
10
- for (const [cond, value] of args) {
11
- if (cond)
12
- return value
13
- }
14
- }
15
-
16
- export function toArray<T>(value: T | T[]): T[] {
17
- if (Array.isArray(value))
18
- return value as any
19
- else return [value].filter(Boolean) as any
20
- }
21
-
22
- export function removeTags(content = '') {
23
- return content
24
- .replace(/<\/?[^>]*>/g, '')
25
- .replace(/[|]*\n/, '')
26
- }
27
-
28
- export function getArchiveLink(year?: string, month?: string) {
29
- if (!year)
30
- return '/archives/'
31
- if (!month)
32
- return `/archives/${year}`
33
- if (month)
34
- return `/archives/${year}/${month}`
35
-
36
- return ''
37
- }
1
+ export function ejectWindow(url: string) {
2
+ const link = document.createElement('a')
3
+ link.href = url
4
+ link.target = '_blank'
5
+ link.click()
6
+ link.remove()
7
+ }
8
+
9
+ export function riposte<T>(...args: [cond: boolean, value: T][]) {
10
+ for (const [cond, value] of args) {
11
+ if (cond)
12
+ return value
13
+ }
14
+ }
15
+
16
+ export function toArray<T>(value: T | T[]): T[] {
17
+ if (Array.isArray(value))
18
+ return value as any
19
+ else return [value].filter(Boolean) as any
20
+ }
21
+
22
+ export function removeTags(content = '') {
23
+ return content
24
+ .replace(/<\/?[^>]*>/g, '')
25
+ .replace(/[|]*\n/, '')
26
+ }
27
+
28
+ export function getArchiveLink(year?: string, month?: string) {
29
+ if (!year)
30
+ return '/archives/'
31
+ if (!month)
32
+ return `/archives/${year}`
33
+ if (month)
34
+ return `/archives/${year}/${month}`
35
+
36
+ return ''
37
+ }
package/valaxy.config.ts CHANGED
@@ -1,26 +1,26 @@
1
- import type { DefaultTheme, ValaxyTheme } from 'valaxy'
2
- import { defineTheme, mergeValaxyConfig } from 'valaxy'
3
- import { addonAlgolia } from 'valaxy-addon-algolia'
4
- import { withImageConfig, withThemeConfig } from './node'
5
- import type { ThemeConfig } from './types'
6
-
7
- export default defineTheme<ThemeConfig>((options) => {
8
- let config: ValaxyTheme<ThemeConfig & DefaultTheme.Config> = {
9
- addons: [
10
- addonAlgolia(),
11
- ],
12
- themeConfig: {
13
- valaxyDarkOptions: {
14
- useDarkOptions: { disableTransition: false },
15
- circleTransition: true,
16
- },
17
- outline: 2,
18
- theme: 'dark',
19
- },
20
- }
21
-
22
- config = mergeValaxyConfig(config, withImageConfig(options))
23
- config = mergeValaxyConfig(config, withThemeConfig(options))
24
-
25
- return config
26
- })
1
+ import type { DefaultTheme, ValaxyTheme } from 'valaxy'
2
+ import { defineTheme, mergeValaxyConfig } from 'valaxy'
3
+ import { addonAlgolia } from 'valaxy-addon-algolia'
4
+ import { withImageConfig, withThemeConfig } from './node'
5
+ import type { ThemeConfig } from './types'
6
+
7
+ export default defineTheme<ThemeConfig>((options) => {
8
+ let config: ValaxyTheme<ThemeConfig & DefaultTheme.Config> = {
9
+ addons: [
10
+ addonAlgolia(),
11
+ ],
12
+ themeConfig: {
13
+ valaxyDarkOptions: {
14
+ useDarkOptions: { disableTransition: false },
15
+ circleTransition: true,
16
+ },
17
+ outline: 2,
18
+ theme: 'dark',
19
+ },
20
+ }
21
+
22
+ config = mergeValaxyConfig(config, withImageConfig(options))
23
+ config = mergeValaxyConfig(config, withThemeConfig(options))
24
+
25
+ return config
26
+ })
@@ -1,6 +0,0 @@
1
- <template></template>
2
-
3
- <route lang="yaml">
4
- meta:
5
- layout: archives
6
- </route>
@@ -1,6 +0,0 @@
1
- <template></template>
2
-
3
- <route lang="yaml">
4
- meta:
5
- layout: tags
6
- </route>