From 94251b28deb663f0d2ce4a6ae0dfee23d5489a90 Mon Sep 17 00:00:00 2001 From: Roy Date: Wed, 10 May 2023 03:53:33 +0200 Subject: [PATCH] Maak het schaakveld geschikt voor mobiele apparaten, bewerk de CSS menubar van het schaakspel en voeg comments toe. --- chess_gui/public/css/index.css | 146 ++++++++++++++++++++------------- chess_gui/public/js/head.js | 1 + chess_gui/views/index.html | 26 +++--- 3 files changed, 105 insertions(+), 68 deletions(-) diff --git a/chess_gui/public/css/index.css b/chess_gui/public/css/index.css index 8da0a54..5154ad6 100644 --- a/chess_gui/public/css/index.css +++ b/chess_gui/public/css/index.css @@ -1,87 +1,64 @@ /* (C) Roy van Lunsen */ -a { - display: block; - text-decoration: none; - outline-style: solid; - color: white; - background-image: url(i/tem.png); +section { + max-width: max-content; } -ol > li li { - display: inline-block; - width: 32px; - height: 32px; +* { + box-sizing: border-box; } +/* Chess board START */ + #y-co { display: flex; flex-flow: column-reverse; /* Order depends on player side #1/3 */ - width: max-content; + padding-left: 24px; } .x-row { display: flex; flex-flow: row; /* Order depends on player side #2/3 */ + padding-left: 32px; } -#x-co { - display: inline-flex; - flex-flow: row; - width: max-content; - margin-top: 32px; +#y-co > li:hover { + background-color: green; } -.x-co { - display: inline-block; +#x-co { + display: flex; + padding-top: 1em; + margin: 0; + padding-left: 56px; + flex-flow: row nowrap; + list-style-position: inside; + list-style-type: upper-alpha; text-align: center; - width: 32px; } -.features, .keys, .values { - list-style-type: none; +#x-co > li { padding: 0; margin: 0; -} - -.features { - display: grid; -} - -.key { - display: none; -} - -.key .values { - display: none; -} - -h3 > ul:hover .key { - display: inline-block; -} - -.key:hover .values { - display: flex; - flex-flow: column; - position: fixed; + flex: 0 1 32px; } img { - position: relative; border: 2.5px; - height: 32px; - border-color: #884b10; - border-color: #592b07; + max-width: 100%; } -#emptyx { - width: 40px; +ol > li li { + flex: 1 1 32px; + height: 36px; + display: flex; + flex-wrap: wrap; + align-content: end; } dl { display: flex; flex-flow: column-reverse; - max-height: 50vh; width: max-content; overflow-y: scroll; scrollbar-width: thin; @@ -92,6 +69,13 @@ dl li { flex-flow: column-reverse; /* Order depends on player side #3/3 */ } +li.coord { +} + +/* Chess board END */ + +/* Chess move log START */ + figure { display: flex; flex-flow: row; @@ -114,13 +98,65 @@ figure img { color: white; } -/*img.black, img.white {*/ -/* border-width: 1px;*/ -/* border-color: red;*/ -/*}*/ - dd.noimg { /* Display text of
and
at the same height when there's no image in
*/ display: flex; flex-wrap: wrap; align-content: end; } + +/* Chess move log END */ + +/* Chess control panel START */ + +.features, .features ul { /* Custom-made flex navbar-like menu #1/7 */ + padding: 0; + margin: 0; + list-style-type: none; +} + +.features > li { + padding: 2vh; +} + +.features { /* Custom-made flex navbar-like menu #2/7 */ + display: flex; + flex-flow: row; + background-color: #5583; + font-weight: bold; + font-family: sans-serif; + z-index: 1; +} + +.keys { /* Custom-made flex navbar-like menu #3/7 */ + display: flex; + flex-flow: row; +} + +.values { /* Custom-made flex navbar-like menu #4/7 */ + display: none; + width: min-content; +} + +.key { /* Custom-made flex navbar-like menu #5/7 */ + display: none; +} + +.key:hover .values { /* Custom-made flex navbar-like menu #6/7 */ + display: initial; +} + +ul.features > li:hover > ul > li { /* Custom-made flex navbar-like menu #7/7 */ + display: flex; + flex-flow: column; +} + +ul a { + text-decoration: none; + display: block; +} + +div.setting { + +} + +/* Chess control panel END */ diff --git a/chess_gui/public/js/head.js b/chess_gui/public/js/head.js index 6ea6c05..8d0af64 100644 --- a/chess_gui/public/js/head.js +++ b/chess_gui/public/js/head.js @@ -31,6 +31,7 @@ function G(i, s, o, r) { if (i % 8 === 0) { var li = document.createElement('li'); ol = document.createElement('ol'); +ol.setAttribute('class', 'x-row'); I('y-co').appendChild(li); li.appendChild(ol); } diff --git a/chess_gui/views/index.html b/chess_gui/views/index.html index 4603495..f0fe712 100644 --- a/chess_gui/views/index.html +++ b/chess_gui/views/index.html @@ -10,21 +10,22 @@ Game of chess -

New game

-

Replays

+
+
-

-

-
+
    - -
    1. A
    2. B
    3. C
    4. D
    5. E
    6. F
    7. G
    8. H
    + +
    -