编程随笔 编程随笔
  • 前端
  • 后端
  • 星球项目
  • 开源项目
  • 海康AGV
  • 四向车
  • 工具类
  • 项目仓库

    • 部署仓库 (opens new window)
    • 代码仓库 (opens new window)
  • vuepress插件

    • 自动生成导航栏与侧边栏 (opens new window)
    • 评论系统 (opens new window)
    • 全文搜索 (opens new window)
    • 选项卡 (opens new window)
    • 自动生成sitemap (opens new window)
  • 自主开发插件

    • 批量操作frontmatter (opens new window)
    • 链接美化 (opens new window)
    • 折叠代码块 (opens new window)
    • 复制代码块 (opens new window)

liyao52033

走运时,要想到倒霉,不要得意得过了头;倒霉时,要想到走运,不必垂头丧气。心态始终保持平衡,情绪始终保持稳定,此亦长寿之道
  • 前端
  • 后端
  • 星球项目
  • 开源项目
  • 海康AGV
  • 四向车
  • 工具类
  • 项目仓库

    • 部署仓库 (opens new window)
    • 代码仓库 (opens new window)
  • vuepress插件

    • 自动生成导航栏与侧边栏 (opens new window)
    • 评论系统 (opens new window)
    • 全文搜索 (opens new window)
    • 选项卡 (opens new window)
    • 自动生成sitemap (opens new window)
  • 自主开发插件

    • 批量操作frontmatter (opens new window)
    • 链接美化 (opens new window)
    • 折叠代码块 (opens new window)
    • 复制代码块 (opens new window)
  • 知识点

  • 代码调试

  • vue2

  • vue3

    • 注意事项
    • swagger自动生成接口
    • 动态路由
    • 整合 Element Plus
    • wangeditor使用
    • monacoEditor使用
    • 自定义404页面
      • vue2
      • vue3
      • 相关图片
    • 验证码封装
    • 联表查询SQL
    • element-plus多文件手动上传
  • react

  • typescript

  • 前端
  • vue3
华总
2023-08-24
0
0
目录

自定义404页面原创

# vue2

<script>
export default {
  data() {
	return {
	  message: "阿噢,一不小心来到了荒无人烟的沙漠"
	};
  }
};
</script>

<template>
  <div class="wscn-http404-container">
	<div class="wscn-http404">
	  <div class="pic-404">
		<img
		  class="pic-404__parent"
		  src="https://aurora-1258839075.cos.ap-shanghai.myqcloud.com/img/202310012125958.png?q-sign-algorithm=sha1&q-ak=AKIDlOsIWjolbMzQrQyRwNfoovASl088zhGh&q-sign-time=1696166720;8999999999&q-key-time=1696166720;8999999999&q-header-list=host&q-url-param-list=&q-signature=791e6846a407484343215b7a4e4d79efb426d72b"
		  alt="404"
		/>
		<img
		  class="pic-404__child left"
		  src="https://aurora-1258839075.cos.ap-shanghai.myqcloud.com/img/202310012126428.png?q-sign-algorithm=sha1&q-ak=AKIDlOsIWjolbMzQrQyRwNfoovASl088zhGh&q-sign-time=1696166763;9000000000&q-key-time=1696166763;9000000000&q-header-list=host&q-url-param-list=&q-signature=039803999cc8d4c6353799bf8d0b5ca93dd43682"
		  alt="404"
		/>
		<img
		  class="pic-404__child mid"
		  src="https://aurora-1258839075.cos.ap-shanghai.myqcloud.com/img/202310012126428.png?q-sign-algorithm=sha1&q-ak=AKIDlOsIWjolbMzQrQyRwNfoovASl088zhGh&q-sign-time=1696166763;9000000000&q-key-time=1696166763;9000000000&q-header-list=host&q-url-param-list=&q-signature=039803999cc8d4c6353799bf8d0b5ca93dd43682"
		  alt="404"
		/>
		<img
		  class="pic-404__child right"
		  src="https://aurora-1258839075.cos.ap-shanghai.myqcloud.com/img/202310012126428.png?q-sign-algorithm=sha1&q-ak=AKIDlOsIWjolbMzQrQyRwNfoovASl088zhGh&q-sign-time=1696166763;9000000000&q-key-time=1696166763;9000000000&q-header-list=host&q-url-param-list=&q-signature=039803999cc8d4c6353799bf8d0b5ca93dd43682"
		  alt="404"
		/>
	  </div>
	  <div class="bullshit">
		<div class="bullshit__oops">OOPS!</div>
		<div class="bullshit__info">
		  All rights reserved
		  <a
			style="color: #20a0ff"
			href="https://vuepress.vuejs.org/zh/theme/option-api.html#globallayout"
			target="_blank"
		  >vuepress</a
		  >
		</div>
		<div class="bullshit__headline">{{ message }}</div>
		<div class="bullshit__info">
		  请检查您输入的网址是否正确,或返回首页。
		</div>
		<a href="/" class="bullshit__return-home">回首页</a>
	  </div>
	</div>
  </div>
