Skip to content

Commit

Permalink
🛠️ Update BaseLayout
Browse files Browse the repository at this point in the history
  • Loading branch information
EveSunMaple committed Aug 21, 2024
1 parent de3d071 commit 89efb1c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
8 changes: 8 additions & 0 deletions src/layouts/BaseLayout.astro
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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);
Expand Down
9 changes: 0 additions & 9 deletions src/pages/blog/[...slug].astro
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down Expand Up @@ -30,11 +29,3 @@ const { Content } = await post.render();
<Content />
</BaseCard>
</BaseLayout>
<script>
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" });
});
</script>
6 changes: 5 additions & 1 deletion src/styles/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 89efb1c

Please sign in to comment.