resize on body resize

This commit is contained in:
cupcakearmy 2020-09-28 16:25:46 +02:00
parent 27e2e41c44
commit 2eb87b2dba
No known key found for this signature in database
GPG Key ID: D28129AE5654D9D9

View File

@ -6,8 +6,14 @@
export let segment
let wrapper
onMount(() => {
function resize() {
wrapper.style.height = `${window.innerHeight}px`
}
onMount(() => {
const listener = window.addEventListener('resize', resize)
resize()
return () => window.removeEventListener(listener)
})
</script>