Skip to content

Commit

Permalink
New improved 404
Browse files Browse the repository at this point in the history
Signed-off-by: Shahm Najeeb <[email protected]>
  • Loading branch information
DefinetlyNotAI committed Dec 27, 2024
1 parent 495ba7c commit 4e9701a
Show file tree
Hide file tree
Showing 3 changed files with 410 additions and 61 deletions.
40 changes: 21 additions & 19 deletions 404.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
<!doctype html>
<!DOCTYPE html>
<html lang="en">

<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<meta content="width=device-width, initial-scale=1, maximum-scale=1" name="viewport">
<title>Error 404 - Page Not Found!</title>
<link href="src/css/404.css" rel="stylesheet" type="text/css"/>
<link href="src/media/WesmunFavicon.svg" rel="shortcut icon" type="image/x-icon"/>
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<title>404 - Page Not Found</title>
<link href="src/css/404.css" rel="stylesheet">
</head>

<body>
<div class="container">
<img alt="404" class="ops" src="src/media/404.svg"/>
<br/>
<h3>UH OH! You're lost.
<br/>The page you are looking for does not exist.
How you got here is a mystery. But you can click the button below
to go back to the homepage.
</h3>
<br/>
<a class="button" href="/index.html">Back Home</a>
<div class="glitch-wrapper">
<div class="glitch" data-text="404">404</div>
</div>
<div class="message">
<h2>Page Not Found</h2>
<p>Oops! The page you're looking for has drifted into the digital void.</p>
</div>
<div class="interactive-element">
<div class="portal">
<div class="rings"></div>
<div class="core"></div>
</div>
<button class="home-button">Return Home</button>
</div>
<div class="particles"></div>
</div>
<script src="src/js/404.js" type="module"></script>
</body>
<script src="src/js/prettyurl.js"></script>

</html>
219 changes: 177 additions & 42 deletions src/css/404.css
Original file line number Diff line number Diff line change
@@ -1,68 +1,203 @@
@charset "UTF-8";
/* CSS Document */
:root {
--primary: #2c3e50;
--accent: #3498db;
--text: #ecf0f1;
--background: #1a1a2e;
}

body {
background: #fff;
padding: 0;
* {
margin: 0;
font-family: Helvetica, Arial, sans-serif;
padding: 0;
box-sizing: border-box;
}

body {
background: var(--background);
font-family: 'Inter', sans-serif;
color: var(--text);
height: 100vh;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
}

.container {
background-color: #fff;
margin: 0 auto;
text-align: center;
padding-top: 50px;
position: relative;
z-index: 1;
}

h3 {
font-size: 16px;
color: #3498db;
font-weight: bold;
text-align: center;
line-height: 130%;
.glitch-wrapper {
position: relative;
margin-bottom: 2rem;
}

.button {
background: #3498db;
padding: 10px 20px;
color: #fff;
.glitch {
font-size: 8rem;
font-weight: bold;
text-align: center;
border-radius: 3px;
text-decoration: none;
position: relative;
text-shadow: 0.05em 0 0 #00fffc, -0.03em -0.04em 0 #fc00ff,
0.025em 0.04em 0 #fffc00;
animation: glitch 725ms infinite;
}

a:hover {
color: #ff0;
.glitch span {
position: absolute;
top: 0;
left: 0;
}

span {
font-size: 14px;
color: #FFF;
font-weight: normal;
text-align: center;
@keyframes glitch {
0% {
text-shadow: 0.05em 0 0 #00fffc, -0.03em -0.04em 0 #fc00ff,
0.025em 0.04em 0 #fffc00;
}
15% {
text-shadow: 0.05em 0 0 #00fffc, -0.03em -0.04em 0 #fc00ff,
0.025em 0.04em 0 #fffc00;
}
16% {
text-shadow: -0.05em -0.025em 0 #00fffc, 0.025em 0.035em 0 #fc00ff,
-0.05em -0.05em 0 #fffc00;
}
49% {
text-shadow: -0.05em -0.025em 0 #00fffc, 0.025em 0.035em 0 #fc00ff,
-0.05em -0.05em 0 #fffc00;
}
50% {
text-shadow: 0.05em 0.035em 0 #00fffc, 0.03em 0 0 #fc00ff,
0 -0.04em 0 #fffc00;
}
99% {
text-shadow: 0.05em 0.035em 0 #00fffc, 0.03em 0 0 #fc00ff,
0 -0.04em 0 #fffc00;
}
100% {
text-shadow: -0.05em 0 0 #00fffc, -0.025em -0.04em 0 #fc00ff,
-0.04em -0.025em 0 #fffc00;
}
}

span a {
color: #FF0;
text-decoration: none;
.message {
margin-bottom: 3rem;
}

span a:hover {
color: #F00;
.message h2 {
font-size: 2rem;
margin-bottom: 1rem;
color: var(--accent);
}

@media screen and (max-width: 500px) {
img {
width: 70%;
}
.message p {
font-size: 1.2rem;
color: var(--text);
opacity: 0.8;
}

.container {
padding: 70px 10px 10px 10px;
.portal {
width: 150px;
height: 150px;
margin: 0 auto 2rem;
position: relative;
cursor: pointer;
}

.rings {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 100%;
height: 100%;
border: 2px solid var(--accent);
border-radius: 50%;
animation: pulse 2s infinite;
}

.rings::before, .rings::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 70%;
height: 70%;
border: 2px solid var(--accent);
border-radius: 50%;
animation: pulse 2s infinite 0.5s;
}

.rings::after {
width: 40%;
height: 40%;
animation-delay: 1s;
}

.core {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 20%;
height: 20%;
background: var(--accent);
border-radius: 50%;
box-shadow: 0 0 20px var(--accent);
animation: glow 2s infinite;
}

@keyframes pulse {
0% {
transform: translate(-50%, -50%) scale(0.8);
opacity: 0.5;
}
50% {
transform: translate(-50%, -50%) scale(1);
opacity: 1;
}
100% {
transform: translate(-50%, -50%) scale(0.8);
opacity: 0.5;
}
}

h3 {
font-size: 14px;
@keyframes glow {
0% {
box-shadow: 0 0 20px var(--accent);
}
50% {
box-shadow: 0 0 40px var(--accent);
}
100% {
box-shadow: 0 0 20px var(--accent);
}
}

.home-button {
background: transparent;
border: 2px solid var(--accent);
color: var(--accent);
padding: 1rem 2rem;
font-size: 1.1rem;
border-radius: 30px;
cursor: pointer;
transition: all 0.3s ease;
position: relative;
overflow: hidden;
}

.home-button:hover {
background: var(--accent);
color: var(--background);
}

.particles {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: -1;
}
Loading

0 comments on commit 4e9701a

Please sign in to comment.