Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(subtitles): Styles. #15043

Merged
merged 1 commit into from
Aug 28, 2024
Merged

fix(subtitles): Styles. #15043

merged 1 commit into from
Aug 28, 2024

Conversation

hristoterezov
Copy link
Member

  • Move the styles from css to tss-react ones
  • Dynamic fontSize based on the visible area of the page
  • Remove the gaps in the background when a line is wrapped.
  • Change the text color to white.
  • Remove transparency.

damencho
damencho previously approved these changes Aug 22, 2024
*/
export function calculateSubtitlesFontSize(clientHeight?: number) {
if (typeof clientHeight === 'undefined') {
return 16;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extract to a constant since it's used in 2 places here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

1px 0px 1px rgba(0,0,0,0.3),
0px 0px 1px rgba(0,0,0,0.3)`,
transform: 'translateX(-50%)',
zIndex: 7,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why 7? Is it relative to something? A comment explaining woould help.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably. Now the thing is this is a copy paste of the css :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you insist on reviewing all z-indexes so that we can write what do we want to cover?

If we are doing this wouldn't it be more beneficial, to review all zIndex levels, to define all z-index levels as variables with meaningful names and comments?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a comment for now


return {
transcriptionSubtitles: {
bottom: _isLifted ? `${toolbarSize + 36 + 40}px` : `${toolbarSize + 40}px`,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where do those 36 and 40 come from?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto.

For 36 I guess the intention was to lift it for the label for the on stage participant's name. Will add a comment or something.

For 40 I can only guess this only the desired padding...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I see that this whole thing is kind of dependent on the onstage participant display name badge, which uses the theme. I'll move those in a common place and use it from there.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be fixed now. both stage participant display name badge and the captions are using the same thing from a generic function which uses the theme.

 - Move the styles from css to tss-react ones
 - Dynamic fontSize based on the visible area of the page
 - Remove the gaps in the background when a line is wrapped.
 - Change the text color to white.
 - Remove transparency.
@hristoterezov hristoterezov merged commit 2d56dbe into master Aug 28, 2024
9 checks passed
@hristoterezov hristoterezov deleted the transcriptions_styles branch August 28, 2024 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants