SanYeCao-blog/src/components/Footer.astro

131 lines
2.9 KiB
Text
Raw Normal View History

2026-03-24 17:33:01 +00:00
---
2026-03-24 22:28:23 +00:00
import { getLangFromUrl, getTranslations, type Lang } from "@/i18n";
2026-04-16 18:10:25 +00:00
import BuildHashBlocks from "@/components/BuildHashBlocks.astro";
const commit = import.meta.env.PUBLIC_GIT_COMMIT || "unknown";
2026-03-24 22:28:23 +00:00
const lang = getLangFromUrl(Astro.url);
const t = getTranslations(lang);
2026-03-24 17:33:01 +00:00
---
2026-03-24 22:28:23 +00:00
<footer class="footer">
2026-04-16 19:20:09 +00:00
<a
href="https://github.com/ClovertaTheTrilobita/SanYeCao-blog"
class="github"
aria-label="GitHub repository"></a>
<a href="mailto:cloverta@petalmail.com" class="email" aria-label="Email"></a>
<p class="footer-content-pc">
© 2026 ClovertaTheTrilobita · <a
href="https://github.com/ClovertaTheTrilobita/SanYeCao-blog"
>Source code</a
> licensed under MIT. Content rights reserved.
<!-- <code class="build-commit">{commit.slice(0, 7)}</code> -->
</p>
<div class="footer-content-mobile">
<p>© 2026 ClovertaTheTrilobita</p>
<p>Content rights reserved.</p>
</div>
2026-04-16 18:10:25 +00:00
<BuildHashBlocks />
2026-03-24 22:28:23 +00:00
</footer>
<style>
2026-04-16 19:20:09 +00:00
.github {
display: inline-block;
width: 30px;
height: 30px;
background-color: #1f2328;
-webkit-mask: url("/images/github-outline-7.svg") no-repeat center / contain;
mask: url("/images/github-outline-7.svg") no-repeat center / contain;
vertical-align: middle;
margin-bottom: 0.5rem;
margin-right: 0.5rem;
transition:
transform 0.18s ease,
opacity 0.18s ease;
}
.email {
display: inline-block;
width: 30px;
height: 30px;
background-color: #1f2328;
-webkit-mask: url("/images/email.svg") no-repeat center / contain;
mask: url("/images/email.svg") no-repeat center / contain;
vertical-align: middle;
margin-bottom: 0.5rem;
transition:
transform 0.18s ease,
opacity 0.18s ease;
}
.github:hover {
transform: translateY(-2px);
}
.email:hover {
transform: translateY(-2px);
}
:global(html.dark .github) {
background-color: #e6e6e6;
}
:global(html.dark .email) {
background-color: #e6e6e6;
}
2026-03-24 22:28:23 +00:00
.footer {
margin-top: 1rem;
padding: 1.5rem 0 0;
font-size: 0.95rem;
opacity: 0.9;
position: relative;
2026-04-16 19:20:09 +00:00
text-align: center;
2026-03-24 22:28:23 +00:00
}
.footer::before {
content: "";
display: block;
width: 100%;
height: 12px;
margin-bottom: 1rem;
background: repeating-linear-gradient(
-45deg,
2026-04-16 17:50:59 +00:00
#ef5a6f 0 14px,
2026-03-24 22:28:23 +00:00
transparent 14px 28px,
2026-04-16 17:50:59 +00:00
#536493 28px 42px,
2026-03-24 22:28:23 +00:00
transparent 42px 56px
);
pointer-events: none;
}
2026-04-16 19:20:09 +00:00
.footer-content-mobile {
display: none;
2026-03-24 22:28:23 +00:00
}
2026-04-16 19:20:09 +00:00
.footer p {
margin: 0.4rem 0;
font-size: 0.8rem;
/* display: inline-flex; */
2026-03-24 22:28:23 +00:00
}
:global(.dark) .footer::before {
background: repeating-linear-gradient(
-45deg,
#ff8a8a 0 14px,
transparent 14px 28px,
#9ecbff 28px 42px,
transparent 42px 56px
);
}
2026-04-16 19:20:09 +00:00
@media (max-width: 700px) {
.footer-content-pc {
display: none;
}
.footer-content-mobile {
display: block;
}
}
2026-03-24 22:28:23 +00:00
</style>