Maak het schaakveld geschikt voor mobiele apparaten, bewerk de CSS menubar van het schaakspel en voeg comments toe.

main
Roy 2 years ago
parent 0f09d55c20
commit 94251b28de
  1. 146
      chess_gui/public/css/index.css
  2. 1
      chess_gui/public/js/head.js
  3. 26
      chess_gui/views/index.html

@ -1,87 +1,64 @@
/* (C) Roy van Lunsen */ /* (C) Roy van Lunsen */
a { section {
display: block; max-width: max-content;
text-decoration: none;
outline-style: solid;
color: white;
background-image: url(i/tem.png);
} }
ol > li li { * {
display: inline-block; box-sizing: border-box;
width: 32px;
height: 32px;
} }
/* Chess board START */
#y-co { #y-co {
display: flex; display: flex;
flex-flow: column-reverse; /* Order depends on player side #1/3 */ flex-flow: column-reverse; /* Order depends on player side #1/3 */
width: max-content; padding-left: 24px;
} }
.x-row { .x-row {
display: flex; display: flex;
flex-flow: row; /* Order depends on player side #2/3 */ flex-flow: row; /* Order depends on player side #2/3 */
padding-left: 32px;
} }
#x-co { #y-co > li:hover {
display: inline-flex; background-color: green;
flex-flow: row;
width: max-content;
margin-top: 32px;
} }
.x-co { #x-co {
display: inline-block; 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; text-align: center;
width: 32px;
} }
.features, .keys, .values { #x-co > li {
list-style-type: none;
padding: 0; padding: 0;
margin: 0; margin: 0;
} flex: 0 1 32px;
.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;
} }
img { img {
position: relative;
border: 2.5px; border: 2.5px;
height: 32px; max-width: 100%;
border-color: #884b10;
border-color: #592b07;
} }
#emptyx { ol > li li {
width: 40px; flex: 1 1 32px;
height: 36px;
display: flex;
flex-wrap: wrap;
align-content: end;
} }
dl { dl {
display: flex; display: flex;
flex-flow: column-reverse; flex-flow: column-reverse;
max-height: 50vh;
width: max-content; width: max-content;
overflow-y: scroll; overflow-y: scroll;
scrollbar-width: thin; scrollbar-width: thin;
@ -92,6 +69,13 @@ dl li {
flex-flow: column-reverse; /* Order depends on player side #3/3 */ flex-flow: column-reverse; /* Order depends on player side #3/3 */
} }
li.coord {
}
/* Chess board END */
/* Chess move log START */
figure { figure {
display: flex; display: flex;
flex-flow: row; flex-flow: row;
@ -114,13 +98,65 @@ figure img {
color: white; color: white;
} }
/*img.black, img.white {*/
/* border-width: 1px;*/
/* border-color: red;*/
/*}*/
dd.noimg { /* Display text of <dd> and <dt> at the same height when there's no image in <dd> */ dd.noimg { /* Display text of <dd> and <dt> at the same height when there's no image in <dd> */
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
align-content: end; 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 */

@ -31,6 +31,7 @@ function G(i, s, o, r) {
if (i % 8 === 0) { if (i % 8 === 0) {
var li = document.createElement('li'); var li = document.createElement('li');
ol = document.createElement('ol'); ol = document.createElement('ol');
ol.setAttribute('class', 'x-row');
I('y-co').appendChild(li); I('y-co').appendChild(li);
li.appendChild(ol); li.appendChild(ol);
} }

@ -10,21 +10,22 @@
<title>Game of chess</title> <title>Game of chess</title>
</head> </head>
<body> <body>
<h1>New game</h1> <section id="board">
<h2>Replays</h2>
<section> <section>
<h3>
<ul class="features"> <ul class="features">
<li>Options</li> <li><a href="#">New game</a></li>
<li><a href="#">Replays</a></li>
<li><a href="#">Options</a>
<ul class="keys"> <ul class="keys">
<li class="key">Difficulty <li class="key"><div class="setting">Difficulty</div>
<ul class="values"> <ul class="values">
<li><a href="#">Normal</a></li> <li><a href="#">Normal</a></li>
<li><a href="#">Easy</a></li> <li><a href="#">Easy</a></li>
<li><a href="#">Very easy</a></li> <li><a href="#">Very easy</a></li>
</ul> </ul>
</li> </li>
<li class="key">Player side <li class="key"><div class="setting">Player side</div>
<ul class="values"> <ul class="values">
<li><a href="#">White</a></li> <li><a href="#">White</a></li>
<li><a href="#">Black</a></li> <li><a href="#">Black</a></li>
@ -32,24 +33,23 @@
<li><a href="#">Control both</a></li> <li><a href="#">Control both</a></li>
</ul> </ul>
</li> </li>
<!--<li class="key">Advanced <li class="key"><div class="setting">Advanced</div>
<ul class="values"> <ul class="values">
<li><a href="#">Total turn limit</a></li> <li><a href="#">Total turn limit</a></li>
<li><a href="#">Movement loop limit</a></li> <li><a href="#">Movement loop limit</a></li>
<li><a href="#">Tie on only kings moveable</a></li> <li><a href="#">Tie on only kings moveable</a></li>
<li><a href="#">Verbose output</a></li> <li><a href="#">Verbose output</a></li>
</ul> </ul>
</li>--> </li>
</ul> </ul>
</li>
</ul> </ul>
</h3>
</section> </section>
<section id="board">
<ol id="y-co"></ol> <ol id="y-co"></ol>
<!-- [% FOREACH row IN board %]<li><ol>[% FOREACH object IN row %][% IF object.isPiece %]<li id="[% GET object.pco %]" class="coord piece"><img id="[% GET object.id %]" src="i/[% GET object.img %].png" alt="[% GET object.prettyName %] on [% GET object.pco %]" width="32px"></li>[% ELSE %]<li id="[% GET object.pco %]" class="coord empty"></li>[% END %][% END %]</ol></li>[% END %] --> <!-- [% FOREACH row IN board %]<li><ol>[% FOREACH object IN row %][% IF object.isPiece %]<li id="[% GET object.pco %]" class="coord piece"><img id="[% GET object.id %]" src="i/[% GET object.img %].png" alt="[% GET object.prettyName %] on [% GET object.pco %]" width="32px"></li>[% ELSE %]<li id="[% GET object.pco %]" class="coord empty"></li>[% END %][% END %]</ol></li>[% END %]</ol> -->
<ol id="x-co"><li id="emptyx" class="x-co"></li><li class="x-co">A</li><li class="x-co">B</li><li class="x-co">C</li><li class="x-co">D</li><li class="x-co">E</li><li class="x-co">F</li><li class="x-co">G</li><li class="x-co">H</li></ol> <ol id="x-co"><li></li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ol> <!-- List used for x-coordinates. Let me know if there's a better way. -->
</section> </section>
<!--</ol>-->
<script type="text/javascript" src="js/dand.js"></script> <script type="text/javascript" src="js/dand.js"></script>
</body> </body>
</html> </html>

Loading…
Cancel
Save