-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
86 lines (77 loc) · 4.16 KB
/
Copy pathindex.html
File metadata and controls
86 lines (77 loc) · 4.16 KB
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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- Primary Meta Tags -->
<title>contrast-color-picker - Drop-in Color Input Replacement</title>
<meta name="title" content="contrast-color-picker - Drop-in Color Input Replacement" />
<meta name="description" content="Web component color picker with WCAG contrast guides" />
<meta name="keywords" content="color-picker, web-component, accessibility, wcag, contrast, canvas, drop-in-replacement, framework-agnostic" />
<meta name="author" content="metaory" />
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website" />
<meta property="og:url" content="https://metaory.github.io/contrast-color-picker/" />
<meta property="og:title" content="contrast-color-picker - Drop-in Color Input Replacement" />
<meta property="og:description" content="Web component color picker with WCAG contrast guides" />
<meta property="og:image" content="https://metaory.github.io/contrast-color-picker/screenshot.png" />
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image" />
<meta property="twitter:url" content="https://metaory.github.io/contrast-color-picker/" />
<meta property="twitter:title" content="contrast-color-picker - Drop-in Color Input Replacement" />
<meta property="twitter:description" content="Web component color picker with WCAG contrast guides" />
<meta property="twitter:image" content="https://metaory.github.io/contrast-color-picker/screenshot.png" />
<!-- Theme Color -->
<meta name="theme-color" content="#ff9988" />
<!-- Demo Styles -->
<link rel="stylesheet" href="/src/demo.css" />
</head>
<body>
<a href="https://github.com/metaory/contrast-color-picker" target="_blank" rel="noopener" class="github-link">
<img src="/github.svg" alt="GitHub" class="github-icon">
</a>
<div id="app">
<div>
<h1>contrast-color-picker</h1>
<p>Web component color picker with WCAG contrast guides. Drop-in replacement for <code><input type="color"></code> with visual contrast indicators.</p>
<h2>Usage</h2>
<p>Click swatch to open picker. Click reference area to change background. Plus signs = acceptable contrast.</p>
<p><code><contrast-color-picker value="#3498db" reference="#ffffff"></contrast-color-picker></code></p>
<div style="display: flex; gap: 2rem; justify-content: center; align-items: flex-start; flex-wrap: wrap;">
<div style="flex: 1; min-width: 300px; text-align: center;">
<h3>Basic</h3>
<contrast-color-picker value="#3498db"></contrast-color-picker>
</div>
<div style="flex: 1; min-width: 300px; text-align: center;">
<h3>With Reference Color</h3>
<contrast-color-picker value="#ff5733" reference="#4411ee"></contrast-color-picker>
</div>
</div>
<!--
<h2>Form Integration</h2>
<p>Works seamlessly in forms:</p>
<form onsubmit="event.preventDefault(); alert('Form submitted with color: ' + document.getElementById('form-color').value)">
<label>
Theme Color: <contrast-color-picker
id="form-color"
name="themeColor"
value="#00ff00"
reference="#ffffff">
</contrast-color-picker>
</label>
<button type="submit">Submit</button>
</form>
<h2>Smart Positioning</h2>
<p>Native popover API handles positioning automatically:</p>
<div style="display: flex; gap: 1rem; flex-wrap: wrap; justify-content: space-between;">
<contrast-color-picker value="#ff0000" reference="#ffffff"></contrast-color-picker>
<contrast-color-picker value="#00ff00" reference="#000000"></contrast-color-picker>
<contrast-color-picker value="#0000ff" reference="#f0f0f0"></contrast-color-picker>
</div>
-->
</div>
</div>
<script type="module" src="/src/main.js"></script>
</body>
</html>