From 2555400b2d24a11199733112ce30e64add8e0203 Mon Sep 17 00:00:00 2001 From: Herwin Date: Wed, 21 Sep 2022 21:52:49 +0200 Subject: [PATCH] Improved slightly error pages, Added card's corner triangular button Update .gitignore, 403.php, and 7 more files... --- .gitignore | 3 + 403.php | 61 +++++++++++------- 404.php | 63 ++++++++++++------- commons/headers.php | 15 +++-- commons/modals.php | 38 +++++++++++ commons/strings.json | 18 +++++- resources/Azias/js/nibblepoker.lu.js | 12 ++-- .../Azias/scss/halfmoon/element/card.scss | 56 +++++++++++++++++ resources/Azias/scss/nibblepoker.lu.scss | 1 + 9 files changed, 210 insertions(+), 57 deletions(-) create mode 100644 commons/modals.php create mode 100644 resources/Azias/scss/halfmoon/element/card.scss diff --git a/.gitignore b/.gitignore index 771e00a..e53d270 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,6 @@ resources/FontAwesomePro/ tmp/ resources/Azias/css/*.css resources/Azias/css/*.map +resources/Azias/sass/**.css +resources/Azias/sass/**.map + diff --git a/403.php b/403.php index 7935ff5..0eab7c2 100644 --- a/403.php +++ b/403.php @@ -2,6 +2,7 @@ set_include_path('./commons/'); include_once 'config.php'; include_once 'langs.php'; +include_once 'modals.php'; ?> @@ -17,7 +18,18 @@ include_once 'langs.php'; - + Not present in request !" + ) . "
"; + $debuggingText .= "
TODO: Add more info once the cache if properly configured for 4xx errors !"; + add_code_modal( + "http-error", + localize('modal.title.debugging'), + $debuggingText + ); + include 'body-root.php'; + ?>
@@ -28,32 +40,39 @@ include_once 'langs.php';
-
-
-
-
-
-
-
-
-
-
-

-
-
-
-
-
-
-

-

+
+
+
+
+
+
+
+

+
+
+

+ +

+
+

+ +

+ + "> +
+ +
+
+
-
diff --git a/404.php b/404.php index 7980c9c..9b84d13 100644 --- a/404.php +++ b/404.php @@ -2,6 +2,7 @@ set_include_path('./commons/'); include_once 'config.php'; include_once 'langs.php'; +include_once 'modals.php'; ?> @@ -17,7 +18,18 @@ include_once 'langs.php'; - + Not present in request !" + ) . "
"; + $debuggingText .= "
TODO: Add more info once the cache if properly configured for 4xx errors !"; + add_code_modal( + "http-error", + localize('modal.title.debugging'), + $debuggingText + ); + include 'body-root.php'; + ?>
@@ -28,32 +40,39 @@ include_once 'langs.php';
-
-
-
-
-
-
-
-
-
-
-

-
-
-
-
-
-
-

-

+
+
+
+
+
+
+
+

+
+
+

+ +

+
+

+ +

