Skip to content

Commit 4af1c47

Browse files
Add marquee to Alumni Section
Signed-off-by: Vipul Gupta (@vipulgupta2048) <[email protected]>
1 parent 5a2ca90 commit 4af1c47

File tree

3 files changed

+5
-46
lines changed

3 files changed

+5
-46
lines changed

src/components/Reusables/AlumniItem/AlumniItem.module.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
justify-content: center;
44
align-items: center;
55
overflow-y: hidden;
6+
padding-right: 5rem;
67
}
78

89
.alumni_item__detail {

src/components/Reusables/Carousel/Carousel.jsx

Lines changed: 4 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* eslint-disable react/prop-types */
2+
import Marquee from "react-fast-marquee"
23
import styles from "./Carousel.module.css"
34

45
/**
@@ -10,50 +11,13 @@ import styles from "./Carousel.module.css"
1011
* @returns {JSX.Element} - The rendered carousel item component.
1112
*/
1213
const Carousel = ({ id, props }) => {
13-
const handleClickScrollLeft = (e) => {
14-
const carousel = document.getElementById(e)
15-
if (carousel) {
16-
carousel.scrollBy({
17-
left: -carousel.offsetWidth,
18-
behavior: "smooth",
19-
})
20-
}
21-
}
22-
23-
const handleClickScrollRight = (e) => {
24-
const carousel = document.getElementById(e)
25-
if (carousel) {
26-
carousel.scrollBy({
27-
left: carousel.offsetWidth,
28-
behavior: "smooth",
29-
})
30-
}
31-
}
3214
return (
3315
<div className={styles.carousel__container}>
34-
<button
35-
className={styles.carousel__button__left}
36-
onClick={() => handleClickScrollLeft(id)}
37-
>
38-
<img
39-
className={styles.carousel__button__img}
40-
src="assets/icons/left-arrow.svg"
41-
alt="arrow"
42-
/>
43-
</button>
4416
<div id={id} className={styles.carousel}>
45-
{props}
17+
<Marquee speed={220} pauseOnHover={true}>
18+
{props}
19+
</Marquee>
4620
</div>
47-
<button
48-
className={styles.carousel__button__right}
49-
onClick={() => handleClickScrollRight(id)}
50-
>
51-
<img
52-
className={styles.carousel__button__img}
53-
src="assets/icons/right-arrow.svg"
54-
alt="arrow"
55-
/>
56-
</button>
5721
</div>
5822
)
5923
}

src/components/Reusables/Carousel/Carousel.module.css

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,8 @@
1212
}
1313

1414
.carousel {
15-
display: grid;
16-
grid-auto-flow: column;
17-
grid-auto-columns: calc((100% - var(--gap)) / var(--items));
18-
gap: var(--gap);
1915
overflow-x: auto;
20-
scrollbar-width: none;
2116
width: 100%;
22-
max-width: 1445px;
2317
}
2418

2519
/* Hide scrollbar for Chrome, Safari and Opera */

0 commit comments

Comments
 (0)