From 03c2f3fe033ce73be6b28ddc729ec06e0738cc9c Mon Sep 17 00:00:00 2001 From: alphaplayerofdooms <154459496+alphaplayerofdooms@users.noreply.github.com> Date: Sat, 21 Dec 2024 13:27:32 +0530 Subject: [PATCH 1/4] Custom 404 page --- corpus/corpus/urls.py | 4 +- corpus/pages/views.py | 3 + corpus/templates/404.html | 148 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 154 insertions(+), 1 deletion(-) create mode 100644 corpus/templates/404.html diff --git a/corpus/corpus/urls.py b/corpus/corpus/urls.py index 01171cb..f458620 100644 --- a/corpus/corpus/urls.py +++ b/corpus/corpus/urls.py @@ -50,5 +50,7 @@ path("newsletter/", include("newsletter.urls")), ] +handler404 = "pages.views.custom_404" + if settings.DEBUG: - urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) \ No newline at end of file diff --git a/corpus/pages/views.py b/corpus/pages/views.py index 48264b0..f9fa9a4 100644 --- a/corpus/pages/views.py +++ b/corpus/pages/views.py @@ -45,3 +45,6 @@ def sig(request, sig_name): def farewell(request): return render(request, "pages/farewell.html") + +def custom_404(request, exception): + return render(request, "404.html", status=404) \ No newline at end of file diff --git a/corpus/templates/404.html b/corpus/templates/404.html new file mode 100644 index 0000000..65d0d5e --- /dev/null +++ b/corpus/templates/404.html @@ -0,0 +1,148 @@ +{% extends 'base.html' %} + +{% load static %} + +{% block title %}404 - Page Not Found | IEEE-NITK{% endblock %} + +{% block content %} + + + +
+
+ + +
+ + +

Page Not Found

+

Oops! The page you are looking for seems to have wandered off.

