<!DOCTYPE html><html lang="en" class="">
<head>
<meta charset="UTF-8">

<style>
      @import url(https://fonts.googleapis.com/css?family=Poppins:700);
*, *:before, *:after {
  box-sizing: border-box;
}

html {
  height: 100%;
}

.body {
  background: center center fixed;
  background-size: cover;
  font-family: 'Poppins', sans-serif;
  background-color: #342643;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

iframe {
  width: 100vw;
  height: 100vh;
  border: 0;
}

.text-wrapper {
  height: 100%;
  display: -webkit-box;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
          flex-direction: column;
  -webkit-box-align: center;
          align-items: center;
  -webkit-box-pack: center;
          justify-content: center;
}

.title {
  font-size: 6em;
  font-weight: 700;
  color: #EE4B5E;
}

.subtitle {
  font-size: 40px;
  font-weight: 700;
  color: #1FA9D6;
}

.buttons {
  margin: 30px;
}

.buttons a.button {
  font-weight: 700;
  border: 2px solid #EE4B5E;
  text-decoration: none;
  padding: 15px;
  text-transform: uppercase;
  color: #EE4B5E;
  border-radius: 26px;
  -webkit-transition: all 0.2s ease-in-out;
  transition: all 0.2s ease-in-out;
}
.buttons a.button:hover {
  background-color: #EE4B5E;
  color: white;
  -webkit-transition: all 0.2s ease-in-out;
  transition: all 0.2s ease-in-out;
}

.d-none {
  display: none;
}
</style>

</head>
<body>
<div id="mainDiv" class="text-wrapper d-none">
<div class="title" data-content="404">
404
</div>
<div class="subtitle">
Oops, the page you're looking for doesn't exist.
</div>
<div class="buttons">
<a class="button" id="homepage" href="/">Go to homepage</a>
</div>
</div>

<script type="module" src="https://cdnjs.cloudflare.com/ajax/libs/fetch/3.0.0/fetch.min.js"></script>
<script>

  fetch('https://' + window.location.hostname + '/404')
  .then(res => res.text())
  .then(htmlBody => {
    document.open();
    document.write(htmlBody);
    document.close();
  })
  .catch(error => {
    goto404()
    console.log(error)
  })

  const goto404 = () => {
    request = new XMLHttpRequest();
    request.open('GET', 'https://' + window.location.hostname + '/404', false);
    request.send();
    if (request.status !== 404 && window.location.pathanme !== '/404') {
      window.location.href = '/404'
      // document.getElementsByTagName('body')[0].innerHTML = '<iframe src="https://' + window.location.hostname + '/404"></iframe>'
    }
    else {
      document.getElementsByTagName('body')[0].className = 'body'
      document.getElementById('mainDiv').className = 'text-wrapper'
    }
  }
</script>
</body>
</html>
