diff options
author | Hsieh Chin Fan <pham@topo.tw> | 2024-09-18 23:41:15 +0800 |
---|---|---|
committer | Hsieh Chin Fan <pham@topo.tw> | 2024-09-18 23:52:49 +0800 |
commit | 4cf84d2fe96c004fef3b508ce344885db74917e2 (patch) | |
tree | 87fad915787b4621d0eb2f3e9086f54afdffa5a4 /src/css | |
parent | fdf3e2780edf92bd0cdb7aefc7a196e608b9cbd1 (diff) |
feat: swith focus map by tab key and click
* Use data-focus attribute and MutationObserver to move map-container
between Sementic HTML and Showcase.
* Currently set return value of docuement.onkeydown in editor, then
reset onkeydown function in dumbymap. Maybe there is a better way?
* CSS to make placeholder not so obvious
Diffstat (limited to 'src/css')
-rw-r--r-- | src/css/dumbymap.css | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/src/css/dumbymap.css b/src/css/dumbymap.css index 6554ceb..03c6c2a 100644 --- a/src/css/dumbymap.css +++ b/src/css/dumbymap.css | |||
@@ -40,8 +40,11 @@ | |||
40 | 40 | ||
41 | .Showcase { | 41 | .Showcase { |
42 | order: 2; | 42 | order: 2; |
43 | #mapPlaceholder { | 43 | display: none; |
44 | display: none; | 44 | |
45 | .map-container { | ||
46 | width: 100% !important; | ||
47 | height: 100% !important; | ||
45 | } | 48 | } |
46 | } | 49 | } |
47 | 50 | ||
@@ -74,9 +77,11 @@ | |||
74 | } | 77 | } |
75 | 78 | ||
76 | .map-container { | 79 | .map-container { |
80 | background: white; | ||
77 | margin: 2px; | 81 | margin: 2px; |
78 | &.focus { | 82 | border: 3px solid transparent; |
79 | border: solid gray; | 83 | &[data-focus=true] { |
84 | border: 3px solid gray; | ||
80 | } | 85 | } |
81 | } | 86 | } |
82 | 87 | ||
@@ -90,6 +95,11 @@ | |||
90 | width: fit-content; | 95 | width: fit-content; |
91 | flex: 0 0; | 96 | flex: 0 0; |
92 | } | 97 | } |
98 | [data-placeholder] { | ||
99 | box-sizing: border-box; | ||
100 | border: 5px solid white; | ||
101 | background: lightgray; | ||
102 | margin: 0; | ||
93 | } | 103 | } |
94 | } | 104 | } |
95 | 105 | ||
@@ -116,6 +126,10 @@ | |||
116 | display: none; | 126 | display: none; |
117 | pointer-events: none; | 127 | pointer-events: none; |
118 | } | 128 | } |
129 | |||
130 | .Showcase { | ||
131 | display: block; | ||
132 | } | ||
119 | } | 133 | } |
120 | 134 | ||
121 | .DumbyMap[data-layout=side] { | 135 | .DumbyMap[data-layout=side] { |
@@ -191,9 +205,14 @@ | |||
191 | } | 205 | } |
192 | } | 206 | } |
193 | } | 207 | } |
208 | |||
194 | > :not(.draggable-block) { | 209 | > :not(.draggable-block) { |
195 | display: none; | 210 | display: none; |
196 | } | 211 | } |
212 | |||
213 | [data-placeholder] { | ||
214 | max-width: 50px; | ||
215 | } | ||
197 | } | 216 | } |
198 | } | 217 | } |
199 | 218 | ||