From f6b67f9fdf90820c1b7a38f75f596dafbe37c9b0 Mon Sep 17 00:00:00 2001 From: Julien Calixte Date: Sat, 8 Jul 2023 17:43:58 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20(search=20params)=20remove=20title?= =?UTF-8?q?=20when=20display=20is=20pure?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 1 + main.ts | 11 +++++++++++ style.css | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 main.ts diff --git a/index.html b/index.html index 48bba2b..b6da799 100644 --- a/index.html +++ b/index.html @@ -112,5 +112,6 @@ + diff --git a/main.ts b/main.ts new file mode 100644 index 0000000..bace0b1 --- /dev/null +++ b/main.ts @@ -0,0 +1,11 @@ +type TPSSearchParams = { + display?: "pure" | "full" +} + +const params = new URL(document.location.href).searchParams + +const display = params.get("display") + +if (display === "pure") { + document.querySelector("header")?.remove() +} diff --git a/style.css b/style.css index 57d0648..e9e687d 100644 --- a/style.css +++ b/style.css @@ -23,7 +23,7 @@ main { flex-direction: column; justify-content: center; gap: 0; - margin: 0 1rem; + margin: 1rem 1rem 0; } ul {