New video player and changed Zakarya banner

This commit is contained in:
2024-12-31 20:22:38 -08:00
parent af5c2b6b56
commit 05ff4ecc5d
8 changed files with 247 additions and 4 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
zakarya/videos

View File

@ -10,7 +10,6 @@ function toggle_nav_menu() {
<div class="nav-right inline">
<ul id="menu" class="responsive-hidden">
<li><a href="/zakarya">Zakarya</a></li>
<!--<li><a href="https://github.com/ColormaticStudios" target="_blank" rel="noopener noreferrer">GitHub</a></li>-->
<li><a href="/studios">Colormatic Studios</a></li>
<li><a href="/about">About</a></li>
</ul>

View File

@ -121,14 +121,17 @@ main div.hero h1 a {
text-decoration: none;
}
main div.hero p.justify {
p.justify {
text-align: justify;
text-justify: auto;
width: 60%;
margin-left: auto;
margin-right: auto;
}
main div.hero p.justify {
width: 60%;
}
main div.hero ul {
margin-left: auto;
margin-right: auto;
@ -202,6 +205,33 @@ div.double-linktree ul.linktree {
margin: 0;
}
ul.videolist {
list-style-type: none;
display: flex;
padding-left: 0;
width: min-content;
}
ul.videolist li {
padding: 8px;
}
ul.videolist li a {
text-decoration: none;
}
ul.videolist li a img {
width: 250px;
height: auto;
border-radius: 8px;
}
ul.videolist li a span {
display: block;
color: var(--text-color);
font-size: 120%;
}
div.footer {
border-top: solid 1px #00000033;
width: 95%;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 722 KiB

After

Width:  |  Height:  |  Size: 705 KiB

100
video/css/style.css Normal file
View File

@ -0,0 +1,100 @@
div.videocontainer {
display: flex;
color: var(--text-color);
width: 90%;
margin: 16px auto 16px auto;
border: solid 1px #00000033;
border-radius: 8px;
box-shadow: 1px 1px 8px #00000033;
padding: 16px;
}
div.videocontainer video#videoplayer {
flex-grow: 1;
border-radius: 12px;
height: auto;
max-width: 55%;
}
div.videocontainer div.videoobjects {
display: grid;
padding: 24px;
}
div.videocontainer div.videodetails h1#videotitle {
padding: 0 12px;
}
div.dropdown-container {
display: flex;
flex-direction: column-reverse;
}
div.videocontainer div.download-dropdown {
position: relative;
display: inline-block;
padding: 12px;
width: 25px;
height: 25px;
background-color: #21afff;
box-shadow: 1px 1px 8px #00000033;
border-radius: 50px;
transition-duration: 0.35s;
}
div.videocontainer div.download-dropdown:hover {
box-shadow: 1px 1px 8px #00000088;
}
div.videocontainer div.download-dropdown img {
width: 25px;
height: 25px;
}
div.videocontainer div.download-dropdown div.dropdown-content {
display: none;
position: absolute;
font-size: 80%;
min-width: 135px;
background-color: #edeeee;
box-shadow: 1px 1px 8px #00000033;
border-radius: 8px;
text-align: center;
}
div.videocontainer div.download-dropdown:hover div.dropdown-content {
display: block;
}
div.videocontainer div.download-dropdown div.dropdown-content ul {
list-style-type: none;
padding-left: 0;
}
div.videocontainer div.download-dropdown div.dropdown-content ul li {
padding: 4px;
}
div.videocontainer div.download-dropdown div.dropdown-content ul li:hover {
background-color: #dcdfdf;
}
div.videocontainer div.download-dropdown div.dropdown-content ul li a {
text-decoration: none;
color: var(--text-color);
}
@media screen and (max-width: 800px) {
div.videocontainer {
display: block;
}
div.videocontainer video#videoplayer {
width: 100%;
}
div.videocontainer div.download-dropdown {
display: block;
margin-left: auto;
margin-right: auto;
margin-top: 12px;
}
}

50
video/index.html Normal file
View File

@ -0,0 +1,50 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/svg" href="/img/colormatic_logo.svg">
<link rel="stylesheet" href="/css/style.css">
<link rel="stylesheet" href="/video/css/style.css">
<script src="/js/jquery.js"></script>
<title>Video Player</title>
<script>
$(document).ready(function(){
$("#navbar").load("/component/navbar.html")
})
$(document).ready(function(){
$("#footer").load("/component/footer.html")
})
</script>
</head>
<body>
<header class="container" id="navbar"></header>
<div class="videocontainer">
<video id="videoplayer" controls></video>
<div class="videoobjects">
<div class="videodetails">
<h1 id="videotitle"></h1>
<p id="videodescription" class="justify"></p>
</div>
<div class="dropdown-container">
<div class="download-dropdown">
<img src="https://icons.getbootstrap.com/assets/icons/download.svg" alt="Download">
<div class="dropdown-content">
<ul>
<li><a id="videodownload">Downolad Video</a></li>
<li><a id="sourcedownload">Download Source</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<footer id="footer"></footer>
<script src="/video/js/main.js"></script>
</body>
</html>

48
video/js/main.js Normal file
View File

@ -0,0 +1,48 @@
const BASEURL = "https://files.colormatic.org/"
var videoplayer = document.getElementById("videoplayer");
var videotitle = document.getElementById("videotitle");
var videodescription = document.getElementById("videodescription");
var videodownload = document.getElementById("videodownload");
var sourcedownload = document.getElementById("sourcedownload");
var params = new URLSearchParams(window.location.search);
function getParam(paramName) {
return params.get(paramName);
}
async function getJSON(url) {
const response = await fetch(url);
if(!response.ok)
throw new Error(response.statusText);
const data = response.json();
return data;
}
function getVideo(cname, vname) {
getJSON(BASEURL + cname + "/videos/data/" + vname + ".json").then((data) => {
videoURL = BASEURL + cname + "/videos/raw/" + data.video_file + "." + data.video_format;
var videosource = document.createElement("source");
videosource.setAttribute("src", videoURL);
videosource.setAttribute("type", "video/" + data.video_format);
videoplayer.appendChild(videosource);
document.title = data.title;
videotitle.appendChild(document.createTextNode(data.title));
data.description.forEach((iter) => { // TODO: Detect if one of these lines contains a link and if so, make it a link
videodescription.appendChild(document.createTextNode(iter));
videodescription.appendChild(document.createElement("br"));
});
videodownload.setAttribute("href", BASEURL + cname + "/videos/raw/" + data.video_file + "." + data.video_format);
videodownload.setAttribute("download", data.video_file + "." + data.video_format);
sourcedownload.setAttribute("href", BASEURL + cname + "/videos/source/" + data.source_file + "." + data.source_format);
sourcedownload.setAttribute("download", data.source_file + "." + data.source_format);
}).catch((error) => {
console.error(error);
});
}
getVideo(getParam("c"), getParam("v"));

View File

@ -23,6 +23,7 @@ $(document).ready(function(){
<main>
<img class="banner" src="/img/zakarya-banner.png">
<div class="hero">
<h1>Links:</h1>
<ul class="linktree">
@ -30,7 +31,21 @@ $(document).ready(function(){
<li><a href="https://ko-fi.com/zakarya" target="_blank" rel="noopener noreferrer">Ko-fi</a></li>
<li><a href="https://www.youtube.com/@czakarya" target="_blank" rel="noopener noreferrer">Youtube</a></li>
<li><a href="https://github.com/CZakarya" target="_blank" rel="noopener noreferrer">GitHub</a></li>
<li><a href="https://www.reddit.com/user/CZakarya/" target="_blank" rel="noopener noreferrer">Reddit</a></li>
<!--<li><a href="https://www.reddit.com/user/CZakarya/" target="_blank" rel="noopener noreferrer">Reddit</a></li>-->
</ul>
</div>
<div class="hero">
<h1>Featured Videos:</h1>
<ul class="videolist">
<li><a href="/video?c=zakarya&v=the-way-forward">
<img src="https://files.colormatic.org/zakarya/videos/thumbnail/wayforward.png">
<span class="title">The Way Forward</span>
</a></li>
<li><a href="/videoindex.html?c=zakarya&v=hello-world">
<img src="https://files.colormatic.org/zakarya/videos/thumbnail/helloworld.png">
<span class="title">Hello World</span>
</a></li>
</ul>
</div>
</main>