initial commit

This commit is contained in:
Milarin
2024-09-15 14:16:45 +02:00
commit 18078d1d3b
13 changed files with 1048 additions and 0 deletions

117
static/css/dialog.css Normal file
View File

@ -0,0 +1,117 @@
dialog {
margin: auto;
background-color: rgba(0, 0, 0, 0.75);
backdrop-filter: blur(10px);
color: white;
box-shadow: 1px 1px 10px 10px rgba(0, 0, 0, 0.25);
border-radius: 0.25em;
}
dialog .header {
display: grid;
grid-template-columns: 1fr auto;
padding: 0.5em;
}
dialog .header h1 {
font-size: 1.5rem;
text-align: center;
}
dialog .header span.close {
font-size: 2rem;
margin-left: 0.5em;
transition: all 0.1s ease-in-out;
}
dialog .header span.close:hover {
transform: scale(1.2);
transition: all 0.1s ease-in-out;
}
dialog .body form {
padding: 0.5em;
display: flex;
flex-direction: column;
}
dialog .body form input[type="radio"],
dialog .body form input[type="checkbox"] {
display: none;
}
dialog .body form label {
padding: 0.75em;
text-align: center;
}
dialog .body form input[type="radio"]:checked + label {
background-color: rgba(255, 255, 255, 0.1);
}
dialog .body form input[type="url"] {
background-color: #111;
color: white;
padding: 0.75em;
border: 1px solid #333;
margin-bottom: 1em;
transition: all 0.25s ease-in-out;
}
dialog .body form input[type="url"]:focus {
border: 1px solid #555;
transition: all 0.25s ease-in-out;
}
dialog .body form button {
background-color: transparent;
color: white;
padding: 0.75em;
font-size: 1rem;
transition: all 0.25s ease-in-out;
}
dialog .body form button:hover {
background-color: rgba(255, 255, 255, 0.1);
transition: all 0.25s ease-in-out;
}
dialog:not([open]) {
pointer-events: none;
opacity: 0;
}
dialog::backdrop {
background-color: rgba(0, 0, 0, 0);
backdrop-filter: blur(3px);
}
/* var(--video-card-width) * 2 + var(--video-card-gap) * 3 */
@media (max-width: 51.5em) {
dialog {
margin: 0;
width: 100%;
height: 100%;
min-width: 100%;
min-height: 100%;
border: none;
background-color: rgba(0, 0, 0, 0.85);
}
}
/* dialog-specific rules */
#close-video-dialog {
max-width: 30em;
}
#close-video-dialog .body p {
text-align: center;
padding: 0.25em;
}
#close-video-dialog-title {
background-color: #111;
border: 1px solid #333;
margin-bottom: 0.5em;
}

173
static/css/main.css Normal file
View File

