File tree Expand file tree Collapse file tree 3 files changed +21
-23
lines changed
src/components/OBS_Components/WaifuAlerts Expand file tree Collapse file tree 3 files changed +21
-23
lines changed Original file line number Diff line number Diff line change @@ -100,9 +100,9 @@ export default function WaifuRoulette({
100100 prizesWithText : true ,
101101 hideCenterDelimiter : true ,
102102 } }
103- // prizeItemRenderFunction={prize => (
104- // <WaifuRoulettePrizeItem image={prize.image} text={prize.text} />
105- // )}
103+ prizeItemRenderFunction = { prize => (
104+ < WaifuRoulettePrizeItem image = { prize . image } text = { prize . text } />
105+ ) }
106106 onPrizeDefined = { ( ) => {
107107 setVisible ( false ) ;
108108 const div = rouletteDiv . current ! ;
Original file line number Diff line number Diff line change 11.figure {
22 position : relative ;
3- width : 190px ;
3+ width : 100% ;
4+ height : 100% ;
45 margin : 0 ;
6+ box-sizing : border-box ;
7+ padding : 0 12px ;
58 perspective : 900px ;
69 display : flex ;
710 flex-direction : column ;
1215
1316.inner {
1417 position : relative ;
15- width : 180 px ;
16- height : 240 px ;
18+ width : 100 % ;
19+ height : 100 % ;
1720 border-radius : 18px ;
1821 overflow : hidden ;
1922 box-shadow : var (--site-shadow-medium );
7477 text-overflow : ellipsis ;
7578}
7679
77- @media (max-width : 1280px ) {
78- .figure {
79- width : 180px ;
80- margin : 0 8px ;
81- gap : 12px ;
82- }
83-
84- .inner {
85- width : 160px ;
86- height : 210px ;
87- }
88- }
89-
9080@media (hover : none ) {
9181 .inner :hover {
9282 transform : none ;
Original file line number Diff line number Diff line change @@ -5,24 +5,32 @@ interface WaifuRoulettePrizeItemProps {
55 text ?: string ;
66}
77
8+ const PRIZE_ITEM_WIDTH = 205 ;
9+ const PRIZE_ITEM_HEIGHT = 234 ;
10+
811export default function WaifuRoulettePrizeItem ( {
912 image,
1013 text,
1114} : WaifuRoulettePrizeItemProps ) {
1215 if ( image ) {
16+ const normalizedText = text ?. trim ( ) ;
17+
1318 return (
14- < figure className = { styles . figure } >
19+ < figure
20+ className = { styles . figure }
21+ style = { { width : `${ PRIZE_ITEM_WIDTH } px` , height : `${ PRIZE_ITEM_HEIGHT } px` } }
22+ >
1523 < div className = { styles . inner } >
1624 < img
1725 src = { image }
18- alt = { text || "" }
26+ alt = { normalizedText || "" }
1927 className = { styles . image }
2028 loading = "lazy"
2129 />
2230 </ div >
23- { text && text . trim ( ) . length > 0 ? (
31+ { normalizedText ? (
2432 < figcaption className = { styles . caption } >
25- < span > { text } </ span >
33+ < span > { normalizedText } </ span >
2634 </ figcaption >
2735 ) : null }
2836 </ figure >
You can’t perform that action at this time.
0 commit comments