docs/.vitepress/theme/components/NotFound.vue

6fb17543d94a32902b48680ada8fd8e33cdf4cb2
wotaku/docs/.vitepress/theme/components/NotFound.vue history · blame · raw

118 lines · 3439 bytes

  1<!--
  2  Copyright (c) 2024 taskylizard
  3
  4  Licensed under the Apache License, Version 2.0 (the "License");
  5  you may not use this file except in compliance with the License.
  6  You may obtain a copy of the License at
  7
  8  http://www.apache.org/licenses/LICENSE-2.0
  9
 10  Unless required by applicable law or agreed to in writing, software
 11  distributed under the License is distributed on an "AS IS" BASIS,
 12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  See the License for the specific language governing permissions and
 14  limitations under the License.
 15-->
 16<script setup lang="ts">
 17import { ref } from 'vue'
 18
 19// Set a fixed image size
 20const imageSize = ref('550px') // Fixed size for the image
 21</script>
 22
 23<template>
 24  <div class="flex min-h-[calc(100vh-4rem)] items-center justify-center p-4">
 25    <div class="text-center">
 26      <img
 27        :style="{ width: imageSize, height: 'auto' }"
 28        src="/asset/404.gif"
 29        alt="404 Image"
 30        class="mx-auto"
 31      />
 32      <p class="text-title-lg mt-4 font-bold leading-tight text-white">404</p>
 33      <p
 34        class="text-body-lg flex flex-wrap items-center justify-center leading-snug text-gray-400"
 35      >
 36        Umm.... you shouldn’t be here
 37        <span class="icon-container mx-1">
 38          <img class="icon-img" src="/asset/inahuh.png" alt="Inahuh Icon" />
 39        </span>
 40        If you got here from a link, please click
 41        <span class="icon-container mx-1">
 42          <svg
 43            class="w-icon h-icon inline-block align-text-bottom"
 44            xmlns="http://www.w3.org/2000/svg"
 45            viewBox="0 0 24 24"
 46            fill="none"
 47            stroke="currentColor"
 48            stroke-linecap="round"
 49            stroke-linejoin="round"
 50            stroke-width="2"
 51          >
 52            <rect width="20" height="16" x="2" y="4" rx="2"></rect>
 53            <path d="m22 7l-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"></path>
 54          </svg>
 55        </span>
 56        to report it.
 57      </p>
 58    </div>
 59  </div>
 60</template>
 61
 62<style scoped>
 63.text-title-lg {
 64  font-size: 1.5rem; /* Font size for titles */
 65}
 66
 67.text-body-lg {
 68  font-size: 1rem; /* Font size for body text */
 69}
 70
 71.w-icon {
 72  width: 1em; /* Make the icon size relative to the text size */
 73}
 74
 75.h-icon {
 76  height: 1.25em; /* Make the icon size relative to the text size */
 77}
 78
 79.icon-container {
 80  display: inline-flex; /* Use inline-flex to control spacing within the container */
 81  align-items: center; /* Vertically center the icon/image */
 82  justify-content: center; /* Horizontally center the icon/image */
 83}
 84
 85.icon-img {
 86  width: 1em; /* Make the image size relative to the text size */
 87  height: auto; /* Maintain aspect ratio */
 88}
 89
 90.mx-1 {
 91  margin-left: 0.25em; /* Adjust this value for precise spacing */
 92  margin-right: 0.25em; /* Adjust this value for precise spacing */
 93}
 94
 95@media (max-width: 640px) {
 96  .text-title-lg {
 97    font-size: 1.25rem; /* Adjusted font size for smaller screens */
 98  }
 99  .text-body-lg {
100    font-size: 0.875rem; /* Adjusted font size for smaller screens */
101  }
102
103  .mx-1 {
104    margin-left: 0.1em; /* Adjusted margin for smaller screens */
105    margin-right: 0.1em; /* Adjusted margin for smaller screens */
106  }
107}
108
109p {
110  overflow-wrap: break-word;
111  word-break: break-word;
112}
113
114div {
115  max-height: 100vh; /* Prevents container from exceeding viewport height */
116  overflow-y: hidden; /* Ensures no vertical scrollbar is visible */
117}
118</style>