html {
height: 100%;
}
-
body {
height: 100%;
margin: 0;
/* https://stackoverflow.com/a/24392249/12660887 */
position: relative;
}
-
main {
display: flex;
flex-direction: column;
flex-wrap: nowrap;
font-size: 1.25rem;
}
-
-main > div {
- margin-top: 25vh;
- min-height: 500px;
- min-width: 320px;
- max-width: 800px; /*useful for rules display only*/
-}
-
-@media(max-height: 800px) {
- main > div {
- margin-top: 30px;
- }
-}
-
-@media(max-width: 767px) {
- main > div {
- padding: 0 10px;
- }
-}
-
-.author {
- color: darkblue;
- font-style: italic;
-}
-
-#boardContainer {
- margin: 0;
- padding: 0;
- border: none;
-}
-
h1 {
font-size: 2rem;
font-weight: bold;
display: block;
margin: 10px 0;
}
-
h4 {
font-size: 1.5rem;
font-weight: bold;
margin: 10px 0;
color: darkgreen;
}
+a {
+ text-decoration: none;
+}
+.bold {
+ font-weight: bold;
+}
+button {
+ background-color: #757575;
+ border: none;
+ color: white;
+ padding: 10px 15px;
+ text-align: center;
+ text-decoration: none;
+ display: inline-block;
+ font-size: 1em;
+ cursor: pointer;
+ border-radius: 20%;
+ margin: 15px 0;
+}
+button:hover, button.block-btn:hover {
+ background-color: #b11adc;
+}
+button.block-btn {
+ display: block;
+ background-color: #01786F;
+ margin: 0 auto 30px auto; /*TODO: margin-bottom 20px ? */
+ font-size: 2rem;
+ padding: 15px 32px;
+}
+button.cancel-something {
+ background-color: darkred;
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+}
+/* "Sticky footer" */
+#footer {
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ height: 50px;
+ text-align: center;
+}
+@media(max-height: 399px) {
+ #footer {
+ display: none;
+ }
+}
+a.left-link {
+ margin-right: 25px;
+}
+a.right-link {
+ margin-left: 25px;
+}
+#footer a > img {
+ height: 1.2em;
+ display: inline-block;
+ transform: translateY(3px);
+}
+
+main > div {
+ margin-top: 25vh;
+ min-height: 500px;
+ min-width: 320px;
+}
+#gameInfos {
+ max-width: 800px;
+}
+@media(max-height: 800px) {
+ #newGameForm, #gameInfos {
+ margin-top: 30px;
+ }
+}
+@media(max-width: 767px) {
+ main > div {
+ padding: 0 10px;
+ }
+}
#gameInfos,
#boardContainer,
#gameStopped,
#newGameForm {
display: none;
}
-
-.bold {
- font-weight: bold;
+#gameStopped > h1 {
+ margin-bottom: 10px;
}
#gameInfos > .players-info {
text-align: center;
}
-
#gameInfos > .options-info {
text-align: center;
color: #757575;
margin-bottom: 15px;
}
-
#gameInfos > div {
margin: 10px 0;
}
-
#gameInfos > .rules {
color: #732E6C;
}
-
-#gameInfos > .rules > p,
-#gameInfos > .rules > ul,
-#gameInfos > .rules > ol {
+#gameInfos > .rules p,
+#gameInfos > .rules ul,
+#gameInfos > .rules ol {
margin: 10px 0;
}
-
-#gameInfos > .rules > ul {
+#gameInfos > .rules ul {
list-style-type: square;
padding-left: 30px;
}
-#gameInfos > .rules > ol {
+#gameInfos > .rules ol {
list-style-type: numeric;
padding-left: 30px;
}
-
-#gameInfos > .rules > a {
+#gameInfos > .rules a {
padding-bottom: 1px;
border-bottom: 1px dotted black;
}
-
-#gameStopped > h1 {
- margin-bottom: 10px;
+#gameInfos > .rules .author {
+ color: darkblue;
+ font-style: italic;
}
-/* "Sticky footer" */
-#footer {
- position: absolute;
- bottom: 0;
- left: 0;
- right: 0;
- height: 50px;
- text-align: center;
+/* Complete rules (separate page) */
+.full-rules {
+ max-width: 800px;
+ margin: 20px auto;
+ padding: 0 10px;
+ overflow: auto;
}
-
-@media(max-height: 399px) {
- #footer {
- display: none;
- }
+.full-rules > div {
+ margin-bottom: 20px;
}
-
-a.left-link {
- margin-right: 25px;
+.full-rules h1, .full-rules h2, .full-rules h3, .full-rules h4 {
+ font-weight: bold;
+ display: block;
}
-a.right-link {
- margin-left: 25px;
+.full-rules h1 {
+ font-size: 2.5em;
+ margin: 10px 0 20px 0;
}
-
-#footer a > img {
- height: 1.2em;
- display: inline-block;
- transform: translateY(3px);
+.full-rules h2 {
+ color: darkred;
+ font-size: 2em;
+ margin: 10px 0;
}
-
-button {
- background-color: #757575;
- border: none;
- color: white;
- padding: 10px 15px;
+.full-rules h3 {
+ color: darkviolet;
+ font-size: 1.8em;
+ margin: 10px 0;
+}
+.full-rules h4 {
+ color: darkgreen;
+ font-size: 1.5em;
+ margin: 5px 0;
text-align: center;
- text-decoration: none;
- display: inline-block;
- font-size: 1em;
- cursor: pointer;
- border-radius: 20%;
- margin: 15px 0;
}
-
-button:hover, button.block-btn:hover {
- background-color: #b11adc;
+piece.mark {
+ background-image: url('/pieces/mark.svg');
}
-
-button.block-btn {
+piece.mark.transparent {
+ opacity: 0.65;
+}
+.full-rules figure {
display: block;
- background-color: #01786F;
- margin: 0 auto 30px auto; /*TODO: margin-bottom 20px ? */
- font-size: 2rem;
- padding: 15px 32px;
+ overflow: visible;
+ margin-top: 20px;
}
-
-button.cancel-something {
- background-color: darkred;
+.full-rules figure::after {
+ content: '';
display: block;
- margin-left: auto;
- margin-right: auto;
+ clear: both;
+ margin-bottom: 20px;
}
-
-#upLeftInfos {
- position: absolute;
- left: 0;
- top: 0;
+.full-rules .diag {
+ position: relative;
+ margin: 0 auto;
}
-
-#upRightStop {
- position: absolute;
- left: calc(100% - 25px);
- top: 0;
+.full-rules .left {
+ float: left;
}
-#upLeftInfos > svg, #upRightStop > svg {
- width: 25px;
- cursor: pointer;
+.full-rules .right {
+ float: right;
}
-
-@media(max-width: 767px) {
- #upRightStop {
- left: calc(100% - 35px);
- }
- #upLeftInfos > svg, #upRightStop > svg {
- width: 35px;
- }
- #upLeftInfos > svg path, #upRightStop > svg path {
- fill: #999;
- }
+.full-rules figcaption {
+ display: block;
+ text-align: center;
+ clear: both;
+ font-size: 0.9em;
+ color: #0D1C46;
+ font-weight: bold;
+}
+/* TODO: use same CSS for rules and full-rules? */
+.full-rules p, .full-rules ul, .full-rules ol {
+ margin: 10px 0;
+}
+.full-rules ul {
+ list-style-type: square;
+ padding-left: 30px;
+}
+.full-rules ol {
+ list-style-type: numeric;
+ padding-left: 30px;
}
#ng-select {
margin-bottom: 20px;
}
-
/* Options when starting custom game */
.words {
line-height: 0.9em;
.highlight-word {
background-color: lightblue;
}
-
#gameOptions {
text-align: center;
}
-
.option-select, .option-input {
margin: 15px 0 0 0;
}
-
.option-input {
display: inline-block;
margin-right: 10px;
}
-
.option-input input[type=number] {
width: 64px;
}
-
.btn-wrap {
text-align: center;
}
width: inherit;
text-align: center;
}
-
-a {
- text-decoration: none;
-}
-
/* Game link div + custom game "button" */
#gameLink span, #gameLink a, #footer a {
padding-bottom: 1px;
border-bottom: 1px dotted darkgrey;
color: darkred;
}
-
#gameLink span {
display: inline-box;
cursor: pointer;
}
-
#gameLink > p {
margin: 10px 0;
}
-/* Board container (without reserves) */
+/* Board container (with reserves) */
+#boardContainer {
+ position: fixed;
+ width: 100%;
+ height: 100%;
+ left: 0;
+ top: 0;
+ margin: 0;
+ padding: 0;
+ border: none;
+}
+#upLeftInfos {
+ position: absolute;
+ left: 0;
+ top: 0;
+}
+#upRightStop {
+ position: absolute;
+ left: calc(100% - 25px);
+ top: 0;
+}
+#upLeftInfos > svg, #upRightStop > svg {
+ width: 25px;
+ cursor: pointer;
+}
+@media(max-width: 767px) {
+ #upRightStop {
+ left: calc(100% - 35px);
+ }
+ #upLeftInfos > svg, #upRightStop > svg {
+ width: 35px;
+ }
+ #upLeftInfos > svg path, #upRightStop > svg path {
+ fill: #999;
+ }
+}
+/* Playing board (without reserves) */
.chessboard {
position: absolute;
cursor: pointer;
min-width: 200px;
min-height: 200px;
}
-
piece {
position: absolute;
top: 0;
will-change: transform;
pointer-events: none;
}
-
piece.hidden {
display: none;
}
-
/* Drawing of the board */
.chessboard_SVG {
width: 100%;
height: 100%;
}
-
/* Default squares colors (can be overriden or unused) */
.dark-square {
fill: #b58863;
.light-square {
fill: #f0d9b5;
}
-
.in-shadow {
filter: brightness(50%);
}
-
.reserves {
position: absolute;
display: block;
cursor: pointer;
}
-
.reserve-cell {
position: relative;
display: block;
float: left;
}
-
/* Pieces' counter for reserves */
.reserve-num {
color: red;
position: absolute;
display: block;
font-weight: bold;
- /*z-index: 10;*/
}
-
-/* Choices div after a promotion (TODO: do not hide board) */
+/* Choices div after a promotion */
#choices, .choice {
position: absolute;
cursor: pointer;
}
-
/* https://moderncss.dev/custom-select-styles-with-pure-css/ */
:root {
--select-border: #777;
--select-focus: #b11adc;
--select-arrow: var(--select-border);
}
-
select {
appearance: none;
background-color: transparent;
z-index: 1;
outline: none;
}
-
.select {
display: grid;
grid-template-areas: "select";
width: 100%;
margin: auto;
}
-
select, .select::after {
grid-area: select;
}
-
.select::after {
content: "";
justify-self: end;
background-color: var(--select-arrow);
clip-path: polygon(100% 0%, 0 0%, 50% 100%);
}
-
select:focus + .focus {
position: absolute;
top: -1px;
border-radius: inherit;
}
-
/* https://auralinna.blog/post/2018/how-to-create-material-design-like-form-text-fields/ */
.form-field {
display: block;
width: 100%;
}
-
/* https://dev.to/kallmanation/styling-a-checkbox-with-only-css-3o3p */
label.checkbox > input[type="checkbox"] {
display: none;
border-width: 0.1rem;
border-color: gray;
}
-
label.checkbox > input[type="checkbox"]:checked + *::before {
content: "✓";
font-size: 1.1rem;
label.checkbox > input[type="checkbox"]:checked + * {
color: teal;
}
-
-/*label.checkbox {
- color: teal;
-}*/
label.checkbox > span.spacer {
width: 10px;
content: " ";
}
-
/* https://theanam.github.io/css-only-loaders/ ("hour-glass") */
:root{
--loader-width: 70px;
flex-grow: 0;
flex-shrink: 0;
}
-
@keyframes slide {
0% {
transform: translateY(0%);
transform: translateY(0%);
}
}
-
@keyframes spin {
0% {
transform: rotate(0deg);
transform: rotate(360deg);
}
}
-
.loader.hour-glass {
position: relative;
width: var(--loader-width, 100px);
animation: spin var(--animation-duration, 4s) infinite ease-in-out;
margin: 20px auto;
}
-
.hour-glass:before {
content: "";
position: absolute;