+
+ + + + +
+
+
+
+ +{% endblock %} From 8353a3be7055b4f0e0807e1add1ee04e571e4b43 Mon Sep 17 00:00:00 2001 From: alphaplayerofdooms <154459496+alphaplayerofdooms@users.noreply.github.com> Date: Thu, 26 Dec 2024 21:04:45 +0530 Subject: [PATCH 2/4] Moved CSS to another file --- corpus/templates/404.html | 122 +--------------------------- corpus/templates/static/css/404.css | 118 +++++++++++++++++++++++++++ 2 files changed, 121 insertions(+), 119 deletions(-) create mode 100644 corpus/templates/static/css/404.css diff --git a/corpus/templates/404.html b/corpus/templates/404.html index 65d0d5e..9179623 100644 --- a/corpus/templates/404.html +++ b/corpus/templates/404.html @@ -6,125 +6,9 @@ {% block content %} - + + +
diff --git a/corpus/templates/static/css/404.css b/corpus/templates/static/css/404.css new file mode 100644 index 0000000..675738b --- /dev/null +++ b/corpus/templates/static/css/404.css @@ -0,0 +1,118 @@ + +@keyframes ieee404-wiggle { + 0%, 100% { transform: rotate(0deg); } + 25% { transform: rotate(-5deg); } + 75% { transform: rotate(5deg); } +} +@keyframes ieee404-glitch { + 2%, 64% { transform: translate(2px, 0) skew(0deg); } + 4%, 60% { transform: translate(-2px, 0) skew(0deg); } + 62% { transform: translate(0, 0) skew(5deg); } +} + +.error404-body { + height: 100vh; + font-family: 'Arial', sans-serif; + margin: 0; + overflow: hidden; + perspective: 1000px; + {% comment %} background: oklch(0.5686 0.255 257.57); {% endcomment %} +} + +.error404-container { + background: rgba(255, 255, 255, 0.05); + backdrop-filter: blur(15px); + border-radius: 20px; + padding: 3rem; + text-align: center; + box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15); + opacity: 0.9; + max-width: 600px; + width: 90%; + position: relative; + overflow: hidden; + animation: ieee404-float 4s ease-in-out infinite; + transition: all 0.3s ease; +} + +.error404-ieee-logo { + position: absolute; + top: 20px; + left: 50%; + transform: translateX(-50%); + width: 120px; + opacity: 0.8; + animation: ieee404-wiggle 2s infinite; +} + +.error404-number-dark{ + font-size: 10rem; + font-weight: bold; + background: linear-gradient(45deg, white, #7EBAE7); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + margin-bottom: 1rem; + margin-top: 10px; + animation: ieee404-glitch 3s infinite; +} + +.error404-number-light { + font-size: 10rem; + font-weight: bold; + background: linear-gradient(45deg, #2B2B2B, #0056b3); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + margin-bottom: 1rem; + margin-top: 10px; + animation: ieee404-glitch 3s infinite; +} + +@keyframes ieee404-fadeIn { + from { opacity: 0; transform: translateY(20px); } + to { opacity: 0.9; transform: translateY(0); } +} + +.error404-back-link { + display: inline-block; + margin-top: 2rem; + padding: 12px 24px; + border-radius: 30px; + transition: all 0.3s ease; + animation: ieee404-pulse 2s infinite; +} + +@keyframes ieee404-pulse { + 0% { transform: scale(1); } + 50% { transform: scale(1.05); } + 100% { transform: scale(1); } +} + +@media (max-width: 768px) { + .error404-container { + padding: 2rem; + width: 95%; + margin: 0 10px; + } + .error404-number { + font-size: 6rem; + margin-top: 20px; + } + .error404-message { + font-size: 1.2rem; + } + .error404-back-link { + padding: 10px 20px; + } +} + +@media (max-width: 480px) { + .error404-number { + font-size: 4rem; + } + .error404-message { + font-size: 1rem; + } + .error404-back-link { + padding: 8px 16px; + } +} \ No newline at end of file From f3fa267e724ac4a54e1489c6feb870e8e49602d1 Mon Sep 17 00:00:00 2001 From: alphaplayerofdooms <154459496+alphaplayerofdooms@users.noreply.github.com> Date: Thu, 2 Jan 2025 10:45:21 +0530 Subject: [PATCH 3/4] Using tailwind css --- corpus/corpus/urls.py | 2 -- corpus/pages/views.py | 3 --- corpus/templates/404.html | 37 +++++++++++++++++-------------------- 3 files changed, 17 insertions(+), 25 deletions(-) diff --git a/corpus/corpus/urls.py b/corpus/corpus/urls.py index f458620..3409ccd 100644 --- a/corpus/corpus/urls.py +++ b/corpus/corpus/urls.py @@ -50,7 +50,5 @@ path("newsletter/", include("newsletter.urls")), ] -handler404 = "pages.views.custom_404" - if settings.DEBUG: urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) \ No newline at end of file diff --git a/corpus/pages/views.py b/corpus/pages/views.py index f9fa9a4..48264b0 100644 --- a/corpus/pages/views.py +++ b/corpus/pages/views.py @@ -45,6 +45,3 @@ def sig(request, sig_name): def farewell(request): return render(request, "pages/farewell.html") - -def custom_404(request, exception): - return render(request, "404.html", status=404) \ No newline at end of file diff --git a/corpus/templates/404.html b/corpus/templates/404.html index 9179623..59c027f 100644 --- a/corpus/templates/404.html +++ b/corpus/templates/404.html @@ -5,28 +5,25 @@ {% block title %}404 - Page Not Found | IEEE-NITK{% endblock %} {% block content %} - - - - - -
-
- - -
- - -

Page Not Found

-

Oops! The page you are looking for seems to have wandered off.

-
- - - - +
+
+
+ + +
+ +
404
+

Page Not Found

+

Oops! The page you are looking for seems to have wandered off.

+
+ + + + +
-{% endblock %} +{% endblock %} \ No newline at end of file From 57c7ded153a16bff2a9206c944d4ac6e9a55d88b Mon Sep 17 00:00:00 2001 From: NikhilKottoli <154459496+NikhilKottoli@users.noreply.github.com> Date: Thu, 2 Jan 2025 10:49:16 +0530 Subject: [PATCH 4/4] Delete 404.css --- corpus/templates/static/css/404.css | 118 ---------------------------- 1 file changed, 118 deletions(-) delete mode 100644 corpus/templates/static/css/404.css diff --git a/corpus/templates/static/css/404.css b/corpus/templates/static/css/404.css deleted file mode 100644 index 675738b..0000000 --- a/corpus/templates/static/css/404.css +++ /dev/null @@ -1,118 +0,0 @@ - -@keyframes ieee404-wiggle { - 0%, 100% { transform: rotate(0deg); } - 25% { transform: rotate(-5deg); } - 75% { transform: rotate(5deg); } -} -@keyframes ieee404-glitch { - 2%, 64% { transform: translate(2px, 0) skew(0deg); } - 4%, 60% { transform: translate(-2px, 0) skew(0deg); } - 62% { transform: translate(0, 0) skew(5deg); } -} - -.error404-body { - height: 100vh; - font-family: 'Arial', sans-serif; - margin: 0; - overflow: hidden; - perspective: 1000px; - {% comment %} background: oklch(0.5686 0.255 257.57); {% endcomment %} -} - -.error404-container { - background: rgba(255, 255, 255, 0.05); - backdrop-filter: blur(15px); - border-radius: 20px; - padding: 3rem; - text-align: center; - box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15); - opacity: 0.9; - max-width: 600px; - width: 90%; - position: relative; - overflow: hidden; - animation: ieee404-float 4s ease-in-out infinite; - transition: all 0.3s ease; -} - -.error404-ieee-logo { - position: absolute; - top: 20px; - left: 50%; - transform: translateX(-50%); - width: 120px; - opacity: 0.8; - animation: ieee404-wiggle 2s infinite; -} - -.error404-number-dark{ - font-size: 10rem; - font-weight: bold; - background: linear-gradient(45deg, white, #7EBAE7); - -webkit-background-clip: text; - -webkit-text-fill-color: transparent; - margin-bottom: 1rem; - margin-top: 10px; - animation: ieee404-glitch 3s infinite; -} - -.error404-number-light { - font-size: 10rem; - font-weight: bold; - background: linear-gradient(45deg, #2B2B2B, #0056b3); - -webkit-background-clip: text; - -webkit-text-fill-color: transparent; - margin-bottom: 1rem; - margin-top: 10px; - animation: ieee404-glitch 3s infinite; -} - -@keyframes ieee404-fadeIn { - from { opacity: 0; transform: translateY(20px); } - to { opacity: 0.9; transform: translateY(0); } -} - -.error404-back-link { - display: inline-block; - margin-top: 2rem; - padding: 12px 24px; - border-radius: 30px; - transition: all 0.3s ease; - animation: ieee404-pulse 2s infinite; -} - -@keyframes ieee404-pulse { - 0% { transform: scale(1); } - 50% { transform: scale(1.05); } - 100% { transform: scale(1); } -} - -@media (max-width: 768px) { - .error404-container { - padding: 2rem; - width: 95%; - margin: 0 10px; - } - .error404-number { - font-size: 6rem; - margin-top: 20px; - } - .error404-message { - font-size: 1.2rem; - } - .error404-back-link { - padding: 10px 20px; - } -} - -@media (max-width: 480px) { - .error404-number { - font-size: 4rem; - } - .error404-message { - font-size: 1rem; - } - .error404-back-link { - padding: 8px 16px; - } -} \ No newline at end of file