diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro
index 92e2fc5..23a77cc 100644
--- a/src/layouts/BaseLayout.astro
+++ b/src/layouts/BaseLayout.astro
@@ -1,4 +1,5 @@
---
+import "medium-zoom/dist/style.css";
import "/node_modules/katex/dist/katex.min.css";
import Profile from "../components/ProfileCard.astro";
import BaseHead from "../components/BaseHead.astro";
@@ -111,6 +112,13 @@ const { title, image, includeSidebar = true } = Astro.props;
});
}
+ import mediumZoom from "medium-zoom/dist/pure";
+ mediumZoom(".main-card img", { margin: 24, background: "#00000080" });
+
+ document.addEventListener("swup:page:view", () => {
+ mediumZoom(".main-card img", { margin: 24, background: "#00000080" });
+ });
+
document.addEventListener("DOMContentLoaded", addCopyButton);
document.addEventListener("swup:page:view", addCopyButton);
diff --git a/src/pages/blog/[...slug].astro b/src/pages/blog/[...slug].astro
index 3742f94..1aee869 100644
--- a/src/pages/blog/[...slug].astro
+++ b/src/pages/blog/[...slug].astro
@@ -1,7 +1,6 @@
---
import BaseLayout from "../../layouts/BaseLayout.astro";
import BaseCard from "../../components/BaseCard.astro";
-import "medium-zoom/dist/style.css";
import { type CollectionEntry, getCollection } from "astro:content";
export async function getStaticPaths() {
@@ -30,11 +29,3 @@ const { Content } = await post.render();
-
diff --git a/src/styles/global.scss b/src/styles/global.scss
index 086e459..aa8ef68 100644
--- a/src/styles/global.scss
+++ b/src/styles/global.scss
@@ -15,8 +15,12 @@ a {
@apply relative no-underline;
}
+.katex-display {
+ overflow-x: auto;
+}
+
.medium-zoom-image--opened {
- @apply rounded-xl;
+ @apply rounded-xl shadow-xl;
}
.main-card img {