/
index.html
83 lines (63 loc) · 2.41 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>What the color? - A color game for web developers!</title>
<link rel="icon" href='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y=".9em" font-size="90">🎨</text></svg>'>
<meta name="viewport" content="width=device-width; initial-scale=1.0">
<link rel="stylesheet" href="style.css" />
</head>
<body>
<h1>
What the <span>color?</span>
</h1>
<main>
<p id="timer">00:00.0</p>
<div id="colors">
<div id="solution" class="color" title="Color to guess"></div>
<div id="yourcolor" class="color" title="Your guess"></div>
<output id="proximity" data-label="Proximity">0%</output>
</div>
<div id="attempt_container">
<span class="attempts"><span id="attempt_count">0</span> attempts, <span id="unique_attempt_count">0</span> unique</span>
<div id="progression"></div>
<input id="attempt" placeholder="rgb(), hsl() etc" autofocus />
<code id="hint" class="popup"></code>
</div>
<p id="success" class="message">
Yay! You got it!
<a href="#">Next</a>
</p>
<p id="slow" class="message">
Looks like this color is taking you a bit long. Wanna skip it?
<a href="#">Skip</a>
</p>
<ul class="help">
<li>Any CSS color is valid, whether supported by your browser or not.
This includes named colors, #hex, <code>rgb()</code>, <code>hsl()</code>, <code>oklch()</code> etc.</li>
<li><kbd>↑</kbd><kbd>↓</kbd> to increment/decrement by 1, <kbd>Shift</kbd> + <kbd>↑</kbd><kbd>↓</kbd> to increment/decrement by 10.</li>
</ul>
</main>
<aside id="successes">
<header>
0 colors, 00:00.0 avg, 00:00.0 total
</header>
<div>
</div>
<a href="https://twitter.com/intent/tweet?text=" target="_blank" id="tweet">Tweet score</a>
</aside>
<footer>
Made with ❤️ by <a href="http://lea.verou.me">Lea Verou</a> using <a href="https://colorjs.io">Color.js</a>
• <a href="https://github.com/LeaVerou/whathecolor" target="_blank">Github</a>
</footer>
<script src="js/whathecolor.js" type="module"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-25106441-4', 'verou.me');
ga('send', 'pageview');
</script>
</body>
</html>