This commit is contained in:
@@ -34,6 +34,7 @@ const features: Array<Feature> = [
|
||||
<Heading>Core Features & Values</Heading>
|
||||
</div>
|
||||
<div
|
||||
id="features-cards-container"
|
||||
class="flex flex-row flex-nowrap overflow-x-auto snap-x snap-mandatory gap-card overflow-y-clip p-main snap-center"
|
||||
>
|
||||
{
|
||||
@@ -47,3 +48,27 @@ const features: Array<Feature> = [
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
import { animate, inView, stagger } from "motion";
|
||||
import { ease } from "@unom/style";
|
||||
|
||||
const cardsContainer = document.getElementById("features-cards-container");
|
||||
|
||||
const cards = document.querySelectorAll("#features-cards-container .card");
|
||||
|
||||
if (cardsContainer) {
|
||||
inView(cardsContainer, () => {
|
||||
animate(
|
||||
cards,
|
||||
{
|
||||
scale: [0.8, 1],
|
||||
opacity: [0, 1],
|
||||
},
|
||||
{ ...ease.quint(0.8).out, delay: stagger(0.1) }
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
console.log(cardsContainer);
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user