Commit 4dffc3cd authored by sunye's avatar sunye
Browse files

Add missing Javascript client files

parent 0e1b9d8d
/*
* @Author: Quentin Tonneau
* @Date: 2018-03-19 13:23:50
* @Last Modified by: Quentin Tonneau
* @Last Modified time: 2018-03-19 15:20:20
*/
/**
* Fonction principale executée après le chargement de la page
* Initialise l'échiquier en fonction de la variable "echiquier"
*/
function init(){
const CHESSBOARD_LENGTH = 8;
for(var col = 0; col < CHESSBOARD_LENGTH; col++){
for(var line = 0; line < CHESSBOARD_LENGTH; line++){
var square = boardJSON.board[col][7-line]; // HTML Table lines are inversed
var squareView = document.getElementsByTagName("tr")[line+1].getElementsByTagName("td")[col];
if(square.isEmpty) {
squareView.innerHTML = "";
} else {
squareView.innerHTML = square.piece.symbol;
}
}
}
}
\ No newline at end of file
.chessboard {
border:brown 10px solid;border-collapse: collapse;
}
/* Mise en forme des noms de ligne/colonne */
.chessboard th{
padding:5px;
}
/* Style des cases de l'echiquier */
.chessboard td{
/*Dimensionnement relatif au navigateur*/
width:8vmin;
height:8vmin;
min-height:30px;
min-width:30px;
font-size: 6vmin;
background:chocolate; /*couleur par défaut*/
color:black;
text-align: center;
border : solid 1px grey;
}
/* Gestion des cases blanches */
.chessboard tr:nth-child(even) td:nth-child(even), .chessboard tr:nth-child(odd) td:nth-child(odd) {
background: bisque;
}
/* Gestion des images dans les cases de l'échiquier (option) */
.chessboard td img{
max-width:90%;
max-height:90%;
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment