Skip to content

Commit 801467f

Browse files
committed
Refactor Message component and update Scoreboard styles for improved layout and functionality
- Updated video element in Message component to disable controls, enable autoplay, and mute audio for better user experience. - Simplified conditional rendering for media types in Message component. - Removed min-height from Scoreboard styles to enhance layout flexibility. - Adjusted default layout settings for header positioning and dimensions in AdminPanel types.
1 parent 9f557b3 commit 801467f

27 files changed

+3717
-33
lines changed

src/components/OBS_Components/ChatVertical/Message.tsx

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,9 @@ export function Message({ message, onRemove }: Props) {
140140
<video
141141
key={part.id}
142142
src={part.content}
143-
controls
143+
controls={false}
144+
autoPlay
145+
muted
144146
style={{
145147
maxWidth: "180px",
146148
maxHeight: "120px",
@@ -172,35 +174,11 @@ export function Message({ message, onRemove }: Props) {
172174
</span>
173175
);
174176
}
175-
if (part.type === "image") {
176-
return (
177-
<img
178-
key={part.id}
179-
src={part.content}
180-
alt="image"
181-
style={{
182-
maxWidth: "120px",
183-
maxHeight: "120px",
184-
margin: "0 4px",
185-
}}
186-
/>
187-
);
188-
}
189-
if (part.type === "video") {
190-
return (
191-
<video
192-
key={part.id}
193-
src={part.content}
194-
controls
195-
style={{
196-
maxWidth: "180px",
197-
maxHeight: "120px",
198-
margin: "0 4px",
199-
}}
200-
/>
201-
);
202-
}
203-
if (part.type === "link") {
177+
if (
178+
part.type === "link" ||
179+
part.type === "video" ||
180+
part.type === "image"
181+
) {
204182
return (
205183
<span key={part.id} className={styles.linkStub}>
206184
ссылка
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import EBALO4Url from "@/components/OBS_Components/PNGTuber/png/EBALO4.png";
2+
3+
import { FireOutlineCanvas } from "./FireShader";
4+
5+
// Демо-компонент: PNG-картинка + огненная обводка поверх. Параметры заметности
6+
export const AvatarWithFire = () => {
7+
const size = 512;
8+
const radius = Math.floor(size * 0.14);
9+
const intensity = 1.6;
10+
const speed = 1.35;
11+
12+
return (
13+
<div
14+
style={{
15+
width: size,
16+
height: size,
17+
position: "relative",
18+
background: "#000",
19+
}}
20+
>
21+
<img
22+
alt="avatar-mask"
23+
src={EBALO4Url}
24+
style={{
25+
width: "100%",
26+
height: "100%",
27+
objectFit: "contain",
28+
display: "block",
29+
userSelect: "none",
30+
pointerEvents: "none",
31+
position: "absolute",
32+
inset: 0,
33+
zIndex: 0,
34+
}}
35+
/>
36+
<FireOutlineCanvas
37+
width={size}
38+
height={size}
39+
maskUrl={EBALO4Url}
40+
radiusPx={radius}
41+
intensity={intensity}
42+
speed={speed}
43+
style={{ position: "absolute", inset: 0 }}
44+
/>
45+
</div>
46+
);
47+
};
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import { FireOutlineCanvas } from "./FireShader";
2+
3+
// Демо: в качестве маски используется SVG (data URL), вокруг него рисуем огонь
4+
export const AvatarWithFireSvg = () => {
5+
const size = 512;
6+
const radius = Math.floor(size * 0.5);
7+
const intensity = 3.0;
8+
const speed = 1.35;
9+
10+
// Простой SVG-силуэт (блоб) на прозрачном фоне
11+
const svg = `
12+
<svg xmlns='http://www.w3.org/2000/svg' width='${size}' height='${size}' viewBox='0 0 ${size} ${size}'>
13+
<defs>
14+
<radialGradient id='g' cx='50%' cy='45%' r='50%'>
15+
<stop offset='0%' stop-color='#ffffff' />
16+
<stop offset='100%' stop-color='#dddddd' />
17+
</radialGradient>
18+
</defs>
19+
<rect width='100%' height='100%' fill='transparent'/>
20+
<path fill='url(#g)' d='
21+
M ${size * 0.2} ${size * 0.45}
22+
C ${size * 0.2} ${size * 0.25}, ${size * 0.35} ${size * 0.1}, ${size * 0.5} ${size * 0.1}
23+
C ${size * 0.72} ${size * 0.1}, ${size * 0.8} ${size * 0.28}, ${size * 0.8} ${size * 0.45}
24+
C ${size * 0.8} ${size * 0.72}, ${size * 0.64} ${size * 0.88}, ${size * 0.5} ${size * 0.9}
25+
C ${size * 0.35} ${size * 0.88}, ${size * 0.2} ${size * 0.7}, ${size * 0.2} ${size * 0.45}
26+
Z' />
27+
</svg>`;
28+
const svgUrl = `data:image/svg+xml;utf8,${encodeURIComponent(svg)}`;
29+
30+
return (
31+
<div
32+
style={{
33+
width: size,
34+
height: size,
35+
position: "relative",
36+
background: "#000",
37+
}}
38+
>
39+
<img
40+
alt="svg-mask"
41+
src={svgUrl}
42+
style={{
43+
width: "100%",
44+
height: "100%",
45+
objectFit: "contain",
46+
display: "block",
47+
userSelect: "none",
48+
pointerEvents: "none",
49+
position: "absolute",
50+
inset: 0,
51+
zIndex: 0,
52+
}}
53+
/>
54+
<FireOutlineCanvas
55+
width={size}
56+
height={size}
57+
maskUrl={svgUrl}
58+
radiusPx={radius}
59+
intensity={intensity}
60+
speed={speed}
61+
style={{ position: "absolute", inset: 0 }}
62+
/>
63+
</div>
64+
);
65+
};

0 commit comments

Comments
 (0)