Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

animated event lists. #115

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/components/events/Event.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { motion } from "framer-motion";
import Image from "next/image";
import Link from "next/link";
import star from "../../../public/star.webp";
Expand All @@ -10,7 +11,13 @@ interface EventProps {

const Event: React.FC<EventProps> = ({ title, time, link }) => {
return (
<div className="flex w-[80vw] md:w-[65vw]">
<motion.div
initial={{ opacity: 0, x: -50 }}
whileInView={{ opacity: 1, x: 0 }}
viewport={{ once: true }}
transition={{ duration: 0.5 }}
className="mb-6 flex w-[80vw] md:w-[65vw]"
>
<Image
src={star}
alt="star icon"
Expand All @@ -32,7 +39,7 @@ const Event: React.FC<EventProps> = ({ title, time, link }) => {
More info
</Link>
</div>
</div>
</motion.div>
);
};

Expand Down
19 changes: 16 additions & 3 deletions src/components/events/EventList.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
import { motion } from "framer-motion";
import Event from "./Event";
import { eventInfo } from "@/data/eventInfo";

const EventList = () => {
return (
<div className="mb-[25%] md:mb-[10%]">
<motion.div
initial={{ opacity: 0, y: 50 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true }}
transition={{ duration: 0.8 }}
className="mb-[25%] md:mb-[10%]"
>
<h2 className="font-title text-[6vw] font-light text-hearts-light-brown md:text-[4vw]">
Upcoming Events
</h2>
<div className="mb-[2%] ml-[13%] h-[1px] w-[30%] bg-hearts-light-brown md:h-[3px] md:w-[22%]" />
<motion.div
initial={{ scaleX: 0 }}
whileInView={{ scaleX: 1 }}
viewport={{ once: true }}
transition={{ duration: 0.5, delay: 0.3 }}
className="mb-[2%] ml-[13%] h-[1px] w-[30%] origin-left bg-hearts-light-brown md:h-[3px] md:w-[22%]"
/>
{eventInfo.map((event, index) => (
<Event
key={index}
Expand All @@ -16,7 +29,7 @@ const EventList = () => {
link={event.link}
/>
))}
</div>
</motion.div>
);
};

Expand Down
Loading