diff options
| author | Maksymilian Jopek <maks@jopek.eu> | 2021-10-31 21:36:36 +0100 |
|---|---|---|
| committer | Maksymilian Jopek <maks@jopek.eu> | 2021-10-31 21:36:36 +0100 |
| commit | 373edf54a9ac76fa47e563e8d6f0f16df49c454e (patch) | |
| tree | 31bc9a027d1ce6658758f5678850166720b105bb /src | |
| parent | 27075885e95bd0efc062920685e04287feb4b556 (diff) | |
| download | isiqandisi-373edf54a9ac76fa47e563e8d6f0f16df49c454e.tar.gz isiqandisi-373edf54a9ac76fa47e563e8d6f0f16df49c454e.tar.zst isiqandisi-373edf54a9ac76fa47e563e8d6f0f16df49c454e.zip | |
v1.0.0
Diffstat (limited to 'src')
| -rw-r--r-- | src/modules/Chit.ts | 15 | ||||
| -rw-r--r-- | src/modules/Fridge.ts | 2 | ||||
| -rw-r--r-- | src/styles/main.css | 10 |
3 files changed, 19 insertions, 8 deletions
diff --git a/src/modules/Chit.ts b/src/modules/Chit.ts index 7d7169a..e475eba 100644 --- a/src/modules/Chit.ts +++ b/src/modules/Chit.ts @@ -69,6 +69,8 @@ export default class Chit { moveOrResize(e: MouseEvent, what: "mov" | "res") { e.stopPropagation() const [sx, sy] = [e.x, e.y] + const [ssx, ssy] = [this.#left, this.#top] + const [ssw, ssh] = [this.#width, this.#height] let top = this.#top, left = this.#left, width = this.#width, height = this.#height; this.color = this.cCol; this.#fridge.makeTrans(this); @@ -82,25 +84,24 @@ export default class Chit { if (ee.x !== ee.clientX) throw new Error("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") if (what === "mov") { - top = this.#top - dy; - left = this.#left - dx; + top = ssy - dy; + left = ssx - dx; this.#div.style.top = top + 'px'; this.#div.style.left = left + 'px'; } else { const m = 150; - width = this.#width - dx > m ? this.#width - dx : m - height = this.#height - dy > m ? this.#height - dy : m + width = ssw - dx > m ? ssw - dx : m + height = ssh - dy > m ? ssh - dy : m this.#div.style.width = width + "px" this.#div.style.height = height + "px" } - } - - const stopRes = () => { this.top = top this.left = left this.width = width this.height = height + } + const stopRes = () => { this.color = this.nCol; this.save() document.onmousemove = () => null diff --git a/src/modules/Fridge.ts b/src/modules/Fridge.ts index 7137f6d..f920ad0 100644 --- a/src/modules/Fridge.ts +++ b/src/modules/Fridge.ts @@ -17,7 +17,7 @@ export default class Fridge { location.href = "/" return; } - // sessionStorage.clear() + sessionStorage.clear() const fdb = JSON.parse(f) as FridgeFromDb; if (fdb.mileage != null && fdb.cs != null) { diff --git a/src/styles/main.css b/src/styles/main.css index 3dc2cef..8f49142 100644 --- a/src/styles/main.css +++ b/src/styles/main.css @@ -20,12 +20,22 @@ body { .chit { border: 1px solid black; position: absolute; + user-select: none; + -webkit-user-drag: none; + -khtml-user-drag: none; + -moz-user-drag: none; + -o-user-drag: none; } .txt { width: 90%; height: 90%; margin: 5%; overflow: auto; + user-select: none; + -webkit-user-drag: none; + -khtml-user-drag: none; + -moz-user-drag: none; + -o-user-drag: none; } .edit { position: absolute; |