</template>

<style lang="stylus" scoped>

.wscn-http404-container {
  position: relative !important;
}

.wscn-http404 {
  position: absolute !important;
  top: 50% !important;
  transform: translateY(50%) !important;
  width: 1200px;
  padding: 0 50px;
  overflow: hidden;
}

.wscn-http404 > .pic-404 {
  position: relative;
  float: left;
  width: 600px;
  overflow: hidden;
}

.pic-404__parent {
  width: 100%;
}

.pic-404__child {
  position: absolute;
}


.left {
  top: 17px;
  left: 220px;
  width: 80px;
  opacity: 0;
  animation-name: cloudLeft;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-delay: 1s;
  animation-fill-mode: forwards;
}

 .mid {
  top: 10px;
  left: 420px;
  width: 46px;
  opacity: 0;
  animation-name: cloudMid;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-delay: 1.2s;
  animation-fill-mode: forwards;
}

.right {
  top: 100px;
  left: 500px;
  width: 62px;
  opacity: 0;
  animation-name: cloudRight;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-delay: 1s;
  animation-fill-mode: forwards;
}

@keyframes cloudLeft {
  0% {
	top: 17px;
	left: 220px;
	opacity: 0;
  }
  
  20% {
	top: 33px;
	left: 188px;
	opacity: 1;
  }
  
  80% {
	top: 81px;
	left: 92px;
	opacity: 1;
  }
  
  100% {
	top: 97px;
	left: 60px;
	opacity: 0;
  }
}

@keyframes cloudRight {
  0% {
	top: 100px;
	left: 500px;
	opacity: 0;
  }
  
  20% {
	top: 120px;
	left: 460px;
	opacity: 1;
  }
  
  80% {
	top: 180px;
	left: 340px;
	opacity: 1;
  }
  
  100% {
	top: 200px;
	left: 300px;
	opacity: 0;
  }
}

.bullshit {
  position: relative;
  float: left;
  width: 300px;
  padding: 30px 0;
  overflow: hidden;
}

.bullshit__oops {
  margin-bottom: 20px;
  font-size: 32px;
  font-weight: bold;
  line-height: 40px;
  color: #1482f0;
  opacity: 0;
  animation-name: slideUp;
  animation-duration: 0.5s;
  animation-fill-mode: forwards;
}

.bullshit__headline {
  margin-bottom: 10px;
  font-size: 20px;
  font-weight: bold;
  line-height: 24px;
  color: #222;
  opacity: 0;
  animation-name: slideUp;
  animation-duration: 0.5s;
  animation-delay: 0.1s;
  animation-fill-mode: forwards;
}

.bullshit__info {
  margin-bottom: 30px;
  font-size: 13px;
  line-height: 21px;
  color: grey;
  opacity: 0;
  animation-name: slideUp;
  animation-duration: 0.5s;
  animation-delay: 0.2s;
  animation-fill-mode: forwards;
}

