refactor: replace css fade animations with gsap, optimize post page animations and mobile responsiveness

This commit is contained in:
radishzzz 2025-05-18 16:03:17 +01:00
parent 90c2099fec
commit db4aa56987
9 changed files with 239 additions and 211 deletions

View file

@ -1,29 +0,0 @@
---
import GoBackIcon from '@/assets/icons/go-back.svg';
---
<button
id="back-button"
class="animation-fade-goback hidden"
lg="block absolute c-secondary/40 left--10 top-1/2 aspect-square w-4.5 translate-y--1/2 transition-colors duration-300 ease-out c-secondary active:scale-90 hover:c-primary/80"
aria-label="Go back"
>
<GoBackIcon
aria-hidden="true"
fill="currentColor"
/>
</button>
<!-- Go Back Script >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> -->
<script>
function setupBackButton() {
document.getElementById('back-button')?.addEventListener('click', () => {
if (window.history.length > 1) {
window.history.back()
}
})
}
setupBackButton()
document.addEventListener('astro:after-swap', setupBackButton)
</script>