Cool background animation

This commit is contained in:
2024-12-31 23:09:19 -08:00
parent 05ff4ecc5d
commit bdee81be16
10 changed files with 222 additions and 5 deletions

View File

@ -1,4 +1,4 @@
const BASEURL = "https://files.colormatic.org/"
const BASEURL = "/"
var videoplayer = document.getElementById("videoplayer");
var videotitle = document.getElementById("videotitle");
@ -23,6 +23,7 @@ async function getJSON(url) {
function getVideo(cname, vname) {
getJSON(BASEURL + cname + "/videos/data/" + vname + ".json").then((data) => {
videoURL = BASEURL + cname + "/videos/raw/" + data.video_file + "." + data.video_format;
videoplayer.setAttribute("poster", BASEURL + cname + "/videos/thumbnail/" + data.thumbnail);
var videosource = document.createElement("source");
videosource.setAttribute("src", videoURL);
videosource.setAttribute("type", "video/" + data.video_format);