-
Notifications
You must be signed in to change notification settings - Fork 0
/
options.html
58 lines (58 loc) · 1.78 KB
/
options.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
section:not(:last-of-type) { margin-bottom: 24px; }
ul#list, ul#actions { list-style-type: none; display: flex; padding-left: 0; }
ul#list { flex-direction: column; row-gap: 1rem; }
ul#actions { column-gap: 8px; }
#saved { opacity: 0; color: darkgreen; transition: 0.2s ease-out; }
#saved.show { opacity: 0.5; }
ul#list > li { display: flex; flex-wrap: wrap; column-gap: 1rem; row-gap: 6px; }
label { display: flex; gap: 0.5em; }
.field-name { min-width: 6em; text-align: right; }
@media (prefers-color-scheme: dark) {
body { background-color: #222; color: white; }
#saved { color: lightgreen; }
}
</style>
</head>
<body>
<section>
<h3>Rules</h3>
<form>
<ul id="list"></ul>
<ul id="actions">
<li><button id="more" type="button">Add more</button></li>
<li><button type="submit">Save</button></li>
<li><span id="saved">saved</span></li>
</ul>
</form>
</section>
<section>
<h3>Examples</h3>
<ul>
<li><code>*</code> - match everything.</li>
<li><code>example.com</code> – match <code>example.com</code> only.</li>
<li>
<code>*.example.com</code> – match <code>example.com</code> and its subdomains.
</li>
</ul>
</section>
<template id="rule">
<li>
<label>
<span class="field-name">Host</span>
<input type="text" class="host" pattern="(\*\.)?([\w\-_]+\.)*[\w\-_]+|\*">
</label>
<label>
<span class="field-name">Language</span>
<input type="text" class="language">
</label>
</li>
</template>
<script type="module" src="options.js"></script>
</body>
</html>