summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2024-12-16 09:55:29 +0800
committerEltrac <hi@guhub.cn>2024-12-16 09:55:29 +0800
commit043d862cf2ccdcb89149a235fb7e7a6f27252561 (patch)
tree58a99b2e0fe2aa258652c4b2f74a92f0e6ca2050
parent351763cfbcb354e96ec0e3b73ae63d50985d7737 (diff)
feat(theme): image gallery
-rw-r--r--themes/yinyang/assets/css/index.css23
-rw-r--r--themes/yinyang/layouts/shortcodes/gallery.html3
2 files changed, 26 insertions, 0 deletions
diff --git a/themes/yinyang/assets/css/index.css b/themes/yinyang/assets/css/index.css
index fb9bdca9..60372ad3 100644
--- a/themes/yinyang/assets/css/index.css
+++ b/themes/yinyang/assets/css/index.css
@@ -604,6 +604,29 @@ a.blog-link img {
margin: 0.1rem
}
+/* inline-image shortcode */
+
+.inline-image {
+ display: flex;
+ overflow-x: auto;
+ scroll-behavior: smooth;
+ gap: 1rem;
+ white-space: nowrap;
+}
+
+.inline-image > figure {
+ display: inline-block;
+ margin: 0;
+ flex-shrink: 0;
+}
+
+.inline-image > figure img {
+ height: 20rem;
+ object-fit: cover;
+ display: block;
+}
+
+
/* transition animation */
html.is-changing .transition-fade article {
diff --git a/themes/yinyang/layouts/shortcodes/gallery.html b/themes/yinyang/layouts/shortcodes/gallery.html
new file mode 100644
index 00000000..a6e4d1b5
--- /dev/null
+++ b/themes/yinyang/layouts/shortcodes/gallery.html
@@ -0,0 +1,3 @@
+<div class="inline-image">
+ {{ .Inner | safeHTML }}
+</div>