minearm-website 0.0.3-beta.2

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.
Files changed (123) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +67 -0
  3. package/astro.config.ts +33 -0
  4. package/minearm.ts +174 -0
  5. package/package.json +64 -0
  6. package/public/13.jpg +0 -0
  7. package/public/1937daxue.png +0 -0
  8. package/public/3.png +0 -0
  9. package/public/404.png +0 -0
  10. package/public/5.jpg +0 -0
  11. package/public/BC.png +0 -0
  12. package/public/Chinese.png +0 -0
  13. package/public/avatar.avif +0 -0
  14. package/public/avatar.jpg +0 -0
  15. package/public/c++1.png +0 -0
  16. package/public/docker-hub.png +0 -0
  17. package/public/favicon.png +0 -0
  18. package/public/help1.png +0 -0
  19. package/public/heroimg.jpg +0 -0
  20. package/public/logo.png +0 -0
  21. package/public/mail.png +0 -0
  22. package/public/nahida.png +0 -0
  23. package/public/pojipao.avif +0 -0
  24. package/public/rust1.png +0 -0
  25. package/public/scripts/mdata.json +4 -0
  26. package/public/scripts/utils.js +190 -0
  27. package/public/xmrig.jpg +0 -0
  28. package/src/components/BodyInject.astro +5 -0
  29. package/src/components/HeadInject.astro +16 -0
  30. package/src/components/Search.astro +30 -0
  31. package/src/components/animation/bubbles.astro +82 -0
  32. package/src/components/animation/wave.astro +81 -0
  33. package/src/components/aside/announcement.astro +25 -0
  34. package/src/components/aside/aside.astro +32 -0
  35. package/src/components/aside/asideComps.astro +26 -0
  36. package/src/components/aside/authorInfo.astro +54 -0
  37. package/src/components/aside/blogToc.astro +26 -0
  38. package/src/components/aside/countScript.astro +18 -0
  39. package/src/components/aside/customCard.astro +23 -0
  40. package/src/components/aside/siteInfo.astro +51 -0
  41. package/src/components/client/searchCore.vue +77 -0
  42. package/src/components/client/themeControl.vue +77 -0
  43. package/src/components/footer/Footer.astro +32 -0
  44. package/src/components/header/Header.astro +40 -0
  45. package/src/components/header/HeaderButton.astro +59 -0
  46. package/src/components/header/HeaderItem.astro +63 -0
  47. package/src/components/header/heroWave.astro +19 -0
  48. package/src/components/header/searchBar.astro +21 -0
  49. package/src/components/icons/bilibili.astro +10 -0
  50. package/src/components/icons/c.astro +10 -0
  51. package/src/components/icons/code.astro +37 -0
  52. package/src/components/icons/computer.astro +4 -0
  53. package/src/components/icons/cube.astro +10 -0
  54. package/src/components/icons/game.astro +10 -0
  55. package/src/components/icons/getIcon.astro +64 -0
  56. package/src/components/icons/github.astro +10 -0
  57. package/src/components/icons/hardDriver.astro +10 -0
  58. package/src/components/icons/home.astro +14 -0
  59. package/src/components/icons/icon.ts +33 -0
  60. package/src/components/icons/icons.json +91961 -0
  61. package/src/components/icons/link.astro +4 -0
  62. package/src/components/icons/mail.astro +10 -0
  63. package/src/components/icons/paperPlane.astro +4 -0
  64. package/src/components/icons/pen.astro +14 -0
  65. package/src/components/icons/person.astro +14 -0
  66. package/src/components/icons/searchicon.astro +23 -0
  67. package/src/components/icons/tags.astro +10 -0
  68. package/src/components/icons/toTop.astro +10 -0
  69. package/src/components/icons/tools.astro +1 -0
  70. package/src/components/loading/loading.vue +185 -0
  71. package/src/components/postComment.astro +62 -0
  72. package/src/components/postlist/pagination.astro +40 -0
  73. package/src/components/postlist/postsList.astro +57 -0
  74. package/src/content/blog/default/Extended Search.md +50 -0
  75. package/src/content/blog/default/Mail.md +15 -0
  76. package/src/content/blog/default/history//345/205/254/345/205/203/345/211/215//347/247/246/345/247/213/347/232/207/347/273/237/344/270/200/345/205/255/345/233/275.md +40 -0
  77. package/src/content/blog/default/history//350/277/221/344/273/243/347/257/207//344/270/255/345/233/275/345/205/261/344/272/247/345/205/232/345/205/232/345/217/262.md +2361 -0
  78. package/src/content/blog/default/it/Rust/345/237/272/346/234/254/350/257/255/346/263/225.md +298 -0
  79. package/src/content/config.ts +38 -0
  80. package/src/env.d.ts +148 -0
  81. package/src/layouts/BaseLayout.astro +67 -0
  82. package/src/layouts/DefaultMdLayout.astro +46 -0
  83. package/src/layouts/HomeLayout.astro +27 -0
  84. package/src/layouts/PostLayout.astro +60 -0
  85. package/src/layouts/TagsLayout.astro +44 -0
  86. package/src/layouts/c.astro +42 -0
  87. package/src/layouts/h.astro +60 -0
  88. package/src/pages/404.md +10 -0
  89. package/src/pages/[...page].astro +46 -0
  90. package/src/pages/about/index.md +90 -0
  91. package/src/pages/blog/[...slug].astro +68 -0
  92. package/src/pages/categories/[category]/[...page].astro +45 -0
  93. package/src/pages/categories/index.astro +20 -0
  94. package/src/pages/friends/index.md +24 -0
  95. package/src/pages/rss.xml.js +20 -0
  96. package/src/pages/tags/[tag]/[...page].astro +42 -0
  97. package/src/pages/tags/index.astro +19 -0
  98. package/src/site_config.ts +15 -0
  99. package/src/styles/animation.scss +94 -0
  100. package/src/styles/blog/blog.scss +124 -0
  101. package/src/styles/blog/code.scss +111 -0
  102. package/src/styles/blog/directives.scss +356 -0
  103. package/src/styles/blog/index.scss +4 -0
  104. package/src/styles/blog/post.scss +474 -0
  105. package/src/styles/components/aside.scss +178 -0
  106. package/src/styles/components/footer.scss +74 -0
  107. package/src/styles/components/header.scss +421 -0
  108. package/src/styles/components/heroWave.scss +24 -0
  109. package/src/styles/components/main.scss +275 -0
  110. package/src/styles/components/page-content.scss +147 -0
  111. package/src/styles/components/pagination.scss +121 -0
  112. package/src/styles/components/search.scss +349 -0
  113. package/src/styles/custom.scss +21 -0
  114. package/src/styles/global.scss +167 -0
  115. package/src/styles/mixin.scss +17 -0
  116. package/src/styles/tags/tags.scss +83 -0
  117. package/src/theme_config.ts +178 -0
  118. package/src/utils/generateSearchData.ts +30 -0
  119. package/src/utils/md.ts +114 -0
  120. package/src/utils/processMd.ts +278 -0
  121. package/src/utils/utils.ts +87 -0
  122. package/tsconfig.json +32 -0
  123. package/vercel.json +26 -0
