-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgame.html
101 lines (97 loc) · 5.26 KB
/
game.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<!DOCTYPE html>
<script type="importmap">
{
"imports": {
"vue": "https://unpkg.com/vue@3/dist/vue.esm-browser.js"
}
}
</script>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="UTF-8">
<title>Kniffel</title>
<link id="style1" rel="stylesheet" href="style_game.css">
<link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon/favicon-16x16.png">
<link rel="manifest" href="/favicon/site.webmanifest">
</head>
<body>
<div id="app" class="container">
<h1 class="item">Kniffelspaß!</h1>
<div class="item">
<p class="text" v-if="activePlayer == 0" class="item">Spieler {{player_name_1}} ist am Zug</p>
<p class="text" v-else class="item">Spieler {{player_name_2}} ist am Zug</p>
</div>
<div class="item">
<div class="item" style="flex-flow: column">
<div v-for="button in buttonList" :key="button.id">
<button v-if="button.locked" class="dice"
:style="{ backgroundImage: 'url(images/dice' + button.value + '_marked.png)' }"
@click="holdDice(button.id)" :disabled="allDisabled"> </button>
<button v-else class="dice" :style="{ backgroundImage: 'url(images/dice' + button.value + '.png)' }"
@click="holdDice(button.id)" :disabled="allDisabled"> </button>
</div>
<button v-if="rollCounter<3" class='standard_button' @click="rollDices">Würfeln</button>
<button v-else class='standard_button' @click="rollDices" disabled>Würfeln</button>
</div>
<div class="item">
<table>
<thead>
<tr>
<td class="table_cell"></td>
<td class="table_cell_heading">{{player_name_1}}</td>
<td class="table_cell_heading">{{player_name_2}} </td>
</tr>
</thead>
<tbody>
<tr v-for="score in scoreList.slice(0,6)" :key="score.id">
<td class="table_cell_heading">{{score.name}}</td>
<td class="table_cell"><button class="button_table"
:class="{ 'button_table_possible': score.possible[0]}" :disabled="score.locked[0]"
@click="selectResult(score.id)">{{score.value[0]}}</button></td>
<td class="table_cell"><button class="button_table"
:class="{ 'button_table_possible': score.possible[1]}" :disabled="score.locked[1]"
@click="selectResult(score.id)">{{score.value[1]}}</button></td>
</tr>
<tr v-for="score in scoreList.slice(6,9)" :key="score.id">
<td class="table_cell_heading">{{score.name}}</td>
<td class="table_cell"> {{score.value[0]}} </td>
<td class="table_cell"> {{score.value[1]}} </td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<td class="table_cell"></td>
<td class="table_cell_heading">{{player_name_1}}</td>
<td class="table_cell_heading">{{player_name_2}} </td>
</tr>
</thead>
<tbody>
<tr v-for="score in scoreList.slice(9,16)" :key="score.id">
<td class="table_cell_heading">{{score.name}}</td>
<td class="table_cell"><button class="button_table"
:class="{ 'button_table_possible': score.possible[0]}" :disabled="score.locked[0]"
@click="selectResult(score.id)">{{score.value[0]}}</button></td>
<td class="table_cell"><button class="button_table"
:class="{ 'button_table_possible': score.possible[1]}" :disabled="score.locked[1]"
@click="selectResult(score.id)">{{score.value[1]}}</button></td>
</tr>
<tr v-for="score in scoreList.slice(16)" :key="score.id">
<td class="table_cell_heading">{{score.name}}</td>
<td class="table_cell"> {{score.value[0]}} </td>
<td class="table_cell"> {{score.value[1]}} </td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="item">
<button class="standard_button" @click="exitGame" style="width: 300px">Spiel abbrechen</button>
</div>
</div>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script src="app.js" type="module"></script>
</body>