分享一个会遮掩的吊炸天登录页面

简介: 分享一个会遮掩的吊炸天登录页面

今天逛gitee,发现了一个有趣的页面,于是来分享一下。

先看效果:


3d2a95771a934abe85d63c0f54997841.png


熊猫是css画的,眼睛会跟着鼠标转动,当填写密码的时候,熊猫会把登录框举起来,遮住眼睛。

熊猫是css画的,每一个部分都是,真的是直呼666


/* 开始画熊猫 */
.panda{
    /* 相对定位 */
    position: relative;
    width: 200px;
}
/* 脸部 */
.face{
    width: 200px;
    height: 200px;
    background-color: #fff;
    border-radius: 100%;
    box-shadow: 0 10px 15px rgba(0,0,0,0.15);
    position: relative;
    z-index: 1;
}
/* 耳朵 */
.ear{
    width: 70px;
    height: 70px;
    background-color: #000;
    border-radius: 100%;
    position: absolute;
    top: -10px;
}
.ear.right{
    right: 0;
}
/* 黑眼圈 */
.eye-shadow{
    width: 50px;
    height: 80px;
    background-color: #000;
    border-radius: 50%;
    /* 绝对定位 */
    position: absolute;
    top: 40px;
}
.eye-shadow.left{
    transform: rotate(45deg);
    left: 30px;
}
.eye-shadow.right{
    transform: rotate(-45deg);
    right: 30px;
}
/* 眼白 */
.eye-white{
    width: 30px;
    height: 30px;
    background-color: #fff;
    border-radius: 100%;
    position: absolute;
    top: 68px;
}
.eye-white.left{
    left: 38px;
}
.eye-white.right{
    right: 38px;
}
/* 眼球 */
.eye-ball{
    width: 20px;
    height: 20px;
    background-color: #000;
    border-radius: 100%;
    position: absolute;
    left: 5px;
    top: 5px;
}
/* 鼻子 */
.nose{
    width: 35px;
    height: 20px;
    background-color: #000;
    position: absolute;
    left: 0;
    right: 0;
    margin: auto;
    bottom: 65px;
    border-radius: 42px 42px 60px 60px / 30px 30px 60px 60px;
}
/* 嘴巴 */
.mouth{
    width: 68px;
    height: 25px;
    border-bottom: 7px solid #000;
    border-radius: 50%;
    position: absolute;
    left: 0;
    right: 0;
    margin: auto;
    bottom: 35px;
}
/* 身体 */
.body{
    width: 250px;
    height: 280px;
    background-color: #fff;
    position: relative;
    left: -25px;
    top: -10px;
    border-radius: 100px 100px 100px 100px / 126px 126px 96px 96px;
    box-shadow: 0 5px 10px rgba(0,0,0,0.3);
}
/* 脚 */
.foot{
    width: 82px;
    height: 120px;
    background-color: #000;
    position: absolute;
    bottom: 8px;
    z-index: 3;
    border-radius: 40px 40px 35px 40px / 26px 26px 63px 63px;
    box-shadow: 0 5px 5px rgba(0,0,0,0.2);
}
.foot.left{
    left: -80px;
}
.foot.right{
    right: -80px;
    transform: rotateY(180deg);
}
/* 脚掌-大椭圆 */
.foot::after{
    content: "";
    width: 55px;
    height: 65px;
    background-color: #222;
    position: absolute;
    border-radius: 50%;
    left: 0;
    right: 0;
    margin: auto;
    bottom: 10px;
}
/* 脚掌-三个小椭圆 */
.foot .sole,
.foot .sole::before,
.foot .sole::after{
    width: 20px;
    height: 30px;
    background-color: #222;
    position: absolute;
    border-radius: 50%;
    left: 0;
    right: 0;
    margin: auto;
    top: 8px;
}
.foot .sole::before{
    content: "";
    left: -50px;
}
.foot .sole::after{
    content: "";
    left: 25px;
}
/* 手 */
.hand,
.hand::before,
.hand::after{
    width: 40px;
    height: 30px;
    background-color: #000;
    border-radius: 50px;
    position: absolute;
    top: 70px;
    left: -20px;
}
.hand::before{
    content: "";
    top: 16px;
    left: 0;
}
.hand::after{
    content: "";
    top: 32px;
    left: 0;
}
.hand.right{
    right: -20px;
    left: auto;
}


登录框往上举起是用的css动画


/* 登录框向上举 */
.up{
    transform: translate(-50%,-180px);
}


动作交互也非常的简单,用的jquery


$('#password').focusin(function(){
    // 密码框选中
    $('.login-box').addClass('up');
}).focusout(function(){
    // 密码框非选中
    $('.login-box').removeClass('up');
})
// 眼球移动
$(document).on('mousemove',function(e){
    let dw=$(document).width() / 10;
    let dh=$(document).height() / 18;
    let x=e.pageX / dw;
    let y=e.pageY / dh;
    $('.eye-ball').css({
        left:x,
        top:y
    })
})
相关文章
|
26天前
登录注册页面源码分享
LOGO在image里面修改,名字这些有记事本打开修改
19 0
|
26天前
|
小程序 前端开发 数据安全/隐私保护
电商小程序03登录页面开发
电商小程序03登录页面开发
|
26天前
|
前端开发
|
移动开发 前端开发 JavaScript
二次元的登录界面
二次元的登录界面
137 0
|
Web App开发 C# 数据安全/隐私保护
C# 13行代码带你模拟登录QQ空间
C# 13行代码带你模拟登录QQ空间
99 0
|
JavaScript
用HTML+CSS构建一个绚丽的登录页面
自动切换背景,登录页面,水滴效果,绚丽的登录页面
294 0
用HTML+CSS构建一个绚丽的登录页面
|
前端开发
整活系列(二)——整一个好看的毛玻璃登陆页面
昨天刷某站下饭的时候,看见了一个好看的登陆页面,于是昨天晚上用代码实现了一下,今天就拿出来分享给大家。
|
前端开发
HTMl+CSS 模仿京东网登录页面
HTMl+CSS 模仿京东网登录页面
449 0
HTMl+CSS 模仿京东网登录页面
|
数据采集 Java 数据安全/隐私保护
Java爬虫——人人网模拟登录
人人网登录地址:http://www.renren.com/ 此处登录没有考虑验证码验证码。 首先对登录方法进行分析 有两种方法。 一)在Elements中分析源码   发现登录点击后的事件是http://www.
4075 0