about summary refs log tree commit diff stats
path: root/js
diff options
context:
space:
mode:
authorelioat <elioat@tilde.institute>2024-01-12 20:46:06 -0500
committerelioat <elioat@tilde.institute>2024-01-12 20:46:06 -0500
commit7aa3e0212b84957cf45f4240fc2fbf5980b49eba (patch)
treefd0634758c79a788c523b8b2522566b871e01726 /js
parent3f6e81d826516509c7097a10a617f9eaa6c5ce1a (diff)
downloadtour-7aa3e0212b84957cf45f4240fc2fbf5980b49eba.tar.gz
*
Diffstat (limited to 'js')
-rw-r--r--js/inknswitch/ink.js25
1 files changed, 16 insertions, 9 deletions
diff --git a/js/inknswitch/ink.js b/js/inknswitch/ink.js
index 62666af..1fbbf7c 100644
--- a/js/inknswitch/ink.js
+++ b/js/inknswitch/ink.js
@@ -7,17 +7,20 @@ noteArea.value = localStorage.getItem('noteContent') || '';
 noteArea.style.width = '100vw';
 noteArea.style.height = '100vh';
 noteArea.style.boxSizing = 'border-box';
-noteArea.style.backgroundColor = 'rgba(255, 255, 255, 0.5)';
+noteArea.style.position = 'absolute';
+noteArea.style.backgroundColor = 'rgba(255, 255, 255, 0.75)';
+noteArea.style.zIndex = '1';
 
 canvas.width = window.innerWidth;
 canvas.height = window.innerHeight;
-canvas.style.position = 'fixed';
+canvas.style.position = 'absolute';
+canvas.style.zIndex = '0';
 
 let drawing = false;
 let prevX = 0;
 let prevY = 0;
 
-canvas.style.display = 'none';
+canvas.style.pointerEvents = 'none'; // Disable mouse events on the canvas
 
 const getCursorPosition = (e) => {
     const rect = canvas.getBoundingClientRect();
@@ -87,17 +90,21 @@ document.addEventListener('keydown', (e) => {
     // Cmd or Ctrl and D key to toggle modes
     if ((e.metaKey || e.ctrlKey) && e.key === 'd') {
         e.preventDefault();
-        if (canvas.style.display === 'none') {
-            canvas.style.display = 'block';
-            noteArea.style.display = 'none';
+        if (canvas.style.pointerEvents === 'none') {
+            canvas.style.pointerEvents = 'auto';
+            noteArea.style.pointerEvents = 'none';
+            noteArea.style.backgroundColor = 'rgba(255, 255, 255, 0.25)';
+            noteArea.style.color = '#bbb';
         } else {
-            canvas.style.display = 'none';
-            noteArea.style.display = 'block';
+            canvas.style.pointerEvents = 'none';
+            noteArea.style.pointerEvents = 'auto';
+            noteArea.style.backgroundColor = 'rgba(255, 255, 255, 0.75)';
+            noteArea.style.color = 'black';
         }
     }
 
     // C key to clear the canvas
-    if (e.key === 'c' && canvas.style.display === 'block') {
+    if (e.key === 'c' && canvas.style.pointerEvents === 'auto') {
         const confirmClear = confirm('Do you really want to clear the canvas?');
         if (confirmClear) {
             ctx.clearRect(0, 0, canvas.width, canvas.height);
h <boothj5@gmail.com> 2014-01-20 18:40:48 +0000 WIP - /statuses command options' href='/danisanti/profani-tty/commit/tests/test_server_events.c?id=a7a28506376ff3ddf9eef5a6b3b140f8cb9c1da7'>a7a28506 ^
a2c62117 ^


0e2fbeb3 ^
8ebc1d4a ^
0e2fbeb3 ^
a7a28506 ^




a7a28506 ^

a2c62117 ^

ae08e820 ^
0e2fbeb3 ^
a2c62117 ^


0e2fbeb3 ^
8ebc1d4a ^
a7a28506 ^





a7a28506 ^

a2c62117 ^

ae08e820 ^
a7a28506 ^
a2c62117 ^


0e2fbeb3 ^
8ebc1d4a ^
0e2fbeb3 ^
a7a28506 ^

5afb296e ^
95ad5643 ^








51bd4ed3 ^
8aba52f4 ^
9bd2315d ^
95ad5643 ^
9bd2315d ^
95ad5643 ^



f180925c ^



51bd4ed3 ^

f180925c ^

8aba52f4 ^
f180925c ^





1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100