From 85d2a7da62a5656974643ce345f0962d2634b04d Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Fri, 7 Oct 2022 11:15:32 +0100 Subject: [PATCH] Hide some words in top-level menu items on small viewports In their normal state, most of the top-level menu items are a verb and an object, like "Undo move". This is admirably clear, but on a small screen the menu can take a lot of space. In each case the verb alone is sufficient to know what the button does, so use a media query to suppress the noun is the viewport is very narrow. "Very narrow" here is roughly where the menus would overflow onto four lines in my browser. --- html/jspage.pl | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/html/jspage.pl b/html/jspage.pl index 99ec85d..574f255 100755 --- a/html/jspage.pl +++ b/html/jspage.pl @@ -129,6 +129,14 @@ EOF background: inherit; } +\@media (max-width:18em) { + /* Suppress some words in top-level menu items when viewport + * is very small */ + .verbiage { + display: none; + } +} + #gamemenu ul ul { /* Second-level menus and below are not displayed by default */ display: none; @@ -211,11 +219,11 @@ ${unfinishedpara} >
  • Type...
  • New game
  • Restart game
  • Undo move
  • Redo move
  • Solve game
  • New game
  • Restart game
  • Undo move
  • Redo move
  • Solve game