Change infobox to be collapsed at first

main
trivernis 3 months ago
parent 2152586f49
commit 6667747e50
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG Key ID: 7E6D18B61C8D2F4B

@ -28,7 +28,7 @@
</Box> </Box>
{:else} {:else}
<button class="hidden-button info-expand" onclick={toggleExpanded}> <button class="hidden-button info-expand" onclick={toggleExpanded}>
<span class="arrow down-arrow"></span><span class="info-text"> <span class="arrow collapsed-arrow">&gt;</span><span class="info-text">
Info: {title} Info: {title}
</span> </span>
</button> </button>
@ -62,19 +62,12 @@
text-decoration: underline 0.2em var(--color-cyan); text-decoration: underline 0.2em var(--color-cyan);
} }
.down-arrow { .collapsed-arrow {
margin-right: 0.5em; margin-right: 0.5em;
position: relative; position: relative;
transition-duration: 1s; transition-duration: 1s;
top: 0.2em;
color: var(--color-cyan); color: var(--color-cyan);
} }
&:hover {
.down-arrow {
animation-name: pull-down;
}
}
} }
.info-collapse { .info-collapse {
@ -102,18 +95,6 @@
} }
} }
@keyframes pull-down {
0% {
top: 0.2em;
}
50% {
top: 0.5em;
}
100% {
top: 0.2em;
}
}
@keyframes pull-up { @keyframes pull-up {
0% { 0% {
top: 0.1em; top: 0.1em;

@ -14,16 +14,14 @@
</script> </script>
<div class="post-content"> <div class="post-content">
{#if content.__component === "content.text-markdown"} {#if content.__component === "content.paragraph" || content.__component === "content.text-markdown"}
{#if content.type === "paragraph"}
<Box> <Box>
<Markdown markdown={content.value} /> <Markdown markdown={content.value} />
</Box> </Box>
{:else if content.type === "infobox"} {:else if content.__component === "content.infobox"}
<Infobox title="title"> <Infobox title={content.title}>
<Markdown markdown={content.value} /> <Markdown markdown={content.value} />
</Infobox> </Infobox>
{/if}
{:else if content.__component === "content.image"} {:else if content.__component === "content.image"}
{@const imageData = content.value.data.attributes} {@const imageData = content.value.data.attributes}
<Image <Image

@ -37,9 +37,10 @@ type BlogPostContentTemplate<S, T> = {
export type BlogPostContentEntry = export type BlogPostContentEntry =
| BlogPostContentTemplate< | BlogPostContentTemplate<
"content.text-markdown", "content.paragraph" | "content.text-markdown",
{ value: string; type: "paragraph" | "infobox" } { value: string }
> >
| BlogPostContentTemplate<"content.infobox", { value: string; title: string }>
| BlogPostContentTemplate<"content.image", { value: { data: StrapiImage } }>; | BlogPostContentTemplate<"content.image", { value: { data: StrapiImage } }>;
export async function getPosts(locale = "all"): Promise<BlogPostTeaser[]> { export async function getPosts(locale = "all"): Promise<BlogPostTeaser[]> {

@ -34,7 +34,6 @@ export default async function fetchApi<T>({
if (query) { if (query) {
url.search = qs.stringify(query); url.search = qs.stringify(query);
} }
console.log({ url });
const res = await fetch(url.toString(), { const res = await fetch(url.toString(), {
headers: { headers: {
Authorization: `Bearer ${STRAPI_CMS_API_KEY}`, Authorization: `Bearer ${STRAPI_CMS_API_KEY}`,

Loading…
Cancel
Save