diff --git a/scripts/startup.js b/scripts/startup.js
index 06eb279..2c2528a 100644
--- a/scripts/startup.js
+++ b/scripts/startup.js
@@ -64,7 +64,20 @@ function refreshTagList() {
}
function showLoadingGUI() {
+ const css = document.createElement("link");
+ css.setAttribute("rel", "stylesheet");
+ css.setAttribute("href", "css/loader.css");
+ document.head.appendChild(css);
+ const holder = document.createElement("div");
+ holder.classList.add("overlay");
+ const loadCirc = document.createElement("div");
+ loadCirc.classList.add("load-circle");
+ loadCirc.innerHTML = ``;
+
+ holder.appendChild(loadCirc);
+ document.body.appendChild(holder);
+ return holder;
}
function showMediaRules() {
@@ -125,7 +138,69 @@ function showMediaRules() {
}
function showMediaEditor(namespace, fileType) {
+ const media = uploadData.media[namespace];
+
+ const css = document.createElement("link");
+ css.setAttribute("rel", "stylesheet");
+ css.setAttribute("href", "css/media-editor.css");
+ document.head.appendChild(css);
+ const holder = document.createElement("div");
+ holder.classList.add("overlay");
+ const editor = document.createElement("div");
+ editor.classList.add("editor");
+ editor.innerHTML = `
+
+
+
+ ${ fileType === "mp4" ?
+ `` : `
+ Aspect Ratio
+
+
+
+ Important Checks
+
+ selected size
+
+ video length
+ `;
+
+ editor.querySelector(`div[class="exit-btn"]`).addEventListener("click", (e) => {
+ const anim = editor.animate(
+ [{ transform: "translate(-50%, -50%) scale(1)" }, { transform: "translate(-50%, -50%) scale(0)" }], { duration: 250, easing: "ease-in" }
+ );
+ anim.onfinish = () => {
+ css.remove();
+ holder.remove();
+ };
+ e.stopPropagation();
+ });
+
+ holder.appendChild(editor);
+ document.body.appendChild(holder);
+ editor.animate(
+ [{ transform: "translate(-50%, -50%) scale(0)" }, { transform: "translate(-50%, -50%) scale(1)" }], { duration: 300, easing: "ease-in-out" }
+ );
}
/* Internal Utils */
@@ -219,9 +294,9 @@ document.querySelector("form").addEventListener("submit", async (e) => {
e.preventDefault();
if (e.target.checkValidity()) {
console.log("Submitting Data...");
- showLoadingGUI();
+ const loadScreen = showLoadingGUI();
const urlData = constructPost();
- // TODO finish this
+ // TODO send post, then end loadScreen, prevent submit button from working again
}
});
document.addEventListener("DOMContentLoaded", () => {