Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
projet-cdaw
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thibaut Felten
projet-cdaw
Commits
1a585a58
Commit
1a585a58
authored
Dec 04, 2020
by
thibaut-felten
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ménage
parent
5085fdff
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
96 deletions
+0
-96
TP3-1.html
TPFront/3_1/TP3-1.html
+0
-33
img.jpg
TPFront/3_1/img.jpg
+0
-0
script.js
TPFront/3_1/script.js
+0
-63
README.md
frontend/src/model/README.md
+0
-0
No files found.
TPFront/3_1/TP3-1.html
deleted
100644 → 0
View file @
5085fdff
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<title>
TP 3.1
</title>
</head>
<body>
<div
id=
"board"
>
<div
id=
"p1"
>
<div
class=
"avatar_info"
><img
id=
"img"
src=
"img.jpg"
/></div>
<div
class=
"hand"
>
<button
class=
"tile"
data-value=
"5"
data-family=
"bamboo"
>
5 b
</button>
<button
class=
"tile"
data-value=
"5"
data-family=
"bamboo"
>
5 b
</button>
<button
class=
"tile"
data-value=
"5"
data-family=
"bamboo"
>
5 b
</button>
</div>
<div
class=
"actionZone"
>
<p>
Action zone
</p>
<div
class=
"pon"
data-turn=
"3"
data-status=
"visible"
>
<button
class=
"tile"
data-value=
"4"
data-family=
"circle"
>
4 c
</button>
<button
class=
"tile"
data-value=
"4"
data-family=
"circle"
>
4 c
</button>
<button
class=
"tile"
data-value=
"4"
data-family=
"circle"
>
4 c
</button>
</div>
</div>
</div>
</div>
<button
id=
"drawForExample"
></button>
<button
id=
"Kan"
>
Kan
</button>
</body>
<script
src=
"script.js"
></script>
</html>
TPFront/3_1/img.jpg
deleted
100644 → 0
View file @
5085fdff
35.1 KB
TPFront/3_1/script.js
deleted
100644 → 0
View file @
5085fdff
var
drawButton
=
document
.
getElementById
(
"drawForExample"
);
var
img
=
document
.
getElementById
(
"img"
);
let
hand
=
document
.
querySelector
(
".hand"
);
let
kanButton
=
document
.
querySelector
(
"#Kan"
);
let
actionZone
=
document
.
querySelector
(
".actionZone"
);
function
draw
(){
console
.
log
(
hand
);
let
tile
=
document
.
createElement
(
"button"
);
tile
.
setAttribute
(
"class"
,
"tile"
);
tile
.
setAttribute
(
"data-value"
,
"5"
);
tile
.
setAttribute
(
"data-family"
,
"bamboo"
);
tile
.
textContent
=
"5 b"
;
console
.
log
(
tile
);
let
newTile
=
hand
.
appendChild
(
tile
);
}
function
countTiles
(){
var
par
=
document
.
querySelector
(
".avatar_info"
);
let
count
=
hand
.
childElementCount
;
let
n
=
document
.
createElement
(
"div"
);
n
.
setAttribute
(
"class"
,
"countIndic"
)
n
.
textContent
=
count
+
" tiles"
;
let
ntnte
=
par
.
appendChild
(
n
);
}
function
deleteCount
(){
var
countIndicator
=
document
.
querySelector
(
".countIndic"
);
countIndicator
.
remove
();
}
function
kan
(
tiles
){
// let value = tiles[0].dataset.value;
let
value
=
5
;
let
family
=
"bamboo"
;
tiles
.
forEach
(
element
=>
{
element
.
remove
();
});
let
newKan
=
document
.
createElement
(
"div"
);
newKan
.
setAttribute
(
"class"
,
"kan"
);
newKan
.
setAttribute
(
"data-status"
,
"visible"
);
newKan
.
setAttribute
(
"data-turn"
,
"4"
);
let
kanZone
=
actionZone
.
appendChild
(
newKan
);
for
(
let
i
=
0
;
i
<
4
;
i
++
){
let
tile
=
document
.
createElement
(
"button"
);
tile
.
setAttribute
(
"class"
,
"tile"
);
tile
.
setAttribute
(
"data-value"
,
value
);
tile
.
setAttribute
(
"data-family"
,
family
);
tile
.
textContent
=
"5 b"
;
kanZone
.
appendChild
(
tile
);
}
}
drawButton
.
addEventListener
(
"click"
,
()
=>
draw
());
img
.
addEventListener
(
'mouseover'
,
()
=>
countTiles
());
img
.
addEventListener
(
'mouseleave'
,
()
=>
deleteCount
())
kanButton
.
addEventListener
(
'click'
,
()
=>
kan
(
tiles
));
\ No newline at end of file
frontend/src/model/README.md
deleted
100644 → 0
View file @
5085fdff
Binary files a/frontend/src/model/README.md and /dev/null differ
Binary files a/frontend/src/model/README.md and /dev/null differ
Write
Preview
Markdown
is supported
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