lbry-desktop/ui/scss/component/_file-render.scss
2020-02-28 09:28:17 -05:00

253 lines
4.5 KiB
SCSS

.file-render {
width: 100%;
height: 100%;
z-index: 1;
overflow: hidden;
max-height: var(--inline-player-max-height);
@media (max-width: $breakpoint-small) {
// margin-top: 10px;
}
}
.file-render--document {
max-height: none;
.content__loading {
background-color: transparent;
padding: 0;
margin: var(--spacing-xlarge) 0;
.content__loading-text {
color: var(--color-text);
}
}
}
.file-render__viewer {
width: 100%;
height: 100%;
iframe,
webview,
img {
width: 100%;
height: 100%;
object-fit: contain;
}
video {
cursor: pointer;
}
.video-js.vjs-fullscreen.vjs-user-inactive.vjs-playing {
video {
cursor: none;
}
}
}
.file-render__viewer--document {
@extend .file-render__viewer;
overflow: auto;
.markdown-preview {
height: 100%;
overflow: auto;
@media (max-width: $breakpoint-small) {
padding: var(--spacing-small);
}
}
}
.file-render__viewer--pdf {
@extend .file-render__viewer;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.5em;
}
.file-render__content {
width: 100%;
height: 100%;
overflow: auto;
max-width: 100vw;
}
//
// Custom viewers live below here
// These either have custom class names that can't be changed or have styles that need to be overridden
//
// Code-viewer
.CodeMirror {
@extend .file-render__content;
.cm-invalidchar {
display: none;
}
.CodeMirror .CodeMirror-lines {
// is there really a .CodeMirror inside a .CodeMirror?
padding: var(--spacing-small) 0;
}
.CodeMirror-code {
@include font-mono;
letter-spacing: 0.1rem;
}
.CodeMirror-gutters {
background-color: var(--color-gray-1);
border-right: 1px solid var(--color-gray-4);
padding-right: var(--spacing-medium);
}
.CodeMirror-line {
padding-left: var(--spacing-medium);
}
.CodeMirror-linenumber {
color: var(--color-gray-5);
}
}
.video-js {
height: 100%;
width: 100%;
// Removing the play button because we have autoplay turned on
// These are classes added by video.js
.vjs-big-play-button {
display: none;
}
.vjs-modal-dialog .vjs-modal-dialog-content {
position: relative;
padding-top: 5rem;
// Make sure no videojs message interferes with overlaying buttons
pointer-events: none;
}
}
.vjs-paused .vjs-big-play-button,
.vjs-paused.vjs-has-started .vjs-big-play-button {
display: block;
}
.file-render {
.video-js {
display: flex;
align-items: center;
justify-content: center;
.vjs-big-play-button {
@extend .button--icon;
@extend .button--play;
border: none;
position: static;
z-index: 2;
.vjs-icon-placeholder {
display: none;
}
}
}
}
.file-render__embed {
height: 100%;
width: 100%;
position: fixed;
.video-js {
display: flex;
align-items: center;
justify-content: center;
.vjs-big-play-button {
@extend .button--icon;
@extend .button--play;
background-color: rgba(0,0,0,0.6);
border: none;
position: static;
z-index: 2;
.vjs-icon-placeholder {
display: none;
}
}
}
.video-js:hover {
.vjs-big-play-button {
background-color: var(--color-primary);
}
}
}
.video-overlay__wrapper {
position: absolute;
left: auto;
right: auto;
height: 100%;
width: 100%;
background-color: rgba(0, 0, 0, 0.9);
z-index: 999;
color: var(--color-white);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: var(--spacing-large);
.button--uri-indicator {
color: var(--color-gray-3);
}
@media (max-width: $breakpoint-small) {
align-items: flex-start;
padding: var(--spacing-small);
.button,
.video-overlay__subtitle,
.video-overlay__actions {
font-size: var(--font-small);
}
}
}
.video-overlay__title {
font-size: var(--font-title);
font-weight: var(--font-weight-light);
margin-top: var(--spacing-medium);
margin-bottom: var(--spacing-small);
@media (max-width: $breakpoint-small) {
margin: 0;
font-size: var(--font-medium);
}
}
.video-overlay__subtitle {
color: var(--color-gray-3);
margin: var(--spacing-medium) 0;
line-height: 1;
@media (max-width: $breakpoint-small) {
margin: 0;
}
}
.video-overlay__actions {
margin-top: var(--spacing-large);
.button--link {
color: var(--color-white);
}
@media (max-width: $breakpoint-small) {
margin-top: var(--spacing-small);
}
}