diff options
| author | Hsieh Chin Fan <pham@topo.tw> | 2024-09-20 15:03:09 +0800 |
|---|---|---|
| committer | Hsieh Chin Fan <pham@topo.tw> | 2024-09-20 15:59:58 +0800 |
| commit | b3cabd0868db0b90b98e6ee6bb80943e0f4ede4d (patch) | |
| tree | e91830543a4ee777d4de7dc84b47b55833f50bb4 /src/css | |
| parent | d87ed12b603e6a4ffdbe666d984bb464df9b620f (diff) | |
feat: draggable elements only appears in overlay layout
Diffstat (limited to 'src/css')
| -rw-r--r-- | src/css/dumbymap.css | 155 |
1 files changed, 75 insertions, 80 deletions
diff --git a/src/css/dumbymap.css b/src/css/dumbymap.css index a3f1fb9..40397c1 100644 --- a/src/css/dumbymap.css +++ b/src/css/dumbymap.css | |||
| @@ -91,7 +91,7 @@ | |||
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | [data-focus="true"] { | 93 | [data-focus="true"] { |
| 94 | z-index: 9999; | 94 | z-index: 1; |
| 95 | } | 95 | } |
| 96 | } | 96 | } |
| 97 | 97 | ||
| @@ -101,6 +101,12 @@ | |||
| 101 | overflow-y: scroll; | 101 | overflow-y: scroll; |
| 102 | width: 100%; | 102 | width: 100%; |
| 103 | 103 | ||
| 104 | .dumby-block { | ||
| 105 | border-left: #f0f0f0 0.5em solid; | ||
| 106 | padding-left: 0.5em; | ||
| 107 | margin-left: -0.5em; | ||
| 108 | } | ||
| 109 | |||
| 104 | pre { | 110 | pre { |
| 105 | width: 100%; | 111 | width: 100%; |
| 106 | 112 | ||
| @@ -130,26 +136,6 @@ | |||
| 130 | } | 136 | } |
| 131 | } | 137 | } |
| 132 | 138 | ||
| 133 | .draggable-block { | ||
| 134 | pointer-events: auto; | ||
| 135 | background-color: white; | ||
| 136 | margin-bottom: 3rem; | ||
| 137 | |||
| 138 | .draggable { | ||
| 139 | display: none; | ||
| 140 | } | ||
| 141 | } | ||
| 142 | |||
| 143 | /* Left border to indicate there is a block */ | ||
| 144 | .DumbyMap[data-layout]:not([data-layout="overlay"]) { | ||
| 145 | .draggable-block{ | ||
| 146 | width: calc(100% + 0.5em); | ||
| 147 | border-left: #f0f0f0 0.5em solid; | ||
| 148 | padding-left: 0.5em; | ||
| 149 | margin-left: -0.5em; | ||
| 150 | } | ||
| 151 | } | ||
| 152 | |||
| 153 | .DumbyMap[data-layout]:not([data-layout="none"]) { | 139 | .DumbyMap[data-layout]:not([data-layout="none"]) { |
| 154 | margin: 0 auto; | 140 | margin: 0 auto; |
| 155 | height: 100vh; | 141 | height: 100vh; |
| @@ -174,88 +160,97 @@ | |||
| 174 | flex: 50%; | 160 | flex: 50%; |
| 175 | display: block; | 161 | display: block; |
| 176 | height: 100vh; | 162 | height: 100vh; |
| 163 | z-index: -1; | ||
| 177 | } | 164 | } |
| 178 | } | 165 | } |
| 179 | 166 | ||
| 180 | .DumbyMap[data-layout="overlay"] { | 167 | .DumbyMap[data-layout="overlay"] { |
| 181 | .Showcase, | 168 | .SemanticHtml, |
| 182 | .SemanticHtml { | 169 | .Showcase { |
| 183 | position: fixed; | 170 | display: block; |
| 171 | position: absolute; | ||
| 172 | left: 0; | ||
| 173 | top: 0; | ||
| 174 | padding: 0; | ||
| 175 | margin: 0; | ||
| 184 | height: 100%; | 176 | height: 100%; |
| 185 | width: 100%; | 177 | width: 100%; |
| 186 | } | 178 | } |
| 187 | 179 | ||
| 188 | .Showcase { | 180 | .Showcase { |
| 189 | display: block; | 181 | z-index: 0; |
| 190 | } | 182 | } |
| 191 | 183 | ||
| 192 | .SemanticHtml { | 184 | .SemanticHtml { |
| 193 | font-size: 12px; | ||
| 194 | pointer-events: none; | 185 | pointer-events: none; |
| 195 | z-index: 1; | 186 | z-index: 1; |
| 187 | } | ||
| 188 | } | ||
| 196 | 189 | ||
| 197 | > .draggable-block { | 190 | .draggable-block { |
| 198 | box-sizing: content-box; | 191 | background-color: white; |
| 199 | position: absolute; | 192 | margin-bottom: 3rem; |
| 200 | width: fit-content; | 193 | font-size: 12px; |
| 201 | max-height: 50vh; | 194 | pointer-events: auto; |
| 202 | max-width: 25vw; | 195 | box-sizing: content-box; |
| 203 | overflow: scroll; | 196 | position: absolute; |
| 204 | border: solid gray; | 197 | width: fit-content; |
| 205 | border-radius: 0.5rem; | 198 | max-height: 50vh; |
| 206 | padding-top: 0.5rem; | 199 | max-width: 25vw; |
| 207 | padding-bottom: 0; | 200 | overflow: scroll; |
| 208 | resize: both; | 201 | border: solid gray; |
| 209 | 202 | border-radius: 0.5rem; | |
| 210 | &[style*="height"], | 203 | padding-top: 0.5rem; |
| 211 | &[style*="width"] { | 204 | padding-bottom: 0; |
| 212 | max-height: unset; | 205 | resize: both; |
| 213 | max-width: unset; | 206 | |
| 214 | } | 207 | &[style*="height"], |
| 208 | &[style*="width"] { | ||
| 209 | max-height: unset; | ||
| 210 | max-width: unset; | ||
| 211 | } | ||
| 215 | 212 | ||
| 216 | .map-container { | 213 | .dumby-block { |
| 217 | min-width: 200px; | 214 | border: none; |
| 218 | } | 215 | padding: 0; |
| 216 | } | ||
| 219 | 217 | ||
| 220 | > :not(.draggable) { | 218 | .map-container { |
| 221 | margin-inline: 0.5rem; | 219 | min-width: 200px; |
| 222 | } | 220 | } |
| 223 | 221 | ||
| 224 | .draggable { | 222 | > :not(.draggable) { |
| 225 | display: block; | 223 | margin-inline: 0.5rem; |
| 226 | top: 0; | 224 | } |
| 227 | left: 0; | ||
| 228 | position: sticky; | ||
| 229 | background: linear-gradient(0deg, rgb(255 255 255 / 0%), rgb(255 255 255 / 100%) 60%); | ||
| 230 | margin-bottom: -18px; | ||
| 231 | transform: translate(0, -16px); | ||
| 232 | width: 100%; | ||
| 233 | padding-inline: 0; | ||
| 234 | padding-bottom: 2em; | ||
| 235 | text-align: center; | ||
| 236 | z-index: 9999; | ||
| 237 | transition: all 0.3s ease-in-out; | ||
| 238 | |||
| 239 | &:hover { | ||
| 240 | background: #e1e1e1; | ||
| 241 | padding-block: 1em 0.5em; | ||
| 242 | |||
| 243 | & ~ * { | ||
| 244 | opacity: 0.7; | ||
| 245 | color: gray; | ||
| 246 | } | ||
| 247 | } | ||
| 248 | } | ||
| 249 | } | ||
| 250 | 225 | ||
| 251 | > :not(.draggable-block) { | 226 | .draggable { |
| 252 | display: none; | 227 | display: block; |
| 228 | top: 0; | ||
| 229 | left: 0; | ||
| 230 | position: sticky; | ||
| 231 | background: linear-gradient(0deg, rgb(255 255 255 / 0%), rgb(255 255 255 / 100%) 60%); | ||
| 232 | margin-bottom: -18px; | ||
| 233 | transform: translate(0, -16px); | ||
| 234 | width: 100%; | ||
| 235 | padding-inline: 0; | ||
| 236 | padding-bottom: 2em; | ||
| 237 | text-align: center; | ||
| 238 | z-index: 9999; | ||
| 239 | transition: all 0.3s ease-in-out; | ||
| 240 | |||
| 241 | &:hover { | ||
| 242 | background: #e1e1e1; | ||
| 243 | padding-block: 1em 0.5em; | ||
| 244 | |||
| 245 | & ~ * { | ||
| 246 | opacity: 0.7; | ||
| 247 | color: gray; | ||
| 248 | } | ||
| 253 | } | 249 | } |
| 254 | |||
| 255 | } | 250 | } |
| 256 | |||
| 257 | } | 251 | } |
| 258 | 252 | ||
| 253 | |||
| 259 | .bold-options { | 254 | .bold-options { |
| 260 | font-weight: bold; | 255 | font-weight: bold; |
| 261 | } | 256 | } |