From 7943cde45ccd9f1d668c6364759c8194f7b4ac0a Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Tue, 11 Oct 2022 23:23:05 -0700 Subject: [PATCH] Add note and fix ctrl click behavior --- index.html | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/index.html b/index.html index bd6b8d1..5cf58e1 100644 --- a/index.html +++ b/index.html @@ -64,6 +64,14 @@ padding: 0 3px; } + kbd { + background: hsl(275deg 25% 85%); + border-radius: 4px; + border: 1px solid hsl(275deg 20% 85%); + box-shadow: 0 1px 1px hsl(275deg 10% 10% / 40%), 0 2px 0 0 hsl(275deg 100% 97% / 70%) inset; + padding: 2px 4px; + } + p.subtitle { font-weight: 700; } @@ -107,6 +115,7 @@

The purpose of this website is to isolate the problem of client-side routing and provide a minimal reference implementation for it.

@@ -160,6 +169,10 @@ // Set event handlers for (const router of routers) { router.addEventListener('click', e => { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return; // Use default behavior if any keyboard modifier is applied to the click + } + e.preventDefault(); route(e.target.dataset.route); }); -- 2.47.3