Add tuto for query strings

This commit is contained in:
Julien Calixte
2024-05-14 18:45:18 +02:00
parent 1dde2f94ab
commit 0964951354
3 changed files with 37 additions and 10 deletions

View File

@@ -1,13 +1,9 @@
type TPSSearchParams = {
display?: 'house-only' | 'full'
}
const params = new URL(document.location.href).searchParams
const display = params.get('display')
if (display === 'house-only') {
document.querySelector('header')?.remove()
document.querySelectorAll('.hud')?.forEach((hud) => hud.remove())
}
const size = params.get('size')