Skip to content

Commit

Permalink
fix: textbox offset left can not modify when miniavatar on
Browse files Browse the repository at this point in the history
  • Loading branch information
MakinoharaShoko committed Jun 2, 2024
1 parent c1d9ea6 commit 4f592f2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
transition: left 0.33s;
}

.TextBox_main_miniavatarOff {
left: 25px;
}

.TextBox_Background {
z-index: 2;
background: linear-gradient(rgba(245, 247, 250, 1) 0%, rgba(189, 198, 222, 1) 100%);
Expand Down
17 changes: 13 additions & 4 deletions packages/webgal/src/Stage/TextBox/IMSSTextbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export default function IMSSTextbox(props: ITextboxProps) {
e.className = applyStyle('TextBox_textElement_Settled', styles.TextBox_textElement_Settled);
});
}

WebGAL.events.textSettle.on(settleText);
return () => {
WebGAL.events.textSettle.off(settleText);
Expand Down Expand Up @@ -107,19 +108,27 @@ export default function IMSSTextbox(props: ITextboxProps) {
className={
applyStyle('TextBox_main', styles.TextBox_main) +
' ' +
applyStyle('TextBox_Background', styles.TextBox_Background)
applyStyle('TextBox_Background', styles.TextBox_Background) +
' ' +
(miniAvatar === ''
? applyStyle('TextBox_main_miniavatarOff', styles.TextBox_main_miniavatarOff)
: undefined)
}
style={{
opacity: `${textboxOpacity / 100}`,
left: miniAvatar === '' ? 25 : undefined,
}}
/>
<div
id="textBoxMain"
className={applyStyle('TextBox_main', styles.TextBox_main)}
className={
applyStyle('TextBox_main', styles.TextBox_main) +
' ' +
(miniAvatar === ''
? applyStyle('TextBox_main_miniavatarOff', styles.TextBox_main_miniavatarOff)
: undefined)
}
style={{
fontFamily: font,
left: miniAvatar === '' ? 25 : undefined,
}}
>
<div id="miniAvatar" className={applyStyle('miniAvatarContainer', styles.miniAvatarContainer)}>
Expand Down
4 changes: 4 additions & 0 deletions packages/webgal/src/Stage/TextBox/textbox.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ $height: 330px;
transition: left 0.33s;
}

.TextBox_main_miniavatarOff {
left: 25px;
}

.TextBox_Background {
z-index: 2;
background: linear-gradient(rgba(245, 247, 250, 1) 0%, rgba(189, 198, 222, 1) 100%);
Expand Down

0 comments on commit 4f592f2

Please sign in to comment.