From 7c288722f7a0e94da1b20ab214d2034d1515e890 Mon Sep 17 00:00:00 2001 From: YuviPanda Date: Sat, 3 Feb 2024 16:21:13 -0800 Subject: [PATCH] Cleanup the menu UI better - Has a hover state and an active state --- js/index.css | 21 +++++++++++-------- js/tooltip.js | 7 ++----- .../static/index.html | 8 +++---- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/js/index.css b/js/index.css index 9eeb0c78..a01c6726 100644 --- a/js/index.css +++ b/js/index.css @@ -32,7 +32,6 @@ body { border-bottom: 1px white; display: flex; align-items: center; - padding: 4px 0px; } #logo { @@ -51,8 +50,8 @@ body { } #menu li { - border-right: 1px white solid; - padding: 8px 8px; + border-right: 1px var(--jupyter-grey) solid; + padding: 12px 0px; } #menu li:last-child { @@ -62,15 +61,20 @@ body { #menu a { color: white; text-decoration: none; + padding: 12px 8px; } -#status-label { - font-weight: normal; +#menu a:hover, +#menu a.active { + background-color: var(--jupyter-medium-grey); +} + +li#status-container { + padding-right: 8px; } -#status { - text-align: center; - flex-grow: 1; +#status-label { + font-weight: normal; } #screen { @@ -97,7 +101,6 @@ body { } .tooltip-container { - display: none; overflow: visible; /* Needed for the arrow to show up */ width: max-content; position: absolute; diff --git a/js/tooltip.js b/js/tooltip.js index c2aec1ad..b4053adb 100644 --- a/js/tooltip.js +++ b/js/tooltip.js @@ -48,11 +48,8 @@ export function setupTooltip(trigger, tooltip) { } trigger.addEventListener("click", (e) => { - if (tooltip.style.display === "block") { - tooltip.style.display = "none"; - } else { - tooltip.style.display = "block"; - } + tooltip.classList.toggle("hidden"); + trigger.classList.toggle("active"); updatePosition(); e.preventDefault(); }); diff --git a/jupyter_remote_desktop_proxy/static/index.html b/jupyter_remote_desktop_proxy/static/index.html index 24a0cf52..688f02a7 100644 --- a/jupyter_remote_desktop_proxy/static/index.html +++ b/jupyter_remote_desktop_proxy/static/index.html @@ -22,12 +22,12 @@ @@ -36,7 +36,7 @@ -
+