soapbox/app/styles/components/video-player.scss

438 wiersze
7.4 KiB
SCSS
Czysty Zwykły widok Historia

2020-06-03 02:11:01 +00:00
.video-error-cover {
align-items: center;
background: var(--background-color);
color: var(--primary-text-color);
cursor: pointer;
display: flex;
flex-direction: column;
height: 100%;
justify-content: center;
margin-top: 8px;
position: relative;
text-align: center;
z-index: 100;
}
.status__video-player {
background: var(--background-color);
box-sizing: border-box;
cursor: default; /* May not be needed */
margin-top: 8px;
overflow: hidden;
position: relative;
}
.status__video-player-video {
height: 100%;
object-fit: cover;
position: relative;
top: 50%;
transform: translateY(-50%);
width: 100%;
z-index: 1;
}
.status__video-player-expand,
.status__video-player-mute {
color: var(--primary-text-color);
opacity: 0.8;
position: absolute;
right: 4px;
text-shadow: 0 1px 1px $base-shadow-color, 1px 0 1px $base-shadow-color;
}
.status__video-player-spoiler {
display: none;
color: var(--primary-text-color);
left: 4px;
position: absolute;
text-shadow: 0 1px 1px $base-shadow-color, 1px 0 1px $base-shadow-color;
top: 4px;
z-index: 100;
&.status__video-player-spoiler--visible {
display: block;
}
}
.status__video-player-expand {
bottom: 4px;
z-index: 100;
}
.status__video-player-mute {
top: 4px;
z-index: 5;
}
.detailed,
.fullscreen {
.video-player__volume__current,
.video-player__volume::before {
bottom: 27px;
}
.video-player__volume__handle {
bottom: 23px;
}
}
.video-player {
overflow: hidden;
position: relative;
background: $base-shadow-color;
max-width: 100%;
border-radius: 10px;
2021-05-18 00:39:08 +00:00
box-sizing: border-box;
direction: ltr;
color: white;
&.editable {
border-radius: 0;
height: 100% !important;
}
2020-06-03 02:11:01 +00:00
&:focus {
outline: 0;
}
video {
2021-05-18 00:39:08 +00:00
display: block;
2020-06-03 02:11:01 +00:00
z-index: 1;
}
&.fullscreen {
width: 100% !important;
height: 100% !important;
margin: 0;
video {
max-width: 100% !important;
max-height: 100% !important;
width: 100% !important;
height: 100% !important;
2021-05-18 00:39:08 +00:00
outline: 0;
2020-06-03 02:11:01 +00:00
}
}
2022-03-21 18:09:01 +00:00
&--inline {
2020-06-03 02:11:01 +00:00
video {
object-fit: contain;
position: relative;
2022-04-14 20:47:55 +00:00
max-height: 100%;
2020-06-03 02:11:01 +00:00
}
}
&__controls {
position: absolute;
z-index: 2;
bottom: 0;
left: 0;
right: 0;
box-sizing: border-box;
background: linear-gradient(0deg, rgba($base-shadow-color, 0.85) 0, rgba($base-shadow-color, 0.45) 60%, transparent);
padding: 0 15px;
opacity: 0;
transition: opacity 0.1s ease;
2020-06-03 02:11:01 +00:00
&.active {
opacity: 1;
}
}
2022-03-21 18:09:01 +00:00
&--inactive {
2021-05-18 01:08:09 +00:00
min-height: 300px;
2020-06-03 02:11:01 +00:00
video,
.video-player__controls {
visibility: hidden;
}
}
&__spoiler {
display: none;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 4;
border: 0;
background: var(--background-color);
2020-06-07 03:55:00 +00:00
color: var(--primary-text-color--faint);
2020-06-03 02:11:01 +00:00
transition: none;
pointer-events: none;
&.active {
display: block;
pointer-events: auto;
&:hover,
&:active,
&:focus {
color: var(--primary-text-color);
}
}
&__title {
display: block;
font-size: 14px;
}
&__subtitle {
display: block;
font-size: 11px;
font-weight: 500;
}
}
&__buttons-bar {
display: flex;
justify-content: space-between;
2021-05-18 00:39:08 +00:00
padding-bottom: 8px;
margin: 0 -5px;
.video-player__download__icon {
color: inherit;
}
2020-06-03 02:11:01 +00:00
}
&__buttons {
2021-05-18 00:39:08 +00:00
display: flex;
flex: 0 1 auto;
min-width: 30px;
align-items: center;
2020-06-03 02:11:01 +00:00
font-size: 16px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
2021-05-18 00:39:08 +00:00
.player-button {
display: inline-block;
outline: 0;
flex: 0 0 auto;
2020-06-03 02:11:01 +00:00
background: transparent;
2021-09-28 04:47:43 +00:00
padding: 5px 6px;
2020-06-03 02:11:01 +00:00
font-size: 16px;
border: 0;
color: rgba(#fff, 0.75);
2020-06-03 02:11:01 +00:00
2021-09-28 04:47:43 +00:00
.svg-icon {
width: 20px;
height: 20px;
}
2020-06-03 02:11:01 +00:00
&:active,
&:hover,
&:focus {
color: #fff;
2020-06-03 02:11:01 +00:00
}
}
}
2021-05-18 00:39:08 +00:00
&__time {
display: inline;
flex: 0 1 auto;
overflow: hidden;
text-overflow: ellipsis;
margin: 0 5px;
}
2020-06-03 02:11:01 +00:00
&__time-sep,
&__time-total,
&__time-current {
font-size: 14px;
font-weight: 500;
}
&__time-current {
color: #fff;
2020-06-03 02:11:01 +00:00
}
&__time-sep {
display: inline-block;
margin: 0 6px;
}
&__time-sep,
&__time-total {
color: #fff;
2020-06-03 02:11:01 +00:00
}
&__volume {
2021-05-18 00:39:08 +00:00
flex: 0 0 auto;
display: inline-flex;
2020-06-03 02:11:01 +00:00
cursor: pointer;
height: 24px;
2021-05-18 00:39:08 +00:00
position: relative;
overflow: hidden;
.no-reduce-motion & {
transition: all 100ms linear;
}
&.active {
overflow: visible;
width: 50px;
margin-right: 16px;
}
2020-06-03 02:11:01 +00:00
&::before {
content: "";
width: 50px;
background: rgba(#fff, 0.35);
2020-06-03 02:11:01 +00:00
border-radius: 4px;
display: block;
position: absolute;
height: 4px;
2021-05-18 00:39:08 +00:00
left: 0;
top: 50%;
transform: translate(0, -50%);
2020-06-03 02:11:01 +00:00
}
&__current {
2022-05-07 15:52:14 +00:00
@apply bg-accent-500;
2020-06-03 02:11:01 +00:00
display: block;
position: absolute;
height: 4px;
border-radius: 4px;
2021-05-18 00:39:08 +00:00
left: 0;
top: 50%;
transform: translate(0, -50%);
2020-06-03 02:11:01 +00:00
}
&__handle {
2022-05-07 15:52:14 +00:00
@apply bg-accent-500;
2020-06-03 02:11:01 +00:00
position: absolute;
z-index: 3;
border-radius: 50%;
width: 12px;
height: 12px;
2021-05-18 00:39:08 +00:00
top: 50%;
left: 0;
margin-left: -6px;
transform: translate(0, -50%);
2020-06-03 02:11:01 +00:00
box-shadow: 1px 2px 6px rgba($base-shadow-color, 0.2);
2021-05-18 00:39:08 +00:00
opacity: 0;
.no-reduce-motion & {
transition: opacity 100ms linear;
}
}
&.active &__handle {
opacity: 1;
2020-06-03 02:11:01 +00:00
}
}
&__link {
padding: 2px 10px;
a {
text-decoration: none;
font-size: 14px;
font-weight: 500;
color: #fff;
2020-06-03 02:11:01 +00:00
&:hover,
&:active,
&:focus {
text-decoration: underline;
}
}
}
&__seek {
cursor: pointer;
height: 24px;
position: relative;
&::before {
content: "";
width: 100%;
background: rgba(#fff, 0.35);
2020-06-03 02:11:01 +00:00
border-radius: 4px;
display: block;
position: absolute;
height: 4px;
2021-05-18 00:39:08 +00:00
top: 14px;
2020-06-03 02:11:01 +00:00
}
&__progress,
&__buffer {
display: block;
position: absolute;
height: 4px;
border-radius: 4px;
2021-05-18 00:39:08 +00:00
top: 14px;
2022-05-07 15:52:14 +00:00
}
&__progress {
@apply bg-accent-500;
2020-06-03 02:11:01 +00:00
}
&__buffer {
background: rgba(#fff, 0.2);
2020-06-03 02:11:01 +00:00
}
&__handle {
2022-05-07 15:52:14 +00:00
@apply bg-accent-500;
2020-06-03 02:11:01 +00:00
position: absolute;
z-index: 3;
opacity: 0;
border-radius: 50%;
width: 12px;
height: 12px;
2021-05-18 00:39:08 +00:00
top: 10px;
2020-06-03 02:11:01 +00:00
margin-left: -6px;
box-shadow: 1px 2px 6px rgba($base-shadow-color, 0.2);
2021-05-18 00:39:08 +00:00
.no-reduce-motion & {
transition: opacity 0.1s ease;
}
2020-06-03 02:11:01 +00:00
&.active {
opacity: 1;
}
}
&:hover {
.video-player__seek__handle {
opacity: 1;
}
}
}
&.detailed,
&.fullscreen {
.video-player__buttons {
2021-05-18 00:39:08 +00:00
.player-button {
2020-06-03 02:11:01 +00:00
padding-top: 10px;
padding-bottom: 10px;
}
}
}
}
.media-spoiler-video {
background-size: cover;
background-repeat: no-repeat;
background-position: center;
cursor: pointer;
margin-top: 8px;
position: relative;
border: 0;
display: block;
}
.media-spoiler-video-play-icon {
border-radius: 100px;
2020-06-07 03:55:00 +00:00
color: var(--primary-text-color--faint);
2020-06-03 02:11:01 +00:00
font-size: 36px;
left: 50%;
padding: 5px;
position: absolute;
top: 50%;
transform: translate(-50%, -50%);
}