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

feat (#332) : added the list stack #360

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

mansidhamne
Copy link
Contributor

@mansidhamne mansidhamne commented Oct 10, 2024

Video preview:

hack-2.mov

Do suggest any changes @hari

Closes #332

Copy link

🚀 Preview deployed to: https://1d2c58d3.animata.pages.dev

@hari hari self-requested a review October 15, 2024 10:13
Copy link
Contributor

@hari hari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check the comments. Also, make sure to use the same duration so the animations look better.

Comment on lines +82 to +127
<AnimatePresence>
{showAll
? cards.map((card, index) => (
<motion.div
key={card.id}
custom={index}
variants={revealAnimation}
initial="hidden"
animate="visible"
exit="hidden"
className="mb-3"
>
<CardStack
id={card.id}
icon={card.icon}
title={card.title}
location={card.location}
date={card.date}
/>
</motion.div>
))
: cards.map((card, index) => (
<motion.div
key={card.id}
custom={index}
variants={stackAnimation}
initial="hidden"
animate="visible"
exit="hidden"
style={{
position: "absolute",
transformOrigin: "top center",
zIndex: cards.length - index,
}}
>
<CardStack
id={card.id}
icon={card.icon}
title={card.title}
location={card.location}
date={card.date}
/>
</motion.div>
))}
</AnimatePresence>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need the conditional rendering here. Just conditionally change the CSS style (transform).

Comment on lines +137 to +164
{showAll ? (
<>
<div className="flex flex-row items-center gap-1.5">
<p>Hide</p>
<motion.div
initial={{ rotate: 0 }}
animate={{ rotate: 180 }}
transition={{ duration: 0.4 }}
>
<ChevronDown />
</motion.div>
</div>
</>
) : (
<>
<div className="flex flex-row items-center gap-1.5">
<p>Show All</p>
<motion.div
initial={{ rotate: 0 }}
animate={{ rotate: 0 }}
transition={{ duration: 0.4 }}
>
<ChevronDown />
</motion.div>
</div>
</>
)}
</motion.button>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, you can conditionally change the text and the rotate property of the chevron, keeping the same elements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

List stack
2 participants