Fix linting issues
This commit is contained in:
@@ -94,13 +94,13 @@ export async function importArtWork(store: Store, cords: Coordinates, palette: P
|
|||||||
},
|
},
|
||||||
cb: (name, x, y, confirm) => {
|
cb: (name, x, y, confirm) => {
|
||||||
if (confirm) {
|
if (confirm) {
|
||||||
resolve({ name, pixels, x, y })
|
resolve({ name, pixels, x, y });
|
||||||
} else {
|
} else {
|
||||||
reject(new Error("Canceled by user"));
|
reject(new Error("Canceled by user"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -225,13 +225,13 @@ export async function getImageSettingFromUser(image: HTMLImageElement): Promise<
|
|||||||
<Input
|
<Input
|
||||||
type='number'
|
type='number'
|
||||||
min={1}
|
min={1}
|
||||||
onChange={ev => {processNumberEvent(ev, n => {width = n})}}
|
onChange={ev => {processNumberEvent(ev, n => {width = n;});}}
|
||||||
/>
|
/>
|
||||||
x
|
x
|
||||||
<Input
|
<Input
|
||||||
type='number'
|
type='number'
|
||||||
min={1}
|
min={1}
|
||||||
onChange={ev => {processNumberEvent(ev, n => {height = n})}}
|
onChange={ev => {processNumberEvent(ev, n => {height = n;});}}
|
||||||
/>
|
/>
|
||||||
</div>,
|
</div>,
|
||||||
[
|
[
|
||||||
|
|||||||
+1
-1
@@ -53,7 +53,7 @@ export const Theme = styled.div`
|
|||||||
color: rgb(10, 10, 10);
|
color: rgb(10, 10, 10);
|
||||||
border: 2px solid black;
|
border: 2px solid black;
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
`
|
`;
|
||||||
|
|
||||||
export const Border = styled.div`
|
export const Border = styled.div`
|
||||||
border: 2px solid black;
|
border: 2px solid black;
|
||||||
|
|||||||
+9
-9
@@ -23,7 +23,7 @@ function appendWindow(children: React.ReactNode) {
|
|||||||
document.body.appendChild(rootElement);
|
document.body.appendChild(rootElement);
|
||||||
return () => {
|
return () => {
|
||||||
rootElement.parentElement?.removeChild(rootElement);
|
rootElement.parentElement?.removeChild(rootElement);
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export class UI {
|
export class UI {
|
||||||
@@ -33,11 +33,11 @@ export class UI {
|
|||||||
constructor(private store: Store, private palette: Palette) {
|
constructor(private store: Store, private palette: Palette) {
|
||||||
this.container = document.createElement("div");
|
this.container = document.createElement("div");
|
||||||
const s = this.container.style;
|
const s = this.container.style;
|
||||||
this.container.setAttribute("mod", "pixel-canvas-overlay")
|
this.container.setAttribute("mod", "pixel-canvas-overlay");
|
||||||
s.position = "fixed";
|
s.position = "fixed";
|
||||||
s.zIndex = "1000"
|
s.zIndex = "1000";
|
||||||
s.left = "0px";
|
s.left = "0px";
|
||||||
s.bottom = "0px"
|
s.bottom = "0px";
|
||||||
const container = document.createElement("div");
|
const container = document.createElement("div");
|
||||||
const ss = container.style;
|
const ss = container.style;
|
||||||
this.container.appendChild(container);
|
this.container.appendChild(container);
|
||||||
@@ -89,13 +89,13 @@ export class UI {
|
|||||||
pixels,
|
pixels,
|
||||||
cb: (name, x, y, confirm) => {
|
cb: (name, x, y, confirm) => {
|
||||||
if (confirm) {
|
if (confirm) {
|
||||||
resolve({ name, pixels, x, y })
|
resolve({ name, pixels, x, y });
|
||||||
} else {
|
} else {
|
||||||
reject(new Error("Canceled by user"));
|
reject(new Error("Canceled by user"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
});
|
||||||
const heights = prompt(`Enter name and location [name, x, y]`) || "";
|
const heights = prompt(`Enter name and location [name, x, y]`) || "";
|
||||||
const data = heights.split(",");
|
const data = heights.split(",");
|
||||||
const numbers = [data[1], data[2]].map(e=> parseInt(e.trim(), 10));
|
const numbers = [data[1], data[2]].map(e=> parseInt(e.trim(), 10));
|
||||||
@@ -107,7 +107,7 @@ export class UI {
|
|||||||
x: numbers[0],
|
x: numbers[0],
|
||||||
y: numbers[1],
|
y: numbers[1],
|
||||||
pixels
|
pixels
|
||||||
}
|
};
|
||||||
try {
|
try {
|
||||||
validateMural(mural);
|
validateMural(mural);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -116,7 +116,7 @@ export class UI {
|
|||||||
return mural;
|
return mural;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
private async importFile() {
|
private async importFile() {
|
||||||
const fileInput = new FileInput();
|
const fileInput = new FileInput();
|
||||||
fileInput.setAcceptType(["png", "jpg", "jpeg", ...TEXT_FORMATS]);
|
fileInput.setAcceptType(["png", "jpg", "jpeg", ...TEXT_FORMATS]);
|
||||||
@@ -187,7 +187,7 @@ export class UI {
|
|||||||
canvas.height = getMuralHeight(mural);
|
canvas.height = getMuralHeight(mural);
|
||||||
ctx.drawImage(mural.ref, 0, 0, canvas.width, canvas.height);
|
ctx.drawImage(mural.ref, 0, 0, canvas.width, canvas.height);
|
||||||
const wh = document.createElement("div");
|
const wh = document.createElement("div");
|
||||||
wh.textContent = `Size ${getMuralWidth(mural)}x${getMuralHeight(mural)}`
|
wh.textContent = `Size ${getMuralWidth(mural)}x${getMuralHeight(mural)}`;
|
||||||
const at = document.createElement("div");
|
const at = document.createElement("div");
|
||||||
at.textContent = `At: ${mural.x}x${mural.y}`;
|
at.textContent = `At: ${mural.x}x${mural.y}`;
|
||||||
container.appendChild(h5);
|
container.appendChild(h5);
|
||||||
|
|||||||
Reference in New Issue
Block a user