-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
167 lines (159 loc) · 8.88 KB
/
index.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Codebreaker Game</title>
<link rel="icon" type="image/svg+xml" href="favicon.svg" sizes="any">
<link rel="icon" type="image/png" href="favicon.png" sizes="32x32">
<link rel="stylesheet" href="styles.css">
</head>
<body>
<noscript>JavaScript is needed. Please enable JavaScript for this page in your browser.</noscript>
<!-- ui template -->
<div id="app">
<h1 class="center">{{ visibleTeamName }}</h1>
<div class="columns p-6">
<!-- Left section containing the team information -->
<aside class="column-17">
<h1 class="title">Teams</h1>
<p class="menu-label">{{ team1.team.name }}:</p>
<ul class="menu-list">
<li v-for="player in team1.team.members">
<span :class="playerCss(player)">{{ player.avatar }} {{ player.playerName }}</span>
</li>
</ul>
<p class="menu-label">{{ team2.team.name }}:</p>
<ul class="menu-list">
<li v-for="player in team2.team.members">
<span :class=" playerCss(player)">{{ player.avatar }} {{ player.playerName }}</span>
</li>
</ul>
<br>
<h1 class="title">Status</h1>
<p class="menu-label">Round: {{ round }}</p>
<p class="menu-label">Phase: {{visiblePhaseName}}</p>
<button @click="initGame" :disabled="anyTeamNeedsPlayer">Restart</button>
</aside>
<!-- Middle section containing the code words -->
<main class="column-66" style="border-left: 1px solid #36363640; border-right: 1px solid #36363640;">
<article>
<section class="columns">
<div class="column-25">
<div class="panel">
<h1 class="panel-head" :class="teamFillClass">{{ visibleKeywords[0] }}</h1>
<p class="panel-block" v-for="code in visibleTeam.word1.hints">{{ code }}</p>
</div>
</div>
<div class="column-25">
<div class="panel">
<h1 class="panel-head" :class="teamFillClass">{{ visibleKeywords[1] }}</h1>
<p class="panel-block" v-for="code in visibleTeam.word2.hints">{{ code }}</p>
</div>
</div>
<div class="column-25">
<div class="panel">
<h1 class="panel-head" :class="teamFillClass">{{ visibleKeywords[2] }}</h1>
<p class="panel-block" v-for="code in visibleTeam.word3.hints">{{ code }}</p>
</div>
</div>
<div class="column-25">
<div class="panel">
<h1 class="panel-head" :class="teamFillClass">{{ visibleKeywords[3] }}</h1>
<p class="panel-block" v-for="code in visibleTeam.word4.hints">{{ code }}</p>
</div>
</div>
</section>
<footer class="columns footer">
<div class="column-50 center">
<p>Wrong guesses of the own team:</p><span
v-for="n in visibleTeam.team.failedOwnDecodings">⚫</span>
</div>
<div class="column-50 center">
<p>Correct guesses of the enemy team:</p><span
v-for="n in visibleTeam.team.correctOtherEncodings">⚪</span>
</div>
</footer>
</article>
<nav class="center">
<ul>
<li class="team1-fill-action" :class="{'is-active': visibleTeamId == 1}" id="team-select-a"
@click="showTeam1">{{ team1.team.name }}
</li>
<li class="team2-fill-action" :class="{'is-active': visibleTeamId == 2}" id="team-select-a"
@click="showTeam2">{{ team2.team.name }}
</li>
</ul>
</nav>
</main>
<!-- Right section containing the current code and its hints -->
<section class="column-17">
<div class="columns">
<div class="column-25">
<div class="panel">
<!-- Current 3-digit code -->
<h1 class="panel-head" :class="teamFillClass">
<div class="code">
<span>{{ visibleCode[0] }}</span>
<span>{{ visibleCode[1] }}</span>
<span>{{ visibleCode[2] }}</span>
</div>
</h1>
<!-- 1st line of the 3-digit code -->
<div class="panel-block">
<input type="text" v-model.trim="visibleHints[0]" :class="teamBorderClass" id="hint1"
:placeholder="hintPlaceholder[0]" :disabled="isHintInputDisabled">
<!-- Dropdown for guess of own team -->
<select id="guess1" v-model="visibleGuess1" @change="guessChanged"
:class="teamFillActionClass" :disabled="isCodeGuessDisabled">
<option value="">▼</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
</div>
<!-- 2nd line of the 3-digit code -->
<div class="panel-block">
<input type="text" v-model.trim="visibleHints[1]" :class="teamBorderClass" id="hint2"
:placeholder="hintPlaceholder[1]" :disabled="isHintInputDisabled">
<!-- Dropdown for guess of own team -->
<select id="guess2" v-model="visibleGuess2" @change="guessChanged"
:class="teamFillActionClass" :disabled="isCodeGuessDisabled">
<option value="">▼</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
</div>
<!-- 3rd line of the 3-digit code -->
<div class="panel-block">
<input type="text" v-model.trim="visibleHints[2]" :class="teamBorderClass" id="hint3"
:placeholder="hintPlaceholder[2]" :disabled="isHintInputDisabled">
<!-- Dropdown for guess of own team -->
<select id="guess3" v-model="visibleGuess3" @change="guessChanged"
:class="teamFillActionClass" :disabled="isCodeGuessDisabled">
<option value="">▼</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
</div>
<!-- Button to submit -->
<div class="panel-block">
<input type="button" :value="submit_text" @click="submit" :disabled="is_submit_disabled"
class="button-submit" :class="teamFillActionClass">
</div>
</div>
</div>
</div>
</section>
</div>
<footer>Version {{ version }}</footer>
</div>
<!-- code logic -->
<script type="module" src="logic.mjs"></script>
</body>
</html>