Section, dodanie sekcji z rozdzieleniem na standardowa i tą pod iframe
This commit is contained in:
36
src/components/sections/SectionDefault.astro
Normal file
36
src/components/sections/SectionDefault.astro
Normal file
@@ -0,0 +1,36 @@
|
||||
---
|
||||
import Markdown from "../../islands/Markdown.jsx";
|
||||
|
||||
const { section, index } = Astro.props;
|
||||
|
||||
const hasImage = !!section.image;
|
||||
const reverse = index % 2 === 1;
|
||||
---
|
||||
<section class="fuz-section">
|
||||
<div class={`fuz-section-grid ${hasImage ? "md:grid-cols-2" : "md:grid-cols-1"}`}>
|
||||
|
||||
{hasImage && (
|
||||
<img
|
||||
src={section.image}
|
||||
alt={section.title}
|
||||
class={`fuz-section-image ${reverse ? "md:order-1" : "md:order-2"}
|
||||
${section.dimmed ? "fuz-image-dimmed" : ""}`}
|
||||
/>
|
||||
)}
|
||||
|
||||
<div class={`fuz-section-text ${hasImage ? (reverse ? "md:order-2" : "md:order-1") : ""}`}>
|
||||
<h2 class="fuz-section-title text-center">{section.title}</h2>
|
||||
|
||||
<Markdown text={section.content} />
|
||||
|
||||
{section.button && (
|
||||
<div class="mt-8 flex justify-center">
|
||||
<a href={section.button.url} class="btn btn-outline">
|
||||
{section.button.text}
|
||||
</a>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
Reference in New Issue
Block a user