/src/views/errorPage/404.vue

https://github.com/2017coding/BBS · Vue · 255 lines · 251 code · 3 blank · 1 comment · 2 complexity · 1f139994b2e77b6cf332db5231545512 MD5 · raw file

  1. <template>
  2. <div style="background:#f0f2f5;height:100%;">
  3. <div class="wscn-http404-container">
  4. <div class="wscn-http404">
  5. <div class="pic-404">
  6. <img class="pic-404__parent" :src="img404" alt="404">
  7. <img class="pic-404__child left" :src="img404Cloud" alt="404">
  8. <img class="pic-404__child mid" :src="img404Cloud" alt="404">
  9. <img class="pic-404__child right" :src="img404Cloud" alt="404">
  10. </div>
  11. <div class="bullshit">
  12. <div class="bullshit__oops">OOPS!</div>
  13. <div class="bullshit__info">随便逛逛
  14. <a class="link-type" href="https://www.taobao.com/" target="_blank">淘宝网</a>
  15. </div>
  16. <div class="bullshit__headline">{{ message }}</div>
  17. <div class="bullshit__info">
  18. <!-- 请检查您输入的网址是否正确请点击以下按钮返回主页 -->
  19. </div>
  20. <a icon="arrow-left" class="bullshit__return-home" @click="back">返回</a>
  21. <a href="" class="bullshit__return-home" style="margin-left: 20px;">返回首页</a>
  22. </div>
  23. </div>
  24. </div>
  25. </div>
  26. </template>
  27. <script>
  28. import img404 from '@/views/errorPage/img/404.png'
  29. import img404Cloud from '@/views/errorPage/img/404_cloud.png'
  30. export default {
  31. name: 'Page404',
  32. data () {
  33. return {
  34. img404,
  35. img404Cloud
  36. }
  37. },
  38. computed: {
  39. message () {
  40. return '访问的页面地球上找不到了......'
  41. }
  42. },
  43. methods: {
  44. back () {
  45. if (this.$route.query.noGoBack) {
  46. this.$router.push({ path: '/' })
  47. } else {
  48. this.$router.go(-2)
  49. }
  50. }
  51. }
  52. }
  53. </script>
  54. <style rel="stylesheet/scss" lang="scss" scoped>
  55. .pan-back-btn {
  56. background: #008489;
  57. color: #fff;
  58. border: none!important;
  59. }
  60. .wscn-http404-container{
  61. transform: translate(-50%,-50%);
  62. position: absolute;
  63. top: 40%;
  64. left: 50%;
  65. }
  66. .wscn-http404 {
  67. position: relative;
  68. width: 1200px;
  69. padding: 0 50px;
  70. overflow: hidden;
  71. .pic-404 {
  72. position: relative;
  73. float: left;
  74. width: 600px;
  75. overflow: hidden;
  76. &__parent {
  77. width: 100%;
  78. }
  79. &__child {
  80. position: absolute;
  81. &.left {
  82. width: 80px;
  83. top: 17px;
  84. left: 220px;
  85. opacity: 0;
  86. animation-name: cloudLeft;
  87. animation-duration: 2s;
  88. animation-timing-function: linear;
  89. animation-fill-mode: forwards;
  90. animation-delay: 1s;
  91. }
  92. &.mid {
  93. width: 46px;
  94. top: 10px;
  95. left: 420px;
  96. opacity: 0;
  97. animation-name: cloudMid;
  98. animation-duration: 2s;
  99. animation-timing-function: linear;
  100. animation-fill-mode: forwards;
  101. animation-delay: 1.2s;
  102. }
  103. &.right {
  104. width: 62px;
  105. top: 100px;
  106. left: 500px;
  107. opacity: 0;
  108. animation-name: cloudRight;
  109. animation-duration: 2s;
  110. animation-timing-function: linear;
  111. animation-fill-mode: forwards;
  112. animation-delay: 1s;
  113. }
  114. @keyframes cloudLeft {
  115. 0% {
  116. top: 17px;
  117. left: 220px;
  118. opacity: 0;
  119. }
  120. 20% {
  121. top: 33px;
  122. left: 188px;
  123. opacity: 1;
  124. }
  125. 80% {
  126. top: 81px;
  127. left: 92px;
  128. opacity: 1;
  129. }
  130. 100% {
  131. top: 97px;
  132. left: 60px;
  133. opacity: 0;
  134. }
  135. }
  136. @keyframes cloudMid {
  137. 0% {
  138. top: 10px;
  139. left: 420px;
  140. opacity: 0;
  141. }
  142. 20% {
  143. top: 40px;
  144. left: 360px;
  145. opacity: 1;
  146. }
  147. 70% {
  148. top: 130px;
  149. left: 180px;
  150. opacity: 1;
  151. }
  152. 100% {
  153. top: 160px;
  154. left: 120px;
  155. opacity: 0;
  156. }
  157. }
  158. @keyframes cloudRight {
  159. 0% {
  160. top: 100px;
  161. left: 500px;
  162. opacity: 0;
  163. }
  164. 20% {
  165. top: 120px;
  166. left: 460px;
  167. opacity: 1;
  168. }
  169. 80% {
  170. top: 180px;
  171. left: 340px;
  172. opacity: 1;
  173. }
  174. 100% {
  175. top: 200px;
  176. left: 300px;
  177. opacity: 0;
  178. }
  179. }
  180. }
  181. }
  182. .bullshit {
  183. position: relative;
  184. float: left;
  185. width: 300px;
  186. padding: 30px 0;
  187. overflow: hidden;
  188. &__oops {
  189. font-size: 32px;
  190. font-weight: bold;
  191. line-height: 40px;
  192. color: #1482f0;
  193. opacity: 0;
  194. margin-bottom: 20px;
  195. animation-name: slideUp;
  196. animation-duration: 0.5s;
  197. animation-fill-mode: forwards;
  198. }
  199. &__headline {
  200. font-size: 20px;
  201. line-height: 24px;
  202. color: #222;
  203. font-weight: bold;
  204. opacity: 0;
  205. margin-bottom: 10px;
  206. animation-name: slideUp;
  207. animation-duration: 0.5s;
  208. animation-delay: 0.1s;
  209. animation-fill-mode: forwards;
  210. }
  211. &__info {
  212. font-size: 13px;
  213. line-height: 21px;
  214. color: grey;
  215. opacity: 0;
  216. margin-bottom: 30px;
  217. animation-name: slideUp;
  218. animation-duration: 0.5s;
  219. animation-delay: 0.2s;
  220. animation-fill-mode: forwards;
  221. }
  222. &__return-home {
  223. display: block;
  224. float: left;
  225. width: 110px;
  226. height: 36px;
  227. background: #1482f0;
  228. border-radius: 100px;
  229. text-align: center;
  230. color: #ffffff;
  231. opacity: 0;
  232. font-size: 14px;
  233. line-height: 36px;
  234. cursor: pointer;
  235. animation-name: slideUp;
  236. animation-duration: 0.5s;
  237. animation-delay: 0.3s;
  238. animation-fill-mode: forwards;
  239. }
  240. @keyframes slideUp {
  241. 0% {
  242. transform: translateY(60px);
  243. opacity: 0;
  244. }
  245. 100% {
  246. transform: translateY(0);
  247. opacity: 1;
  248. }
  249. }
  250. }
  251. }
  252. </style>