refactor: replace svh with a more compatible approach (#252)

* first attempt

* second attempt

* blind commit
This commit is contained in:
Spedon
2024-01-23 00:06:42 +08:00
committed by GitHub
parent 44d7da48e3
commit 2fd34c2f7f
2 changed files with 11 additions and 1 deletions

View File

@@ -18,6 +18,16 @@
{{- partial "plugin/style.html" $style -}}
{{- end -}}
{{/* fuck safari */}}
<script>
function z() {
const r = document.querySelector(':root')
r.style.setProperty('--window-height', `${window.innerHeight}px`)
}
z()
window.addEventListener('resize', z, { passive: true })
</script>
{{/* main js */}}
{{- $script := dict "Link" "/bundled/js/main.js" "Defer" true "Esm" true -}}
{{- partial "plugin/script.html" $script -}}