<一 404 动态页面>
<!-- 2017/5/26- yyy-404页面-->
<template>
<section class="page__404" :style="{height:height+'px'}">
<div class="error-container">
<div class="page__error">
<div id="pacman"></div>
</div>
<div class="page__container">
<div class="page__title">
<h1>对不起, 你访问的页面不存在!</h1>
</div>
<div class="page__content clearfix">
<div class="left">
<p>可能是如下原因引起了这个错误:</p>
<ol type="I">
<li>URL输入错误</li>
<li>链接已失效</li>
<li>其他原因...</li>
</ol>
</div>
<div class="right">
<p>推荐您通过以下链接继续访问本网站:</p>
<ol class="links" type="I">
<li><a href="http://www.huamoe.com">» 画萌官网</a></li>
<li><a href="http://weibo.com/punion">» 画萌微博</a></li>
<li><a href="http://www.chinarising.com.cn/">» 美盛文化</a></li>
</ol>
</div>
</div>
<div class="page__footer">
浙ICP备16022393号-1 浙公网安备 33010802006150号
</div>
</div>
</div>
</section>
</template> <script> export default {
data:()=>{
return {
height:"",
}
},
mounted(){
this.icon();
let ele = document.getElementById("pacman");
this.toggleClass(ele, "pacman_eats");
},
methods:{
icon(){
let _this = this;
_this.height = window.innerHeight;
window.onresize=function(){ // 屏幕变化时,高度自适应
_this.height = window.innerHeight;
};
setInterval(function(){
let ele = document.getElementById("pacman");
_this.toggleClass(ele, "pacman_eats");
}, 300);
let current = 0;
let errAll = document.getElementsByClassName("page__404")[0];
setInterval(function(){
current -= 1;
errAll.style.backgroundPosition = current + "px";
}, 50);
},
hasClass(ele, cls) {
return ele.className.match(new RegExp("(\\s|^)" + cls + "(\\s|$)"));
},
addClass(ele, cls) {
let _this = this;
if(!_this.hasClass(ele, cls)) ele.className += " " + cls;
},
removeClass(ele, cls) {
let _this = this;
if (_this.hasClass(ele, cls)) {
let reg = new RegExp("(\\s|^)" + cls + "(\\s|$)");
ele.className = ele.className.replace(reg, " ");
}
},
toggleClass(ele, cls) {
let _this = this;
if(_this.hasClass(ele, cls)) {
_this.removeClass(ele, cls);
} else {
_this.addClass(ele, cls);
}
}
}
}
</script> <style lang="scss" scoped>
@import "../../common/css/reset.css";
@import "../../common/css/define";
.page__404 {
width: 100%;
height: 100%;
text-shadow: 0 1px 0 #ffffff;
filter: dropshadow(color=#ffffff, offx=0, offy=1);
text-align: center;
background-color:#aaa;
background-image:url('./images/maze_bg.png');
overflow: hidden;
}
.page__error {
background:transparent url('./images/404e.png') right 35px no-repeat;
}
.page__error #pacman {
background:transparent url('./images/pacman_eats.png') 0 0 no-repeat;
}
.pacman_eats {
background:transparent url('./images/pacman_eats.png') 0 -207px no-repeat!important;
}
.page__container {
width:760px;
margin:0 auto;
border:1px solid #E0E0E0;
border-top:1px solid #fff;
border-bottom:1px solid #ccc;
background-color:#E5E5E5;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 2px 4px rgba(0, 0, 0, 0.7);
}
.page__container .page__title {
border-bottom:1px solid #aaa;
overflow:hidden;
background-color:#E7E7E7;
text-align: center;
}
.page__container .page__content {
border-top:1px solid #fff;
border-bottom:1px solid #aaa;
}
.page__container .page__content ol{
margin-top: 10px;
li {
font-size: 16px;
margin: 8px 0;
a {
color: #000000;
font-weight: bold;
transition: all 0.1s linear;
&:hover {
color: #f9798e;
}
}
}
}
.page__container .page__footer {
padding:10px 20px 10px 20px;
border-top:1px solid #f5f5f5;
font-size:14px;
color: #555;
background-color:#D5D5D5;
}
.page__container .left {
padding:30px 10px 20px 50px;
width:350px;
float:left;
}
.page__container .right {
padding:30px 20px 20px 10px;
width:320px;
float:right;
} .error-container {
display:block;
text-align: left;
width: 960px;
margin: 0 auto;
padding-top:40px;
padding-bottom:40px;
}
.page__error {
background:transparent url('./images/404e.png') right 35px no-repeat;
width:680px;
height:280px;
position:relative;
margin:0 auto;
}
.page__error #pacman {
width:207px;
height:207px;
position:absolute;
left:0px;
top:16px;
background:transparent url('./images/pacman_eats.png') 0 0 no-repeat;
animation:eats 2s linear 0s infinite alternate;
}
.pacman_eats {
background:transparent url('./images/pacman_eats.png') 0 -207px no-repeat!important;
}
@keyframes eats {
from {
left:0px; top:16px;
}
to {
left:200px; top:16px;
}
} </style>

