不偷看密码的超萌猫头鹰

页面结构

不偷看密码的超萌猫头鹰.css

* {
	/* 初始化 */
	margin: 0;
	padding: 0;
}

body {
	/* 100%窗口高度 */
	height: 100vh;
	/* 弹性布局 居中 */
	display: flex;
	justify-content: center;
	align-items: center;
	/* 渐变背景 */
	background: linear-gradient(200deg, #72afd3, #96fbc4);
}

.login-box {
	/* 相对定位 */
	position: relative;
	width: 320px;
}

.input-box {
	/* 弹性布局 垂直排列 */
	display: flex;
	flex-direction: column;
}

.input-box input {
	height: 40px;
	border-radius: 3px;
	/* 缩进15像素 */
	text-indent: 15px;
	outline: none;
	border: none;
	margin-bottom: 15px;
}

.input-box input:focus {
	outline: 1px solid lightseagreen;
}

.input-box button {
	border: none;
	height: 45px;
	background-color: lightseagreen;
	color: #fff;
	border-radius: 3px;
	cursor: pointer;
}

/* 接下来是猫头鹰样式 */
.owl {
	width: 211px;
	height: 108px;
	/* 背景图片 */
	background: url("../img/owl-login.png") no-repeat;
	/* 绝对定位 */
	position: absolute;
	top: -100px;
	/* 水平居中 */
	left: 50%;
	transform: translateX(-50%);
}

.owl .hand {
	width: 34px;
	height: 34px;
	border-radius: 40px;
	background-color: #472d20;
	/* 绝对定位 */
	position: absolute;
	left: 12px;
	bottom: -8px;
	/* 沿Y轴缩放0.6倍(压扁) */
	transform: scaleY(0.6);
	/* 动画过渡 */
	transition: 0.3s ease-out;
}

.owl .hand.hand-r {
	left: 170px;
}

.owl.password .hand {
	transform: translateX(42px) translateY(-15px) scale(0.7);
}

.owl.password .hand.hand-r {
	transform: translateX(-42px) translateY(-15px) scale(0.7);
}

.owl .arms {
	position: absolute;
	top: 58px;
	width: 100%;
	height: 41px;
	overflow: hidden;
}

.owl .arms .arm {
	width: 40px;
	height: 65px;
	position: absolute;
	left: 20px;
	top: 40px;
	background: url("../img/owl-login-arm.png") no-repeat;
	transform: rotate(-20deg);
	transition: 0.3s ease-out;
}

.owl .arms .arm.arm-r {
	transform: rotate(20deg) scaleX(-1);
	left: 158px;
}

.owl.password .arms .arm {
	transform: translateY(-40px) translateX(40px);
}

.owl.password .arms .arm.arm-r {
	transform: translateY(-40px) translateX(-40px) scaleX(-1);
}

 超萌猫头鹰登录界面

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>不偷看密码的超萌猫头鹰</title>
		<link rel="stylesheet" href="css/不偷看密码的超萌猫头鹰.css"/>
		<script src="./js/jquery-3.6.0.min.js"></script>
		<!-- <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> -->
		<script type="text/javascript">
		    $(function(){
		        $('#password').focus(function(){
		            // 密码框获得焦点,追加样式.password
		            $('#owl').addClass('password');
		        }).blur(function(){
		            // 密码框失去焦点,移除样式.password
		            $('#owl').removeClass('password');
		        })
		    })
		</script>
	</head>
	<body>
		<div class="login-box">
			<div class="owl" id="owl">
				<div class="hand"></div>
				<div class="hand hand-r"></div>
				<div class="arms">
					<div class="arm"></div>
					<div class="arm arm-r"></div>
				</div>
			</div>
			<div class="input-box">
				<input type="text" placeholder="账号">
				<input type="password" placeholder="密码"
				id="password"/>
				<button>登录</button>
			</div>
		</div>
	</body>
</html>

获取源码

v:1657601603

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

苦逼的猿宝

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值