From 0e69f5d86638a26896a0214de1b8fc07b6147c22 Mon Sep 17 00:00:00 2001 From: Jordan Bancino Date: Mon, 26 Feb 2018 16:11:43 -0500 Subject: [PATCH] feat: Add styled error pages --- README.md | 1 + apaxy/htaccess.txt | 14 +++++++++ apaxy/theme/400.html | 20 ++++++++++++ apaxy/theme/403.html | 20 ++++++++++++ apaxy/theme/404.html | 20 ++++++++++++ apaxy/theme/408.html | 20 ++++++++++++ apaxy/theme/500.html | 20 ++++++++++++ apaxy/theme/502.html | 20 ++++++++++++ apaxy/theme/style.css | 72 +++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 207 insertions(+) create mode 100644 apaxy/theme/400.html create mode 100644 apaxy/theme/403.html create mode 100644 apaxy/theme/404.html create mode 100644 apaxy/theme/408.html create mode 100644 apaxy/theme/500.html create mode 100644 apaxy/theme/502.html diff --git a/README.md b/README.md index 1612f8d..c56d1b8 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ Apaxy may be basic, but it gives you a great deal of creative freedom when styli * Make it pop with Javascript or jQuery. * Add welcome messages, download instructions or copyright notices. * Add custom mime type icons (requires editing the `.htaccess` file) +* Use custom error pages. _Sadly, visual style is all you can work with. It's not possible to alter the generated table structure of the listing directory with Apaxy._ diff --git a/apaxy/htaccess.txt b/apaxy/htaccess.txt index a24660a..00c3ff7 100644 --- a/apaxy/htaccess.txt +++ b/apaxy/htaccess.txt @@ -92,3 +92,17 @@ HeaderName /{FOLDERNAME}/theme/header.html ReadmeName /{FOLDERNAME}/theme/footer.html IndexStyleSheet "/{FOLDERNAME}/theme/style.css" + + + +# +# ERROR PAGES +# + + ErrorDocument 400 http://%{HTTP_HOST}/{FOLDERNAME}/theme/400.html + ErrorDocument 403 http://%{HTTP_HOST}/{FOLDERNAME}/theme/403.html + ErrorDocument 404 http://%{HTTP_HOST}/{FOLDERNAME}/theme/404.html + ErrorDocument 408 http://%{HTTP_HOST}/{FOLDERNAME}/theme/408.html + ErrorDocument 500 http://%{HTTP_HOST}/{FOLDERNAME}/theme/500.html + ErrorDocument 502 http://%{HTTP_HOST}/{FOLDERNAME}/theme/502.html + diff --git a/apaxy/theme/400.html b/apaxy/theme/400.html new file mode 100644 index 0000000..1a9d357 --- /dev/null +++ b/apaxy/theme/400.html @@ -0,0 +1,20 @@ + + + + + + Error 403 + + + + + + +
+

Error.

+
400 +
+

Sorry, I don't understand what you want me to do.

+
+ + diff --git a/apaxy/theme/403.html b/apaxy/theme/403.html new file mode 100644 index 0000000..b4651c3 --- /dev/null +++ b/apaxy/theme/403.html @@ -0,0 +1,20 @@ + + + + + + Error 403 + + + + + + +
+

Error.

+
403 +
+

You aren't allowed to be here.

+
+ + diff --git a/apaxy/theme/404.html b/apaxy/theme/404.html new file mode 100644 index 0000000..fed3840 --- /dev/null +++ b/apaxy/theme/404.html @@ -0,0 +1,20 @@ + + + + + + Error 404 + + + + + + +
+

Error.

+
404 +
+

I can't find what you are looking for...

+
+ + diff --git a/apaxy/theme/408.html b/apaxy/theme/408.html new file mode 100644 index 0000000..2accee4 --- /dev/null +++ b/apaxy/theme/408.html @@ -0,0 +1,20 @@ + + + + + + Error 403 + + + + + + +
+

Error.

+
408 +
+

I refuse to wait any longer.

+
+ + diff --git a/apaxy/theme/500.html b/apaxy/theme/500.html new file mode 100644 index 0000000..58ca9e2 --- /dev/null +++ b/apaxy/theme/500.html @@ -0,0 +1,20 @@ + + + + + + Error 500 + + + + + + +
+

Error.

+
500 +
+

I don't know what to do. This isn't your fault.

+
+ + diff --git a/apaxy/theme/502.html b/apaxy/theme/502.html new file mode 100644 index 0000000..cc53833 --- /dev/null +++ b/apaxy/theme/502.html @@ -0,0 +1,20 @@ + + + + + + Error 403 + + + + + + +
+

Error.

+
502 +
+

I received some invalid information from my master.

+
+ + diff --git a/apaxy/theme/style.css b/apaxy/theme/style.css index 66744eb..0dc9a28 100644 --- a/apaxy/theme/style.css +++ b/apaxy/theme/style.css @@ -128,3 +128,75 @@ tr.parent a[href^="/"] { text-align:center; font-size:.75em; } + +/*------------------------------------*\ + Error pages +/*------------------------------------*/ +/* Animation */ +@-webkit-keyframes fadeDown { + 0% { + opacity: 0; + -webkit-transform: translateY(-20px); + } + 100% { + opacity: 1; + -webkit-transform: translateY(0); + } +} + +@-moz-keyframes fadeDown { + 0% { + opacity: 0; + -moz-transform: translateY(-20px); + } + 100% { + opacity: 1; + -moz-transform: translateY(0); + } +} + +@-ms-keyframes fadeDown { + 0% { + opacity: 0; + -ms-transform: translateY(-20px); + } + 100% { + opacity: 1; + -ms-transform: translateY(0); + } +} + +@-o-keyframes fadeDown { + 0% { + opacity: 0; + -o-transform: translateY(-20px); + } + 100% { + opacity: 1; + -o-transform: translateY(0); + } +} + +@keyframes fadeDown { + 0% { + opacity: 0; + transform: translateY(-20px); + } + 100% { + opacity: 1; + transform: translateY(0); + } +} + +.fadeDown { + -webkit-animation:fadeDown 1s ease; + -moz-animation:fadeDown 1s ease; + -ms-animation:fadeDown 1s ease; + -o-animation:fadeDown 1s ease; + animation:fadeDown 1s ease; +} + +/* Error code display */ +.errorCode { + font-size: 80px; +}