Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
Echecs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Elarouti Adam
Echecs
Commits
e5a62eeb
Commit
e5a62eeb
authored
4 months ago
by
De Brettes Thomas
Browse files
Options
Downloads
Patches
Plain Diff
Timer
parent
ef698fd7
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/index.js
+10
-0
10 additions, 0 deletions
htdocs/index.js
htdocs/page_acceuil2.html
+16
-4
16 additions, 4 deletions
htdocs/page_acceuil2.html
with
26 additions
and
4 deletions
htdocs/index.js
+
10
−
0
View file @
e5a62eeb
...
@@ -791,6 +791,7 @@ function estEchecEtMat(pieceAttack , rowPiece, colPiece) {
...
@@ -791,6 +791,7 @@ function estEchecEtMat(pieceAttack , rowPiece, colPiece) {
if
(
player
.
isBlackPlayer
===
true
){
if
(
player
.
isBlackPlayer
===
true
){
[
kingRow
,
kingCol
]
=
find_pieces
(
"
K
"
,
board
);
[
kingRow
,
kingCol
]
=
find_pieces
(
"
K
"
,
board
);
}
}
<<<<<<<
Updated
upstream
else
{
else
{
[
kingRow
,
kingCol
]
=
find_pieces
(
"
k
"
,
board
);
[
kingRow
,
kingCol
]
=
find_pieces
(
"
k
"
,
board
);
}
}
...
@@ -901,3 +902,12 @@ function peutIntercepter(kingRow, kingCol, board, attaquant, movesAttaquant) {
...
@@ -901,3 +902,12 @@ function peutIntercepter(kingRow, kingCol, board, attaquant, movesAttaquant) {
}
}
return
false
;
return
false
;
}
}
=======
socket
.
on
(
'
update-timer
'
,
(
gameState
)
=>
{
document
.
getElementById
(
'
player1-time
'
).
textContent
=
gameState
.
player1
.
time
;
document
.
getElementById
(
'
player2-time
'
).
textContent
=
gameState
.
player2
.
time
;
});
>>>>>>>
Stashed
changes
This diff is collapsed.
Click to expand it.
htdocs/page_acceuil2.html
+
16
−
4
View file @
e5a62eeb
...
@@ -4,6 +4,8 @@
...
@@ -4,6 +4,8 @@
<head>
<head>
<meta
charset=
"UTF-8"
>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<link
href=
"https://fonts.googleapis.com/css2?family=Libre+Baskerville&display=swap"
rel=
"stylesheet"
>
<!-- Ajout de la police Libre Baskerville -->
<link
href=
"https://fonts.googleapis.com/css2?family=Anton&display=swap"
rel=
"stylesheet"
>
<link
rel=
"stylesheet"
href=
"./bootstrap/css/bootstrap.min.css"
>
<link
rel=
"stylesheet"
href=
"./bootstrap/css/bootstrap.min.css"
>
<link
rel=
"stylesheet"
href=
"style.css"
>
<link
rel=
"stylesheet"
href=
"style.css"
>
<title>
Jeu d'échecs
</title>
<title>
Jeu d'échecs
</title>
...
@@ -11,7 +13,7 @@
...
@@ -11,7 +13,7 @@
<body>
<body>
<nav
class=
"navbar navbar-expand-lg navbar-dark bg-dark"
>
<nav
class=
"navbar navbar-expand-lg navbar-dark bg-dark
fixed-top
"
>
<div
class=
"container-fluid"
>
<div
class=
"container-fluid"
>
<a
class=
"navbar-brand"
href=
"/"
>
Échec ECL
</a>
<a
class=
"navbar-brand"
href=
"/"
>
Échec ECL
</a>
<button
class=
"navbar-toggler"
type=
"button"
data-bs-toggle=
"collapse"
<button
class=
"navbar-toggler"
type=
"button"
data-bs-toggle=
"collapse"
...
@@ -30,7 +32,7 @@
...
@@ -30,7 +32,7 @@
Jeux
Jeux
</a>
</a>
<ul
class=
"dropdown-menu"
aria-labelledby=
"navbarDropdown"
>
<ul
class=
"dropdown-menu"
aria-labelledby=
"navbarDropdown"
>
<li><a
class=
"dropdown-item"
href=
"page_
jeu
.html"
>
Echecs
</a></li>
<li><a
class=
"dropdown-item"
href=
"page_
acceuil2
.html"
>
Echecs
contre un ordinateur
</a></li>
</ul>
</ul>
</li>
</li>
</ul>
</ul>
...
@@ -43,7 +45,7 @@
...
@@ -43,7 +45,7 @@
<div
class=
"col-sm-12 col-md-6 offset-md-3"
>
<div
class=
"col-sm-12 col-md-6 offset-md-3"
>
<div
class=
"alert d-none"
role=
"alert"
id=
"turn-message"
></div>
<div
class=
"alert d-none"
role=
"alert"
id=
"turn-message"
></div>
<div
id=
"echec-message"
role =
"alert"
class=
"card mb-3 d-none text-black"
>
Échec !
</div>
<div
class=
"card mb-3"
id=
"user-card"
>
<div
class=
"card mb-3"
id=
"user-card"
>
<div
class=
"card-body"
>
<div
class=
"card-body"
>
...
@@ -54,7 +56,7 @@
...
@@ -54,7 +56,7 @@
<input
type=
"text"
class=
"form-control"
id=
"username"
minlength=
"2"
maxlength=
"20"
<input
type=
"text"
class=
"form-control"
id=
"username"
minlength=
"2"
maxlength=
"20"
placeholder=
"Saisir votre nom d'utilisateur"
required
>
placeholder=
"Saisir votre nom d'utilisateur"
required
>
</div>
</div>
<button
class=
"btn btn-primary"
id=
"start"
type=
"submit"
>
Créer un salon privé
e
</button>
<button
class=
"btn btn-primary"
id=
"start"
type=
"submit"
>
Créer un salon privé
</button>
</form>
</form>
</div>
</div>
...
@@ -85,12 +87,22 @@
...
@@ -85,12 +87,22 @@
<div
class=
"text-center d-none mt-2"
id=
"restart-area"
>
<div
class=
"text-center d-none mt-2"
id=
"restart-area"
>
<input
class=
"btn btn-primary"
id=
"restart"
type=
"button"
value=
"Rejouer"
>
<input
class=
"btn btn-primary"
id=
"restart"
type=
"button"
value=
"Rejouer"
>
</div>
</div>
<canvas
id=
"chessboard"
class=
"board"
width=
"550"
height=
"550"
></canvas>
</div>
</div>
</div>
</div>
</div>
<div
id=
"timer"
class=
"text-white"
>
<h2>
Joueur 1 :
<span
id=
"player1-time"
>
300
</span>
secondes
</h2>
<h2>
Joueur 2 :
<span
id=
"player2-time"
>
300
</span>
secondes
</h2>
</div>
</div>
<
<<<<<<
Updated
upstream
<
div
id=
"echec-message"
class=
"d-none"
>
Échec !
</div>
<
div
id=
"echec-message"
class=
"d-none"
>
Échec !
</div>
<div
id=
"echec-et-mat-message"
class=
"d-none"
>
Échec et mat !
</div>
<div
id=
"echec-et-mat-message"
class=
"d-none"
>
Échec et mat !
</div>
<canvas
id=
"chessboard"
class=
"board"
width=
"480"
height=
"480"
></canvas>
<canvas
id=
"chessboard"
class=
"board"
width=
"480"
height=
"480"
></canvas>
=======
>>>>>>> Stashed changes
<script
src=
"./jquery/jquery.min.js"
></script>
<script
src=
"./jquery/jquery.min.js"
></script>
<script
src=
"./bootstrap/js/bootstrap.min.js"
></script>
<script
src=
"./bootstrap/js/bootstrap.min.js"
></script>
<script
src=
"/socket.io/socket.io.js"
></script>
<script
src=
"/socket.io/socket.io.js"
></script>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment