Newer
Older
KaiFengPC / src / views / error / 404.vue
@zhangdeliang zhangdeliang on 23 May 5 KB 初始化项目
  1. <template>
  2. <div class="wscn-http404-container">
  3. <div class="wscn-http404">
  4. <div class="pic-404">
  5. <img class="pic-404__parent" src="@/assets/404_images/404.png" alt="404" />
  6. <img class="pic-404__child left" src="@/assets/404_images/404_cloud.png" alt="404" />
  7. <img class="pic-404__child mid" src="@/assets/404_images/404_cloud.png" alt="404" />
  8. <img class="pic-404__child right" src="@/assets/404_images/404_cloud.png" alt="404" />
  9. </div>
  10. <div class="bullshit">
  11. <div class="bullshit__oops">404错误!</div>
  12. <div class="bullshit__headline">
  13. {{ message }}
  14. </div>
  15. <div class="bullshit__info">
  16. 对不起,您正在寻找的页面不存在。尝试检查URL的错误,然后按浏览器上的刷新按钮或尝试在我们的应用程序中找到其他内容。
  17. </div>
  18. <router-link to="/door" class="bullshit__return-home"> 返回首页 </router-link>
  19. </div>
  20. </div>
  21. </div>
  22. </template>
  23.  
  24. <script setup>
  25. let message = computed(() => {
  26. return '找不到网页!';
  27. });
  28. </script>
  29.  
  30. <style lang="scss" scoped>
  31. .wscn-http404-container {
  32. transform: translate(-50%, -50%);
  33. position: absolute;
  34. top: 40%;
  35. left: 50%;
  36. }
  37. .wscn-http404 {
  38. position: relative;
  39. width: 1200px;
  40. padding: 0 50px;
  41. overflow: hidden;
  42. .pic-404 {
  43. position: relative;
  44. float: left;
  45. width: 600px;
  46. overflow: hidden;
  47. &__parent {
  48. width: 100%;
  49. }
  50. &__child {
  51. position: absolute;
  52. &.left {
  53. width: 80px;
  54. top: 17px;
  55. left: 220px;
  56. opacity: 0;
  57. animation-name: cloudLeft;
  58. animation-duration: 2s;
  59. animation-timing-function: linear;
  60. animation-fill-mode: forwards;
  61. animation-delay: 1s;
  62. }
  63. &.mid {
  64. width: 46px;
  65. top: 10px;
  66. left: 420px;
  67. opacity: 0;
  68. animation-name: cloudMid;
  69. animation-duration: 2s;
  70. animation-timing-function: linear;
  71. animation-fill-mode: forwards;
  72. animation-delay: 1.2s;
  73. }
  74. &.right {
  75. width: 62px;
  76. top: 100px;
  77. left: 500px;
  78. opacity: 0;
  79. animation-name: cloudRight;
  80. animation-duration: 2s;
  81. animation-timing-function: linear;
  82. animation-fill-mode: forwards;
  83. animation-delay: 1s;
  84. }
  85. @keyframes cloudLeft {
  86. 0% {
  87. top: 17px;
  88. left: 220px;
  89. opacity: 0;
  90. }
  91. 20% {
  92. top: 33px;
  93. left: 188px;
  94. opacity: 1;
  95. }
  96. 80% {
  97. top: 81px;
  98. left: 92px;
  99. opacity: 1;
  100. }
  101. 100% {
  102. top: 97px;
  103. left: 60px;
  104. opacity: 0;
  105. }
  106. }
  107. @keyframes cloudMid {
  108. 0% {
  109. top: 10px;
  110. left: 420px;
  111. opacity: 0;
  112. }
  113. 20% {
  114. top: 40px;
  115. left: 360px;
  116. opacity: 1;
  117. }
  118. 70% {
  119. top: 130px;
  120. left: 180px;
  121. opacity: 1;
  122. }
  123. 100% {
  124. top: 160px;
  125. left: 120px;
  126. opacity: 0;
  127. }
  128. }
  129. @keyframes cloudRight {
  130. 0% {
  131. top: 100px;
  132. left: 500px;
  133. opacity: 0;
  134. }
  135. 20% {
  136. top: 120px;
  137. left: 460px;
  138. opacity: 1;
  139. }
  140. 80% {
  141. top: 180px;
  142. left: 340px;
  143. opacity: 1;
  144. }
  145. 100% {
  146. top: 200px;
  147. left: 300px;
  148. opacity: 0;
  149. }
  150. }
  151. }
  152. }
  153. .bullshit {
  154. position: relative;
  155. float: left;
  156. width: 300px;
  157. padding: 30px 0;
  158. overflow: hidden;
  159. &__oops {
  160. font-size: 32px;
  161. font-weight: bold;
  162. line-height: 40px;
  163. color: #1482f0;
  164. opacity: 0;
  165. margin-bottom: 20px;
  166. animation-name: slideUp;
  167. animation-duration: 0.5s;
  168. animation-fill-mode: forwards;
  169. }
  170. &__headline {
  171. font-size: 20px;
  172. line-height: 24px;
  173. color: #c6c6c6;
  174. font-weight: bold;
  175. opacity: 0;
  176. margin-bottom: 10px;
  177. animation-name: slideUp;
  178. animation-duration: 0.5s;
  179. animation-delay: 0.1s;
  180. animation-fill-mode: forwards;
  181. }
  182. &__info {
  183. font-size: 13px;
  184. line-height: 21px;
  185. color: grey;
  186. opacity: 0;
  187. margin-bottom: 30px;
  188. animation-name: slideUp;
  189. animation-duration: 0.5s;
  190. animation-delay: 0.2s;
  191. animation-fill-mode: forwards;
  192. }
  193. &__return-home {
  194. display: block;
  195. float: left;
  196. width: 110px;
  197. height: 36px;
  198. background: #1482f0;
  199. border-radius: 100px;
  200. text-align: center;
  201. color: #ffffff;
  202. opacity: 0;
  203. font-size: 14px;
  204. line-height: 36px;
  205. cursor: pointer;
  206. animation-name: slideUp;
  207. animation-duration: 0.5s;
  208. animation-delay: 0.3s;
  209. animation-fill-mode: forwards;
  210. }
  211. @keyframes slideUp {
  212. 0% {
  213. transform: translateY(60px);
  214. opacity: 0;
  215. }
  216. 100% {
  217. transform: translateY(0);
  218. opacity: 1;
  219. }
  220. }
  221. }
  222. }
  223. </style>