@@ -0,0 +1,82 @@
1
+ ---
2
+ interface Props {
3
+ bubbles: number;
4
+ }
5
+
6
+ const { bubbles } = Astro.props;
7
+ ---
8
+
9
+ <div class="area">
10
+ <ul class="circles">
11
+ {
12
+ () => {
13
+ let li = "";
14
+ for (let i = 0; i < bubbles; i++) {
15
+ li += "<li></li>";
16
+ }
17
+ return <Fragment set:html={li} />;
18
+ }
19
+ }
20
+ </ul>
21
+ </div>
22
+
23
+ <style lang="scss">
24
+ .area {
25
+ pointer-events: none;
26
+ position: fixed;
27
+ height: 100%;
28
+ width: 100%;
29
+ left: 0;
30
+ top: 0;
31
+ z-index: 200;
32
+ }
33
+
34
+ .circles {
35
+ position: absolute;
36
+ top: 0;
37
+ left: 0;
38
+ width: 100%;
39
+ height: 100%;
40
+ overflow: hidden;
41
+ }
42
+
43
+ .circles :global(li) {
44
+ position: absolute;
45
+ display: block;
46
+ list-style: none;
47
+ width: 20px;
48
+ height: 20px;
49
+ background: rgba(255, 255, 255, 0.5);
50
+ animation: animate 25s linear infinite;
51
+ bottom: -150px;
52
+ }
53
+
54
+ @for $i from 1 through 50 {
55
+ .circles :global(li:nth-child(#{$i})) {
56
+ left: random(110) - 5vw;
57
+ $size: random(150) + 10px;
58
+ width: $size;
59
+ height: $size;
60
+ animation-delay: random(20) + s;
61
+ animation-duration: random(10) + 5s;
62
+ }
63
+ }
64
+
65
+ :global([data-theme="light"]) .circles :global(li) {
66
+ background-color: rgba(146, 172, 233, 0.1);
67
+ }
68
+
69
+ @keyframes animate {
70
+ 0% {
71
+ transform: translateY(0) rotate(0deg);
72
+ opacity: 1;
73
+ border-radius: 10%;
74
+ }
75
+
76
+ 100% {
77
+ transform: translateY(-120vh) rotate(720deg);
78
+ opacity: 0;
79
+ border-radius: 50%;
80
+ }
81
+ }
82
+ </style>
@@ -0,0 +1,81 @@
1
+ ---
2
+ ---
3
+
4
+ <section class="hero-waves-area waves-area">
5
+ <svg
6
+ class="waves-svg"
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ viewBox="0 24 150 28"
9
+ preserveAspectRatio="none"
10
+ shape-rendering="auto"
11
+ ><defs
12
+ ><path
13
+ id="gentle-wave"
14
+ d="M-160 44c30 0 58-18 88-18s58 18 88 18 58-18 88-18 58 18 88 18v44h-352Z"
15
+ ></path></defs
16
+ ><g class="parallax"
17
+ ><use href="#gentle-wave" x="48" y="0"></use><use
18
+ href="#gentle-wave"
19
+ x="48"
20
+ y="3"></use><use href="#gentle-wave" x="48" y="5"></use><use
21
+ href="#gentle-wave"
22
+ x="48"
23
+ y="7"></use></g
24
+ ></svg
25
+ >
26
+ </section>
27
+
28
+ <style>
29
+ .waves-area {
30
+ width: 100%;
31
+ position: absolute;
32
+ left: 0;
33
+ bottom: -11px;
34
+ z-index: 5;
35
+ }
36
+
37
+ .waves-svg {
38
+ width: 100%;
39
+ height: 5rem;
40
+ }
41
+
42
+ .parallax > use:nth-child(1) {
43
+ animation-delay: -2s;
44
+ animation-duration: 7s;
45
+ fill: var(--body-background-color);
46
+ opacity: 0.7;
47
+ }
48
+
49
+ .parallax > use:nth-child(2) {
50
+ animation-delay: -3s;
51
+ animation-duration: 10s;
52
+ fill: var(--body-background-color);
53
+ opacity: 0.5;
54
+ }
55
+
56
+ .parallax > use:nth-child(3) {
57
+ animation-delay: -4s;
58
+ animation-duration: 13s;
59
+ fill: var(--body-background-color);
60
+ opacity: 0.2;
61
+ }
62
+
63
+ .parallax > use:nth-child(4) {
64
+ animation-delay: -5s;
65
+ animation-duration: 20s;
66
+ fill: var(--body-background-color);
67
+ }
68
+
69
+ .parallax > use {
70
+ animation: move-forever 25s cubic-bezier(0.55, 0.5, 0.45, 0.5) infinite;
71
+ }
72
+
73
+ @keyframes move-forever {
74
+ 0% {
75
+ transform: translate3d(-90px, 0, 0);
76
+ }
77
+ 100% {
78
+ transform: translate3d(85px, 0, 0);
79
+ }
80
+ }
81
+ </style>
@@ -0,0 +1,25 @@
1
+ ---
2
+ import { ThemeConfig } from "@src/theme_config";
3
+ import { utils } from "@src/utils/utils";
4
+ import GetIcon from "@comp/icons/getIcon.astro";
5
+ const announcement: Announcement = ThemeConfig.aside.announcement;
6
+ ---
7
+
8
+ <div class="announcement-card aside-card">
9
+ <div class="announcement-headline aside-card-headline">
10
+ <GetIcon
11
+ Icon="local:solid.bullhorn"
12
+ class="announcement-icon aside-card-icon"
13
+ />
14
+ <div class="announcement-title aside-card-title">
15
+ {announcement.headline}
16
+ </div>
17
+ </div>
18
+ <div
19
+ class="announcement-content aside-card-content"
20
+ set:html={utils.replaceLink(
21
+ utils.executeEmbeddedScripts(announcement.content),
22
+ "aside-card-link"
23
+ )}
24
+ />
25
+ </div>
@@ -0,0 +1,32 @@
1
+ ---
2
+ import "@style/components/aside.scss";
3
+ import AsideComps from "./asideComps.astro";
4
+ import CustomCard from "./customCard.astro";
5
+ import { ThemeConfig } from "@src/theme_config";
6
+ interface Props {
7
+ class?: string;
8
+ comps?: AsideComponents[];
9
+ stickyComps?: AsideComponents[];
10
+ direct?: "left" | "right" | false;
11
+ }
12
+
13
+ const { class: className, comps, stickyComps, direct } = Astro.props;
14
+ ---
15
+
16
+ {
17
+ direct !== false && (
18
+ <aside
19
+ class:list={["aside-content", className]}
20
+ style={`order: ${direct === "right" ? "2" : ""};`}
21
+ >
22
+ <AsideComps comps={comps} />
23
+ {ThemeConfig.aside.customCards.map((card) => (
24
+ <CustomCard card={card} />
25
+ ))}
26
+ <div class="sticky-container">
27
+ <AsideComps comps={stickyComps} />
28
+ <slot />
29
+ </div>
30
+ </aside>
31
+ )
32
+ }
@@ -0,0 +1,26 @@
1
+ ---
2
+ import Announcement from "./announcement.astro";
3
+ import AuthorInfo from "./authorInfo.astro";
4
+ import BlogToc from "./blogToc.astro";
5
+ import SiteInfo from "./siteInfo.astro";
6
+
7
+ interface Props {
8
+ comps?: AsideComponents[];
9
+ }
10
+
11
+ const { comps } = Astro.props;
12
+
13
+ const compMap = new Map<AsideComponents, any>([
14
+ ["Announcement", Announcement],
15
+ ["AuthorInfo", AuthorInfo],
16
+ ["BlogToc", BlogToc],
17
+ ["SiteInfo", SiteInfo],
18
+ ]);
19
+ ---
20
+
21
+ {
22
+ comps?.map((comp) => {
23
+ const Item: any = compMap.get(comp as AsideComponents);
24
+ return <Item />;
25
+ })
26
+ }
@@ -0,0 +1,54 @@
1
+ ---
2
+ import { ThemeConfig as TC } from "@src/theme_config";
3
+ import GetIcon from "@comp/icons/getIcon.astro";
4
+ import { utils } from "@src/utils/utils";
5
+ const authorInfo: AuthorInfo = TC.aside.authorInfo;
6
+ ---
7
+
8
+ <div class="author-info-card aside-card">
9
+ <div class="author-info">
10
+ <img class="author-avatar" src={authorInfo.avatar} alt="author-avatar" />
11
+ <div class="author-name">{TC.site.author}</div>
12
+ <div
13
+ class="author-desc"
14
+ set:html={utils.replaceLink(
15
+ utils.executeEmbeddedScripts(authorInfo.description),
16
+ "aside-card-link"
17
+ )}
18
+ />
19
+ </div>
20
+ <div class="blog-counts">
21
+ <div class="blog-count">
22
+ <div class="count">87</div>
23
+ <div class="tag">文章</div>
24
+ </div>
25
+ <a class="blog-count" href="/categories">
26
+ <div class="count">9</div>
27
+ <div class="tag">分类</div>
28
+ </a>
29
+ <a class="blog-count" href="/tags">
30
+ <div class="count">10</div>
31
+ <div class="tag">标签</div>
32
+ </a>
33
+ </div>
34
+ <div class="social-medias">
35
+ {
36
+ authorInfo.socialMedias.map((media) => (
37
+ <div
38
+ title={media.customClass}
39
+ class:list={["social-media", media.customClass]}
40
+ >
41
+ {media.link ? (
42
+ <a href={media.link} class="social-link" title={media.title || ""}>
43
+ <GetIcon class="social-icon" Icon={media.icon} />
44
+ </a>
45
+ ) : (
46
+ <div class="social-link" title={media.title || ""}>
47
+ <GetIcon class="social-icon" Icon={media.icon} />
48
+ </div>
49
+ )}
50
+ </div>
51
+ ))
52
+ }
53
+ </div>
54
+ </div>
@@ -0,0 +1,26 @@
1
+ ---
2
+ interface Props {
3
+ toc: Array<{
4
+ level: string;
5
+ id: string;
6
+ value: string;
7
+ }>;
8
+ }
9
+
10
+ const { toc } = Astro.props;
11
+ ---
12
+
13
+ <div class="card-toc aside-card">
14
+ <header class="card-toc-header">文章内容</header>
15
+ <ol class="toc">
16
+ {
17
+ toc.map((item) => (
18
+ <li class:list={["toc-item", `toc-level-${item.level}`]}>
19
+ <a href={`#${item.id}`} class="toc-link">
20
+ <span class="toc-text">{item.value}</span>
21
+ </a>
22
+ </li>
23
+ ))
24
+ }
25
+ </ol>
26
+ </div>
@@ -0,0 +1,18 @@
1
+ ---
2
+ ---
3
+
4
+ <script is:inline>
5
+ hsu
6
+ .getJson("/scripts/mdata.json")
7
+ .then((mdata) => {
8
+ const wordCounts = document.querySelector("#word-counts");
9
+ const postCounts = document.querySelector("#post-counts");
10
+ if (wordCounts)
11
+ wordCounts.innerText = hsu.formatNumber(mdata.totalWordCounts);
12
+ if (postCounts)
13
+ postCounts.innerText = hsu.formatNumber(mdata.totalPostCounts);
14
+ })
15
+ .catch((error) => {
16
+ console.error(error);
17
+ });
18
+ </script>
@@ -0,0 +1,23 @@
1
+ ---
2
+ import GetIcon from "@comp/icons/getIcon.astro";
3
+ import { utils } from "@src/utils/utils";
4
+
5
+ interface Props {
6
+ card: CustomCard;
7
+ }
8
+ const { card } = Astro.props;
9
+ ---
10
+
11
+ <div class={`aside-card ${card.customClass}`}>
12
+ <div class={`aside-card-headline ${card.customClass}`}>
13
+ <GetIcon Icon={card.icon} class={`aside-card-icon ${card.customClass}`} />
14
+ <div class={`aside-card-title ${card.customClass}`}>{card.title}</div>
15
+ </div>
16
+ <div
17
+ class={`aside-card-content ${card.customClass}`}
18
+ set:html={utils.replaceLink(
19
+ utils.executeEmbeddedScripts(card.content),
20
+ ` ${card.customClass} aside-card-link`
21
+ )}
22
+ />
23
+ </div>
@@ -0,0 +1,51 @@
1
+ ---
2
+ import GetIcon from "@comp/icons/getIcon.astro";
3
+ import { ThemeConfig } from "@src/theme_config";
4
+ import CountScript from "./countScript.astro";
5
+ ---
6
+
7
+ <div class="siteinfo-card aside-card">
8
+ <div class="siteinfo-headline aside-card-headline">
9
+ <GetIcon
10
+ Icon="local:solid.circle-info"
11
+ class="siteinfo-icon aside-card-icon"
12
+ />
13
+ <div class="siteinfo-title aside-card-title">网站信息</div>
14
+ </div>
15
+ <div class="siteinfo-content aside-card-content">
16
+ {
17
+ ThemeConfig.aside.siteInfo.busuanzi && (
18
+ <Fragment>
19
+ <div class="siteinfo-item">
20
+ <span class="item-name">本站访客数:</span>
21
+ <span class="item-count" id="busuanzi_value_site_uv" />
22
+ </div>
23
+ <div class="siteinfo-item">
24
+ <span class="item-name">本站访问量</span>
25
+ <span class="item-count" id="busuanzi_value_site_pv" />
26
+ </div>
27
+ </Fragment>
28
+ )
29
+ }
30
+ {
31
+ ThemeConfig.aside.siteInfo.totalPostCounts && (
32
+ <div class="siteinfo-item">
33
+ <span class="item-name">本站文章数</span>
34
+ <span class="item-count" id="post-counts" />
35
+ </div>
36
+ )
37
+ }
38
+ {
39
+ ThemeConfig.aside.siteInfo.totalWordCounts && (
40
+ <div class="siteinfo-item">
41
+ <span class="item-name">本站总字数</span>
42
+ <span class="item-count" id="word-counts" />
43
+ </div>
44
+ )
45
+ }
46
+ </div>
47
+ {
48
+ (ThemeConfig.aside.siteInfo.totalPostCounts ||
49
+ ThemeConfig.aside.siteInfo.totalWordCounts) && <CountScript />
50
+ }
51
+ </div>
@@ -0,0 +1,77 @@
1
+ <script setup lang="ts">
2
+ import { ref, reactive, computed, onMounted, Ref } from "vue";
3
+ import Fuse from "fuse.js";
4
+
5
+ interface Result {
6
+ content: string;
7
+ title: string;
8
+ url: string;
9
+ }
10
+
11
+ const fuseOptions = {
12
+ isCaseSensitive: false,
13
+ includeScore: true,
14
+ includeMatches: true,
15
+ minMatchCharLength: 1,
16
+ shouldSort: true,
17
+ findAllMatches: false,
18
+ // location: 0,
19
+ // distance: 100,
20
+ // ignoreLocation: false,
21
+ threshold: 0.6,
22
+ useExtendedSearch: false,
23
+ ignoreFieldNorm: false,
24
+ fieldNormWeight: 1,
25
+ keys: ["title", "content"],
26
+ };
27
+
28
+ const keywords = ref("");
29
+ const result: Ref<Fuse.FuseResult<Result>[][]> = ref([]);
30
+ const pageNumber: Ref<number> = ref(1);
31
+ const pageSize: Ref<number> = ref(0);
32
+
33
+ const list = await hsu.getJson("/scripts/searchData.json");
34
+ const fuse = new Fuse(list, fuseOptions);
35
+ const search = () => {
36
+ let tmp: Fuse.FuseResult<Result>[] = fuse.search(keywords.value);
37
+ result.value = [];
38
+
39
+ for (let i = 0; i < tmp.length; i += 10) {
40
+ result.value.push(tmp.slice(i, i + 10));
41
+ }
42
+
43
+ pageNumber.value = 1;
44
+
45
+ pageSize.value = result.value.length;
46
+ };
47
+ </script>
48
+
49
+ <template>
50
+ <input
51
+ class="search-input"
52
+ type="text"
53
+ placeholder=""
54
+ v-model="keywords"
55
+ @keydown.enter="search"
56
+ />
57
+ <div class="search-results">
58
+ <a
59
+ v-if="result.length"
60
+ v-for="i in 10"
61
+ class="search-result"
62
+ :href="result[pageNumber - 1][i - 1]?.item.url"
63
+ >{{ result[pageNumber - 1][i - 1]?.item.title }}</a
64
+ >
65
+ </div>
66
+ <div class="search-pagination">
67
+ <span
68
+ v-for="num in pageSize"
69
+ :class="{ 'search-pagenumber': true, active: pageNumber == num }"
70
+ @click="pageNumber = num"
71
+ >
72
+ <span>{{ num }}</span>
73
+ </span>
74
+ </div>
75
+ </template>
76
+
77
+ <style scoped></style>
@@ -0,0 +1,77 @@
1
+ <script setup lang="ts">
2
+ import { ref, computed, onMounted } from "vue";
3
+
4
+ const THEME_KEY = "theme"; // 用于localStorage的key
5
+
6
+ const isLight = ref(localStorage.getItem(THEME_KEY) !== "dark"); // 从localStorage读取主题
7
+
8
+ const root = document.documentElement;
9
+
10
+ // 初始设置根元素的data-theme属性
11
+ onMounted(() => {
12
+ root.setAttribute("data-theme", isLight.value ? "light" : "dark");
13
+ });
14
+
15
+ const svgClass = computed(() => {
16
+ return isLight.value ? "light" : "dark";
17
+ });
18
+
19
+ const toggleSvg = () => {
20
+ isLight.value = !isLight.value;
21
+
22
+ // 存储新的主题设置到localStorage
23
+ localStorage.setItem(THEME_KEY, svgClass.value);
24
+
25
+ // 更新根元素的data-theme属性
26
+ root.setAttribute("data-theme", svgClass.value);
27
+ };
28
+ </script>
29
+
30
+ <template>
31
+ <div class="menu-button theme-control">
32
+ <div @click="toggleSvg" class="menu-button-link" title="changeMode">
33
+ <div class="menu-button-icon">
34
+ <svg
35
+ class="light"
36
+ xmlns="http://www.w3.org/2000/svg"
37
+ viewBox="0 0 512 512"
38
+ >
39
+ <!--! Font Awesome Pro 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. -->
40
+ <path
41
+ fill="currentColor"
42
+ d="M361.5 1.2c5 2.1 8.6 6.6 9.6 11.9L391 121l107.9 19.8c5.3 1 9.8 4.6 11.9 9.6s1.5 10.7-1.6 15.2L446.9 256l62.3 90.3c3.1 4.5 3.7 10.2 1.6 15.2s-6.6 8.6-11.9 9.6L391 391 371.1 498.9c-1 5.3-4.6 9.8-9.6 11.9s-10.7 1.5-15.2-1.6L256 446.9l-90.3 62.3c-4.5 3.1-10.2 3.7-15.2 1.6s-8.6-6.6-9.6-11.9L121 391 13.1 371.1c-5.3-1-9.8-4.6-11.9-9.6s-1.5-10.7 1.6-15.2L65.1 256 2.8 165.7c-3.1-4.5-3.7-10.2-1.6-15.2s6.6-8.6 11.9-9.6L121 121 140.9 13.1c1-5.3 4.6-9.8 9.6-11.9s10.7-1.5 15.2 1.6L256 65.1 346.3 2.8c4.5-3.1 10.2-3.7 15.2-1.6zM160 256a96 96 0 1 1 192 0 96 96 0 1 1 -192 0zm224 0a128 128 0 1 0 -256 0 128 128 0 1 0 256 0z"
43
+ />
44
+ </svg>
45
+ <svg
46
+ class="dark"
47
+ xmlns="http://www.w3.org/2000/svg"
48
+ viewBox="0 0 640 512"
49
+ >
50
+ <!--! Font Awesome Pro 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. -->
51
+ <path
52
+ fill="currentColor"
53
+ d="M495.8 0c5.5 0 10.9 .2 16.3 .7c7 .6 12.8 5.7 14.3 12.5s-1.6 13.9-7.7 17.3c-44.4 25.2-74.4 73-74.4 127.8c0 81 65.5 146.6 146.2 146.6c8.6 0 17-.7 25.1-2.1c6.9-1.2 13.8 2.2 17 8.5s1.9 13.8-3.1 18.7c-34.5 33.6-81.7 54.4-133.6 54.4c-9.3 0-18.4-.7-27.4-1.9c-11.2-22.6-29.8-40.9-52.6-51.7c-2.7-58.5-50.3-105.3-109.2-106.7c-1.7-10.4-2.6-21-2.6-31.8C304 86.1 389.8 0 495.8 0zM447.9 431.9c0 44.2-35.8 80-80 80H96c-53 0-96-43-96-96c0-47.6 34.6-87 80-94.6l0-1.3c0-53 43-96 96-96c34.9 0 65.4 18.6 82.2 46.4c13-9.1 28.8-14.4 45.8-14.4c44.2 0 80 35.8 80 80c0 5.9-.6 11.7-1.9 17.2c37.4 6.7 65.8 39.4 65.8 78.7z"
54
+ />
55
+ </svg>
56
+ </div>
57
+ </div>
58
+ </div>
59
+ </template>
60
+
61
+ <style scoped>
62
+ [data-theme="light"] .dark {
63
+ display: none;
64
+ }
65
+
66
+ [data-theme="light"] .light {
67
+ animation: var(--appear-animation);
68
+ }
69
+
70
+ [data-theme="dark"] .light {
71
+ display: none;
72
+ }
73
+
74
+ [data-theme="dark"] .dark {
75
+ animation: var(--appear-animation);
76
+ }
77
+ </style>
@@ -0,0 +1,32 @@
1
+ ---
2
+ import "@style/components/footer.scss";
3
+ import { ThemeConfig } from "@src/theme_config";
4
+ import { utils } from "@utils/utils";
5
+
6
+ const copyright = utils.replaceLink(
7
+ utils.executeEmbeddedScripts(ThemeConfig.footer.copyright),
8
+ "footer-link"
9
+ );
10
+ const footerText = utils.replaceLink(
11
+ utils.executeEmbeddedScripts(ThemeConfig.footer.text),
12
+ "footer-link"
13
+ );
14
+ ---
15
+
16
+ <footer id="site-footer">
17
+ <div class="footer-container">
18
+ <div class="copyright">
19
+ <Fragment set:html={copyright} />
20
+ </div>
21
+ <div class="astro-build">
22
+ 由 <a class="footer-link" href="https://minearm.org">minearm-1.1.4.5</a>
23
+ 构建<a
24
+ class="footer-link"
25
+ href="https://github.com/Minearm-RPM/minearm">Minearm-RPM</a
26
+ >
27
+ </div>
28
+ <div class="footer-info">
29
+ <Fragment set:html={footerText} />
30
+ </div>
31
+ </div>
32
+ </footer>
@@ -0,0 +1,40 @@
1
+ ---
2
+ import "@style/components/header.scss";
3
+ import { ThemeConfig } from "@src/theme_config";
4
+ import HeaderItem from "./HeaderItem.astro";
5
+ import HeaderButton from "./HeaderButton.astro";
6
+ import GetIcon from "@comp/icons/getIcon.astro";
7
+ import SearchBar from "@comp/header/searchBar.astro";
8
+ import { SiteConfig } from "@src/site_config";
9
+ ---
10
+
11
+ <header id="site-header">
12
+ <nav class="header-menu">
13
+ <div class="nav-left header-nav">
14
+ {
15
+ ThemeConfig.header.functions.headerLogo && (
16
+ <GetIcon class="site-logo" Icon={ThemeConfig.site.logo} />
17
+ )
18
+ }
19
+ <h1
20
+ class="site-name"
21
+ style={`order: ${
22
+ ThemeConfig.header.functions.headerLogo === "left" ? 2 : 0
23
+ };`}
24
+ >
25
+ {ThemeConfig.site.title}
26
+ </h1>
27
+ </div>
28
+ <div class="nav-center header-nav">
29
+ <div class="menu-items">
30
+ <HeaderItem />
31
+ </div>
32
+ </div>
33
+ <div class="nav-right header-nav">
34
+ <div class="menu-buttons">
35
+ {SiteConfig.localSearch && <SearchBar />}
36
+ <HeaderButton />
37
+ </div>
38
+ </div>
39
+ </nav>
40
+ </header>