@ -0,0 +1,173 @@
* {
margin: 0;
padding: 0;
border: 0;
outline: none;
}
:root {
/*
when changing these values,
both media queries in dialog.css and video.css
should be changed accordingly as well.
*/
--video-card-width: 25em;
--video-card-gap: 0.5em;
--header-height: 3em;
--footer-height: 6em;
--footer-padding: 0.5em;
}
.material-symbols-outlined {
font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
user-select: none;
}
html {
min-height: 100%;
}
body {
background-color: #111;
font-size: 100%;
display: block;
min-height: calc(100vh - var(--header-height));
}
header {
display: absolute;
position: fixed;
top: 0;
left: 0;
right: 0;
background-color: rgba(200, 55, 55, 0.9);
box-shadow: 0 0 0.5em 0.5em rgba(0, 0, 0, 0.3);
backdrop-filter: blur(5px);
color: white;
height: var(--header-height);
padding: 0 0.25em;
z-index: 11;
}
header span.material-symbols-outlined {
font-size: 2em;
line-height: 3rem;
float: right;
padding: 0 0.25em;
transition: all 0.1s ease-in-out;
}
header span.material-symbols-outlined:hover {
transform: scale(1.2);
transition: all 0.1s ease-in-out;
}
#video-container {
margin-top: var(--header-height);
margin-bottom: calc(var(--footer-height) + var(--footer-padding) * 2);
}
footer {
display: grid;
grid-template-columns: auto 1fr auto auto auto 1fr auto;
grid-template-rows: auto 1fr;
grid-template-areas:
"current-timestamp seekbar seekbar seekbar seekbar seekbar video-length"
". . replay pause forward volume-bar volume-bar";
position: fixed;
bottom: 0;
left: 0;
right: 0;
background-color: rgba(17, 17, 17, 0.95);
box-shadow: 0 0 0.5em 0.5em rgba(0, 0, 0, 0.3);
backdrop-filter: blur(3px);
padding: var(--footer-padding);
z-index: 11;
height: var(--footer-height);
}
#seekbar {
--margin: 0.75em;
grid-area: seekbar;
align-self: center;
width: calc(100% - var(--margin) * 2);
margin: 0.5em var(--margin);
}
#replay {
grid-area: replay;
background-color: transparent;
color: white;
text-align: right;
cursor: pointer;
}
#play-pause {
grid-area: pause;
background-color: transparent;
color: white;
text-align: center;
margin: 0 0.5em;
cursor: pointer;
}
#forward {
grid-area: forward;
background-color: transparent;
color: white;
text-align: left;
cursor: pointer;
}
#volume-bar {
--margin: 0.75em;
grid-area: volume-bar;
max-width: 15em;
width: calc(100% - var(--margin) * 2);
margin: 0 var(--margin);
justify-self: right;
align-self: center;
}
#play-pause .material-symbols-outlined {
font-size: 4rem;
}
#play-pause:disabled,
#replay:disabled,
#forward:disabled {
color: gray;
}
#current-timestamp {
grid-area: current-timestamp;
color: white;
}
#video-length {
grid-area: video-length;
color: white;
}
footer .material-symbols-outlined {
font-size: 2.5rem;
}
input[type="range"] {
appearance: none;
height: 0.5em;
background-color: #333;
border-radius: 0.25em;
}
input[type="range"]::-webkit-slider-thumb,
input[type="range"]::-moz-range-thumb {
cursor: pointer;
appearance: none;
width: 1.5em;
height: 1.5em;
border-radius: 50%;
background-color: rgb(200, 55, 55);
border: none;
}

87
static/css/video.css Normal file
View File

@ -0,0 +1,87 @@
#video-container {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
gap: var(--video-card-gap);
padding: var(--video-card-gap);
}
.video-item {
width: var(--video-card-width);
max-width: 100%;
position: relative;
cursor: pointer;
}
.video-image {
display: block;
width: 100%;
}
.video-image:not(.shown-on-display) {
filter: brightness(50%);
}
.video-bottom {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background-color: rgba(0, 0, 0, 0.5);
color: white;
}
.video-title {
user-select: none;
padding: 0.5em;
}
.video-progress {
height: 3px;
background-color: rgba(0, 0, 0, 0.5);
position: relative;
}
.video-progress .primary {
position: absolute;
top: 0;
bottom: 0;
left: 0;
z-index: 10;
height: 100%;
background-color: #ee1111;
}
.video-progress .secondary {
position: absolute;
top: 0;
bottom: 0;
left: 0;
height: 100%;
background-color: #994444;
}
.video-close {
color: white;
position: absolute;
top: 0;
right: 0;
font-size: 1.75rem;
padding: 0.1em;
text-shadow: 0px 0px 0.5em black;
transition: all 0.1s ease-in-out;
}
.video-close:hover {
transform: scale(1.2);
text-shadow: 0px 0px 0.25em black;
transition: all 0.1s ease-in-out;
}
/* var(--video-card-width) * 2 + var(--video-card-gap) * 3 */
@media (max-width: 51.5em) {
.video-item {
width: 100%;
}
}