forked from ilesar/pickr-game
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
161 lines (143 loc) · 3.7 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
<style>
html, body {
margin: 0;
color: white;
font-family: "Roboto", sans-serif;
font-size: 11px;
}
.hidden {
opacity: 0;
transition: opacity 0.3s ease-in-out;
}
.score-wrapper {
transition: opacity 0.3s ease-in-out;
}
.container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
min-height: 100vh;
}
.scene {
display: flex;
position: relative;
margin-top: 0px;
flex-direction: column;
justify-content: center;
align-items: center;
transition: all 0.3s ease-in-out;
}
.scene-game {
position: relative;
z-index: -2;
bottom: 10px;
left: 80px;
}
.task-wrapper {
position: fixed;
bottom: 12px;
left: 80px;
color: #333;
transform: translateY(0px);
transition: all 1s ease-in-out;
}
.task-wrapper.hidden {
transform: translateY(100px);
transition: all 1s ease-in-out;
}
.round-wrapper {
position: fixed;
bottom: 12px;
right: 80px;
color: #333;
transform: translateY(0px);
transition: all 1s ease-in-out;
}
.round-wrapper.hidden {
transform: translateY(100px);
transition: all 1s ease-in-out;
}
#canvas {
position: fixed;
z-index: -1;
left: 0;
top: 0;
width: 100vw;
height: 100vh;
transition: all 0.3s ease-in-out;
pointer-events: none;
}
#canvas.active {
z-index: 100;
left: 60px;
top: 60px;
width: calc(100vw - 120px);
height: calc(100vh - 120px);
cursor: url(img/pipette.png) 0 40, auto;
pointer-events: all;
}
.title {
font-family: "Times New Roman", serif;
font-size: 64px;
transition: opacity 0.3s ease-in-out;
}
.sub-title {
font-size: 24px;
text-align: center;
line-height: 80px;
}
.score-text {
/*color: #000;*/
font-size: 128px;
}
.button {
margin-top: 30px;
width: 180px;
height: 40px;
line-height: 40px;
background: transparent;
color: #FFF;
border: 1px solid #FFF;
border-radius: 45px;
cursor: url(img/pipette.png) 0 40, auto;
transition: opacity 0.3s ease-in-out;
}
.color-name {
font-weight: 700;
background: #CCC;
border-radius: 45px;
padding: 8px 16px 8px 16px;
margin-left: 4px;
}
</style>
<html>
<head>
<title content="13k"></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div class="container">
<section class="scene scene-game">
<p class="task-wrapper hidden">
Pick the closest color to <span class="color-name">violet blue</span>
</p>
<p class="round-wrapper">
</p>
</section>
<section class="scene scene-gradient">
<canvas id="canvas" width="150" height="150"></canvas>
</section>
<section class="scene scene-intro hidden">
<div class="title">pickr</div>
<div class="button start-button">START</div>
</section>
<section class="scene scene-end hidden">
<div class="score-wrapper sub-title">Game over. Your error rate is <br><span class="score-text"></span></div>
<div class="button restart-button">PLAY AGAIN</div>
</section>
</div>
<script src="dist/bundle.js"></script>
</body>
</html>