More Input Form

This commit is contained in:
brausjonas
2023-07-07 18:20:50 +02:00
parent ac85fbda21
commit 1025c5b722
3 changed files with 78 additions and 16 deletions
+14
View File
@@ -1,5 +1,6 @@
import './App.css';
import {useEffect, useLayoutEffect, useRef, useState} from "react";
import {Save} from "./Save";
let mouseDownMenuBar = false
let mouseDownCanvas = false
@@ -688,6 +689,19 @@ export default function Drawing(p) {
pointerEvents: "auto"
}}
onClick={() => {
let save = canvas.toDataURL("image/png")
let arrString = localStorage.getItem("save")
if(arrString !== null) {
let json = JSON.parse(arrString)
json.arr.push(new Save(save))
localStorage.setItem("save", JSON.stringify(json))
}
else {
let json = {
arr: [new Save(save)]
}
localStorage.setItem("save", JSON.stringify(json))
}
window.location.reload()
}}>
Home