Skip to content

Commit c2ca78a

Browse files
committed
Formatting pass
1 parent 2714040 commit c2ca78a

File tree

15 files changed

+54
-32
lines changed

15 files changed

+54
-32
lines changed

editor.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
"private": true,
44
"type": "module",
55
"scripts": {
6-
"lint": "prettier . --ignore-path .gitignore --check && eslint . --ignore-path .gitignore",
7-
"format": "prettier . --ignore-path .gitignore --write && eslint . --ignore-path .gitignore --fix",
6+
"lint": "prettier . --ignore-path .gitignore --check",
7+
"postlint": "eslint . --ignore-path .gitignore",
8+
"format": "prettier . --ignore-path .gitignore --write",
9+
"postformat": "eslint . --ignore-path .gitignore --fix",
810
"test": "npm run check && vitest",
911
"check": "tsc --noEmit",
1012
"dev": "vite",

public/css/editor.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,11 @@ input.focus + label.button--secondary {
8686
linear-gradient(45deg, transparent 75%, rgba(0, 0, 0, 0.2) 75%),
8787
linear-gradient(-45deg, transparent 75%, rgba(0, 0, 0, 0.2) 75%);
8888
background-size: 16px 16px;
89-
background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
89+
background-position:
90+
0 0,
91+
0 8px,
92+
8px -8px,
93+
-8px 0px;
9094
}
9195
.layer__preview--mask {
9296
background-image: none;

public/css/viewer.css

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,18 @@ body {
88
margin: 0;
99
min-height: calc(100vh - 1rem); /* Not sure why this works (: */
1010

11-
font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
12-
Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
11+
font-family:
12+
'Lato',
13+
-apple-system,
14+
BlinkMacSystemFont,
15+
'Segoe UI',
16+
Roboto,
17+
Oxygen,
18+
Ubuntu,
19+
Cantarell,
20+
'Open Sans',
21+
'Helvetica Neue',
22+
sans-serif;
1323
color: var(--text-color);
1424
background: var(--background);
1525
text-align: center;
@@ -178,12 +188,16 @@ input:focus + label.button--primary,
178188
input.focus + label.button--primary input:focus + label.button--secondary,
179189
input.focus + label.button--secondary {
180190
background: #ffbf1d;
181-
box-shadow: 0 1px 2px #3c40434d, 0 1px 3px 1px #3c404326;
191+
box-shadow:
192+
0 1px 2px #3c40434d,
193+
0 1px 3px 1px #3c404326;
182194
}
183195
.button--primary:active,
184196
.button--secondary:active {
185197
background: #ffd567;
186-
box-shadow: 0 1px 2px #3c40434d, 0 2px 6px 2px #3c404326;
198+
box-shadow:
199+
0 1px 2px #3c40434d,
200+
0 2px 6px 2px #3c404326;
187201
}
188202

189203
.button__row {
@@ -339,7 +353,9 @@ input.focus + label.button--secondary {
339353
border-radius: 0px;
340354
-webkit-clip-path: inset(10% round 50%);
341355
clip-path: inset(10% round 50%);
342-
transition: clip-path 0.3s ease, -webkit-clip-path 0.3s ease;
356+
transition:
357+
clip-path 0.3s ease,
358+
-webkit-clip-path 0.3s ease;
343359
}
344360
.icon {
345361
transform: none;

settings.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />

src/editor/canvas.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export async function toUrl(canvas, blob) {
9494
if (blob && canvas.toBlob) {
9595
/** @type {Blob | null} */
9696
const blob = await new Promise((resolve) =>
97-
canvas.toBlob(resolve, 'image/png')
97+
canvas.toBlob(resolve, 'image/png'),
9898
);
9999
return URL.createObjectURL(blob);
100100
} else {
@@ -187,7 +187,7 @@ export class CanvasController {
187187
layer,
188188
canvases.map(({ canvas, size }) => {
189189
return { canvas, size, ctx: canvas.getContext('2d') };
190-
})
190+
}),
191191
);
192192
this.draw(layer);
193193
}

src/editor/export.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ async function download(controller) {
6060
if (url.startsWith('blob:')) {
6161
URL.revokeObjectURL(url);
6262
}
63-
})
63+
}),
6464
);
6565

6666
try {

src/editor/layer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export async function layersFromFiles(files) {
2525
const layer = createLayer('#ffffff', img);
2626
layer.name = file.name;
2727
return layer;
28-
})
28+
}),
2929
);
3030
}
3131

