HTML5+CSS3小實(shí)例:不偷看密碼的超萌貓頭鷹登錄界面

實(shí)例:不偷看密碼的超萌貓頭鷹登錄界面
技術(shù)棧:HTML+CSS+JQuery
JQuery下載地址:https://www.jb51.net/zt/jquerydown.htm
效果:


源碼:
【html】

<!DOCTYPE html>
<html>
 
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
 
    <title>不偷看密碼的超萌貓頭鷹</title>
    <link rel="stylesheet" href="../css/50.css">
    <script src="../js/jquery-3.6.0.min.js"></script>
    <script>
        $(function() {
            $('#password').focus(function() {
                // 密碼框獲得焦點(diǎn),追加樣式.password
                $('#owl').addClass('password');
            }).blur(function() {
                // 密碼框失去焦點(diǎn),移除樣式.password
                $('#owl').removeClass('password');
            });
        });
    </script>
</head>
 
<body>
    <div class="login-box">
        <div id="owl" class="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="賬號(hào)">
            <input id="password" type="password" placeholder="密碼">
            <button>登錄</button>
        </div>
    </div>
</body>
 
</html>

【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 {
  /* 相對(duì)定位 */
  position: relative;
  width: 320px;
}
 
.input-box {
  /* 彈性布局 垂直排列 */
  display: flex;
  flex-direction: column;
}
 
.input-box input {
  height: 40px;
  border-radius: 3px;
  /* 縮進(jìn)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;
  border-radius: 3px;
  color: #fff;
  cursor: pointer;
}
 
/* 貓頭鷹樣式 */
.owl {
  width: 211px;
  height: 108px;
  background-image: url("../images/owl-login.png");
  /* 絕對(duì)定位 */
  position: absolute;
  top: -100px;
  /* 水平居中 */
  left: 50%;
  transform: translateX(-50%);
}
 
.owl .hand {
  width: 34px;
  height: 34px;
  border-radius: 40px;
  background-color: #472d20;
  /* 縮放0.6倍 */
  transform: scaleY(0.6);
  /* 動(dòng)畫(huà)過(guò)渡 */
  transition: 0.3s ease-out;
  position: absolute;
  left: 12px;
  bottom: -8px;
}
 
.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 {
  top: 58px;
  position: absolute;
  width: 100%;
  height: 41px;
  overflow: hidden;
}
 
.owl .arms .arm {
  width: 40px;
  height: 65px;
  position: absolute;
  left: 20px;
  top: 40px;
  background-image: url("../images/owl-login-arm.png");
  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);
}

【圖片素材】
https://www.aliyundrive.com/s/HDwxVHGbYiw
https://www.aliyundrive.com/s/z2AiixjVT8N

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀(guān)點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • parse_str() 函數(shù)[https://www.runoob.com/php/func-string-par...
    _fhs閱讀 111評(píng)論 0 0
  • 返回上一頁(yè): 點(diǎn)擊回到頂部 解決辦法: a標(biāo)簽跳轉(zhuǎn)錨點(diǎn)到頁(yè)面指定位置 https://blog.csdn.net/...
    zlf_j閱讀 1,596評(píng)論 0 1
  • A-iOS開(kāi)發(fā)常用網(wǎng)址(最全) 資源互鏈?。?!資源的精華都在這里了 iOS開(kāi)發(fā)推薦DMG資源http://blog...
    YY110閱讀 1,121評(píng)論 0 2
  • 一套實(shí)用的滲透測(cè)試崗位面試題,你會(huì)嗎? 1.拿到一個(gè)待檢測(cè)的站,你覺(jué)得應(yīng)該先做什么? 收集信息 whois、網(wǎng)站源...
    g0閱讀 5,157評(píng)論 0 9
  • 1、局部變量->全局變量def func():a=1print(a)global bb=2print(b) fun...
    無(wú)量?jī)?/span>閱讀 1,031評(píng)論 0 0

友情鏈接更多精彩內(nèi)容