File tree Expand file tree Collapse file tree 3 files changed +5
-46
lines changed Expand file tree Collapse file tree 3 files changed +5
-46
lines changed Original file line number Diff line number Diff line change 33 justify-content : center;
44 align-items : center;
55 overflow-y : hidden;
6+ padding-right : 5rem ;
67}
78
89.alumni_item__detail {
Original file line number Diff line number Diff line change 11/* eslint-disable react/prop-types */
2+ import Marquee from "react-fast-marquee"
23import 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 */
1213const 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}
Original file line number Diff line number Diff line change 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 */
You can’t perform that action at this time.
0 commit comments