src/editor/main.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const template = document.querySelector('.layer__template');
2626
const options = document.querySelector('.options');
2727
/** @type {NodeListOf<HTMLDivElement>} */
2828
const canvasContainers = document.querySelectorAll(
29-
'.icon__mask, .icon__original'
29+
'.icon__mask, .icon__original',
3030
);
3131

3232
/** @type {import("./history.js").History} */
@@ -53,21 +53,21 @@ function createCanvases(preview) {
5353

5454
/** @type {HTMLCanvasElement} */
5555
const backgroundPreview = document.querySelector(
56-
'.layer__preview--background'
56+
'.layer__preview--background',
5757
);
5858
const canvases = createCanvases(backgroundPreview);
5959

6060
layers.set(
6161
document.querySelector('input[name="layer"][value="background"'),
62-
background
62+
background,
6363
);
6464

6565
const newLayer = copyLayer(background);
6666

6767
history = new History(
6868
newLayer,
6969
document.querySelector('input[name="layer"][value="background"'),
70-
0
70+
0,
7171
);
7272

7373
controller.add(background, canvases);
@@ -305,18 +305,18 @@ if (window.EyeDropper) {
305305

306306
for (const element of document.querySelectorAll('.toggle--layers')) {
307307
element.addEventListener('click', () =>
308-
document.body.classList.toggle('open')
308+
document.body.classList.toggle('open'),
309309
);
310310
}
311311

312312
{
313313
const exportDialog = new DialogManager(
314-
document.querySelector('.export-dialog')
314+
document.querySelector('.export-dialog'),
315315
);
316316
const lazyLoadSetup = lazy(() =>
317317
import('./export.js').then(({ setupExportDialog }) => {
318318
exportDialog.setupContent = () => setupExportDialog(controller);
319-
})
319+
}),
320320
);
321321

322322
for (const element of document.querySelectorAll('.toggle--export')) {

src/viewer/dialog.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export class DialogManager {
1212
* Title of the dialog, will be focused on when dialog is opened.
1313
*/
1414
this.title = dialog.querySelector(
15-
`#${dialog.getAttribute('aria-labelledby')}`
15+
`#${dialog.getAttribute('aria-labelledby')}`,
1616
);
1717
/**
1818
* @type {NodeListOf<HTMLElement>}

src/viewer/libs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ if (document.monetization && ad) {
4242
}
4343
document.monetization.addEventListener(
4444
'monetizationstart',
45-
onMonetizationStart
45+
onMonetizationStart,
4646
);
4747
}

src/viewer/upload-icon.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,25 +82,25 @@ if (fileInput) {
8282
fileInput.addEventListener(
8383
'change',
8484
() => updateDisplayedIcon(fileInput.files[0]),
85-
pas
85+
pas,
8686
);
8787
// Update the displayed icon when a file is dropped in
8888
fileDrop.addEventListener(
8989
'filedrop',
9090
(evt) => updateDisplayedIcon(evt.files[0]),
91-
pas
91+
pas,
9292
);
9393

9494
// File input focus polyfill for Firefox
9595
fileInput.addEventListener(
9696
'focus',
9797
() => fileInput.classList.add('focus'),
98-
pas
98+
pas,
9999
);
100100
fileInput.addEventListener(
101101
'blur',
102102
() => fileInput.classList.remove('focus'),
103-
pas
103+
pas,
104104
);
105105
}
106106

tsconfig.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"tests/**/*",
66
"src/missing-types.d.ts",
77
"*.mjs",
8-
"*.cjs"
8+
"*.cjs",
99
],
1010
"compilerOptions": {
1111
"allowJs": true,
@@ -20,6 +20,6 @@
2020
"noEmit": true,
2121
"baseUrl": ".",
2222
"types": ["node", "vite/client", "vite-plugin-pwa/client"],
23-
"lib": ["dom", "dom.iterable", "es2015", "es2018.promise"]
24-
}
23+
"lib": ["dom", "dom.iterable", "es2015", "es2018.promise"],
24+
},
2525
}

vite.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default defineConfig({
3333
},
3434
}),
3535
webfont(
36-
'https://fonts.googleapis.com/css2?family=Lato:wght@400;900&display=swap'
36+
'https://fonts.googleapis.com/css2?family=Lato:wght@400;900&display=swap',
3737
),
3838
pwa({
3939
manifest: false,

0 commit comments

Comments
 (0)