.bullshit__return-home {
  display: block;
  float: left;
  width: 110px;
  height: 36px;
  font-size: 14px;
  line-height: 36px;
  color: #fff;
  text-align: center;
  cursor: pointer;
  background: #1482f0;
  border-radius: 100px;
  opacity: 0;
  animation-name: slideUp;
  animation-duration: 0.5s;
  animation-delay: 0.3s;
  animation-fill-mode: forwards;
}

@keyframes slideUp {
  0% {
	opacity: 0;
	transform: translateY(60px);
  }
  
  100% {
	opacity: 1;
	transform: translateY(0);
  }
}


</style>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254

# vue3

<!-- setup 无法设置组件名称,组件名称keepAlive必须 -->
<script lang="ts">
export default {
  name: "Page404",
};
</script>

<script setup lang="ts">
const message = "当前页面不存在"
</script>

<template>
  <div class="wscn-http404-container">
    <div class="wscn-http404">
      <div class="pic-404">
        <img
		  class="pic-404__parent"
		  src="https://aurora-1258839075.cos.ap-shanghai.myqcloud.com/img/202310012125958.png?q-sign-algorithm=sha1&q-ak=AKIDlOsIWjolbMzQrQyRwNfoovASl088zhGh&q-sign-time=1696166720;8999999999&q-key-time=1696166720;8999999999&q-header-list=host&q-url-param-list=&q-signature=791e6846a407484343215b7a4e4d79efb426d72b"
		  alt="404"
		/>
		<img
		  class="pic-404__child left"
		  src="https://aurora-1258839075.cos.ap-shanghai.myqcloud.com/img/202310012126428.png?q-sign-algorithm=sha1&q-ak=AKIDlOsIWjolbMzQrQyRwNfoovASl088zhGh&q-sign-time=1696166763;9000000000&q-key-time=1696166763;9000000000&q-header-list=host&q-url-param-list=&q-signature=039803999cc8d4c6353799bf8d0b5ca93dd43682"
		  alt="404"
		/>
		<img
		  class="pic-404__child mid"
		  src="https://aurora-1258839075.cos.ap-shanghai.myqcloud.com/img/202310012126428.png?q-sign-algorithm=sha1&q-ak=AKIDlOsIWjolbMzQrQyRwNfoovASl088zhGh&q-sign-time=1696166763;9000000000&q-key-time=1696166763;9000000000&q-header-list=host&q-url-param-list=&q-signature=039803999cc8d4c6353799bf8d0b5ca93dd43682"
		  alt="404"
		/>
		<img
		  class="pic-404__child right"
		  src="https://aurora-1258839075.cos.ap-shanghai.myqcloud.com/img/202310012126428.png?q-sign-algorithm=sha1&q-ak=AKIDlOsIWjolbMzQrQyRwNfoovASl088zhGh&q-sign-time=1696166763;9000000000&q-key-time=1696166763;9000000000&q-header-list=host&q-url-param-list=&q-signature=039803999cc8d4c6353799bf8d0b5ca93dd43682"
		  alt="404"
		/>
      </div>
      <div class="bullshit">
        <div class="bullshit__oops">OOPS!</div>
        <div class="bullshit__info">
          All rights reserved
          <a
            style="color: #20a0ff"
            href="https://wallstreetcn.com"
            target="_blank"
            >wallstreetcn</a
          >
        </div>
        <div class="bullshit__headline">{{ message }}</div>
        <div class="bullshit__info">
					 请检查您输入的网址是否正确,或返回首页。
        </div>
        <a href="" class="bullshit__return-home">回首页</a>
      </div>
    </div>
  </div>
</template>

