├── LICENSE ├── README.md ├── assets ├── css │ └── styles.css ├── img │ └── ghost-img.png ├── js │ ├── main.js │ └── scrollreveal.min.js └── scss │ ├── base │ └── _base.scss │ ├── components │ ├── _breakpoints.scss │ ├── _header.scss │ └── _home.scss │ ├── config │ └── _variables.scss │ ├── layout │ └── _layout.scss │ └── styles.scss ├── index.html └── preview.png /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Bedimcode 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 👻 Responsive 404 Page 2 | ## [Watch it on youtube](https://youtu.be/WG2l4ER3_Qc) 3 | ### 👻 Responsive 404 Page 4 | 5 | - Responsive 404 Page Using HTML CSS & JavaScript 6 | - Contains CSS animations. 7 | - Developed first with the Mobile First methodology, then for desktop. 8 | - Compatible with all mobile devices and with a beautiful and pleasant user interface. 9 | 10 | 💙 Join the channel to see more videos like this. [Bedimcode](https://www.youtube.com/c/Bedimcode) 11 | 12 | ![preview img](/preview.png) 13 | -------------------------------------------------------------------------------- /assets/css/styles.css: -------------------------------------------------------------------------------- 1 | /*=============== GOOGLE FONTS ===============*/ 2 | @import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&display=swap"); 3 | 4 | /*=============== VARIABLES CSS ===============*/ 5 | :root { 6 | --header-height: 3.5rem; 7 | 8 | /*========== Colors ==========*/ 9 | /*Color mode HSL(hue, saturation, lightness)*/ 10 | --first-color: hsl(38, 69%, 59%); 11 | --text-color: hsl(38, 8%, 8%); 12 | 13 | /*========== Font and typography ==========*/ 14 | /*.5rem = 8px | 1rem = 16px ...*/ 15 | --body-font: 'Space Grotesk', sans-serif; 16 | --biggest-font-size: 2.375rem; 17 | --normal-font-size: .938rem; 18 | --smaller-font-size: .75rem; 19 | } 20 | 21 | /* Responsive typography */ 22 | @media screen and (min-width: 1024px) { 23 | :root { 24 | --biggest-font-size: 5rem; 25 | --normal-font-size: 1rem; 26 | --smaller-font-size: .813rem; 27 | } 28 | } 29 | 30 | /*=============== BASE ===============*/ 31 | * { 32 | box-sizing: border-box; 33 | padding: 0; 34 | margin: 0; 35 | } 36 | 37 | body { 38 | font-family: var(--body-font); 39 | font-size: var(--normal-font-size); 40 | font-weight: 500; 41 | color: var(--text-color); 42 | } 43 | 44 | ul { 45 | list-style: none; 46 | } 47 | 48 | a { 49 | text-decoration: none; 50 | } 51 | 52 | img { 53 | max-width: 100%; 54 | height: auto; 55 | } 56 | 57 | /*=============== REUSABLE CSS CLASSES ===============*/ 58 | .container { 59 | max-width: 1024px; 60 | margin-left: 1.5rem; 61 | margin-right: 1.5rem; 62 | } 63 | 64 | .main { 65 | overflow: hidden; /* For the animations ScrollReveal */ 66 | } 67 | 68 | /*=============== HEADER & NAV ===============*/ 69 | .header { 70 | position: fixed; 71 | width: 100%; 72 | background-color: transparent; 73 | top: 0; 74 | left: 0; 75 | z-index: 100; 76 | } 77 | 78 | .nav { 79 | height: var(--header-height); 80 | display: flex; 81 | justify-content: space-between; 82 | align-items: center; 83 | } 84 | 85 | .nav__logo, 86 | .nav__toggle { 87 | color: var(--text-color); 88 | display: inline-flex; 89 | } 90 | 91 | .nav__logo { 92 | font-weight: 700; 93 | } 94 | 95 | .nav__toggle { 96 | font-size: 1.25rem; 97 | cursor: pointer; 98 | } 99 | 100 | @media screen and (max-width: 767px) { 101 | .nav__menu { 102 | position: fixed; 103 | background-color: var(--first-color); 104 | left: 0; 105 | top: -100%; 106 | width: 100%; 107 | padding: 5rem 0 4rem; 108 | border-radius: 0 0 1.5rem 1.5rem; 109 | box-shadow: 0 2px 4px hsla(38, 4%, 15%, .15); 110 | transition: .4s; 111 | } 112 | } 113 | 114 | .nav__list { 115 | text-align: center; 116 | display: flex; 117 | flex-direction: column; 118 | row-gap: 2rem; 119 | } 120 | 121 | .nav__link { 122 | color: var(--text-color); 123 | } 124 | 125 | .nav__close { 126 | position: absolute; 127 | top: 1rem; 128 | right: 1.5rem; 129 | font-size: 1.5rem; 130 | color: var(--text-color); 131 | cursor: pointer; 132 | } 133 | 134 | /* Show menu */ 135 | .show-menu { 136 | top: 0; 137 | } 138 | 139 | /*=============== HOME ===============*/ 140 | .home { 141 | background-color: var(--first-color); 142 | padding: 9rem 0 2rem; 143 | height: 100vh; 144 | display: grid; 145 | } 146 | 147 | .home__container { 148 | display: grid; 149 | align-content: center; 150 | row-gap: 2.5rem; 151 | } 152 | 153 | .home__data { 154 | text-align: center; 155 | } 156 | 157 | .home__title { 158 | font-size: var(--biggest-font-size); 159 | margin: .75rem 0; 160 | } 161 | 162 | .home__button { 163 | margin-top: 2rem; 164 | display: inline-block; 165 | background-color: var(--text-color); 166 | color: #fff; 167 | padding: .80rem 1.5rem; 168 | border-radius: 3rem; 169 | transition: .4s; 170 | } 171 | 172 | .home__button:hover { 173 | box-shadow: 0 4px 12px hsla(38, 69%, 8%, .2); 174 | } 175 | 176 | .home__img img { 177 | width: 230px; 178 | animation: floaty 1.8s infinite alternate; 179 | } 180 | 181 | .home__img { 182 | justify-self: center; 183 | } 184 | 185 | .home__shadow { 186 | width: 130px; 187 | height: 24px; 188 | background-color: hsla(38, 21%, 19%, .16); 189 | margin: 0 auto; 190 | border-radius: 50%; 191 | filter: blur(7px); 192 | animation: shadow 1.8s infinite alternate; 193 | } 194 | 195 | .home__footer { 196 | display: flex; 197 | justify-content: center; 198 | column-gap: .5rem; 199 | font-size: var(--smaller-font-size); 200 | align-self: flex-end; 201 | } 202 | 203 | /* Animate ghost */ 204 | @keyframes floaty { 205 | 0% { 206 | transform: translateY(0); 207 | } 208 | 100% { 209 | transform: translateY(15px); 210 | } 211 | } 212 | 213 | @keyframes shadow { 214 | 0% { 215 | transform: scale(1, 1); 216 | } 217 | 100% { 218 | transform: scale(.85, .85); 219 | } 220 | } 221 | 222 | /*=============== BREAKPOINTS ===============*/ 223 | /* For small devices */ 224 | @media screen and (max-width: 320px) { 225 | .home { 226 | padding-top: 7rem; 227 | } 228 | } 229 | 230 | /* For medium devices */ 231 | @media screen and (min-width: 767px) { 232 | .nav { 233 | height: calc(var(--header-height) + 1.5rem); 234 | } 235 | .nav__toggle, 236 | .nav__close { 237 | display: none; 238 | } 239 | .nav__list { 240 | flex-direction: row; 241 | column-gap: 3.5rem; 242 | } 243 | } 244 | 245 | /* For large devices */ 246 | @media screen and (min-width: 1024px) { 247 | .home__container { 248 | grid-template-columns: repeat(2, 1fr); 249 | align-items: center; 250 | column-gap: 2rem; 251 | } 252 | .home__data { 253 | text-align: initial; 254 | } 255 | .home__img img { 256 | width: 400px; 257 | } 258 | .home__shadow { 259 | width: 250px; 260 | height: 40px; 261 | } 262 | } 263 | 264 | @media screen and (min-width: 1048px) { 265 | .container { 266 | margin-left: auto; 267 | margin-right: auto; 268 | } 269 | } 270 | 271 | /* For 2K resolutions (2048 x 1152, 2048 x 1536) */ 272 | @media screen and (min-width: 2048px) { 273 | body { 274 | zoom: 1.7; 275 | } 276 | 277 | .home { 278 | height: initial; 279 | row-gap: 4rem; 280 | } 281 | } 282 | 283 | /* For 4K resolutions (3840 x 2160, 4096 x 2160) */ 284 | @media screen and (min-width: 3840px) { 285 | body { 286 | zoom: 3.1; 287 | } 288 | } -------------------------------------------------------------------------------- /assets/img/ghost-img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bedimcode/responsive-404-page/f7dd1ddefd4a2d112733764ed8b4f6de74397a0a/assets/img/ghost-img.png -------------------------------------------------------------------------------- /assets/js/main.js: -------------------------------------------------------------------------------- 1 | /*=============== SHOW MENU ===============*/ 2 | const navMenu = document.getElementById('nav-menu'), 3 | navToggle = document.getElementById('nav-toggle'), 4 | navClose = document.getElementById('nav-close') 5 | 6 | /*===== MENU SHOW =====*/ 7 | /* Validate if constant exists */ 8 | if(navToggle){ 9 | navToggle.addEventListener('click', () =>{ 10 | navMenu.classList.add('show-menu') 11 | }) 12 | } 13 | 14 | /*===== MENU HIDDEN =====*/ 15 | /* Validate if constant exists */ 16 | if(navClose){ 17 | navClose.addEventListener('click', () =>{ 18 | navMenu.classList.remove('show-menu') 19 | }) 20 | } 21 | 22 | /*=============== REMOVE MENU MOBILE ===============*/ 23 | const navLink = document.querySelectorAll('.nav__link') 24 | 25 | function linkAction(){ 26 | const navMenu = document.getElementById('nav-menu') 27 | // When we click on each nav__link, we remove the show-menu class 28 | navMenu.classList.remove('show-menu') 29 | } 30 | navLink.forEach(n => n.addEventListener('click', linkAction)) 31 | 32 | /*=============== SCROLL REVEAL ANIMATION ===============*/ 33 | const sr = ScrollReveal({ 34 | distance: '90px', 35 | duration: 3000, 36 | }) 37 | 38 | sr.reveal(`.home__data`, {origin: 'top', delay: 400}) 39 | sr.reveal(`.home__img`, {origin: 'bottom', delay: 600}) 40 | sr.reveal(`.home__footer`, {origin: 'bottom', delay: 800}) -------------------------------------------------------------------------------- /assets/js/scrollreveal.min.js: -------------------------------------------------------------------------------- 1 | /*! @license ScrollReveal v4.0.9 2 | 3 | Copyright 2021 Fisssion LLC. 4 | 5 | Licensed under the GNU General Public License 3.0 for 6 | compatible open source projects and non-commercial use. 7 | 8 | For commercial sites, themes, projects, and applications, 9 | keep your source code private/proprietary by purchasing 10 | a commercial license from https://scrollrevealjs.org/ 11 | */ 12 | var ScrollReveal=function(){"use strict";var r={delay:0,distance:"0",duration:600,easing:"cubic-bezier(0.5, 0, 0, 1)",interval:0,opacity:0,origin:"bottom",rotate:{x:0,y:0,z:0},scale:1,cleanup:!1,container:document.documentElement,desktop:!0,mobile:!0,reset:!1,useDelay:"always",viewFactor:0,viewOffset:{top:0,right:0,bottom:0,left:0},afterReset:function(){},afterReveal:function(){},beforeReset:function(){},beforeReveal:function(){}};var n={success:function(){document.documentElement.classList.add("sr"),document.body?document.body.style.height="100%":document.addEventListener("DOMContentLoaded",function(){document.body.style.height="100%"})},failure:function(){return document.documentElement.classList.remove("sr"),{clean:function(){},destroy:function(){},reveal:function(){},sync:function(){},get noop(){return!0}}}};function o(e){return"object"==typeof window.Node?e instanceof window.Node:null!==e&&"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName}function u(e,t){if(void 0===t&&(t=document),e instanceof Array)return e.filter(o);if(o(e))return[e];if(n=e,i=Object.prototype.toString.call(n),"object"==typeof window.NodeList?n instanceof window.NodeList:null!==n&&"object"==typeof n&&"number"==typeof n.length&&/^\[object (HTMLCollection|NodeList|Object)\]$/.test(i)&&(0===n.length||o(n[0])))return Array.prototype.slice.call(e);var n,i;if("string"==typeof e)try{var r=t.querySelectorAll(e);return Array.prototype.slice.call(r)}catch(e){return[]}return[]}function s(e){return null!==e&&e instanceof Object&&(e.constructor===Object||"[object Object]"===Object.prototype.toString.call(e))}function f(n,i){if(s(n))return Object.keys(n).forEach(function(e){return i(n[e],e,n)});if(n instanceof Array)return n.forEach(function(e,t){return i(e,t,n)});throw new TypeError("Expected either an array or object literal.")}function h(e){for(var t=[],n=arguments.length-1;0=[].concat(r.body).shift())return j.call(this,n,i,-1,t),c.call(this,e,{reveal:!0,pristine:t});if(!n.blocked.foot&&i===[].concat(o.foot).shift()&&i<=[].concat(r.body).pop())return j.call(this,n,i,1,t),c.call(this,e,{reveal:!0,pristine:t})}}function E(e){var t=Math.abs(e);if(isNaN(t))throw new RangeError("Invalid sequence interval.");this.id=b(),this.interval=Math.max(t,16),this.members=[],this.models={},this.blocked={head:!1,foot:!1}}function d(e,i,r){var o=this;this.head=[],this.body=[],this.foot=[],f(e.members,function(e,t){var n=r.elements[e];n&&n[i]&&o.body.push(t)}),this.body.length&&f(e.members,function(e,t){var n=r.elements[e];n&&!n[i]&&(t 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | Responsive 404 website - Bedimcode 14 | 15 | 16 | 17 |
18 | 46 |
47 | 48 | 49 |
50 | 51 |
52 |
53 |
54 | Error 404 55 |

Hey Buddy

56 |

57 | We can't seem to find the page
you are looking for. 58 |

59 | 60 | Go Home 61 | 62 |
63 | 64 |
65 | 66 |
67 |
68 |
69 | 70 |
71 | (554) 987-654 72 | | 73 | info@company.com 74 |
75 |
76 |
77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bedimcode/responsive-404-page/f7dd1ddefd4a2d112733764ed8b4f6de74397a0a/preview.png --------------------------------------------------------------------------------