@7sage/vidstack
Version:
UI component library for building high-quality, accessible video and audio experiences on the web.
149 lines (125 loc) • 3.42 kB
CSS
/*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Keyboard Action
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
:where(.vds-kb-action.hidden) {
opacity: 0;
}
/*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Keyboard Text
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
:where(.vds-kb-text-wrapper) {
text-align: center;
position: absolute;
left: 0;
right: 0;
top: var(--media-kb-text-top, 10%);
z-index: 20;
pointer-events: none;
}
:where(.vds-kb-text) {
display: inline-block;
font-size: var(--media-kb-text-size, 150%);
font-family: var(--media-font-family, sans-serif);
backdrop-filter: blur(2px);
border-radius: var(--media-kb-border-radius, 2.5px);
pointer-events: none;
}
.vds-kb-text {
color: var(--media-kb-text-color, var(--default-color));
background-color: var(--media-kb-text-bg, var(--default-bg));
padding: var(--media-kb-text-padding, 10px 20px);
}
.light .vds-kb-text {
--default-color: #1a1a1a;
--default-bg: rgb(240 240 240 / 0.6);
}
.dark .vds-kb-text {
--default-color: #f5f5f5;
--default-bg: rgb(10 10 10 / 0.6);
}
:where(.vds-kb-text:empty) {
display: none;
}
/*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Keyboard Bezel
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
:where(.vds-kb-bezel) {
--size: var(--media-kb-bezel-size, 52px);
position: absolute;
left: 50%;
top: 45%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: var(--size);
height: var(--size);
margin-left: calc(-1 * calc(var(--size) / 2));
margin-right: calc(-1 * calc(var(--size) / 2));
z-index: 20;
backdrop-filter: blur(2px);
background-color: var(--media-kb-bezel-bg, var(--default-bg));
animation: var(--media-kb-bezel-animation, vds-bezel-fade 0.35s linear 1 normal forwards);
border-radius: var(--media-kb-bezel-border-radius, calc(var(--size) / 2));
pointer-events: none;
}
.vds-kb-bezel:not(:has(svg)) {
display: none ;
}
.light .vds-kb-bezel {
--default-bg: rgb(255 255 255 / 0.6);
}
.dark .vds-kb-bezel {
--default-bg: rgb(10 10 10 / 0.6);
}
@media (prefers-reduced-motion) {
:where(.vds-kb-bezel) {
animation: none;
}
}
:where(.vds-kb-bezel:has(slot:empty)) {
opacity: 0;
}
:where(.vds-kb-action[data-action='seek-forward'] .vds-kb-bezel) {
top: 45%;
left: unset;
right: 10%;
}
:where(.vds-kb-action[data-action='seek-backward'] .vds-kb-bezel) {
top: 45%;
left: 10%;
}
/*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Keyboard Icon
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
:where(.vds-kb-icon) {
--size: var(--media-kb-icon-size, 38px);
width: var(--size);
height: var(--size);
}
.vds-kb-icon {
color: var(--media-kb-icon-color, var(--default-color));
}
.light .vds-kb-icon {
--default-color: #1a1a1a;
}
.dark .vds-kb-icon {
--default-color: #f5f5f5;
}
@keyframes vds-bezel-fade {
0% {
opacity: 1;
}
100% {
opacity: 0;
transform: scale(2);
}
}