-
Notifications
You must be signed in to change notification settings - Fork 14
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
feat: another media custom controls type #566
Merged
Merged
Changes from 14 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
e3b0d9c
feat: new play pause button type
4e6b448
feat: able to hide mute button
df82999
feat: add focus styles
58458c0
fix: remove redundant px
ba4c8d6
feat: backgroundShadowHidden prop
140b77e
fix: simplify
1d08169
feat: added positioning prop
a16873e
feat: added ratio prop
52ea4cf
feat: add ratio to deps
88be367
fix: remove first version of custom controls, use autoplayed version …
a100974
fix: remove onPause handler for autoplayed videos with pause icons
14894f6
feat: removing with-play-pause variant
d700641
feat: using variables
77cecfb
feat: muteButtonShown
bf2b932
fix: use camelCase
02fdeb3
fix: rename with-uikit-play-pause-button to with-play-pause-button
83c61e0
fix: shorter names
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,18 +3,44 @@ | |
|
||
$block: '.#{$ns}CustomBarControls'; | ||
$controlSize: 64px; | ||
// custom controls sizes | ||
$with-uikit-play-pause-control-size: 42px; | ||
$with-uikit-play-pause-control-icon-size: 16px; | ||
$with-mute-control-height: 22px; | ||
$with-mute-control-width: 32px; | ||
// --- | ||
|
||
#{$block} { | ||
&__wrapper { | ||
position: absolute; | ||
bottom: 0; | ||
opacity: 0; | ||
transition: opacity $animationDuration ease 3s; | ||
|
||
&_shown { | ||
opacity: 1; | ||
transition: opacity 0s ease 0s; | ||
} | ||
|
||
&_type { | ||
&_with-play-pause-button { | ||
width: 100%; | ||
padding: $indentS; | ||
&_with-uikit-play-pause-button { | ||
gap: $indentXXXS; | ||
padding: $indentXXXS; | ||
} | ||
} | ||
|
||
&_positioning { | ||
&_left, | ||
&_right, | ||
&_center { | ||
display: flex; | ||
gap: $indentS; | ||
width: 100%; | ||
} | ||
&_right { | ||
flex-direction: row-reverse; | ||
} | ||
&_center { | ||
justify-content: center; | ||
} | ||
} | ||
} | ||
|
@@ -25,25 +51,6 @@ $controlSize: 64px; | |
cursor: pointer; | ||
|
||
&_type { | ||
&_with-play-pause-button { | ||
opacity: 0.9; | ||
background-color: transparent; | ||
transition: opacity $animationDuration ease 3s; | ||
|
||
&:hover, | ||
&:focus { | ||
opacity: 1; | ||
} | ||
&:focus { | ||
outline: 1px solid var(--g-color-line-light); | ||
outline-offset: 2px; | ||
border-radius: 4px; | ||
} | ||
&:focus:not(:focus-visible) { | ||
outline: none; | ||
} | ||
} | ||
|
||
&_with-mute-button { | ||
border-radius: 50%; | ||
display: flex; | ||
|
@@ -55,7 +62,7 @@ $controlSize: 64px; | |
height: $controlSize; | ||
background: var(--g-color-base-background); | ||
transition: background-color $animationDuration; | ||
margin: 12px; | ||
margin: $indentXXS; | ||
|
||
&:hover, | ||
&:focus { | ||
|
@@ -69,23 +76,44 @@ $controlSize: 64px; | |
outline: none; | ||
} | ||
} | ||
|
||
&_with-uikit-play-pause-button { | ||
width: $with-uikit-play-pause-control-size; | ||
height: $with-uikit-play-pause-control-size; | ||
border-radius: 50%; | ||
background: var(--g-color-base-background); | ||
@include shadow(); | ||
|
||
&:focus { | ||
outline: 2px solid var(--g-color-line-misc); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe create mixin for outlines if it would be the same for elements? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, I will create this mixin here #576 |
||
} | ||
&:focus:not(:focus-visible) { | ||
outline: none; | ||
} | ||
} | ||
} | ||
} | ||
|
||
&__play-icon { | ||
height: 24px; | ||
width: 24px; | ||
&_type { | ||
&_with-uikit-play-pause-button { | ||
height: $with-uikit-play-pause-control-icon-size; | ||
width: $with-uikit-play-pause-control-icon-size; | ||
color: var(--g-color-base-neutral-heavy); | ||
} | ||
} | ||
} | ||
|
||
&__mute-icon { | ||
&_type { | ||
&_with-mute-button { | ||
height: 22px; | ||
width: 32px; | ||
height: $with-mute-control-height; | ||
width: $with-mute-control-width; | ||
} | ||
&_with-play-pause-button { | ||
height: 24px; | ||
width: 24px; | ||
&_with-uikit-play-pause-button { | ||
height: $with-uikit-play-pause-control-icon-size; | ||
width: $with-uikit-play-pause-control-icon-size; | ||
color: var(--g-color-base-neutral-heavy); | ||
} | ||
} | ||
} | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you please turn it to camelCase?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done