-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
81 lines (72 loc) · 3.06 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Contrast Suggest - Accessibility Contrast Ratio Checker</title>
<link rel="stylesheet" href="style.css?v=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta property="og:image" content="thumb.png" />
</head>
<body>
<header>
<div class="container">
<h1>Contrast Suggest</h1>
<h2>Accessibility Contrast Ratio Checker</h2>
</div>
</header>
<main>
<!--
<p class="attention">Attention! the "app" is still a little buggy</p>-->
<div class="container form">
<form action="#">
<fieldset class="fields">
<p><label for="bgcolor">background color</label>
<span class="input"><input type="text" name="" id="bgcolor" value="#ffffff" spellcheck="false" aria-controls="contrast" autocomplete="off" /><span></span></span></p>
<button id="switch"><span class="arrow">←</span> <span class="arrow">→</span> <span class="visuallyhidden">Switch colors</span></button>
<p>
<label for="color">text color</label>
<span class="input"><input type="text" name="" id="color" value="#08c" spellcheck="false" aria-controls="contrast" autocomplete="off" /><span></span></span>
</p>
<div><small>(hex values only)</small></div>
<span id="contrast" role="region" aria-live="polite" aria-atomic="true"><span class="visuallyhidden">Calculated contrast:</span> <span id="grade"></span></span>
<span id="messages"></span>
<div><label for="reco">Closest text color with enough contrast:</label> <button disabled id="reco">#007dc0</button></div>
</fieldset>
</form>
<table id="levels">
<caption>wcag 2.0 levels / color ranges:</caption>
<thead>
<tr>
<th>level</th>
<th>darkest</th>
<th>lightest</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<ul id="legend"></ul>
<p>darkest tones of wcag 2.0 levels + selected text and backgound colors:</p>
<ul id="pallette">
</ul>
</div>
</main>
<footer>
<div class="container">
<p>Accessibility contrast ratio checker: insert background and text color to the fields. The calculated contrast ratio will appear. If the contrast ratio is bellow 4.5, a suggested darker/lighter text color will appear.</p>
<p>The idea and the design are based on Lea Verou's excellent <a href="http://leaverou.github.io/contrast-ratio/">contrast ratio checker</a></p>
</div>
<p>© 2017 <a href="https://il.linkedin.com/in/laviperchik" target="_blank">Lavi Perchik</a></p>
</footer>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="script.js?v=1"></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','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-98646058-1', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>