-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
232 lines (212 loc) · 6.72 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="initial-scale=1.0">
<title>Omnichroma</title>
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<style>
body{
display: flex;
margin: 0;
min-width: fit-content;
min-height: 100vh;
overflow: scroll;
flex-direction: column;
align-items: center;
justify-content: center;
background-color: #000;
font-family: Roboto;
}
.color-canvas{
background-color: #000;
height: 0;
width: 0;
transition: .4s height, .4s width;
border-width: 2px;
border-color: white;
border-style: solid;
margin: 1rem;
image-rendering: -moz-crisp-edges;
image-rendering: pixelated;
user-select: none;
-moz-user-select: none;
}
.button{
padding: .5rem;
margin: .2rem;
border-radius: 1px;
border: 3px #fff solid;
color: #fff;
cursor: pointer;
text-decoration: none;
text-transform: capitalize;
transition: .2s padding, .2s margin;
transition-timing-function: cubic-bezier(0.34, 0.46, 0.4, 1.55);
display: block;
}
.button:hover{
padding: .7rem;
margin: 0;
}
.button:active, .button:focus{
padding: .3rem;
margin: .4rem;
}
.controls{
display: flex;
width: 80vw;
max-width: 1600px;
color: #fff;
align-items: flex-end;
justify-content: space-around;
flex-wrap: wrap;
padding-top: 1em;
padding-bottom: 2em;
}
.controls > *{
margin-bottom: 1rem;
}
label{
position: relative;
width: 120px;
margin-left: .5em;
margin-right: .5em;
}
[data-tooltip]:before{
content: attr(data-tooltip);
position: absolute;
bottom: 100%;
border: 1px solid #fff;
padding: 1em;
margin-bottom: .5em;
width: 200%;
transform: translateX(-50%);
left: 50%;
opacity: 0;
transition: .2s opacity;
background-color: #000;
pointer-events: none;
}
[data-tooltip]:hover:before, [data-tooltip]:focus-within:before{
opacity: 1;
}
.input{
display: block;
width: 100%;
box-sizing: border-box;
padding: 0;
}
.pick-active ~ .random{
display: none;
}
.random-active ~ .pick{
display: none;
}
.title-link{
margin-top: 4vh;
margin-bottom: 4vh;
text-decoration: none;
}
.title{
position: relative;
font-size: 5em;
font-size: calc(5vw + 1em);
color: #fff;
background-color: #000;
text-transform: uppercase;
margin: 0;
}
.title:before{
content: '';
position: absolute;
left: 0;
width: 100%;
height: 100%;
opacity: .8;
mix-blend-mode: multiply;
background-image: url("OmnichromaticTitle.png");
background-position-y: 5600%;
background-size: 600px 99%;
animation-name: scrollBg;
animation-duration: 20s;
animation-iteration-count: infinite;
animation-timing-function: linear;
}
.title:after{
content: '';
height: 100%;
width: 6vw;
left: 100%;
position: absolute;
background-image: url(https://cdnjs.cloudflare.com/ajax/libs/octicons/4.4.0/svg/mark-github.svg);
background-color: white;
filter: invert(100%);
opacity: 0;
background-size: 100% 100%;
background-repeat: no-repeat;
mix-blend-mode: multiply;
}
.title:hover:before{
width: calc(100% + 6vw);
}
.title:hover:after{
opacity: 1;
}
@keyframes scrollBg{
0%{
background-position-x: 0;
}
100%{
background-position-x: -600px;
}
}
</style>
</head>
<body>
<a class="title-link" title="Omnichroma's Github repository" href="https://github.com/Sophmrs/omnichroma"><h1 class="title">Omnichroma</h1></a>
<div class="controls">
<label data-tooltip="Width in pixels of the image to be generated. Larger images need a lot more time to generate.">Width<input class="input" data-js="width" type="text" value="256"></label>
<label data-tooltip="Height in pixels of the image to be generated. Larger images need a lot more time to generate.">Height<input class="input" data-js="height" type="text" value="128"></label>
<label data-tooltip="Number of painters increase the speed the image is generated. However more painters demand more processing power.">Nº Painters<input class="input" data-js="painters" type="number" min="1" value="45"></label>
<label data-tooltip="Changes what anchor is selected next to be painted. Try different ones out. This can be changed during image generation.">Selection Mode
<select class="input" data-js="selectionMode">
<option value="random" selected>Random</option>
<option value="worm">Worm - LIFO</option>
<option value="root">Root - FIFO</option>
</select>
</label>
<label data-tooltip="How color proximity is evaluated. RGB is faster but less correct in terms of human perception.">Color Mode
<select class="input" data-js="colorComparison">
<option value="rgb" selected>RGB</option>
<option value="lab">LAB</option>
</select>
</label>
<label data-tooltip="A single seed however you want or however many seeds you do not control?">Seeding Mode
<select class="input" data-js="seedMode">
<option value="pick" selected>Specific</option>
<option value="random">Random</option>
</select>
</label>
<label data-tooltip="How many seeds should be set." class="random">Nº Seeds<input class="input" data-js="seedQty" type="number" value="5" min="1"></label>
<label data-tooltip="What color is the starting seed?" class="pick">Seed Color<input class="input" data-js="seedColor" type="color" value="#ffffff"></label>
<label data-tooltip="Where should it start?" class="pick">Seed Pos
<select class="input" data-js="seedPos">
<option value="tl">Top left</option>
<option value="tc">Top center</option>
<option value="tr">Top right</option>
<option value="cl">Center left</option>
<option value="cc">Center</option>
<option value="cr">Center right</option>
<option value="bl" >Bottom left</option>
<option selected value="bc">Bottom center</option>
<option value="br">Bottom right</option>
</select>
</label>
</div>
<a class="button" data-js="start">Start</a>
<canvas class="color-canvas" data-js="canvas"></canvas>
<a class="button" data-js="download" download="Omnichromatic.png">Download image</a>
<script src="colors-compiled.js"></script>
</body>
</html>