From 4ab1b39650b83622e562864088ec3997ed7b7748 Mon Sep 17 00:00:00 2001 From: Fluffy-Bean Date: Tue, 26 Jul 2022 13:34:48 +0100 Subject: [PATCH] =?UTF-8?q?Added=20"Top"=20button=20=F0=9F=91=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- account.php | 7 +++++-- assets/icons/caret-up.svg | 1 + css/master.css | 31 +++++++++++++++++++++++++++++++ edit.php | 5 ++++- image.php | 6 ++++-- index.php | 5 ++++- login.php | 7 +++++-- scripts/top.js | 11 +++++++++++ signup.php | 7 +++++-- ui/{footer.php => footer.html} | 2 -- ui/top.html | 4 ++++ upload.php | 5 ++++- 12 files changed, 78 insertions(+), 13 deletions(-) create mode 100644 assets/icons/caret-up.svg create mode 100644 scripts/top.js rename ui/{footer.php => footer.html} (85%) create mode 100644 ui/top.html diff --git a/account.php b/account.php index 37f9f52..1311eb9 100644 --- a/account.php +++ b/account.php @@ -16,7 +16,7 @@

Account settings

O hi ".$_SESSION["username"].".

"; + echo "

O hi ".$_SESSION["username"].". This is pretty empty right now. But it wont be soon!

"; echo "Logout"; } else { echo "

You must be logged in to change your account settings!

"; @@ -25,6 +25,9 @@ ?> - + diff --git a/assets/icons/caret-up.svg b/assets/icons/caret-up.svg new file mode 100644 index 0000000..afeb343 --- /dev/null +++ b/assets/icons/caret-up.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/css/master.css b/css/master.css index c3e4cac..701dce0 100644 --- a/css/master.css +++ b/css/master.css @@ -190,3 +190,34 @@ p, a { margin: 0 0 0.5rem 0; font-family: "Fira Code", monospace; } + +/* + -=-=-= Back to top button =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +*/ +#back-to-top { + margin: 0; padding: 0.5rem; + + position: fixed; + right: -2.5rem; bottom: 1rem; + + object-position: center; + + background-color: var(--bg); + + border-radius: 50%; + box-shadow: var(--shadow); + + transition: right 0.15s cubic-bezier(.19,1,.22,1); +} +#back-to-top:hover { + outline: 0.2rem solid var(--green); +} + +#back-to-top * { + margin: 0; padding: 0; + width: 1.5rem; height: 1.5rem; + + display: block; + + object-position: center; +} diff --git a/edit.php b/edit.php index 625fa45..37eb492 100644 --- a/edit.php +++ b/edit.php @@ -70,6 +70,9 @@ ?> - + diff --git a/image.php b/image.php index 6bc1761..50a52b7 100644 --- a/image.php +++ b/image.php @@ -143,9 +143,11 @@ } else { } - ?> - + diff --git a/index.php b/index.php index 4219062..5820604 100644 --- a/index.php +++ b/index.php @@ -62,6 +62,9 @@ ?> - + diff --git a/login.php b/login.php index 8e106b1..10d307a 100644 --- a/login.php +++ b/login.php @@ -94,7 +94,7 @@

Login

-

This is still being worked on, so I ask you kindly to not try anything, thankies!

+

Passwords are important to keep safe. Don't tell anyone your password, not even Fluffy!

@@ -111,6 +111,9 @@ Need an account? Sign up!
- + diff --git a/scripts/top.js b/scripts/top.js new file mode 100644 index 0000000..3fef094 --- /dev/null +++ b/scripts/top.js @@ -0,0 +1,11 @@ +button = document.getElementById("back-to-top"); + +window.onscroll = function() {scrollFunction()}; + +function scrollFunction() { + if (document.body.scrollTop > 300 || document.documentElement.scrollTop > 20) { + button.style.right = "1rem"; + } else { + button.style.right = "-2.5rem"; + } +} diff --git a/signup.php b/signup.php index 0ee14a6..0daa929 100644 --- a/signup.php +++ b/signup.php @@ -113,7 +113,7 @@

Make account

-

This is still being worked on, so I ask you kindly to not try anything, thankies!

+

And amazing things happened here...

@@ -131,6 +131,9 @@
- + diff --git a/ui/footer.php b/ui/footer.html similarity index 85% rename from ui/footer.php rename to ui/footer.html index 8f64a21..d56d839 100644 --- a/ui/footer.php +++ b/ui/footer.html @@ -3,7 +3,6 @@

Contact me

Telegram Twitter - Discord GitHub diff --git a/ui/top.html b/ui/top.html new file mode 100644 index 0000000..12b1f7c --- /dev/null +++ b/ui/top.html @@ -0,0 +1,4 @@ + + + + diff --git a/upload.php b/upload.php index bfa29ee..d5b8236 100644 --- a/upload.php +++ b/upload.php @@ -91,6 +91,9 @@ ?> - +