diff options
| author | Hsieh Chin Fan <pham@topo.tw> | 2024-10-09 18:00:56 +0800 |
|---|---|---|
| committer | Hsieh Chin Fan <pham@topo.tw> | 2024-10-09 18:31:57 +0800 |
| commit | 9b4af831b6b5866e655597eb752311fa79b6ab40 (patch) | |
| tree | aa78486b84cadcbd7958d80556bc60ecb642627b /src | |
| parent | f153a4dfa051c711959a5f58d7a00c5148231f8e (diff) | |
feat: update default contents and used CSS
Diffstat (limited to 'src')
| -rw-r--r-- | src/css/style.css | 28 | ||||
| -rw-r--r-- | src/editor.mjs | 40 |
2 files changed, 55 insertions, 13 deletions
diff --git a/src/css/style.css b/src/css/style.css index 72c8c5f..209ff0b 100644 --- a/src/css/style.css +++ b/src/css/style.css | |||
| @@ -89,6 +89,16 @@ a:hover { | |||
| 89 | text-decoration: underline; | 89 | text-decoration: underline; |
| 90 | } | 90 | } |
| 91 | 91 | ||
| 92 | code { | ||
| 93 | display: inline-block; | ||
| 94 | padding: 0.3em; | ||
| 95 | |||
| 96 | background-color: whitesmoke; | ||
| 97 | |||
| 98 | color: #333; | ||
| 99 | font-size: 1.2em; | ||
| 100 | } | ||
| 101 | |||
| 92 | pre { | 102 | pre { |
| 93 | width: 100%; | 103 | width: 100%; |
| 94 | } | 104 | } |
| @@ -166,3 +176,21 @@ blockquote { | |||
| 166 | 176 | ||
| 167 | text-align: center; | 177 | text-align: center; |
| 168 | } | 178 | } |
| 179 | |||
| 180 | details { | ||
| 181 | display: block; | ||
| 182 | width: fit-content; | ||
| 183 | padding: .3rem 1rem; | ||
| 184 | |||
| 185 | border-radius: 4px; | ||
| 186 | |||
| 187 | background: #F0F0F0; | ||
| 188 | |||
| 189 | summary { | ||
| 190 | cursor: pointer; | ||
| 191 | } | ||
| 192 | |||
| 193 | &:hover { | ||
| 194 | background: #E4E4E7; | ||
| 195 | } | ||
| 196 | } | ||
diff --git a/src/editor.mjs b/src/editor.mjs index b93bad8..819cf68 100644 --- a/src/editor.mjs +++ b/src/editor.mjs | |||
| @@ -74,19 +74,34 @@ You can use it to: | |||
| 74 | 74 | ||
| 75 | 1. [Roll a Dice] for a new map | 75 | 1. [Roll a Dice] for a new map |
| 76 | 2. Hover on [GeoLink][example-geolink] to show point in maps. | 76 | 2. Hover on [GeoLink][example-geolink] to show point in maps. |
| 77 | 3. Add a new anchor by **Right Click** on a map, and **Right Click** on **Selected Text** to attach anchor | 77 | 3. Add GeoLink by dragging **selected text** |
| 78 | 4. Add more contents into [Editor] by text in [Markdown] | 78 | 4. Change contents by [Editor] with [Markdown] text |
| 79 | 5. Generated document is at left hand side, **Right click** for context menu. | 79 | 5. **Right click** to call context menu, you can: |
| 80 | You can: | 80 | + Change focus between maps |
| 81 | + Select content block for browsing | 81 | + Select a block for browsing |
| 82 | + Switch layouts for various use cases | 82 | + Switch layouts for various use cases |
| 83 | 83 | ||
| 84 | 84 | ||
| 85 | If you want know more, take a look at subjects below: | 85 | If you want know more, take a look at subjects below: |
| 86 | 1. [How to write text in Markdown?][subject] | 86 | 1. [How to write Markdown text?](https://www.markdownguide.org/basic-syntax/) |
| 87 | 2. [How can I save contents for next time][subject] | 87 | 1. <details> |
| 88 | 3. [I want XXX feature in maps][subject] | 88 | <summary>How can I save contents for next use?</summary> |
| 89 | 3. [I am a expeienced developer, show me what you got!][subject] | 89 | |
| 90 | Since All contents come from raw texts, you can: | ||
| 91 | 1. Save current page as bookmark by [hash button](#create-hash "=>.mde-hash") | ||
| 92 | 2. Copy texts in editor and save as \`.txt\` file | ||
| 93 | 3. Use online service for hosting Markdown, for example: [HackMD](https://hackmd.io) | ||
| 94 | |||
| 95 | </details> | ||
| 96 | 1. <details> | ||
| 97 | <summary>I want more features in map!</summary> | ||
| 98 | |||
| 99 | DumbyMap use [mapclay](https://github.com/outdoorsafetylab/mapclay) to render maps. | ||
| 100 | 1. You can use \`eval\` options to add custom scripts, see [tutoria](https://github.com/outdoorsafetylab/mapclay?tab=readme-ov-file#run-scripts-after-map-is-created) for more details | ||
| 101 | 2. You can use custom Renderer indtead of default ones, see [tutoria](https://github.com/outdoorsafetylab/mapclay?tab=readme-ov-file#renderer) for more details | ||
| 102 | |||
| 103 | </details> | ||
| 104 | 1. [I am an experienced developer, show me what you got!](https://github.com/outdoorsafetylab/dumbymap) | ||
| 90 | 105 | ||
| 91 | 106 | ||
| 92 | <br> | 107 | <br> |
| @@ -96,10 +111,9 @@ If you want know more, take a look at subjects below: | |||
| 96 | <br> | 111 | <br> |
| 97 | 112 | ||
| 98 | [Roll a dice]: #Click%20it! "=>.mde-roll" | 113 | [Roll a dice]: #Click%20it! "=>.mde-roll" |
| 99 | [example-geolink]: geo:24,121?xy=121,24 | 114 | [example-geolink]: geo:24,121?xy=121,24&text=Use%20yellow%20link%20point%20to%20map |
| 100 | [Markdown]: https://www.markdownguide.org/basic-syntax/ | 115 | [Markdown]: https://www.markdownguide.org/basic-syntax/ |
| 101 | [Editor]: #This%20is%20editor! "=>.editor" | 116 | [Editor]: #This%20is%20editor! "=>.editor"` |
| 102 | [subject]: placeholder` | ||
| 103 | 117 | ||
| 104 | /** Editor from EasyMDE **/ | 118 | /** Editor from EasyMDE **/ |
| 105 | const editor = new EasyMDE({ | 119 | const editor = new EasyMDE({ |
| @@ -1100,7 +1114,7 @@ dumbyContainer.onmousedown = (e) => { | |||
| 1100 | line.position() | 1114 | line.position() |
| 1101 | } | 1115 | } |
| 1102 | 1116 | ||
| 1103 | context.classList.add('dragging-geolink') | 1117 | context.classList.add('dragging-geolink') |
| 1104 | dumbyContainer.onmousemove = onMouseMove | 1118 | dumbyContainer.onmousemove = onMouseMove |
| 1105 | dumbymap.utils.renderedMaps().forEach(map => { map.style.cursor = 'crosshair' }) | 1119 | dumbymap.utils.renderedMaps().forEach(map => { map.style.cursor = 'crosshair' }) |
| 1106 | dumbyContainer.onmouseup = function (e) { | 1120 | dumbyContainer.onmouseup = function (e) { |