Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stewan Lheureux
Échecs féeriques
Commits
4dffc3cd
Commit
4dffc3cd
authored
Mar 17, 2020
by
sunye
Browse files
Add missing Javascript client files
parent
0e1b9d8d
Changes
2
Hide whitespace changes
Inline
Side-by-side
client/script.js
0 → 100644
View file @
4dffc3cd
/*
* @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
client/style.css
0 → 100644
View file @
4dffc3cd
.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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment