From b24f80e496c9d31b62164f7b7bdbccfb3559eedd Mon Sep 17 00:00:00 2001 From: Marcell Mars Date: Tue, 8 Jun 2021 12:39:07 +0200 Subject: [PATCH] folding unfolding frontmatter.. --- public/global.css | 69 +++++---- src/App.svelte | 305 ++++++++++++++++++++++++---------------- src/SpCandidates.svelte | 59 ++++---- src/SpKeys.svelte | 77 ++++++---- src/SpTiers.svelte | 77 ++++++---- src/SpTitle.svelte | 8 +- src/main.js | 2 +- 7 files changed, 361 insertions(+), 236 deletions(-) diff --git a/public/global.css b/public/global.css index 1281d60..9d45d88 100644 --- a/public/global.css +++ b/public/global.css @@ -1,66 +1,66 @@ html, body { - position: relative; - width: 100%; - height: 100%; + position: relative; + width: 100%; + height: 100%; } body { - color: #333; - margin: 0; - padding: 8px; - box-sizing: border-box; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + color: #333; + margin: 0; + padding: 8px; + box-sizing: border-box; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; } a { - color: rgb(0,100,200); - text-decoration: none; + color: rgb(0,100,200); + text-decoration: none; } a:hover { - text-decoration: underline; + text-decoration: underline; } a:visited { - color: rgb(0,80,160); + color: rgb(0,80,160); } input, button, select, textarea { - font-family: inherit; - font-size: inherit; - -webkit-padding: 0.4em 0; - padding: 0.4em; - margin: 0 0 0.5em 0; - box-sizing: border-box; - border: 1px solid #ccc; - border-radius: 2px; + font-family: inherit; + font-size: inherit; + -webkit-padding: 0.4em 0; + padding: 0.4em; + margin: 0 0 0.5em 0; + box-sizing: border-box; + border: 1px solid #ccc; + border-radius: 2px; } input:disabled { - color: #ccc; + color: #ccc; } button { - color: #333; - background-color: #f4f4f4; - outline: none; + color: #333; + background-color: #f4f4f4; + outline: none; } button:disabled { - color: #999; + color: #999; } button:not(:disabled):active { - background-color: #ddd; + background-color: #ddd; } button:focus { - border-color: #666; + border-color: #666; } /* custom part */ -form { +.formgrid { display: grid; grid-template-columns: auto 1fr; grid-gap: 1rem; @@ -145,4 +145,17 @@ select { margin-top: 0.5rem; } +.fmHidden { + display: none; +} +.fmShown { + display: grid; + grid-template-columns: auto 1fr; + grid-gap: 1rem; +} + +.togglefold { + margin-top: 1rem; + margin-bottom: 1rem; +} diff --git a/src/App.svelte b/src/App.svelte index b266a99..a4043bb 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -1,136 +1,203 @@ - +
- - {#each Object.entries(frontmatter) as fmItems} - {#if ['ascriptions', 'triad'].includes(fmItems[0])} +
+ +
+
[fold/unfold frontmatter]
+ + {#each Object.entries(frontmatter) as fmItems} {#each fmItems[1] as fmItem, i} - - - + {#if ["ascriptions", "triad"].includes(fmItems[0])} + + + + {:else if fmItems[0] == "journal"} + + + {/if} {/each} + {/each} + +
+ + - {#if document.location.protocol.substring(0,4) != "file"} - - - {/if} - - - - - - + + + + + + +
diff --git a/src/SpCandidates.svelte b/src/SpCandidates.svelte index 0816a8a..61e50ce 100644 --- a/src/SpCandidates.svelte +++ b/src/SpCandidates.svelte @@ -1,31 +1,42 @@ {#if fmItem.candidates && fmItem.candidates.length > 0} - + {/if} diff --git a/src/SpKeys.svelte b/src/SpKeys.svelte index ca2d74e..d61a708 100644 --- a/src/SpKeys.svelte +++ b/src/SpKeys.svelte @@ -1,36 +1,55 @@ diff --git a/src/SpTiers.svelte b/src/SpTiers.svelte index 248d28b..402d949 100644 --- a/src/SpTiers.svelte +++ b/src/SpTiers.svelte @@ -1,39 +1,54 @@ -{#if fmItem.tiers && fmItem.tiers.length >0} +{#if fmItem.tiers && fmItem.tiers.length > 0}
- {#each fmItem.tiers as tier, i (tier.file)} -
-
- ({tier.title}) + {#each fmItem.tiers as tier, i (tier.file)} +
+
+ ({tier.title}) +
+
+ + + +
-
- - - -
-
- {/each} -
+ {/each} +
{/if} diff --git a/src/SpTitle.svelte b/src/SpTitle.svelte index a11b4c2..5fc33d8 100644 --- a/src/SpTitle.svelte +++ b/src/SpTitle.svelte @@ -1,9 +1,9 @@ - + - + diff --git a/src/main.js b/src/main.js index d6cacbb..e7e7816 100644 --- a/src/main.js +++ b/src/main.js @@ -7,4 +7,4 @@ const app = new App({ } }); -export default app; \ No newline at end of file +export default app;