Stylizacja i poprawki w układzie
This commit is contained in:
@@ -7,13 +7,11 @@ const { section, index } = Astro.props;
|
||||
const hasImage = !!section.image;
|
||||
const reverse = index % 2 === 1;
|
||||
|
||||
// Automatyczny import obrazów sekcji
|
||||
const sectionImages = import.meta.glob<{ default: ImageMetadata }>(
|
||||
"/src/assets/sections/**/*.{png,jpg,jpeg,webp,avif}",
|
||||
{ eager: true },
|
||||
);
|
||||
|
||||
// Znajdź obraz zgodnie z YAML
|
||||
let sectionImage: ImageMetadata | null = null;
|
||||
|
||||
if (section.image) {
|
||||
@@ -23,17 +21,16 @@ if (section.image) {
|
||||
}
|
||||
---
|
||||
|
||||
<section class="fuz-section">
|
||||
<section class="f-section">
|
||||
<div
|
||||
class={`fuz-section-grid ${hasImage ? "md:grid-cols-2" : "md:grid-cols-1"}`}
|
||||
class={`f-section-grid ${hasImage ? "md:grid-cols-2" : "md:grid-cols-1"}`}
|
||||
>
|
||||
{
|
||||
sectionImage && (
|
||||
<Image
|
||||
src={sectionImage}
|
||||
alt={section.title}
|
||||
class={`fuz-section-image ${reverse ? "md:order-1" : "md:order-2"}
|
||||
${section.dimmed ? "fuz-image-dimmed" : ""}`}
|
||||
class={`f-section-image ${reverse ? "md:order-1" : "md:order-2"} ${section.dimmed ? "f-image-dimmed" : ""}`}
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
format="webp"
|
||||
@@ -44,15 +41,16 @@ if (section.image) {
|
||||
}
|
||||
|
||||
<div
|
||||
class={`fuz-section text-center ${hasImage ? (reverse ? "md:order-2" : "md:order-1") : ""}`}
|
||||
class={`f-section-grid ${hasImage ? (reverse ? "md:order-2" : "md:order-1") : ""}`}
|
||||
>
|
||||
<h2 class="fuz-section-title">{section.title}</h2>
|
||||
<!-- TODO: Styl nagłowka powinien byc trochę niżej -->
|
||||
<h2 class="f-section-title">{section.title}</h2>
|
||||
|
||||
<Markdown text={section.content} />
|
||||
|
||||
{
|
||||
section.button && (
|
||||
<div class="mt-8 flex justify-center">
|
||||
<div class="f-section-nav">
|
||||
<a
|
||||
href={section.button.url}
|
||||
class="btn btn-outline"
|
||||
@@ -65,4 +63,4 @@ if (section.image) {
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
Reference in New Issue
Block a user