valaxy-theme-hairy 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. package/@types/markdown-it.d.ts +1 -0
  2. package/@types/markdown-toc.d.ts +1 -0
  3. package/@types/types.d.ts +1 -0
  4. package/@types/valaxy.d.ts +10 -0
  5. package/LICENSE +21 -0
  6. package/components/HairyAlgoliaSearchBox.vue +118 -0
  7. package/components/HairyArticleImage.vue +17 -0
  8. package/components/HairyArticleImageDefault.vue +127 -0
  9. package/components/HairyArticleImageSmall.vue +49 -0
  10. package/components/HairyArticleSeries.vue +73 -0
  11. package/components/HairyArticleText.vue +38 -0
  12. package/components/HairyArticleTop.vue +0 -0
  13. package/components/HairyBackToTop.vue +72 -0
  14. package/components/HairyBody.vue +55 -0
  15. package/components/HairyBreadcrumb.vue +51 -0
  16. package/components/HairyBreadcrumbItem.vue +14 -0
  17. package/components/HairyCarousel.vue +45 -0
  18. package/components/HairyDivider.vue +0 -0
  19. package/components/HairyHeader.vue +31 -0
  20. package/components/HairyImage.vue +14 -0
  21. package/components/HairyImageGroup.vue +69 -0
  22. package/components/HairyImageViewer.vue +22 -0
  23. package/components/HairyLayout.vue +29 -0
  24. package/components/HairyLink.vue +10 -0
  25. package/components/HairyMenu.vue +15 -0
  26. package/components/HairyMenuItem.vue +40 -0
  27. package/components/HairyMeting.vue +19 -0
  28. package/components/HairyNav.vue +39 -0
  29. package/components/HairyNavBackground.vue +7 -0
  30. package/components/HairyNavSearch.vue +265 -0
  31. package/components/HairyNavTitle.vue +13 -0
  32. package/components/HairyNavToggleDark.vue +16 -0
  33. package/components/HairyPostImageList.vue +28 -0
  34. package/components/HairyPostList.vue +24 -0
  35. package/components/HairyPostTitle.vue +33 -0
  36. package/components/HairySocialLinks.vue +27 -0
  37. package/components/HairyTimelinePostItem.vue +40 -0
  38. package/components/HairyToc.vue +135 -0
  39. package/components/HairyUserCard.vue +30 -0
  40. package/components/HairyUserNav.vue +68 -0
  41. package/components/HairyUserTab.vue +40 -0
  42. package/components/HairyWaline.vue +25 -0
  43. package/components/HairyWaves.vue +67 -0
  44. package/components/ValaxyMain.vue +45 -0
  45. package/hooks/useCategory.ts +18 -0
  46. package/hooks/useCategoryPost.ts +21 -0
  47. package/hooks/useContext.ts +16 -0
  48. package/hooks/useHeaderHeight.ts +9 -0
  49. package/hooks/usePostLayout.ts +9 -0
  50. package/hooks/useYearArchives.ts +43 -0
  51. package/images.json +101 -0
  52. package/index.d.ts +54 -0
  53. package/layouts/archives.vue +11 -0
  54. package/layouts/categories.vue +6 -0
  55. package/layouts/default.vue +9 -0
  56. package/layouts/home.vue +23 -0
  57. package/layouts/month.vue +6 -0
  58. package/layouts/post.vue +26 -0
  59. package/layouts/tag.vue +6 -0
  60. package/layouts/tags.vue +6 -0
  61. package/layouts/year.vue +6 -0
  62. package/locales/en.yml +1 -0
  63. package/locales/zh-CN.yml +3 -0
  64. package/modules/context.ts +5 -0
  65. package/modules/loading.scss +531 -0
  66. package/modules/loading.ts +42 -0
  67. package/modules/scroll.ts +21 -0
  68. package/node/addon-hairy.ts +18 -0
  69. package/node/addon-images.ts +61 -0
  70. package/node/addon-meting.ts +13 -0
  71. package/node/addon-statistics.ts +19 -0
  72. package/node/addon-toc.ts +20 -0
  73. package/node/utils.ts +20 -0
  74. package/package.json +47 -0
  75. package/pages/archives/[year]/[month]/index.vue +52 -0
  76. package/pages/archives/[year]/index.vue +73 -0
  77. package/pages/archives/index.vue +53 -0
  78. package/pages/categories/[...categories].vue +115 -0
  79. package/pages/index.vue +14 -0
  80. package/pages/tags/[tag].vue +40 -0
  81. package/pages/tags/index.vue +31 -0
  82. package/setup/main.ts +11 -0
  83. package/shims.d.ts +8 -0
  84. package/styles/css-vars.scss +161 -0
  85. package/styles/element-plus/index.scss +2 -0
  86. package/styles/element-plus/tabs.scss +26 -0
  87. package/styles/element-plus/timeline.scss +19 -0
  88. package/styles/font-face.scss +20 -0
  89. package/styles/fonts/FrederickatheGreat.ttf +0 -0
  90. package/styles/fonts/Modesty.ttf +0 -0
  91. package/styles/fonts/MountainsofChristmas-Bold.ttf +0 -0
  92. package/styles/fonts/MountainsofChristmas-Regular.ttf +0 -0
  93. package/styles/fonts/Seto.ttf +0 -0
  94. package/styles/index.scss +65 -0
  95. package/styles/markdown.scss +60 -0
  96. package/styles/scrollbar.scss +26 -0
  97. package/unocss.config.ts +29 -0
  98. package/utils/createContext.ts +40 -0
  99. package/utils/index.ts +28 -0
  100. package/utils/loading.scss +531 -0
  101. package/utils/loading.ts +30 -0
  102. package/valaxy.config.ts +26 -0
