mirror of
https://github.com/reonokiy/blog.nokiy.net.git
synced 2025-06-16 19:51:07 +02:00
refactor: replace css fade animations with gsap, optimize post page animations and mobile responsiveness
This commit is contained in:
parent
90c2099fec
commit
db4aa56987
9 changed files with 239 additions and 211 deletions
29
src/components/Widgets/BackButton.astro
Normal file
29
src/components/Widgets/BackButton.astro
Normal file
|
@ -0,0 +1,29 @@
|
|||
---
|
||||
import GoBackIcon from '@/assets/icons/go-back.svg';
|
||||
---
|
||||
|
||||
<button
|
||||
id="back-button"
|
||||
class="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>
|
Loading…
Add table
Add a link
Reference in a new issue