+ + "> +
+ +
+
+
-
- +
diff --git a/commons/headers.php b/commons/headers.php index 9f99dc4..39fa0d6 100644 --- a/commons/headers.php +++ b/commons/headers.php @@ -18,9 +18,12 @@ if(basename(__FILE__) == basename($_SERVER["SCRIPT_FILENAME"])) { - - - - - - + +// +// +// +// +// +?> diff --git a/commons/modals.php b/commons/modals.php new file mode 100644 index 0000000..8262784 --- /dev/null +++ b/commons/modals.php @@ -0,0 +1,38 @@ + + +
'); +} + +?> + + + + + diff --git a/commons/strings.json b/commons/strings.json index 8db1664..199f9ef 100644 --- a/commons/strings.json +++ b/commons/strings.json @@ -101,8 +101,10 @@ "error.4xx.button.back": "Go back", "error.403.title": "403 Error", "error.403.description": "Access to the requested resource is forbidden !", + "error.403.explanation": "If this problem persists, you can contact us through avenues given on the Contact page.", "error.404.title": "404 Error", "error.404.description": "The requested resource couldn't be found on the server !", + "error.404.explanation": "If this problem persists, you can contact us through avenues given on the Contact page.", "error.content.title.generic": "Content error", "error.content.title.empty": "No content found", @@ -184,7 +186,12 @@ "contact.tox.main": "Main account:", "contact.tox.secondary": "Backup account:", "contact.tox.button.open": "Open in Tox Client", - "contact.tox.button.copy": "Copy to clipboard" + "contact.tox.button.copy": "Copy to clipboard", + + "generic.button.close": "Close", + "generic.button.copy": "Copy to clipboard", + + "modal.title.debugging": "Debugging information" }, "fr": { "home.title.nav": "Accueil", @@ -284,8 +291,10 @@ "error.4xx.button.back": "Retourner en arrière", "error.403.title": "Erreur 403", "error.403.description": "L'accès à la ressource demandée est interdit !", + "error.403.explanation": "Si ce problème persiste, vous pouvez nous contacter via une des avenues données sur la page Contact.", "error.404.title": "Erreur 404", "error.404.description": "La ressource demandée est introuvable sur le serveur !", + "error.404.explanation": "Si ce problème persiste, vous pouvez nous contacter via une des avenues données sur la page Contact.", "error.content.title.generic": "Erreur de contenu", "error.content.title.empty": "Aucun contenu trouvé", @@ -358,7 +367,12 @@ "contact.tox.main": "Compte principal:", "contact.tox.secondary": "Compte secondaire:", "contact.tox.button.open": "Ouvrir dans un client Tox", - "contact.tox.button.copy": "Copier dans le presse-papier" + "contact.tox.button.copy": "Copier dans le presse-papier", + + "generic.button.close": "Fermer", + "generic.button.copy": "Copier dans le presse-papier", + + "modal.title.debugging": "Informations de débogage" }, "lb": { "home.title.nav": "Doheem", diff --git a/resources/Azias/js/nibblepoker.lu.js b/resources/Azias/js/nibblepoker.lu.js index 883a015..b4de7ed 100644 --- a/resources/Azias/js/nibblepoker.lu.js +++ b/resources/Azias/js/nibblepoker.lu.js @@ -4,13 +4,13 @@ document.getElementById('button-sidebar').addEventListener("click", () => { // TODO: Fix the slide size in gliders }); -// Adding the last URL to every a element with the 'js-set-previous-url' class. -/*document.querySelectorAll("a.js-set-previous-url").forEach(element => { +// Adding the last URL to every "a" element with the 'js-set-previous-url' class. +document.querySelectorAll("a.js-set-previous-url").forEach(element => { element.href = document.referrer; - element.addEventListener('click', function(e) { - window.history.go(-2); - }); -});*/ + //element.addEventListener('click', function(e) { + // window.history.go(-2); + //}); +}); // TOX ID copiers. (Contact page) if(document.getElementById('button-copy-tox-id-main') != null) { diff --git a/resources/Azias/scss/halfmoon/element/card.scss b/resources/Azias/scss/halfmoon/element/card.scss new file mode 100644 index 0000000..9769cf0 --- /dev/null +++ b/resources/Azias/scss/halfmoon/element/card.scss @@ -0,0 +1,56 @@ +/* Halfmoon > Elements > Cards */ + +.container-card-fold { + position: absolute; + bottom: 0; + right: 0; + width: 3rem; + height: 3rem; + + clip-path: polygon(100% 0, 0 100%, 100% 100%); + border-radius: var(--base-border-radius) !important; + //border-bottom-right-radius: var(--base-border-radius) !important; + overflow: hidden; + background-color: deeppink; + opacity: 0.4; + + // https://codepen.io/setswon/pen/VJeXXq + // Using a value of ~0.35 feels sluggish. + transition: width 0.25s ease, height 0.25s ease, opacity 0.2s ease; + transition-timing-function: cubic-bezier(.47,1.64,.41,.8); + + user-select: none; + + &.secondary { + color: var(--dm-button-secondary-text-color); + background-color: var(--dm-button-secondary-bg-color); + background-image: var(--dm-button-secondary-bg-image); + border-color: var(--dm-button-secondary-border-color); + } + + &.danger { + color: var(--dm-button-secondary-text-color); // White icons looks like shit. + background-color: var(--dm-button-danger-bg-color); + background-image: var(--dm-button-danger-bg-image); + border-color: var(--dm-button-danger-border-color); + } + + i { + position: absolute; + right: 0.2rem; + bottom: 0.2rem; + transition: right 0.25s ease, bottom 0.25s ease; + transition-timing-function: cubic-bezier(.47,1.64,.41,.8); + } + + &:hover { + width: 3.5rem; + height: 3.5rem; + opacity: 0.8; + + i { + bottom: 0.325em; + right: 0.325rem; + } + } +} diff --git a/resources/Azias/scss/nibblepoker.lu.scss b/resources/Azias/scss/nibblepoker.lu.scss index 8a425fc..da4e609 100644 --- a/resources/Azias/scss/nibblepoker.lu.scss +++ b/resources/Azias/scss/nibblepoker.lu.scss @@ -18,6 +18,7 @@ @import 'halfmoon/page/contact'; /* Halfmoon > Elements */ +@import 'halfmoon/element/card'; @import 'halfmoon/element/code'; @import 'halfmoon/element/containers'; @import 'halfmoon/element/glider';