<style>
</style>

<script>
    export let href;

	function click() {
		console.log(href);
		window.scrollTo(0, 0);
        var element = document.getElementById(href);
        var panel = document.querySelector(".panel");
        var elementPosition = element.getBoundingClientRect().top;
        var offsetPosition = elementPosition - panel.scrollHeight;

        window.scrollTo({
             top: offsetPosition,
             behavior: "smooth"
        });
    }
</script>

<span on:click|preventDefault={click}><slot></slot></span>
