From f670e000b8e9a48b5a3dee6cf0187a909845a72c Mon Sep 17 00:00:00 2001 From: Fluffy-Bean Date: Fri, 29 Jul 2022 16:41:05 +0100 Subject: [PATCH] In the process of suffering --- css/master.css | 10 ++++++---- image.php | 36 +++++++++++++++++++++++++----------- scripts/flyout.js | 28 ++++++++++++++++++---------- ui/flyout.php | 22 +++++++++++++++++----- 4 files changed, 66 insertions(+), 30 deletions(-) diff --git a/css/master.css b/css/master.css index a6778f9..2444d69 100644 --- a/css/master.css +++ b/css/master.css @@ -31,6 +31,8 @@ html { min-height: 100vh; max-width: 100vw; + position: relative; + background-color: var(--bg-2); background-image: url("../assets/bg2.svg"); @@ -377,11 +379,11 @@ a.btn { margin: 0; padding: 0.5rem 0.5rem 1.5rem; max-width: 621px; width: calc(100% - 2.5rem + 3px); - max-height: 50vh; height: auto; + max-height: 20rem; height: auto; min-height: 10rem; - bottom: -50vh; left: 50%; + bottom: -20rem; left: 50%; - transform: translateX(-50%); + transform: translateX(-50%) scale(0.8); position: fixed; z-index: 99999; @@ -393,7 +395,7 @@ a.btn { word-wrap: break-word; - transition: bottom 0.5s cubic-bezier(.19,1,.22,1); + transition: bottom 0.5s cubic-bezier(.19,1,.22,1), transform 0.5s cubic-bezier(.19,1,.22,1); } .flyout-dim { diff --git a/image.php b/image.php index e4438a3..1fec0c1 100644 --- a/image.php +++ b/image.php @@ -105,8 +105,11 @@ // Image download echo "Download image"; + + // Flyout test button ?> - + +
@@ -153,24 +156,35 @@ $error = "Could not delete image"; } } - // Delete form - echo "
"; - echo "

Danger zone

"; - // Image hover details - echo "
"; - echo ""; - if (isset($error)) { - echo "

".$error."

"; - } - echo "
"; + // Danger zone + echo "
+

Danger zone

"; + // Delete button + ?> + + + "; + ?> ">Delete image + + Modify image content"; echo "
"; } ?> + + { +let show = document.querySelectorAll(".flyout-display"); +let hide = document.querySelector(".flyout-close"); + +show.forEach((pain) => { + pain.addEventListener("click", function(){ + document.querySelector("html").style.overflow= "hidden"; + + document.querySelector(".flyout").style.transform= "translateX(-50%) scale(1)"; + document.querySelector(".flyout").style.bottom= "-1rem"; + document.querySelector(".flyout-dim").style.display= "block"; + }); +}); + + +hide.addEventListener("click", function(){ document.querySelector("html").style.overflow= "auto"; - document.querySelector(".flyout").style.bottom= "-50vh"; + document.querySelector(".flyout").style.transform= "translateX(-50%) scale(0.8)"; + document.querySelector(".flyout").style.bottom= "-20rem"; document.querySelector(".flyout-dim").style.display= "none"; -} - -document.querySelector(".flyout-display").onclick = () =>{ - document.querySelector("html").style.overflow= "hidden"; - - document.querySelector(".flyout").style.bottom= "-1rem"; - document.querySelector(".flyout-dim").style.display= "block"; -} +}); diff --git a/ui/flyout.php b/ui/flyout.php index 9730a84..5221d04 100644 --- a/ui/flyout.php +++ b/ui/flyout.php @@ -2,13 +2,25 @@
".$flyout_header.""; } else { - $flyout_content = "

Dialog

This is a very cool flyout that does nothing but be annoying right now! Sowwy for taking up your screenspace with this box!

This is just being tested as a better alternative to some things, sowwy!

Accept the world is cruel"; - echo $flyout_content; + echo "

Missing Header

"; + } + + // Flyout content, must be included!!!! + if (isset($flyout_content) && !empty($flyout_content)) { + echo "

".$flyout_content."

"; + } else { + echo "

This is just being tested as a better alternative to some things, sowwy!

"; + } + + // Flyout button, not required so must need more information when added + if (isset($flyout_interaction) && !empty($flyout_interaction)) { + echo $flyout_interaction; } ?> - Cancel + Cancel