Add a Bergamot exercise shortcode to give exercises.
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
18
layouts/shortcodes/bergamot_exercise.html
Normal file
18
layouts/shortcodes/bergamot_exercise.html
Normal file
@@ -0,0 +1,18 @@
|
||||
<div class="bergamot-exercise">
|
||||
<span class="bergamot-exercise-label">
|
||||
{{ partial "icon.html" "edit-2" }}
|
||||
<span class="bergamot-exercise-number"></span>
|
||||
{{ if or (eq (.Get "label") "") (eq (.Get "label") nil) }}{{ else }}({{ .Get "label" }}){{ end }}:
|
||||
</span>
|
||||
{{ .Inner }}
|
||||
|
||||
<div class="bergamot-button-group">
|
||||
{{ if or (eq (.Get "preset") "") (eq (.Get "preset") nil) }}
|
||||
{{ else }}
|
||||
<button class="bergamot-button bergamot-play" onclick='window.Bergamot.runPreset(this.parentElement, "bergamot-widget-container-{{ .Get "id" }}", "{{ .Get "preset" }}")'>{{ partial "icon.html" "play" }}Start Bergamot</button>
|
||||
<button class="bergamot-button bergamot-close bergamot-hidden" onclick='window.Bergamot.close(this.parentElement, "bergamot-widget-container-{{ .Get "id" }}")'>{{ partial "icon.html" "x" }}Close Bergamot</button>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
<div id="bergamot-widget-container-{{ .Get "id" }}"></div>
|
||||
</div>
|
||||
6
layouts/shortcodes/bergamot_preset.html
Normal file
6
layouts/shortcodes/bergamot_preset.html
Normal file
@@ -0,0 +1,6 @@
|
||||
<script>
|
||||
window.Bergamot.presets['{{ .Get "name" }}'] = {
|
||||
rules: '{{ .Inner }}',
|
||||
inputPrompt: '{{ .Get "prompt" }}',
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user