Files
portfolio/src/components/Footer.astro
T
Clezio Penha 77d30b30f3
Deploy Portfolio / deploy (push) Failing after 1s
Migrate portfolio from HTML/CSS/JS to Astro
2026-06-10 15:18:02 -03:00

44 lines
796 B
Plaintext

---
import type { Translation } from "../data/translations";
interface Props {
t: Translation;
}
const { t } = Astro.props;
---
<footer class="footer">
<p>
© 2026 {t.profile.name}
</p>
<p>
{t.profile.footerRole}
</p>
</footer>
<button id="backToTop" aria-label={t.ui.backToTop}>
</button>
<script>
const backToTopButton = document.querySelector("#backToTop");
const toggleBackToTop = () => {
backToTopButton?.classList.toggle("show", window.scrollY > 500);
};
window.addEventListener("scroll", toggleBackToTop, { passive: true });
toggleBackToTop();
backToTopButton?.addEventListener("click", () => {
window.scrollTo({
top: 0,
behavior: "smooth"
});
});
</script>