diff options
author | Hsieh Chin Fan <pham@topo.tw> | 2024-10-02 14:12:45 +0800 |
---|---|---|
committer | Hsieh Chin Fan <pham@topo.tw> | 2024-10-02 14:12:45 +0800 |
commit | 061a9e7de3f3426225f73e3cbd59942c1ceae2c8 (patch) | |
tree | 8d361fac36d3eb33cab0f1f39104fe0c06859590 /src | |
parent | afcda458f4d09ee69dda5bbba2710d8c0ed18f20 (diff) |
feat: use focus to decide display in overlay layout
Diffstat (limited to 'src')
-rw-r--r-- | src/Layout.mjs | 4 | ||||
-rw-r--r-- | src/css/dumbymap.css | 14 |
2 files changed, 6 insertions, 12 deletions
diff --git a/src/Layout.mjs b/src/Layout.mjs index 89a48ae..3c4ea3d 100644 --- a/src/Layout.mjs +++ b/src/Layout.mjs | |||
@@ -143,7 +143,7 @@ export class Overlay extends Layout { | |||
143 | wrapper.onmouseup = e => { | 143 | wrapper.onmouseup = e => { |
144 | // Hide block with middle click | 144 | // Hide block with middle click |
145 | if (e.button === 1) { | 145 | if (e.button === 1) { |
146 | wrapper.classList.add('hide') | 146 | block.classList.remove('focus') |
147 | } | 147 | } |
148 | } | 148 | } |
149 | 149 | ||
@@ -182,7 +182,7 @@ export class Overlay extends Layout { | |||
182 | 182 | ||
183 | // Close button | 183 | // Close button |
184 | wrapper.querySelector('#close').onclick = () => { | 184 | wrapper.querySelector('#close').onclick = () => { |
185 | wrapper.classList.add('hide') | 185 | block.classList.remove('focus') |
186 | utils.removeAttribute('style') | 186 | utils.removeAttribute('style') |
187 | } | 187 | } |
188 | // Plus/Minus font-size of content | 188 | // Plus/Minus font-size of content |
diff --git a/src/css/dumbymap.css b/src/css/dumbymap.css index d21c110..3294e40 100644 --- a/src/css/dumbymap.css +++ b/src/css/dumbymap.css | |||
@@ -608,6 +608,8 @@ p a[href^='http']::after, | |||
608 | } | 608 | } |
609 | 609 | ||
610 | .draggable-block { | 610 | .draggable-block { |
611 | /* TODO transition for display */ | ||
612 | display: none; | ||
611 | overflow: visible; | 613 | overflow: visible; |
612 | width: fit-content; | 614 | width: fit-content; |
613 | 615 | ||
@@ -622,6 +624,8 @@ p a[href^='http']::after, | |||
622 | pointer-events: auto; | 624 | pointer-events: auto; |
623 | 625 | ||
624 | &:has(.dumby-block.focus) { | 626 | &:has(.dumby-block.focus) { |
627 | display: block; | ||
628 | |||
625 | z-index: 9001; | 629 | z-index: 9001; |
626 | outline: solid #505050 1px; | 630 | outline: solid #505050 1px; |
627 | border-color: #505050; | 631 | border-color: #505050; |
@@ -708,16 +712,6 @@ p a[href^='http']::after, | |||
708 | transform: translate(0, -0.6rem); | 712 | transform: translate(0, -0.6rem); |
709 | } | 713 | } |
710 | 714 | ||
711 | &.hide { | ||
712 | transition: all 0.5s; | ||
713 | visibility: hidden; | ||
714 | opacity: 0; | ||
715 | |||
716 | .utils { | ||
717 | visibility: hidden !important; | ||
718 | } | ||
719 | } | ||
720 | |||
721 | &.drag, | 715 | &.drag, |
722 | &:has(.draggable-part:hover) { | 716 | &:has(.draggable-part:hover) { |
723 | .handle { | 717 | .handle { |