-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
123 lines (123 loc) · 3.83 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="shortcut icon" href="#">
<link rel="stylesheet" href="style.css">
<title>Selector example</title>
<style>
.selectables-root {
user-select: none;
}
.selectable {
display: inline-block;
margin: 3px;
}
#area-1 .selectable {
background: var(--selectable-area1);
}
#area-2 .selectable {
background: var(--selectable-area2);
}
.selectable.tiny {
width: 15px;
height: 15px;
}
.selectable.small {
width: 30px;
height: 30px;
}
.selectable.regular {
width: 50px;
height: 50px;
}
.selectable.big {
width: 75px;
height: 75px;
}
.selector-rect {
background:
linear-gradient(90deg, #111 50%, transparent 0) repeat-x,
linear-gradient(90deg, #111 50%, transparent 0) repeat-x,
linear-gradient(0deg, #111 50%, transparent 0) repeat-y,
linear-gradient(0deg, #111 50%, transparent 0) repeat-y;
background-size: 7px 1px, 8px 1px, 1px 7px, 1px 7px;
background-position: 0 0, 0 100%, 0 0, 100% 0;
animation: linearGradientMove .4s infinite linear;
opacity: 0.3;
}
.area-1.selector-rect {
background-color: darkslateblue !important;
}
.area-2.selector-rect {
background-color: darkslategrey !important;
}
@keyframes linearGradientMove {
100% {
background-position: 7px 0, -7px 100%, 0 -7px, 100% 7px;
}
}
/* For elements without the "selected" class which we want mark during selection
* to add the "selected" class afterwards.
*/
.mark_add_selected:not(.selected) {
/* Darken the marked elements a bit */
box-shadow: inset 0em 0em 0em 10em rgba(0, 0, 0, 0.3);
}
/* For elements with the "selected" class which we want mark during selection
* for removal of the "selected" class.
*/
.mark_remove_selected.selected {
/* Darken the marked elements a bit */
box-shadow: inset 0em 0em 0em 10em rgba(0, 0, 0, 0.3);
}
#area-1 .selected {
background: var(--selected-area1);
}
#area-2 .selected {
background: var(--selected-area2);
}
.change-selection-mode.add {
color: antiquewhite;
}
#area-1 .change-selection-mode.add {
background: var(--selected-area1);
}
#area-1 .change-selection-mode.remove {
color: darkslategray;
background: var(--selectable-area1);
}
#area-2 .change-selection-mode.add {
background: var(--selected-area2);
}
#area-2 .change-selection-mode.remove {
color: black;
background: var(--selectable-area2);
}
.clear-selected {
background: lightslategray;
}
</style>
</head>
<body>
<div id="areas">
<div id="area-1" class="area">
<div class="buttons">
<button class="clear-selected">Clear selected</button>
<button class="change-selection-mode"></button>
</div>
<div class="selectables-root"></div>
</div>
<div id="area-2" class="area">
<div class="buttons">
<button class="clear-selected">Clear selected</button>
<button class="change-selection-mode"></button>
</div>
<div class="selectables-root"></div>
</div>
</div>
<script type="module" src="example/setup.ts">
</script>
</body>
</html>