From 106a64ea4fbd70da20e8f75da94cbb50acd42367 Mon Sep 17 00:00:00 2001 From: babakfp Date: Mon, 18 Oct 2021 13:09:52 +0330 Subject: [PATCH] [tutorial-ui] Beautified nav and menu - Added a new package called svelte-outclick - Replaced the select box with a new custom menu - Paid attention to the menu accessibility -- hover -- focus-within -- handle click(toggle) -- outclick -- inner click -- selected item auto position correction -- disabled user-select and user-drag --- site/package.json | 3 +- .../tutorial/[slug]/_TableOfContents.svelte | 239 ++++++++++++++---- 2 files changed, 187 insertions(+), 55 deletions(-) diff --git a/site/package.json b/site/package.json index 812460edfe..49c8e0dde2 100644 --- a/site/package.json +++ b/site/package.json @@ -56,7 +56,8 @@ "rollup-plugin-terser": "^7.0.0", "sapper": "^0.29.3", "shelljs": "^0.8.3", - "svelte": "^3.39.0" + "svelte": "^3.39.0", + "svelte-outclick": "^2.2.1" }, "engines": { "node": ">=10.0.0" diff --git a/site/src/routes/tutorial/[slug]/_TableOfContents.svelte b/site/src/routes/tutorial/[slug]/_TableOfContents.svelte index 1faeb17c1b..547e029c1d 100644 --- a/site/src/routes/tutorial/[slug]/_TableOfContents.svelte +++ b/site/src/routes/tutorial/[slug]/_TableOfContents.svelte @@ -1,94 +1,225 @@