From 8742c6e7b961a65a0720422a0a218eb1128dee48 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Wed, 27 Dec 2023 23:31:00 -0800 Subject: [PATCH] Add a Bergamot exercise shortcode to give exercises. Signed-off-by: Danila Fedorin --- assets/scss/bergamot.scss | 72 +++++++++++++++++++++++ layouts/shortcodes/bergamot_exercise.html | 18 ++++++ layouts/shortcodes/bergamot_preset.html | 6 ++ 3 files changed, 96 insertions(+) create mode 100644 layouts/shortcodes/bergamot_exercise.html create mode 100644 layouts/shortcodes/bergamot_preset.html diff --git a/assets/scss/bergamot.scss b/assets/scss/bergamot.scss index 13d54bf..826b1f0 100644 --- a/assets/scss/bergamot.scss +++ b/assets/scss/bergamot.scss @@ -1,6 +1,78 @@ @import "variables.scss"; @import "mixins.scss"; +.bergamot-exercise { + @include bordered-block; + padding: 1em; + counter-increment: bergamot-exercise; + + .bergamot-root { + border: none; + padding: 0; + margin-top: 1em; + } + + + .bergamot-exercise-label { + .bergamot-exercise-number::after { + content: "Exercise " counter(bergamot-exercise); + font-weight: bold; + text-decoration: underline; + } + } + + .bergamot-button { + @include bordered-block; + padding: 0.25em; + padding-left: 1em; + padding-right: 1em; + background-color: inherit; + display: inline-flex; + align-items: center; + justify-content: center; + transition: 0.25s; + font-family: $font-body; + @include var(color, text-color); + + &.bergamot-hidden { + display: none; + } + + .feather { + margin-right: 0.5em; + } + } + + .bergamot-play { + .feather { color: $primary-color; } + &:hover, &:focus { + .feather { color: lighten($primary-color, 20%); } + } + } + + .bergamot-reset { + .feather { color: #0099CC; } + &:hover, &:focus { + .feather { color: lighten(#0099CC, 20%); } + } + + svg { + fill: none; + } + } + + .bergamot-close { + .feather { color: tomato; } + &:hover, &:focus { + .feather { color: lighten(tomato, 20%); } + } + } + + .bergamot-button-group { + margin-top: 0.5em; + } +} + .bergamot-root { @include bordered-block; padding: 1em; diff --git a/layouts/shortcodes/bergamot_exercise.html b/layouts/shortcodes/bergamot_exercise.html new file mode 100644 index 0000000..67244d2 --- /dev/null +++ b/layouts/shortcodes/bergamot_exercise.html @@ -0,0 +1,18 @@ +
+ + {{ partial "icon.html" "edit-2" }} + + {{ if or (eq (.Get "label") "") (eq (.Get "label") nil) }}{{ else }}({{ .Get "label" }}){{ end }}: + + {{ .Inner }} + +
+ {{ if or (eq (.Get "preset") "") (eq (.Get "preset") nil) }} + {{ else }} + + + {{ end }} +
+ +
+
diff --git a/layouts/shortcodes/bergamot_preset.html b/layouts/shortcodes/bergamot_preset.html new file mode 100644 index 0000000..8da76ee --- /dev/null +++ b/layouts/shortcodes/bergamot_preset.html @@ -0,0 +1,6 @@ +