-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
editor.html
225 lines (215 loc) · 9.99 KB
/
editor.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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Maskable.app Editor</title>
<link href="/css/viewer.css" rel="stylesheet" />
<link href="/css/editor.css" rel="stylesheet" />
<script type="module" src="/src/viewer/libs.js"></script>
<script type="module" src="/src/viewer/change-mask.js"></script>
<script type="module" src="/src/editor/main.js"></script>
<script async src="https://media.ethicalads.io/media/client/ethicalads.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
{{> meta }}
</head>
<body>
<button class="scrim toggle--layers" aria-hidden="true" aria-label="Close layers sidebar"></button>
<file-drop accept="image/*" multiple id="icon_drop" class="body icon__file-drop drop">
<main>
{{> navbar page="editor" }}
<article class="viewer">
<div class="button__row">
<button type="button" class="button--secondary toggle--layers small" aria-controls="layersSidebar">
Layers
</button>
<button type="button" class="button--primary toggle--export" name="export" aria-controls="exportModal">
Export
</button>
<button type="button" class="button--primary" name="share">Share</button>
</div>
<section class="icon__grid">
<div class="icon__original editor__preview"></div>
<div class="icon__mask masked editor__preview"></div>
<div class="icon__shadow masked"></div>
</section>
{{> controls }}
<hr />
<aside class="about text">
{{> ad }}
<p class="about__main">
Maskable.app Editor lets you generate maskable PWA icons before adding them to your web app manifest.
</p>
<p class="about__main">
<a class="link" href="https://css-tricks.com/maskable-icons-android-adaptive-icons-for-your-pwa/">
Maskable icons</a
>
allow web developers to specify a full-bleed icon that will be cropped by the user-agent to match other
icons on the device. On Android, this lets developers get rid of the default white background around their
icons and use the entire provided space by generating adaptive icons.
</p>
{{> github }} {{> donate}}
</aside>
</article>
</main>
<aside class="layers" id="layersSidebar">
<h2>Layers</h2>
<div class="button__row">
<input type="file" accept="image/*" class="hidden-offscreen" id="icon_file" name="upload" multiple />
<label for="icon_file" class="button--primary"> Upload </label>
<button type="button" class="button--primary" name="add">Add</button>
</div>
<ul class="layers__list">
<li class="layer">
<label class="layer__preview-button">
<input name="layer" type="radio" value="background" class="layer__radio" checked />
<canvas class="layer__preview layer__preview--background" height="64" width="64"></canvas>
<input class="layer__name" type="text" name="name" aria-label="Layer name" value="Background" disabled />
</label>
</li>
</ul>
<template class="layer__template">
<li class="layer">
<label class="layer__preview-button">
<input name="layer" type="radio" value="{{id}}" class="layer__radio" />
<canvas class="layer__preview" height="64" width="64"></canvas>
<input class="layer__name" type="text" name="name" aria-label="Layer name" />
</label>
</li>
</template>
<form class="options">
<p class="info info--background">
This layer cannot be deleted or made translucent as maskable icons should always be opaque.
</p>
<label class="control">
<span class="control__label">Padding</span>
<input class="control__input" type="range" name="padding" min="-30" max="60" step="5" value="0" disabled />
<span class="control__preview" data-suffix="%"></span>
</label>
<label class="control">
<span class="control__label">X</span>
<input class="control__input" type="range" name="x" min="-200" max="200" step="1" value="0" />
<span class="control__preview" data-suffix="%"></span>
</label>
<label class="control">
<span class="control__label">Y</span>
<input class="control__input" type="range" name="y" min="-200" max="200" step="1" value="0" />
<span class="control__preview" data-suffix="%"></span>
</label>
<label class="control">
<span class="control__label">Rotation</span>
<input class="control__input" type="range" name="rotation" min="0" max="360" step="1" value="0" />
<span class="control__preview" data-suffix="°"></span>
</label>
<div class="control accent--fill">
<span class="control__label">
<label for="color">Color</label>
<button type="button" name="eyedropper" class="control__helper button--small" hidden>
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24">
<path
d="M21.42 6.34l-3.75-3.75-3.82 3.82-1.94-1.91-1.41 1.41 1.42 1.42L3 16.25V21h4.75l8.92-8.92 1.42 1.42 1.41-1.41-1.92-1.92 3.84-3.83zM6.92 19L5 17.08l8.06-8.06 1.92 1.92L6.92 19z"
/>
</svg>
<span class="hidden-offscreen">Eyedropper</span>
</button>
</span>
<input class="control__input" id="color" type="color" name="fill" value="#448AFF" />
<input type="text" name="fill" class="control__preview" aria-label="Color Code" />
</div>
<label class="control accent--fill">
<span class="control__label">Color strength</span>
<input class="control__input" type="range" name="alpha" min="0" max="100" step="1" value="100" disabled />
<span class="control__preview" data-suffix="%"></span>
</label>
<fieldset class="control--radio" name="fit" disabled>
<legend class="control__label">Fit</legend>
<p class="info info--fit">No effect on color layers</p>
<label>
<input type="radio" name="fit" value="contain" checked />
Contain
</label>
<label>
<input type="radio" name="fit" value="cover" />
Cover
</label>
<label>
<input type="radio" name="fit" value="fill" />
Fill
</label>
</fieldset>
<button type="button" class="button--secondary" name="delete">Delete</button>
</form>
</aside>
<dialog class="export-dialog" id="exportModal" role="dialog" aria-modal="true" aria-labelledby="modalTitle">
<h2 id="modalTitle" tabindex="0">Export</h2>
<form id="exportSizes" method="dialog">
<button
type="button"
class="button--small close-button toggle--export"
name="cancel"
aria-label="Close export dialog"
>
×
</button>
<div class="row">
<label class="mask__option mask__option--max">
<input type="checkbox" name="sizes" value="-1" autocomplete="off" checked />
Max size (<span id="maxSize">1024x1024</span>)
</label>
</div>
<div class="row">
<label class="mask__option">
<input type="checkbox" name="sizes" value="48" autocomplete="off" />
48x48
</label>
<label class="mask__option">
<input type="checkbox" name="sizes" value="72" autocomplete="off" />
72x72
</label>
<label class="mask__option">
<input type="checkbox" name="sizes" value="96" autocomplete="off" />
96x96
</label>
<label class="mask__option">
<input type="checkbox" name="sizes" value="128" autocomplete="off" />
128x128
</label>
<label class="mask__option">
<input type="checkbox" name="sizes" value="192" autocomplete="off" />
192x192
</label>
<label class="mask__option">
<input type="checkbox" name="sizes" value="384" autocomplete="off" />
384x384
</label>
<label class="mask__option">
<input type="checkbox" name="sizes" value="512" autocomplete="off" />
512x512
</label>
</div>
<div class="row mask__json-view">
<details class="mask__json-view__details">
<summary class="mask__json-view__summary">Show JSON</summary>
<pre class="mask__json-view__preview">Select some size to display the JSON preview</pre>
<div class="mask__json-view-info">
Copy this JSON into the <code>"icons"</code> array of your
<a
target="_blank"
rel="noreferrer noopener"
href="https://developer.mozilla.org/en-US/docs/Web/Manifest"
>
Web App Manifest</a
>
</div>
</details>
</div>
<div class="button__row dialog-buttons">
<button type="button" class="button--secondary toggle--export" name="cancel">Cancel</button>
<button type="submit" class="button--primary download-button" name="download">Download</button>
</div>
</form>
</dialog>
<button type="button" class="scrim toggle--export" aria-hidden="true" aria-label="Close export dialog"></button>
</file-drop>
{{> clippaths}}
</body>
</html>