Scroll bottom after clicking the arrow

This commit is contained in:
M3DZIK 2024-03-18 16:54:52 +01:00
parent 85c764e28f
commit 47dabfb470
No known key found for this signature in database
GPG Key ID: A5FAC1E185C112DB
1 changed files with 9 additions and 2 deletions

View File

@ -11,6 +11,13 @@
import photo from '../assets/photo.jpg'; import photo from '../assets/photo.jpg';
import SignalIcon from '../lib/Signal.svelte'; import SignalIcon from '../lib/Signal.svelte';
import Arrow from '$lib/Arrow.svelte'; import Arrow from '$lib/Arrow.svelte';
function scrollBottom() {
window.scrollTo({
top: document.body.scrollHeight,
behavior: 'smooth',
});
}
</script> </script>
<svelte:head> <svelte:head>
@ -60,9 +67,9 @@
</footer> </footer>
</div> </div>
<div class="absolute bottom-16 h-8 w-8 text-on-primary-token animate-bounce"> <button class="absolute bottom-16 h-8 w-8 text-on-primary-token animate-bounce" on:click={scrollBottom}>
<Arrow /> <Arrow />
</div> </button>
</div> </div>
<div class="project-gradient mx-auto flex justify-center items-center p-16"> <div class="project-gradient mx-auto flex justify-center items-center p-16">