diff --git a/static/PaperCanvas.js b/static/PaperCanvas.js index e6452c7..6580536 100644 --- a/static/PaperCanvas.js +++ b/static/PaperCanvas.js @@ -14,12 +14,13 @@ export class PaperCanvas extends HTMLElement { - + `; @@ -46,6 +47,8 @@ export class PaperCanvas extends HTMLElement { tool.onMouseDown = function (event) { path = new Path() path.strokeColor = "black" + path.strokeWidth = 3 + path.strokeCap = 'round' path.add(event.point) } diff --git a/static/PatternTrainer.js b/static/PatternTrainer.js index 476e53a..23fe015 100644 --- a/static/PatternTrainer.js +++ b/static/PatternTrainer.js @@ -29,31 +29,69 @@ export class PatternTrainer extends HTMLElement {
- +

Train your Scribble Model

+
+
+ +
- - +
`; this.shadow.appendChild(container.content.cloneNode(true)); - this.shadow.getElementById("name").after(this.canvas) + this.shadow.getElementById("canvas-container").appendChild(this.canvas) this.shadow.getElementById("undo").addEventListener("click", () => { this.canvas.undo() }) this.shadow.getElementById("train").addEventListener("click", () => { console.log(this.canvas.linelist) - console.log("name:", this.shadow.getElementById("name").value) + console.log("name:", this.shadow.getElementById("name").innerHTML) this.socket.emit("new dataset", { - name: this.shadow.getElementById("name").value, + name: this.shadow.getElementById("name").innerHTML, list: this.canvas.linelist, }) diff --git a/templates/train.html b/templates/train.html index c1a0c23..bd86dd1 100644 --- a/templates/train.html +++ b/templates/train.html @@ -4,6 +4,7 @@ title +