This commit is contained in:
brausjonas
2023-07-07 19:49:08 +02:00
parent 2ceced438b
commit d4b9e8eee3
3 changed files with 72 additions and 39 deletions
+18 -33
View File
@@ -622,39 +622,6 @@ export default function Drawing(p) {
gap: 5
}}>
{/*open button*/}
<button style={{
padding: 10,
backgroundColor: "white",
borderRadius: 15,
marginLeft: 10,
boxShadow: "0 0 5px gray",
borderWidth: 0,
width: 100,
height: 60,
pointerEvents: "auto"
}}
onClick={onOpenButtonClick}>
Open
</button>
<input onChange={() => {
let file = fileInput.files[0]
let reader = new FileReader()
reader.onload = e => {
let image = new Image()
image.onload = () => {
context.clearRect(0, 0, p.width, p.height)
context.drawImage(image, 0, 0)
}
image.src = e.target.result
}
reader.readAsText(file)
}} id={"fileInput"} type={"file"} accept={".redraw"}
style={{pointerEvents: "auto", display: "none"}}/>
{/*save button*/}
<button style={{
padding: 10,
@@ -729,6 +696,24 @@ export default function Drawing(p) {
}}>
Save / Home
</button>
{/*home button*/}
<button style={{
padding: 10,
backgroundColor: "white",
borderRadius: 15,
marginLeft: 10,
boxShadow: "0 0 5px gray",
borderWidth: 0,
width: 100,
height: 60,
pointerEvents: "auto"
}}
onClick={() => {
window.location.reload()
}}>
Discard / Home
</button>
</div>
</div>
</div>