Skip to content

Commit 3a00604

Browse files
committed
commit
1 parent c7c411b commit 3a00604

File tree

3 files changed

+21
-23
lines changed

3 files changed

+21
-23
lines changed

src/components/OBS_Components/WaifuAlerts/WaifuRoulette.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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!;

src/components/OBS_Components/WaifuAlerts/components/WaifuRoulettePrizeItem.module.scss

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
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;
@@ -12,8 +15,8 @@
1215

1316
.inner {
1417
position: relative;
15-
width: 180px;
16-
height: 240px;
18+
width: 100%;
19+
height: 100%;
1720
border-radius: 18px;
1821
overflow: hidden;
1922
box-shadow: var(--site-shadow-medium);
@@ -74,19 +77,6 @@
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;

src/components/OBS_Components/WaifuAlerts/components/WaifuRoulettePrizeItem.tsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff 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+
811
export 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>

0 commit comments

Comments
 (0)