summaryrefslogtreecommitdiff
path: root/pixeled.css
blob: 1cef83ac68cb1c799904ab4777fd2cf833f689d7 (plain)
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
html, body {
	margin: 0;
	padding: 0;
	user-select: none;
	font-size: 10px;
	color: #fff;
}

body {
	overflow: hidden;
}

#app_area {
	display: grid;
	height: 100vh;
	width: 100vw;
}

/* The area behind the grid */
#workspace {
	background: #1e3526 linear-gradient(to right, #000000 -7%, transparent 8%, transparent 92%, #000000 107%);
	display: grid;
	overflow: scroll;
	z-index: 1;
}

/* the canvas we're drawing on in the app */
#grid_container {
	display: grid;
	grid-template-columns: repeat(16, 1fr);
	border: 6px solid #000;
	/* gap: 1px; */
	background: #888;
	aspect-ratio: 1;
	box-shadow: 0 0 3.2rem #000;
	z-index: 10;
	height: 75vmin;
	align-self: center;
	justify-self: center;
}

/* 'pixels' on the canvas itself */
#grid_container > div {
	background: white;
	aspect-ratio: 1;
}

.show_grid > div {
	border-bottom: 1px solid #777;
	border-right: 1px solid #777;
	border-collapse: collapse;
}

#toolbox {
	background: #00000088;
	border: 1px solid #000;
	border-radius: 8px;
	display: grid;
	box-sizing: border-box;
	box-shadow: 0 0 16px #000;
	padding: 6px;
	font-size: 14px;
	font-family: "PT Mono", "Envy Code R", "Liberation Mono", "DejaVu Sans", monospace;
	font-weight: bold;
	position: absolute;
	z-index: 20;
	gap: 8px;
	grid-template-rows: 26px 1fr 60px;
	top: 16px;
	left: 16px;
	width: 184px;
}

#toolbox > header {
	margin: 0;
	padding: 0;
	font-size: 1.3em;
	text-align: center;
	text-shadow: 0 0 3px #000;
	line-height: 26px;
}

#tool_palette {
	display: flex;
	flex-flow: row wrap;
	gap: 3px;
}

#tool_palette div {
	background: url("./ui/green-button.png") no-repeat top left transparent;
	display: grid;
	text-align: center;
	font-weight: bold;
	font-size: 1.3em;
	image-rendering: crisp-edges;
	flex-basis: 40px;
	height: 48px;
}

#tool_palette div:hover {
	background-image: url("./ui/cyan-button.png");
}

#tool_palette > div.selected {
	background: url("./ui/green-button-pressed.png") no-repeat top left;
	image-rendering: crisp-edges;
}

#tool_palette > div.active {
	background: url("./ui/yellow-button-pressed.png") no-repeat top left;
	image-rendering: crisp-edges;
}

#tool_palette div.selected .swatch,
#tool_palette div.active .swatch {
	margin-top: 9px;
}

#tool_palette > div > .swatch {
	aspect-ratio: 1;
	margin: 4px auto 0 auto;
	display: block;
	width: 32px;
	height: 32px;
}

#black_pick > .swatch {
	background: url("./ui/black-pen.png") no-repeat center center;
	background-size: contain;
	image-rendering: crisp-edges;
}

#white_pick > .swatch {
	background: url("./ui/eraser.png") no-repeat center center;
	background-size: contain;
	image-rendering: crisp-edges;
}

#custom_pick > .swatch {
	mask: url("./ui/custom-color-mask.png") no-repeat center center;
	mask-size: contain;
	border: 0;
	padding: 0;
}

#custom_color::-moz-color-swatch {
	background: url("./ui/custom-color.png") no-repeat center center;
	background-size: contain;
	image-rendering: crisp-edges;
	border: 0;
	margin: 0;
	padding: 0;
}

#rainbow > .swatch {
	background: url("./ui/rainbow-pen.png") no-repeat center center;
	background-size: contain;
	image-rendering: crisp-edges;
}

#darken > .swatch {
	background: url("./ui/darken-tool.png") no-repeat center center;
	background-size: contain;
	image-rendering: crisp-edges;
}

#lighten > .swatch {
	background: url("./ui/lighten-tool.png") no-repeat center center;
	background-size: contain;
	image-rendering: crisp-edges;
}

#clear_canvas > .swatch {
	background: url("./ui/blank-canvas.png") no-repeat center center;
	background-size: contain;
	image-rendering: crisp-edges;
}

#grid_toggle > .swatch {
	background: url("./ui/grid-toggle.png") no-repeat center center;
	background-size: contain;
	image-rendering: crisp-edges;
}

#canvas_opts {
	display: grid;
	grid-template-areas:
		"lbl lbl"
		"num slider"
	;
	grid-template-columns: 2.5em auto;
	gap: 0 4px;
}

#canvas_opts > label {
	grid-area: lbl;
}

#canvas_opts input[type=range] {
	grid-area: slider;
	width: 100%;
}

#canvas_opts input[type=text] {
	grid-area: num;
	text-align: center;
	background: #fff8;
	border: 0;
	border-radius: 5px;
}

#canvas_opts input[type=text]:focus {
	border: 1px solid #fff;
}