Skip to content

Commit 9d27444

Browse files
committed
Обновление: улучшен компонент IntroStage с изменением отображения аватара и добавлением нового стиля для имени пользователя
1 parent b8e1290 commit 9d27444

File tree

2 files changed

+61
-23
lines changed

2 files changed

+61
-23
lines changed

src/components/OBS_Components/MikuMonday/MikuMonday.module.scss

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@
3939
}
4040

4141
.intro-avatar-wrapper {
42+
display: none;
4243
width: 160px;
4344
height: 160px;
4445
flex: 0 0 160px;
45-
display: flex;
4646
align-items: center;
4747
justify-content: center;
4848
border-radius: 50%;
@@ -78,12 +78,52 @@
7878
flex-direction: column;
7979
gap: 14px;
8080
color: var(--site-text-light);
81+
grid-column: 1 / -1;
82+
text-align: center;
8183
}
8284

8385
.intro-heading {
8486
font-size: clamp(2.2rem, 4vw, 2.8rem);
8587
font-weight: 600;
8688
letter-spacing: 0.05em;
89+
color: rgb(57, 197, 187);
90+
}
91+
92+
.intro-name-with-avatar {
93+
display: flex;
94+
align-items: center;
95+
justify-content: center;
96+
gap: 16px;
97+
}
98+
99+
.intro-small-avatar {
100+
width: 80px;
101+
height: 80px;
102+
flex-shrink: 0;
103+
border-radius: 50%;
104+
border: none;
105+
background: radial-gradient(circle, rgba(255, 255, 255, 0.18) 0%, rgba(5, 8, 16, 0.85) 100%);
106+
box-shadow:
107+
0 0 24px rgba(var(--bs-primary-rgb), 0.65),
108+
inset 0 0 18px rgba(0, 0, 0, 0.55);
109+
overflow: hidden;
110+
display: flex;
111+
align-items: center;
112+
justify-content: center;
113+
}
114+
115+
.intro-small-avatar img {
116+
width: 100%;
117+
height: 100%;
118+
object-fit: cover;
119+
}
120+
121+
.intro-small-avatar-placeholder {
122+
font-size: 2.4rem;
123+
font-weight: 800;
124+
color: #fff;
125+
background: rgba(var(--bs-primary-rgb), 0.4);
126+
text-transform: uppercase;
87127
}
88128

89129
.intro-name {
@@ -101,7 +141,8 @@
101141
}
102142

103143
.intro-subtitle {
104-
margin-top: 8px;
144+
display: block;
145+
margin: 8px auto 0;
105146
font-size: 1.4rem;
106147
font-weight: 500;
107148
color: rgba(255, 255, 255, 0.82);

src/components/OBS_Components/MikuMonday/components/stages/IntroStage.tsx

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ export default function IntroStage({
2929
}, [durationMs, onComplete]);
3030

3131
const displayName = twitchUser.displayName ?? twitchUser.userLogin;
32-
const loginTag = `@${twitchUser.userLogin}`;
3332
const avatarUrl = twitchUser.profileImageUrl ?? fallbackAvatar ?? "";
3433

3534
const fallbackSymbol = useMemo(() => {
@@ -45,33 +44,31 @@ export default function IntroStage({
4544
<article
4645
className={`${styles["intro-stage"]} ${animate.animated} ${animate.fadeIn}`}
4746
>
48-
<div className={styles["intro-avatar-wrapper"]}>
49-
{hasAvatar ? (
50-
<img
51-
src={avatarUrl}
52-
alt={displayName}
53-
className={styles["intro-avatar"]}
54-
/>
55-
) : (
56-
<div className={styles["intro-avatar-placeholder"]}>
57-
{fallbackSymbol}
58-
</div>
59-
)}
60-
</div>
6147
<div className={styles["intro-text-block"]}>
6248
<span
6349
className={`${styles["intro-heading"]} ${commonStyles.textStrokeShadow}`}
6450
>
6551
Мику обратила свой взор на
6652
</span>
67-
<span
68-
className={`${styles["intro-name"]} ${commonStyles.textStrokeShadow}`}
69-
>
70-
{displayName}
71-
</span>
72-
<span className={styles["intro-login"]}>{loginTag}</span>
53+
<div className={styles["intro-name-with-avatar"]}>
54+
<div className={styles["intro-small-avatar"]}>
55+
{hasAvatar ? (
56+
<img src={avatarUrl} alt={displayName} />
57+
) : (
58+
<div className={styles["intro-small-avatar-placeholder"]}>
59+
{fallbackSymbol}
60+
</div>
61+
)}
62+
</div>
63+
<span
64+
className={`${styles["intro-name"]} ${commonStyles.textStrokeShadow}`}
65+
style={{ color: twitchUser.chatColor ?? "#fff" }}
66+
>
67+
{displayName}
68+
</span>
69+
</div>
7370
<span className={styles["intro-subtitle"]}>
74-
Приготовься к волшебству — твой трек уже на подходе!
71+
Всем приготовься к волшебству — новый трек уже на подходе!
7572
</span>
7673
</div>
7774
</article>

0 commit comments

Comments
 (0)