-
Notifications
You must be signed in to change notification settings - Fork 0
/
404.html
118 lines (104 loc) · 3.14 KB
/
404.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<!DOCTYPE html>
<html lang="en">
<head>
<title>File not found</title>
<meta content="text/html; charset=utf-8" />
<script>
function installParallax() {
let middleground = document.querySelector("#middleground");
let background = document.querySelector("#background");
let text404 = document.querySelector("#text404");
let backgroundHeight = background.clientHeight;
let backgroundWidth = background.clientWidth;
let middlegroundHeight = middleground.clientHeight;
let middlegroundWidth = middleground.clientWidth;
let text404Height = text404.clientHeight;
let text404Width = text404.clientWidth;
function applyParallax(event) {
middleground.style.left = `${
((-middlegroundWidth / 8) * event.pageX) / window.innerWidth
}px`;
middleground.style.bottom = `${
(-middlegroundHeight / 5) * (1 - event.pageY / window.innerHeight)
}px`;
background.style.right = `${
(-backgroundWidth / 10) * (1 - event.pageX / window.innerWidth)
}px`;
background.style.bottom = `${
(-backgroundHeight / 9) * (1 - event.pageY / window.innerHeight)
}px`;
text404.style.marginRight = `${
(text404Width / 10) * (event.pageX / window.innerWidth)
}px`;
text404.style.marginTop = `${
(text404Height / 10) * (1 - event.pageY / window.innerHeight)
}px`;
}
document.addEventListener("mousemove", applyParallax);
}
window.addEventListener("load", installParallax);
</script>
<style>
a {
width: 70%;
position: absolute;
top: 5%;
}
@media (min-width: 500px) {
a {
top: 5%;
left: 5%;
width: 20%;
position: absolute;
}
}
#background {
right: 0;
bottom: 0;
width: 50%;
position: absolute;
}
#middleground {
left: 0;
bottom: 0;
width: 80%;
position: absolute;
}
#text404 {
width: 60%;
}
body {
background: linear-gradient(#fbb03b, #ed1c24);
display: flex;
justify-content: center;
align-items: center;
height: 85%;
overflow: hidden;
}
</style>
</head>
<body id="404">
<img
id="text404"
src="/images/background_and_menus/parallax_404_404text.svg"
alt="error 404: This is not the city you are looking for..."
/>
<img
id="background"
src="/images/background_and_menus/parallax_404_background.svg"
alt="the background, a sandy orange yellow hill with sillouhetes of buidlings in dotted line, with question marks in them"
/>
<img
id="middleground"
src="/images/background_and_menus/parallax_404_middleground.svg"
alt="the middleground, a sandy orange hill with dried shrubs"
/>
<a href="/">
<img
id="logo"
src="/images/background_and_menus/logobanner.svg"
alt="click to go to home page"
/>
</a>
</body>
</html>