<style lang="scss" scoped>
.wscn-http404-container {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.wscn-http404 {
  position: relative;
  width: 1200px;
  padding: 0 50px;
  overflow: hidden;

  .pic-404 {
    position: relative;
    float: left;
    width: 600px;
    overflow: hidden;

    &__parent {
      width: 100%;
    }

    &__child {
      position: absolute;

      &.left {
        top: 17px;
        left: 220px;
        width: 80px;
        opacity: 0;
        animation-name: cloudLeft;
        animation-duration: 2s;
        animation-timing-function: linear;
        animation-delay: 1s;
        animation-fill-mode: forwards;
      }

      &.mid {
        top: 10px;
        left: 420px;
        width: 46px;
        opacity: 0;
        animation-name: cloudMid;
        animation-duration: 2s;
        animation-timing-function: linear;
        animation-delay: 1.2s;
        animation-fill-mode: forwards;
      }

      &.right {
        top: 100px;
        left: 500px;
        width: 62px;
        opacity: 0;
        animation-name: cloudRight;
        animation-duration: 2s;
        animation-timing-function: linear;
        animation-delay: 1s;
        animation-fill-mode: forwards;
      }

      @keyframes cloudLeft {
        0% {
          top: 17px;
          left: 220px;
          opacity: 0;
        }

        20% {
          top: 33px;
          left: 188px;
          opacity: 1;
        }

        80% {
          top: 81px;
          left: 92px;
          opacity: 1;
        }

        100% {
          top: 97px;
          left: 60px;
          opacity: 0;
        }
      }

      @keyframes cloudMid {
        0% {
          top: 10px;
          left: 420px;
          opacity: 0;
        }

        20% {
          top: 40px;
          left: 360px;
          opacity: 1;
        }

        70% {
          top: 130px;
          left: 180px;
          opacity: 1;
        }

        100% {
          top: 160px;
          left: 120px;
          opacity: 0;
        }
      }

      @keyframes cloudRight {
        0% {
          top: 100px;
          left: 500px;
          opacity: 0;
        }

        20% {
          top: 120px;
          left: 460px;
          opacity: 1;
        }

        80% {
          top: 180px;
          left: 340px;
          opacity: 1;
        }

        100% {
          top: 200px;
          left: 300px;
          opacity: 0;
        }
      }
    }
  }

  .bullshit {
    position: relative;
    float: left;
    width: 300px;
    padding: 30px 0;
    overflow: hidden;

    &__oops {
      margin-bottom: 20px;
      font-size: 32px;
      font-weight: bold;
      line-height: 40px;
      color: #1482f0;
      opacity: 0;
      animation-name: slideUp;
      animation-duration: 0.5s;
      animation-fill-mode: forwards;
    }

    &__headline {
      margin-bottom: 10px;
      font-size: 20px;
      font-weight: bold;
      line-height: 24px;
      color: #222;
      opacity: 0;
      animation-name: slideUp;
      animation-duration: 0.5s;
      animation-delay: 0.1s;
      animation-fill-mode: forwards;
    }

    &__info {
      margin-bottom: 30px;
      font-size: 13px;
      line-height: 21px;
      color: grey;
      opacity: 0;
      animation-name: slideUp;
      animation-duration: 0.5s;
      animation-delay: 0.2s;
      animation-fill-mode: forwards;
    }

    &__return-home {
      display: block;
      float: left;
      width: 110px;
      height: 36px;
      font-size: 14px;
      line-height: 36px;
      color: #fff;
      text-align: center;
      cursor: pointer;
      background: #1482f0;
      border-radius: 100px;
      opacity: 0;
      animation-name: slideUp;
      animation-duration: 0.5s;
      animation-delay: 0.3s;
      animation-fill-mode: forwards;
    }

    @keyframes slideUp {
      0% {
        opacity: 0;
        transform: translateY(60px);
      }

      100% {
        opacity: 1;
        transform: translateY(0);
      }
    }
  }
}
</style>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278

# 相关图片

404_cloud

404

#前端
上次更新: 2024/01/14 16:27:31
monacoEditor使用
验证码封装

← monacoEditor使用 验证码封装→

最近更新
01
element-plus多文件手动上传 原创
11-03
02
TrueLicense 创建及安装证书 原创
10-25
03
手动修改迅捷配置 原创
09-03
04
安装 acme.sh 原创
08-29
05
zabbix部署 原创
08-20
更多文章>
Copyright © 2023-2024 liyao52033
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式