feat: replace carousel using alpine with javascript
This commit is contained in:
parent
74b9460ea1
commit
700095d8af
9 changed files with 165 additions and 261 deletions
|
@ -3,24 +3,21 @@ import Layout from "@layouts/Layout.astro";
|
|||
import { HOME } from "@consts";
|
||||
import { getCollection } from "astro:content";
|
||||
import Hero from "@components/Hero.astro";
|
||||
import Carousel from "@components/Carousel.astro";
|
||||
import Slideshow from "@components/Slideshow.astro";
|
||||
|
||||
const allProjects = await getCollection("projects");
|
||||
const projects = allProjects
|
||||
.filter((project) => !project.data.draft && project.data.featured)
|
||||
.sort((a, b) => b.data.date.valueOf() - a.data.date.valueOf())
|
||||
.slice(0, HOME.HOMESETTINGS?.NUM_PROJECTS_ON_HOMEPAGE);
|
||||
const projectsJSON = JSON.stringify(projects);
|
||||
---
|
||||
|
||||
<Layout title={HOME.TITLE} description={HOME.DESCRIPTION}>
|
||||
<div class="block w-full">
|
||||
<Hero />
|
||||
<section
|
||||
id="featured-projects"
|
||||
class="animate-reveal opacity-0 [animation-delay:0.1s]"
|
||||
>
|
||||
<Carousel data={projectsJSON} />
|
||||
</section>
|
||||
</div>
|
||||
<Hero />
|
||||
<section
|
||||
id="featured-projects"
|
||||
class="animate-reveal opacity-0 [animation-delay:0.1s]"
|
||||
>
|
||||
<Slideshow images={projects} />
|
||||
</section>
|
||||
</Layout>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue