一.网站要求
- 登录,注册页面的邮箱,密码,项目使用正则表达式,格式错误时提醒。
- 登录界面进入时旋转效果。
- 注册信息要和登录信息一致,否则不予登录。
- 数据传输可以不链接数据库。
- 个人相册实现3D旋转效果,鼠标移动到照片时,动画暂停,鼠标移开时,动画继续。
二.效果展示
登录页面:
注册页面:
个人相册页面(3D旋转效果):
三.设计思路
- 数据传输通过localStorage或sessionStorage本地缓存实现
注意:在IE8以上的IE版本才支持localStorage这个属性。localStorage属于永久性存储,如果存储内容多的话会消耗内存空间,会导致页面变卡。
- 退出时清空缓存
四.所有代码如下
登录页面代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>登录页面</title>
<style>
@keyframes move {
100%{
transform: rotateY(360deg);
}
}
body {
margin: 0px;
padding: 0px;
}
input {
border-style:none none solid none;
font-size: 17px;
filter:alpha(opacity=20);
opacity:0.3;
}
a {
font-size: 17px;
color:rgb(207, 48, 48);
}
button {
width: 150px;
height: 30px;
border-radius: 10%;
background-color: #e05858;
border: none;
color: white;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 15px;
margin: 4px 2px;
cursor: pointer;
-webkit-transition-duration: 0.4s;
transition-duration: 0.4s;}
button:hover {
box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24),0 17px 50px 0 rgba(0,0,0,0.19);
}
#bg {
background-image: url(1.jpg);
position:fixed;
top: 0;
left: 0;
width:100%;
height:100%;
min-width: 250px;
z-index:-10;
zoom: 1;
background-color: #fff;
background-repeat: no-repeat;
background-size: cover;
-webkit-background-size: cover;
-o-background-size: cover;
background-position: center 0;
}
#div1 {
margin:0 auto;
position: relative;
top:30px;
width: 600px;
height: 600px;
border-radius: 50%;
filter:alpha(opacity=50);
opacity:0.5;
animation:move 2s linear 1s 1 alternate;
background-color: rgb(255, 255, 255);
}
#p1 {
font-size: 30px;
color: black;
font-weight: 600;
}
.p2 {
font-size: 17px;
color: rgb(119, 115, 115);
font-weight: 700;
}
#div2 {
float:left;
text-align: center;
width: 450px;
height: 450px;
position: relative;
top:-75%;
animation: move 2s linear 1s 1 alternate;
left:33.5%;
}
</style>
</head>
<body>
<div id="bg">
<div id="div1"></div>
<div id="div2">
<p id="p1">立即登录</p>
<p class="p2">邮箱</p>
<input type="text" placeholder="请输入邮箱" id="email"/>
<p class="p2">密码</p>
<input type="password" placeholder="密码长度至少为六位" id="passworld"/>
</br>
<a href="#" id="a">忘记密码?</a>
</br></br>
<button onclick="denlu()