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 3
3
justify-content : center;
4
4
align-items : center;
5
5
overflow-y : hidden;
6
+ padding-right : 5rem ;
6
7
}
7
8
8
9
.alumni_item__detail {
Original file line number Diff line number Diff line change 1
1
/* eslint-disable react/prop-types */
2
+ import Marquee from "react-fast-marquee"
2
3
import styles from "./Carousel.module.css"
3
4
4
5
/**
@@ -10,50 +11,13 @@ import styles from "./Carousel.module.css"
10
11
* @returns {JSX.Element } - The rendered carousel item component.
11
12
*/
12
13
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
- }
32
14
return (
33
15
< 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 >
44
16
< div id = { id } className = { styles . carousel } >
45
- { props }
17
+ < Marquee speed = { 220 } pauseOnHover = { true } >
18
+ { props }
19
+ </ Marquee >
46
20
</ 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 >
57
21
</ div >
58
22
)
59
23
}
Original file line number Diff line number Diff line change 12
12
}
13
13
14
14
.carousel {
15
- display : grid;
16
- grid-auto-flow : column;
17
- grid-auto-columns : calc ((100% - var (--gap )) / var (--items ));
18
- gap : var (--gap );
19
15
overflow-x : auto;
20
- scrollbar-width : none;
21
16
width : 100% ;
22
- max-width : 1445px ;
23
17
}
24
18
25
19
/* Hide scrollbar for Chrome, Safari and Opera */
You can’t perform that action at this time.
0 commit comments