aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/css/dumbymap.css130
-rw-r--r--src/css/index.css50
-rw-r--r--src/css/style.css35
3 files changed, 138 insertions, 77 deletions
diff --git a/src/css/dumbymap.css b/src/css/dumbymap.css
index 005a8f9..1ebe0d2 100644
--- a/src/css/dumbymap.css
+++ b/src/css/dumbymap.css
@@ -18,13 +18,15 @@
18 18
19.with-leader-line:not(:has(> *)) { 19.with-leader-line:not(:has(> *)) {
20 display: inline-block; 20 display: inline-block;
21 padding-right: 15px; 21
22 padding-left: 6px;
23 background-image: url("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij48cG9seWdvbiBwb2ludHM9IjI0LDAgMCw4IDgsMTEgMCwxOSA1LDI0IDEzLDE2IDE2LDI0IiBmaWxsPSJjb3JhbCIvPjwvc3ZnPg=="); 22 background-image: url("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij48cG9seWdvbiBwb2ludHM9IjI0LDAgMCw4IDgsMTEgMCwxOSA1LDI0IDEzLDE2IDE2LDI0IiBmaWxsPSJjb3JhbCIvPjwvc3ZnPg==");
24 background-size: 12px 12px;
25 background-repeat: no-repeat; 23 background-repeat: no-repeat;
26 background-position: right 2px top 2px; 24 background-position: right 2px top 2px;
25
27 color: #555; 26 color: #555;
27 padding-right: 15px;
28 padding-left: 6px;
29 background-size: 12px 12px;
28 30
29 &.geolink { 31 &.geolink {
30 background-color: rgb(248 248 129); 32 background-color: rgb(248 248 129);
@@ -36,24 +38,28 @@
36 38
37 &:hover { 39 &:hover {
38 background-image: none; 40 background-image: none;
41
39 font-weight: bolder; 42 font-weight: bolder;
40 text-decoration: none; 43 text-decoration: none;
41 } 44 }
42} 45}
43 46
44*:has(> nav) { 47*:has(> nav) {
45 position: absolute;
46 right: 10px;
47 bottom: 10px;
48 48
49 /* FIXME Hide nav at proper time */ 49 /* FIXME Hide nav at proper time */
50 display: none; 50 display: none;
51 padding: 0.5rem; 51 padding: 0.5rem;
52 min-width: 120px; 52
53 position: absolute;
54 right: 10px;
55 bottom: 10px;
56 z-index: 500;
57
53 border: 2px solid gray; 58 border: 2px solid gray;
54 border-radius: 0.5rem; 59 border-radius: 0.5rem;
60
55 background-color: white; 61 background-color: white;
56 z-index: 500; 62 min-width: 120px;
57 63
58 &:has(> nav:empty) { 64 &:has(> nav:empty) {
59 display: none; 65 display: none;
@@ -66,34 +72,38 @@
66} 72}
67 73
68.dumby-block { 74.dumby-block {
69 border-left: #f0f0f0 0.5em solid;
70 padding-left: 0.5em;
71 margin-left: -0.5em; 75 margin-left: -0.5em;
76 padding-left: 0.5em;
77
78 border-left: #f0f0f0 0.5em solid;
72 margin-bottom: 3rem; 79 margin-bottom: 3rem;
73} 80}
74 81
75.DumbyMap { 82.DumbyMap {
76 position: relative; 83 display: flex;
77 max-width: 60em;
78 margin: 0 auto; 84 margin: 0 auto;
79 padding: 0; 85 padding: 0;
80 display: flex; 86
87 position: relative;
81 overflow-x: scroll; 88 overflow-x: scroll;
89 max-width: 60em;
82 90
83 /* height: 100vh; */ 91 /* height: 100vh; */
84 92
85 .Showcase { 93 .Showcase {
86 order: 2;
87 display: none; 94 display: none;
88 overflow: visible; 95 overflow: visible;
96
89 position: relative; 97 position: relative;
98 order: 2;
90 99
91 > * { 100 > * {
92 position: absolute;
93 left: 0;
94 top: 0;
95 width: 100%; 101 width: 100%;
96 height: 100%; 102 height: 100%;
103
104 position: absolute;
105 top: 0;
106 left: 0;
97 } 107 }
98 108
99 [data-focus="true"] { 109 [data-focus="true"] {
@@ -102,10 +112,10 @@
102 } 112 }
103 113
104 .SemanticHtml { 114 .SemanticHtml {
105 order: 1; 115 width: 100%;
106 padding: 1.5rem; 116 padding: 1.5rem;
107 overflow-y: scroll; 117 overflow-y: scroll;
108 width: 100%; 118 order: 1;
109 119
110 pre { 120 pre {
111 width: 100%; 121 width: 100%;
@@ -113,14 +123,17 @@
113 &:has(.map-container) { 123 &:has(.map-container) {
114 display: flex; 124 display: flex;
115 justify-content: flex-start; 125 justify-content: flex-start;
126
116 background-color: inherit; 127 background-color: inherit;
117 } 128 }
118 } 129 }
119 130
120 .map-container { 131 .map-container {
121 background: white;
122 margin: 2px; 132 margin: 2px;
133
123 border: 3px solid transparent; 134 border: 3px solid transparent;
135
136 background: white;
124 animation: fade-in 1s; 137 animation: fade-in 1s;
125 138
126 &[data-focus="true"] { 139 &[data-focus="true"] {
@@ -129,19 +142,21 @@
129 } 142 }
130 143
131 [data-placeholder] { 144 [data-placeholder] {
132 animation: fade-out 1s;
133 opacity: 0.3;
134 border: 3px solid gray; 145 border: 3px solid gray;
146
147 opacity: 0.3;
148 animation: fade-out 1s;
135 } 149 }
136 } 150 }
137} 151}
138 152
139.DumbyMap[data-layout]:not([data-layout="none"]) { 153.DumbyMap[data-layout]:not([data-layout="none"]) {
140 margin: 0 auto;
141 height: 100vh;
142 width: 100%; 154 width: 100%;
143 max-width: none; 155 height: 100vh;
156 margin: 0 auto;
157
144 border: none; 158 border: none;
159 max-width: none;
145 160
146 & ~ :not(.leader-line) { 161 & ~ :not(.leader-line) {
147 display: none; 162 display: none;
@@ -153,14 +168,16 @@
153 .SemanticHtml { 168 .SemanticHtml {
154 flex: 50%; 169 flex: 50%;
155 overflow-y: scroll; 170 overflow-y: scroll;
171
156 height: 100vh; 172 height: 100vh;
157 } 173 }
158 174
159 .Showcase { 175 .Showcase {
160 flex: 50%;
161 display: block; 176 display: block;
162 height: 100vh; 177 height: 100vh;
178
163 z-index: -1; 179 z-index: -1;
180 flex: 50%;
164 } 181 }
165} 182}
166 183
@@ -168,13 +185,14 @@
168 .SemanticHtml, 185 .SemanticHtml,
169 .Showcase { 186 .Showcase {
170 display: block; 187 display: block;
188 width: 100%;
189 height: 100%;
190 margin: 0;
191 padding: 0;
192
171 position: absolute; 193 position: absolute;
172 left: 0;
173 top: 0; 194 top: 0;
174 padding: 0; 195 left: 0;
175 margin: 0;
176 height: 100%;
177 width: 100%;
178 } 196 }
179 197
180 .Showcase { 198 .Showcase {
@@ -183,47 +201,60 @@
183 201
184 .SemanticHtml { 202 .SemanticHtml {
185 pointer-events: none; 203 pointer-events: none;
204
186 z-index: 1; 205 z-index: 1;
187 } 206 }
188} 207}
189 208
190.draggable-block { 209.draggable-block {
191 background-color: white; 210 overflow: clip;
192 font-size: 12px;
193 pointer-events: auto;
194 box-sizing: content-box; 211 box-sizing: content-box;
195 position: absolute;
196 width: fit-content; 212 width: fit-content;
213
214 position: absolute;
215
197 border: solid gray; 216 border: solid gray;
198 border-radius: 0.5rem; 217 border-radius: 0.5rem;
199 overflow: clip; 218
219 background-color: white;
220
221 font-size: 12px;
222 pointer-events: auto;
200 223
201 .dumby-block { 224 .dumby-block {
225 overflow: scroll;
226 margin: 0;
227
228 position: relative;
229
202 border: none; 230 border: none;
203 resize: both; 231 resize: both;
204 padding-inline: 1em; 232 min-width: 5rem;
205 margin: 0;
206 overflow: scroll;
207 max-height: 50vh;
208 max-width: 25vw; 233 max-width: 25vw;
209 position: relative; 234 min-height: 5rem;
235 max-height: 50vh;
236 padding-inline: 1em;
210 237
211 /* allow random width/height after resize */ 238 /* allow random width/height after resize */
239
212 &[style*="height"], 240 &[style*="height"],
213 &[style*="width"] { 241 &[style*="width"] {
214 max-height: unset;
215 max-width: unset; 242 max-width: unset;
243 max-height: unset;
216 } 244 }
217 245
218 /* gray out top of content, make draggable part easy to be seen */ 246 /* gray out top of content, make draggable part easy to be seen */
247
219 &::before { 248 &::before {
220 display: block; 249 display: block;
250 width: 100%;
251 height: 1.5rem;
252
221 position: sticky; 253 position: sticky;
222 top: 0; 254 top: 0;
255
256 background: linear-gradient(0deg, rgb(255 255 255 / 0%), white 60%);
223 content: ''; 257 content: '';
224 width: 100%;
225 height: 1.5rem;
226 background: linear-gradient(0deg, rgb(255 255 255 / 0%), rgb(255 255 255 / 100%) 60%);
227 } 258 }
228 259
229 .map-container { 260 .map-container {
@@ -233,13 +264,14 @@
233 264
234 .draggable { 265 .draggable {
235 display: block; 266 display: block;
236 position: absolute;
237 width: 100%; 267 width: 100%;
268
269 position: absolute;
238 top: 0; 270 top: 0;
239 left: 0; 271 left: 0;
240 font-size: 1.1rem;
241 z-index: 1; 272 z-index: 1;
242 273
274 font-size: 1.1rem;
243 text-align: center; 275 text-align: center;
244 276
245 transition: all 0.3s ease-in-out; 277 transition: all 0.3s ease-in-out;
@@ -247,11 +279,13 @@
247 279
248 &:hover { 280 &:hover {
249 background: #e1e1e1; 281 background: #e1e1e1;
282
250 transform: unset; 283 transform: unset;
251 284
252 & ~ * { 285 & ~ * {
253 opacity: 0.7;
254 color: gray; 286 color: gray;
287
288 opacity: 0.7;
255 } 289 }
256 } 290 }
257 } 291 }
diff --git a/src/css/index.css b/src/css/index.css
index c754600..3b8a51f 100644
--- a/src/css/index.css
+++ b/src/css/index.css
@@ -3,11 +3,15 @@
3 --content-border-radius: 5px; 3 --content-border-radius: 5px;
4} 4}
5 5
6.editor {
7 display: none;
8}
9
6body { 10body {
7 width: 100%; 11 width: 100%;
8 height: 100vh; 12 height: 100vh;
9 13
10 &[data-layout=editing] { 14 &[data-layout="editing"] {
11 display: flex; 15 display: flex;
12 align-items: stretch; 16 align-items: stretch;
13 gap: 0.5em; 17 gap: 0.5em;
@@ -17,37 +21,38 @@ body {
17 .DumbyMap { 21 .DumbyMap {
18 order: 1; 22 order: 1;
19 flex: 1 0 calc(50% - 0.5em); 23 flex: 1 0 calc(50% - 0.5em);
24
20 height: 100%; 25 height: 100%;
21 overflow-y: scroll; 26 overflow-y: scroll;
27
22 border: var(--content-border); 28 border: var(--content-border);
23 border-radius: var(--content-border-radius); 29 border-radius: var(--content-border-radius);
24 } 30 }
31
25 .editor { 32 .editor {
26 display: block; 33 display: block;
27 34
28 order: 2; 35 order: 2;
29 flex: 1 0 50%; 36 flex: 1 0 50%;
30 max-width: calc(50% - 0.5em); 37 max-width: calc(50% - 0.5em);
38
31 height: 100%; 39 height: 100%;
32 } 40 }
33 } 41 }
34} 42}
35 43
36.editor {
37 display: none;
38}
39
40.EasyMDEContainer { 44.EasyMDEContainer {
41 display: flex; 45 display: flex;
46 box-sizing: border-box;
47 height: 100%;
42 align-items: stretch; 48 align-items: stretch;
43 gap: 0.5em; 49 gap: 0.5em;
44 height: 100%;
45 flex-direction: column; 50 flex-direction: column;
46 box-sizing: border-box;
47 51
48 .CodeMirror { 52 .CodeMirror {
49 order: 1; 53 order: 1;
50 flex: 1 0 0; 54 flex: 1 0 0;
55
51 border: var(--content-border); 56 border: var(--content-border);
52 border-radius: var(--content-border-radius); 57 border-radius: var(--content-border-radius);
53 padding-inline: 0; 58 padding-inline: 0;
@@ -58,6 +63,7 @@ body {
58 span { 63 span {
59 white-space: pre; 64 white-space: pre;
60 } 65 }
66
61 .invalid-input { 67 .invalid-input {
62 text-decoration: red wavy underline 1px; 68 text-decoration: red wavy underline 1px;
63 } 69 }
@@ -79,7 +85,7 @@ body {
79/* FIXME For those empty line (no child with cm-comment) */ 85/* FIXME For those empty line (no child with cm-comment) */
80.inside-code-block, 86.inside-code-block,
81.CodeMirror-line:has(.cm-formatting-code-block) { 87.CodeMirror-line:has(.cm-formatting-code-block) {
82 background: rgba(0,0,0,.05) !important; 88 background: rgb(0 0 0 / 5%) !important;
83 89
84 .cm-comment { 90 .cm-comment {
85 background: none !important; 91 background: none !important;
@@ -88,24 +94,27 @@ body {
88 94
89.container__suggestions { 95.container__suggestions {
90 display: none; 96 display: none;
91 position: absolute;
92 width: fit-content; 97 width: fit-content;
93 min-width: 10rem; 98
94 max-height: 40vh; 99 position: absolute;
95 overflow-y: scroll; 100 z-index: 100;
101
96 border: 2px solid lightgray; 102 border: 2px solid lightgray;
97 border-radius: 0.5rem; 103 border-radius: 0.5rem;
98 z-index: 100;
99 104
100 background: #fff; 105 background: white;
106 min-width: 10rem;
107 max-height: 40vh;
108 overflow-y: scroll;
101} 109}
110
102.container__suggestion { 111.container__suggestion {
103 cursor: pointer;
104 display: flex; 112 display: flex;
105 justify-content: space-between;
106 overflow: hidden; 113 overflow: hidden;
107
108 height: fit-content; 114 height: fit-content;
115
116 cursor: pointer;
117 justify-content: space-between;
109 min-height: 2rem; 118 min-height: 2rem;
110 white-space: nowrap; 119 white-space: nowrap;
111 align-items: center; 120 align-items: center;
@@ -113,23 +122,28 @@ body {
113 &:not(:first-child) { 122 &:not(:first-child) {
114 border-top: 1px solid rgb(203 213 225); 123 border-top: 1px solid rgb(203 213 225);
115 } 124 }
125
116 &.focus { 126 &.focus {
117 background: rgb(226 232 240); 127 background: rgb(226 232 240);
118 } 128 }
119 129
120 * { 130 * {
121 flex-shrink: 0; 131 flex-shrink: 0;
132
122 display: inline-block; 133 display: inline-block;
123 overflow: hidden; 134 overflow: hidden;
124 padding-inline: 1em; 135 padding-inline: 1em;
125 } 136 }
137
126 .info { 138 .info {
127 color: #4682B4; 139 color: steelblue;
128 font-weight: bold; 140 font-weight: bold;
129 } 141 }
142
130 .truncate { 143 .truncate {
131 flex-shrink: 1; 144 flex-shrink: 1;
132 text-overflow: ellipsis; 145 text-overflow: ellipsis;
146
133 ::before { 147 ::before {
134 width: 2rem 148 width: 2rem
135 } 149 }
diff --git a/src/css/style.css b/src/css/style.css
index ca53403..34697dc 100644
--- a/src/css/style.css
+++ b/src/css/style.css
@@ -5,6 +5,7 @@
5 5
6* { 6* {
7 margin: 0; 7 margin: 0;
8
8 line-height: calc(1em + 0.5rem); 9 line-height: calc(1em + 0.5rem);
9} 10}
10 11
@@ -20,6 +21,7 @@ p, h1, h2, h3, h4, h5, h6 {
20 overflow-wrap: break-word; 21 overflow-wrap: break-word;
21 hyphens: auto; 22 hyphens: auto;
22} 23}
24
23/* End of Reset */ 25/* End of Reset */
24 26
25body { 27body {
@@ -59,26 +61,32 @@ a:hover {
59} 61}
60 62
61pre:has(code) { 63pre:has(code) {
62 min-width: 400px;
63 display: block; 64 display: block;
64 padding: 9.5px;
65 margin: 0 0 10px; 65 margin: 0 0 10px;
66 font-size: 13px; 66 padding: 9.5px;
67 line-height: 1.42857143; 67
68 border: 1px solid #ccc;
69 border-radius: 4px;
70
71 background-color: whitesmoke;
72
68 color: #333; 73 color: #333;
74 font-size: 13px;
75 line-height: 1.4286;
76 min-width: 400px;
69 word-break: break-all; 77 word-break: break-all;
70 word-wrap: break-word; 78 word-wrap: break-word;
71 background-color: #f5f5f5;
72 border: 1px solid #ccc;
73 border-radius: 4px;
74 79
75 code { 80 code {
76 padding: 0; 81 padding: 0;
77 font-size: inherit; 82
83 border-radius: 0;
84
85 background-color: transparent;
86
78 color: inherit; 87 color: inherit;
88 font-size: inherit;
79 white-space: pre-wrap; 89 white-space: pre-wrap;
80 background-color: transparent;
81 border-radius: 0;
82 } 90 }
83} 91}
84 92
@@ -94,12 +102,15 @@ li {
94 102
95table { 103table {
96 border-collapse: collapse; 104 border-collapse: collapse;
105
97 width: 100%; 106 width: 100%;
98} 107}
99 108
100th, td { 109th, td {
101 border: 1px solid #ddd;
102 padding: 8px; 110 padding: 8px;
111
112 border: 1px solid #ddd;
113
103 text-align: left; 114 text-align: left;
104} 115}
105 116
@@ -109,6 +120,7 @@ th {
109 120
110img { 121img {
111 max-width: 100%; 122 max-width: 100%;
123
112 height: auto; 124 height: auto;
113} 125}
114 126
@@ -117,5 +129,6 @@ blockquote {
117 color: gray; 129 color: gray;
118 font-size: 1.2rem; 130 font-size: 1.2rem;
119 font-style: italic; 131 font-style: italic;
132
120 text-align: center; 133 text-align: center;
121} 134}