Add Quotation Carousel #36
Loading…
Reference in New Issue
No description provided.
Delete Branch "a258wang-quotation-carousel"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Made without visx, because that was easier.
Closes #10.
https://a258wang-quotation-carousel-csc-class-profile-staging-snedadah.k8s.csclub.cloud/playground
Looks good to me. Figma's component has a slight gradient and the text is aligned left, but I think your version looks better.
@ -0,0 +21,4 @@
}
.arrow {
position: relative;
Do you need this?
Yes, it's required for the slight translation on hover to work.
@ -0,0 +31,4 @@
return (
<section
className={styles.carousel}
I noticed other components had customizable className props. Do we need it on this component as well? For example on Figma, the quotation has a subtle opacity change to show some circles in the background.
Good catch, I'll add that in. Also oops I got too excited to put up a PR and forgot to add the circles 🤦
Added the customizable className prop, and also the background circles.
@ -0,0 +32,4 @@
return (
<section
className={styles.carousel}
style={{ width: `${width / 16}rem`, minHeight: `${height / 16}rem` }}
I'm assuming that if we have very large text input, it's up to the developer to manually resize the carousel to fit everything, right?
Yes that's correct, making the developer resize the carousel using props ended up being the easiest for me to implement ("it's not my problem, it's yours" lol).
The issue I was having was getting all the cards to be the same size AND big enough for the longest quote in the carousel (even though the longest quote might be hidden).
@ -0,0 +37,4 @@
<CarouselButton onClick={showPreviousCard} isPrevious />
<div className={styles.card}>
<QuotationMark className={styles.quotationMark} />
<ul>
If there is only ever one quote displayed at a time, why can't you replace the entire
<ul>
withMaybe I'm missing something here.
I'm hiding quotes using
visibility: hidden
instead ofdisplay: none
or conditional rendering, because it allows for a nicer fade animation when changing between quotes.Also, accessibility best practices for carousels are kinda unclear, but one idea I saw was to make each thing in the carousel an item in a list. (This entire component could probably use an accessibility revisit though, to be honest. Actually, we should probably audit the entire Class Profile site for accessibility, once it's almost done.)
I suppose the Figma circles are not centered like this component is, so you could possibly think about adding the customizable props top and left to the circles, however I don't think it's necessary.
Looks great!!!