-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
193 lines (179 loc) · 5.8 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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
<link rel="stylesheet" href="/style.css" />
</head>
<body x-data>
<div id="container-menu" x-show="$store.game.mode === 'menu'">
<div class="title">
<h1>log.io</h1>
</div>
<button @click="$store.game.startGameEasyMode()">
<h2>Zen Mode</h2>
</button>
<button @click="$store.game.startGameMediumMode()">
<h2>Single Mistake</h2>
</button>
<button @click="$store.game.startGameHardMode()">
<h2>Speed Run</h2>
</button>
<button @click="$store.game.startGameBoucleMode()">
<h2>Boucles Only</h2>
</button>
<!-- <button @click="$store.game.lastTest()">
<h2>Last test</h2>
</button> -->
</div>
<div
id="container-main"
x-data="tests"
x-show="$store.game.mode === 'game'"
x-on:keydown.enter.ctrl="runCode"
x-on:keydown.alt.n="newTest"
x-on:keydown.alt.r="restartTest"
x-on:keydown.alt.t="runTest"
>
<div id="container-header">
<!-- <h1>Navigate js data structures</h1> -->
<h1 x-show="$store.game.type == 'hard'" id="timer" x-text="$store.game.timer + 's'"></h1>
</div>
<div id="container-buttons">
<button @click="runCode" title="ctrl + Enter">
<i class="fa-solid fa-terminal" style="font-size: 14px"></i>
<h2>Run</h2>
</button>
<button @click="restartTest" title="alt + R">
<i class="fa-solid fa-sync-alt"></i>
<h2>Reset</h2>
</button>
<button
x-show="!isTestPassed"
x-bind:style="isTestPassed === false && {color: 'red'}"
@click="runTest"
title="alt + T"
>
<i class="fa-solid fa-play"></i>
<h2>Test</h2>
</button>
<button
@click="newTest"
x-bind:style="isTestPassed && {color: 'green'}"
title="alt + N"
x-show="isTestPassed"
>
<i class="fa-solid fa-forward"></i>
<h2>Next</h2>
</button>
<h1 id="goodAnswers" x-text="'Score : ' + $store.game.goodAnswersNb"></h1>
</div>
<div id="container-codes">
<div id="editor-head">
<h3>script</h3>
</div>
<div id="editor"></div>
<div id="console-head">
<h3>console output</h3>
</div>
<div id="console"></div>
</div>
</div>
<script type="module" src="/index.js"></script>
</body>
</html>
<style>
body {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
}
#container-main {
height: 100%;
width: 100%;
padding: 0 10vh 8vh;
display: grid;
grid-template-columns: 1fr;
grid-template-rows: 1fr 1fr 8fr;
grid-template-areas: "header" "buttons" "content";
#container-header {
display: flex;
justify-content: center;
align-items: center;
grid-area: header;
}
#container-buttons {
grid-area: buttons;
display: flex;
justify-content: flex-start;
align-items: center;
#goodAnswers {
font-size: 24px;
margin-left: auto;
margin-right: 30px;
}
}
#container-codes {
grid-area: content;
justify-content: center;
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-rows: 30px 1fr;
grid-template-areas: "header-code header-console" "content-code content-console";
#editor-head {
grid-area: header-code;
background-color: black;
padding-left: 20px;
color: white;
display: flex;
align-items: center;
}
#editor {
grid-area: content-code;
}
#console-head {
grid-area: header-console;
background-color: black;
color: white;
padding-left: 20px;
border-left: 1px solid grey;
display: flex;
align-items: center;
}
#console {
border-left: 1px solid grey;
grid-area: content-console;
}
}
}
#container-menu {
height: 80vh;
width: 60vh;
background-color: black;
border-radius: 25px;
display: flex;
flex-direction: column;
align-items: center;
.title {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 50%;
h1 {
width: 80%;
text-align: center;
}
}
button {
width: 80%;
/* background-color: red; */
margin: 0;
height: 50px;
margin-bottom: 15px;
}
}
</style>