VUE--404页面的更多相关文章

  1. Vue 404页面处理

    问题原因: 刷新页面时访问的资源在服务端找不到,因为vue-router设置的路径不是真实存在的路径 解决方案: 第一步:后端配置 Apache <IfModule mod_rewrite.c& ...

  2. vue 项目中当访问路由不存在的时候默认访问404页面

    前言: 在Vue项目中,当访问的页面路由不存在或错误时,页面显示为一片空白.然而,通常我们需要对访问url不存在或者错误的情况下添加默认的404页面,即not found页面. 一般的处理方法是: 在 ...

  3. nignx部署Vue单页面刷新路由404问题解决

    官网说明: https://router.vuejs.org/zh/guide/essentials/history-mode.html#%E8%AD%A6%E5%91%8A 在linux下搭建ngi ...

  4. 066——VUE中vue-router之rewrite模式下配置404页面

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  5. vue+webpack 打包文件 404 页面空白

    最近用vue-cli+vue-router+webpack建立项目,其中的遇到的三个问题,整理如下: vue-cli+ webpack 建立的项目,cnpm run build 打包项目之后,需要放在 ...

  6. vue hash模式和404页面的配置

    1.设置我们的路由配置文件(/src/router/index.js): { path:'*', component:Error } 这里的path:’*’就是找不到页面时的配置,component是 ...

  7. Vue 实现动态路由及登录&404页面跳转控制&页面刷新空白解决方案

    Vue实现动态路由及登录&404页面跳转控制&页面刷新空白解决方案   by:授客 QQ:1033553122   开发环境   Win 10   Vue 2.9.6   node-v ...

  8. 2种方式解决vue路由跳转未匹配相应路由避免出现空白页面或者指定404页面

    https://www.cnblogs.com/goloving/p/9254084.html https://www.cnblogs.com/goloving/p/9254084.html 1.路由 ...

  9. vue单页面打包文件大?首次加载慢?按需加载?是你打开方式不对

    部署各vue项目,走了一遍坑.... vue单页面应用刷新404 找到nginx多网站配置文件:类似nginx/sites-available/www.baidu.com server { liste ...

  10. thinkphp访问不存在的模块或者方法跳转到404页面

    使用的thinkphp 版本是3.2.0, 在config.php中配置 404地址,即可: 'TMPL_EXCEPTION_FILE' => './Application/Home/View/ ...

随机推荐

  1. djang-celery使用带密码的redis

    前言: 网上很多django-celery使用redis(使用不带密码的redis)的用法都是千篇一律,那带密码的redis该怎么使用了呢,没有看到一篇有帮助的,在官网搜了下,发现以下用法,请看下面 ...

  2. IDEA中Lombok插件的安装及使用

    这个插件的好处在于可以让我们的代码更简洁,减少一些重复的工作,最常用的就是@Data注解,比如在实体类上使用@Data注解,实体类的各个属性就不需要书写get和set方法. 安装方法: 1.File→ ...

  3. Jmeter做压力测试

    1)首先双击bin/jmeter.bat 2)创建Thread Group 3)配置HTTP Request 4)配置Aggregate Report 5)配置并发数和并发时间 6)点击绿色按钮,执行 ...

  4. Centos7——Firefox浏览器个性化配置调教

    因为谷歌浏览器无法正常登陆帐号,只能切换到火狐浏览器 默认浏览器我使用的是bing搜索 1.隐藏顶部标题栏 顶部标题栏真的占地方,所以直接选择隐藏 点击设置->自定义customize-> ...

  5. 基于zynq 7020的串口UART中断实验

    1.参考 UG585,P1790[JokerのZYNQ7020]UART学会Zynq(27)UART中断驱动模式示例 2.理论知识 在ZYNQ的中断中有一个IOP的中断集,它包几个外设的中断,其中包含 ...

  6. DRF框架(二)——解析模块(parsers)、异常模块(exception_handler)、响应模块(Response)、三大序列化组件介绍、Serializer组件(序列化与反序列化使用)

    解析模块 为什么要配置解析模块 1)drf给我们提供了多种解析数据包方式的解析类 form-data/urlencoded/json 2)我们可以通过配置来控制前台提交的哪些格式的数据后台在解析,哪些 ...

  7. 超全、超详的Spring Boot配置讲解笔记

    springboot默认加载配置 SpringBoot使用两种全局的配置文件,全局配置文件可以对一些默认配置进行修改. application.properties application.yml 这 ...

  8. Java ClassLoader 学习理解

    /** * <html> * <body> * <P> Copyright 1994 JsonInternational</p> * <p> ...

  9. Linux RedHat7.0_64位系统中安装Oracle_11g_R2

    步骤一: 当然是安装rhel7操作系统啦(废话),建议在安装过程中系统软件类型选择最后一项[Server with GUI].其他的默认一般即可. 步骤二:在初装完成的系统中无法像Windows那样直 ...

  10. k8s安装部署问题、解决方案汇总

    角色 节点名 节点ip master n1 192.168.14.11 节点1 n2 192.168.14.12 节点2 n3 192.168.14.13 https://raw.githubuser ...