miru/app/css/torrent-player.css

298 lines
7 KiB
CSS

/* yes these are duplicates with framework */
.torrent-player {
--download: 0%;
position: absolute;
display: flex;
flex-direction: column;
justify-content: center;
align-content: center;
color: #ececec;
user-select: none;
font-family: Roboto, Arial, Helvetica, sans-serif;
z-index: 10;
will-change: width, right, bottom, position, display;
bottom: 2rem;
right: 2rem;
width: 25%;
height: auto;
transition: width 0.2s ease;
}
.torrent-player:target {
bottom: 0;
right: 0;
position: relative;
width: 100%;
height: 100%;
transition: none !important;
}
.torrent-player:target > div {
display: flex;
}
.torrent-player video {
position: relative;
flex: 0 1 auto;
z-index: -1;
width: 100%;
height: 100%;
}
.torrent-player:target video {
position: absolute;
}
.torrent-player a.miniplayer {
z-index: 5;
position: absolute;
width: 100%;
height: 100%;
}
.torrent-player.pip {
background: #000;
}
.torrent-player.pip canvas {
left: 99.9% !important; /*hack to hide the canvas but still keep it updating*/
}
.torrent-player .material-icons {
font-size: 2.2rem !important;
padding: 1.2rem;
transition: all 0.2s ease;
display: flex;
}
.torrent-player.immersed {
cursor: none;
}
.torrent-player.immersed .top,
.torrent-player.immersed .bottom {
opacity: 0;
}
.torrent-player:target a.miniplayer,
.torrent-player .bottom input[type='range'][data-name='setProgress'] + img[src=' '],
video[src=''],
.torrent-player.pip video,
.torrent-player .ctrl[disabled],
.torrent-player:fullscreen .ctrl[data-name='toggleTheatre'],
.torrent-player:fullscreen .ctrl[data-name='openPlaylist'],
.torrent-player:fullscreen .ctrl[data-name='togglePopout'] {
display: none !important;
}
.torrent-player .top {
background: linear-gradient(
to bottom,
rgba(0, 0, 0, 0.8),
rgba(0, 0, 0, 0.4) 25%,
rgba(0, 0, 0, 0.2) 50%,
rgba(0, 0, 0, 0.1) 75%,
transparent
);
display: none;
transition: 0.5s opacity ease;
border-width: 0;
border-top-width: 1px;
border-image-slice: 1;
border-style: solid;
border-image-source: linear-gradient(
90deg,
#e5204c var(--download),
rgba(0, 0, 0, 0.8) var(--download)
);
}
.torrent-player .top > div {
display: flex;
}
.torrent-player .top span[data-name='peers']::after,
.torrent-player .top span[data-name='downSpeed']::after,
.torrent-player .top span[data-name='upSpeed']::after,
.torrent-player .top div[data-name='nowPlaying'] {
content: attr(data-value);
font-size: 1.8rem !important;
white-space: nowrap;
align-self: center;
font-weight: 600;
font-family: Roboto, Arial, Helvetica, sans-serif;
padding-left: 1.2rem;
}
.torrent-player .top div[data-name='nowPlaying'] {
padding-left: 1.2rem !important;
overflow: hidden;
text-overflow: ellipsis;
}
.torrent-player .top span[data-name='downloadFile'][disabled] {
display: block !important;
cursor: not-allowed;
color: rgba(255, 255, 255, 0.4);
}
.torrent-player .middle {
height: 100%;
flex: 1;
display: none;
flex-direction: column;
position: relative;
justify-content: center;
align-items: center;
}
.torrent-player .middle div[data-name='bufferingDisplay'] {
border: 4px solid #ffffff00;
border-top: 4px solid #fff;
border-radius: 50%;
width: 40px;
height: 40px;
animation: spin 1s linear infinite;
opacity: 0;
transition: 0.5s opacity ease;
position: absolute;
}
.torrent-player.buffering .middle div[data-name='bufferingDisplay'] {
opacity: 1 !important;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.torrent-player .bottom {
background: linear-gradient(
to top,
rgba(0, 0, 0, 0.8),
rgba(0, 0, 0, 0.4) 25%,
rgba(0, 0, 0, 0.2) 50%,
rgba(0, 0, 0, 0.1) 75%,
transparent
);
display: none;
transition: 0.5s opacity ease;
}
.torrent-player .bottom .ctrl:hover {
filter: drop-shadow(0 0 8px #000);
}
.torrent-player .bottom .ctrl {
cursor: pointer;
}
.torrent-player .bottom input[type='range'] {
-webkit-appearance: none;
background: transparent;
margin: 0;
cursor: pointer;
}
.torrent-player .bottom input[type='range']:focus {
outline: none;
}
.torrent-player .bottom input[type='range']::-webkit-slider-runnable-track {
height: 3px;
}
.torrent-player .bottom input[type='range']::-webkit-slider-thumb {
height: 0;
width: 0;
border-radius: 50%;
background: var(--accent-color);
-webkit-appearance: none;
margin-top: 2px;
transition: all 0.1s ease;
}
.torrent-player .bottom input[type='range']:hover::-webkit-slider-thumb {
height: 12px;
width: 12px;
margin-top: -4px;
}
.torrent-player
.bottom
input[type='range'][data-name='setProgress']::-webkit-slider-runnable-track {
background: linear-gradient(
90deg,
#e5204c var(--progress),
rgba(255, 255, 255, 0.2) var(--progress)
);
}
.torrent-player
.bottom
input[type='range'][data-name='setVolume']::-webkit-slider-runnable-track {
background: linear-gradient(
90deg,
#e5204c var(--volume-level),
rgba(255, 255, 255, 0.2) var(--volume-level)
);
}
.torrent-player .bottom .volume {
display: flex;
width: auto;
}
.torrent-player .bottom .volume:hover input[type='range'] {
width: 5vw;
display: inline-block;
transition: all 0.1s ease;
margin-right: 1rem;
}
.torrent-player .bottom .volume input[type='range'] {
width: 0;
transition: all 0.1s ease;
}
.torrent-player .bottom div[data-name='progressWrapper'] {
--progress: 0%;
}
.torrent-player .bottom input[type='range'][data-name='setProgress'],
.torrent-player .bottom div[data-name='progressWrapper'],
.torrent-player .bottom div[data-name='progressWrapper'] div {
display: flex;
width: 100%;
height: 100%;
position: relative;
}
.torrent-player .bottom input[type='range'][data-name='setProgress'] + img,
.torrent-player .bottom input[type='range'][data-name='setProgress']::before {
pointer-events: none;
opacity: 0;
position: absolute;
transform: translate(-50%, -100%);
font-family: Roboto, Arial, Helvetica, sans-serif;
white-space: nowrap;
align-self: center;
left: var(--progress);
font-weight: 600;
transition: 0.2s opacity ease;
}
.torrent-player .bottom input[type='range'][data-name='setProgress'] + img {
top: -2rem;
width: 150px;
}
.torrent-player .bottom input[type='range'][data-name='setProgress']::before {
top: 0.5rem;
content: attr(data-elapsed);
color: #ececec;
}
.torrent-player .bottom input[type='range'][data-name='setProgress']:active + img,
.torrent-player .bottom input[type='range'][data-name='setProgress']:active::before {
opacity: 1;
}
.torrent-player .bottom div[data-name='progressWrapper']::before,
.torrent-player .bottom div[data-name='progressWrapper']::after {
color: #ececec;
font-size: 1.8rem !important;
white-space: nowrap;
align-self: center;
cursor: default;
line-height: var(--base-line-height);
padding: 0 1.2rem;
font-weight: 600;
}
.torrent-player .bottom div[data-name='progressWrapper']::before {
content: attr(data-elapsed);
}
.torrent-player .bottom div[data-name='progressWrapper']::after {
content: attr(data-remaining);
}