Skip to content

Commit 6039156

Browse files
committed
Fix slug.
1 parent 7ee0824 commit 6039156

File tree

2 files changed

+2
-52
lines changed

2 files changed

+2
-52
lines changed

src/components/SocialMediaCard.astro

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ const { entry } = Astro.props;
66
77
const sessions = await getEntries(entry.data.submissions);
88
---
9-
<div class="slug">{entry.data.slug}</div>
109
<svg width="900" height="900" class="h-full w-full -z-10">
1110
<image href="http://localhost:4321/social/bg.png" width="900" height="900" />
1211
</svg>
@@ -108,9 +107,4 @@ const sessions = await getEntries(entry.data.submissions);
108107
font-weight: bold;
109108
line-height: 1em;
110109
}
111-
112-
.sulg{
113-
display:none;
114-
}
115-
116110
</style>

src/pages/media/social_media_cards.astro

Lines changed: 2 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ type Speaker = CollectionEntry<"speakers">;
2020
<body class="overflow-auto">
2121
{
2222
speakers.map((entry: Speaker) => (
23+
<a href=`/media/card/${entry.data.slug}`>
2324
<div class="social relative w-[900px] h-[900px] overflow-hidden" data-slug={entry.data.slug}>
2425
<SocialMediaCard entry={entry} />
2526
</div>
27+
</a>
2628
))
2729
}
2830

@@ -78,49 +80,3 @@ fitAllText();
7880

7981
window.addEventListener('resize', fitAllText);
8082
</script>
81-
82-
83-
<script>
84-
document.addEventListener('DOMContentLoaded', () => {
85-
document.querySelectorAll('.social').forEach((socialDiv, index) => {
86-
87-
socialDiv.addEventListener('click', () => {
88-
const svgs = socialDiv.querySelectorAll('svg');
89-
90-
if (svgs.length === 0) {
91-
alert('No SVGs found!');
92-
return;
93-
}
94-
95-
const xmlns = "http://www.w3.org/2000/svg";
96-
const combinedSvg = document.createElementNS(xmlns, "svg");
97-
combinedSvg.setAttribute("xmlns", xmlns);
98-
combinedSvg.setAttribute("width", "900");
99-
combinedSvg.setAttribute("height", "900");
100-
combinedSvg.setAttribute("viewBox", "0 0 900 900");
101-
102-
svgs.forEach(svg => {
103-
const g = document.createElementNS(xmlns, "g");
104-
g.innerHTML = svg.innerHTML;
105-
combinedSvg.appendChild(g);
106-
});
107-
108-
const serializer = new XMLSerializer();
109-
const svgString = serializer.serializeToString(combinedSvg);
110-
111-
const blob = new Blob([svgString], {type: "image/svg+xml"});
112-
const url = URL.createObjectURL(blob);
113-
114-
const a = document.createElement('a');
115-
a.href = url;
116-
a.download = `social_media_${index +1}.svg`;
117-
a.style.display = "none";
118-
document.body.appendChild(a);
119-
a.click();
120-
121-
URL.revokeObjectURL(url);
122-
document.body.removeChild(a);
123-
});
124-
});
125-
});
126-
</script>

0 commit comments

Comments
 (0)