@@ -0,0 +1,20 @@
1
+ @font-face {
2
+ font-family: "MountainsofChristmas";
3
+ src: url('./fonts/MountainsofChristmas-Bold.ttf'),
4
+ url('./fonts/MountainsofChristmas-Regular.ttf')
5
+ }
6
+
7
+ @font-face {
8
+ font-family: "FrederickatheGreat";
9
+ src: url('./fonts/FrederickatheGreat.ttf')
10
+ }
11
+
12
+ @font-face {
13
+ font-family: "Modesty";
14
+ src: url('./fonts/Modesty.ttf')
15
+ }
16
+
17
+ @font-face {
18
+ font-family: "Seto";
19
+ src: url('./fonts/Seto.ttf')
20
+ }
Binary file
Binary file
@@ -0,0 +1,65 @@
1
+ @import "./font-face.scss";
2
+ @import "./markdown.scss";
3
+ @import "./element-plus/index.scss";
4
+ @import "./scrollbar.scss";
5
+
6
+ body {
7
+ font-family: var(--hy-font-family-seto);
8
+ @apply transition-colors duration-200;
9
+ }
10
+
11
+ #app {
12
+ @apply transition-none;
13
+ }
14
+
15
+ a {
16
+ @apply transition-colors;
17
+ color: var(--hy-c-primary-light);
18
+
19
+ &:hover {
20
+ --un-text-opacity: 1;
21
+ color: var(--hy-c-primary-dark);
22
+ }
23
+ }
24
+
25
+ html,
26
+ body {
27
+ scroll-behavior: smooth;
28
+ }
29
+
30
+ #nprogress {
31
+ pointer-events: none;
32
+
33
+ .bar {
34
+ top: 0;
35
+ // margin-top: -5px;
36
+ height: 5px;
37
+ opacity: 0.75;
38
+ background: var(--hy-c-primary);
39
+ position: fixed;
40
+ z-index: 1031;
41
+ left: 0;
42
+ width: 100%;
43
+ border-radius: 5px;
44
+ }
45
+ }
46
+
47
+
48
+ @media (min-width: 1200px) {
49
+ .breakpoint {
50
+ width: 72.5rem;
51
+ }
52
+ }
53
+
54
+ @media (max-width: 1200px) {
55
+ .breakpoint {
56
+ padding-left: 0.5rem;
57
+ padding-right: 0.5rem;
58
+ }
59
+ }
60
+
61
+ @media (min-width: 1600px) {
62
+ .breakpoint {
63
+ width: 75vw;
64
+ }
65
+ }
@@ -0,0 +1,60 @@
1
+ @use "valaxy/client/styles/mixins" as *;
2
+
3
+ .markdown-body {
4
+ --c-toc-link: var(--hy-c-text-light);
5
+ }
6
+
7
+ html.dark {
8
+ .markdown-body {
9
+ --c-toc-link: var(--hy-c-text-dark);
10
+ }
11
+ }
12
+
13
+ .markdown-body {
14
+ word-wrap: break-word;
15
+
16
+ h2,
17
+ a {
18
+ color: var(--hy-c-primary);
19
+ }
20
+
21
+ h1,
22
+ h2,
23
+ h3,
24
+ h4,
25
+ h5,
26
+ h6 {
27
+ font-family: var(--hy-font-serif);
28
+ font-weight: 900;
29
+ }
30
+
31
+ ul {
32
+ li>p {
33
+ margin-bottom: 0;
34
+ }
35
+ }
36
+ }
37
+
38
+
39
+ .markdown-body :not(pre)>code {
40
+ padding: 3px 6px;
41
+ font-size: 0.85rem;
42
+ color: var(--hy-c-text-code);
43
+ background: var(--hy-c-bg-mute);
44
+ border-radius: 3px;
45
+ }
46
+
47
+ .markdown-body div[class*=language-] pre {
48
+ max-width: calc(100vw - 56px);
49
+ }
50
+
51
+
52
+ .prose :where(:not(pre) > code):not(:where(.not-prose, .not-prose *))::before,
53
+ .prose :where(:not(pre) > code):not(:where(.not-prose, .not-prose *))::after {
54
+ content: none !important;
55
+ }
56
+
57
+ .custom-block.tip {
58
+ background-color: rgba(200, 200, 200, 0.1);
59
+ border-color: var(--hy-c-primary);
60
+ }
@@ -0,0 +1,26 @@
1
+ ::-webkit-scrollbar {
2
+ width: 8px;
3
+ height: 8px;
4
+ }
5
+
6
+ ::-webkit-scrollbar-track {
7
+ border-radius: 2px;
8
+ background-color: rgba(255, 255, 255, 0.1);
9
+ }
10
+
11
+ ::-webkit-scrollbar-thumb {
12
+ border-radius: 2px;
13
+ background-color: rgba(122, 122, 122, 0.3);
14
+
15
+ &:window-inactive {
16
+ background-color: rgba(122, 122, 122, 0.3);
17
+ }
18
+
19
+ &:hover {
20
+ background-color: rgba(#1bc9a6, 0.7);
21
+ }
22
+
23
+ &:active {
24
+ background-color: rgba(#1bc9a6, 0.9);
25
+ }
26
+ }
@@ -0,0 +1,29 @@
1
+ import { defineConfig } from 'unocss'
2
+ const safelist = [
3
+ 'i-ri:home-2-fill',
4
+ ]
5
+ export default defineConfig({
6
+ theme: {
7
+ breakpoints: {
8
+ 'sm': '640px',
9
+ 'md': '768px',
10
+ 'lg': '1024px',
11
+ 'xl': '1280px',
12
+ '2xl': '1600px',
13
+ },
14
+ },
15
+
16
+ rules: [
17
+ ['font-seto', { 'font-family': 'var(--hy-font-family-seto)' }],
18
+ ['font-modesty', { 'font-family': 'var(--hy-font-family-modesty)' }],
19
+ ['font-christmas', { 'font-family': 'var(--hy-font-family-christmas)' }],
20
+ ['font-frederick', { 'font-family': 'var(--hy-font-family-frederick)' }],
21
+ ['text-primary', { color: 'var(--hy-c-primary)' }],
22
+ ['border-primary', { 'border-color': 'var(--hy-c-primary)' }],
23
+ ],
24
+ shortcuts: [
25
+ ['flex-center', 'flex justify-center items-center'],
26
+ ['inline-flex-center', 'inline-flex justify-center items-center'],
27
+ ],
28
+ safelist,
29
+ })
@@ -0,0 +1,40 @@
1
+ /*
2
+ * @Author: Mr'Mao https://github.com/TuiMao233
3
+ * @Date: 2022-02-09 10:56:30
4
+ * @LastEditors: Mr'Mao
5
+ * @LastEditTime: 2022-02-26 13:47:57
6
+ */
7
+
8
+ import type { InjectionKey } from 'vue'
9
+ import { inject, provide } from 'vue'
10
+
11
+ /**
12
+ * 创建上下文
13
+ * @param key 控制器的 key
14
+ * @param callback 控制器注入的内容
15
+ * @returns
16
+ */
17
+ export function createContext<T>(key: string, getter: () => T) {
18
+ const _key: InjectionKey<T> = Symbol(key)
19
+
20
+ const _provide = () => {
21
+ const controller = getter()
22
+ provide(_key, controller)
23
+ return controller
24
+ }
25
+
26
+ const _inject = () => {
27
+ const controller = inject(_key)
28
+ if (!controller)
29
+ throw new Error(`Please wrap the container in ${_key}`)
30
+
31
+ return controller
32
+ }
33
+
34
+ return {
35
+ key: _key,
36
+ provide: _provide,
37
+ inject: _inject,
38
+ getter,
39
+ }
40
+ }
package/utils/index.ts ADDED
@@ -0,0 +1,28 @@
1
+ /**
2
+ * 跳转到新的页面
3
+ * @param url 跳转url
4
+ */
5
+ export const ejectWindow = (url: string) => {
6
+ const link = document.createElement('a')
7
+ link.href = url
8
+ link.target = '_blank'
9
+ link.click()
10
+ link.remove()
11
+ }
12
+
13
+ export const getArchiveLink = (year?: string, month?: string) => {
14
+ if (!year)
15
+ return '/archives/'
16
+ if (!month)
17
+ return `/archives/${year}`
18
+ if (month)
19
+ return `/archives/${year}/${month}`
20
+
21
+ return ''
22
+ }
23
+
24
+ export const toArr = <T>(arr: T[] | T): T[] => {
25
+ if (Array.isArray(arr))
26
+ return arr as any
27
+ else return [arr].filter(Boolean) as any
28
+ }