HTML+CSS 波光粼粼的登录背景动画.让登录页面酷炫升级!

先上效果

(实际是底部的波浪部分是动态的,图示静态的而已)


🌟 登录页面是用户旅程的起点,它的设计直接影响着用户对品牌的第一印象。一个具有创新性和视觉吸引力的登录页面可以激发用户的兴趣,提升用户体验。本文将探讨如何利用CSS技术为登录页面添加酷炫的波浪动画效果,这种动态效果不仅能够吸引用户的注意力,还能增强页面的现代感和创意性,从而提升整体的品牌形象。


完整代码 

HTML:

<div class="header">
      <div class="inner-header">
        <div class="login-container">
            <h2>登录</h2>
            <form id="loginForm">
                <div class="form-group">
                    <label for="username">用户名:</label>
                    <input type="text" id="username" name="username" required>
                </div>
                <div class="form-group">
                    <label for="password">密码:</label>
                    <input type="password" id="password" name="password" required>
                </div>
                <button type="submit">登录</button>
            </form>
            <p id="error-message" class="error-message"></p>
        </div>
      </div>
      <!--Waves Container-->
      <div>
        <svg
          class="waves"
          xmlns="http://www.w3.org/2000/svg"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          viewBox="0 24 150 28"
          preserveAspectRatio="none"
          shape-rendering="auto"
        >
          <defs>
            <path
              id="gentle-wave"
              d="M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z"
            />
          </defs>
          <g class="parallax">
            <use
              xlink:href="#gentle-wave"
              x="48"
              y="0"
              fill="rgba(255,255,255,0.7"
            />
            <use
              xlink:href="#gentle-wave"
              x="48"
              y="3"
              fill="rgba(255,255,255,0.5)"
            />
            <use
              xlink:href="#gentle-wave"
              x="48"
              y="5"
              fill="rgba(255,255,255,0.3)"
            />
            <use xlink:href="#gentle-wave" x="48" y="7" fill="#fff" />
          </g>
        </svg>
      </div>
      <!--Waves end-->
    </div>

CSS代码:

body {
        margin: 0;
      }

      h1 {
        font-family: "Lato", sans-serif;
        font-weight: 300;
        letter-spacing: 2px;
        font-size: 48px;
      }
      p {
        font-family: "Lato", sans-serif;
        letter-spacing: 1px;
        font-size: 14px;
        color: #333333;
      }

      .header {
        position: relative;
        text-align: center;
        background: linear-gradient(
          60deg,
          rgba(84, 58, 183, 1) 0%,
          rgba(0, 172, 193, 1) 100%
        );
        color: white;
      }
      .logo {
        width: 50px;
        fill: white;
        padding-right: 15px;
        display: inline-block;
        vertical-align: middle;
      }

      .inner-header {
        height: 75vh;
        width: 100%;
        margin: 0;
        padding: 120px 0 0;
        box-sizing: border-box;
      }

      .flex {
        /*Flexbox for containers*/
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center;
      }

      .waves {
        position: relative;
        width: 100%;
        height: 15vh;
        margin-bottom: -7px; /*Fix for safari gap*/
        min-height: 100px;
        max-height: 150px;
      }

      .content {
        position: relative;
        height: 20vh;
        text-align: center;
        background-color: white;
      }

      /* Animation */

      .parallax > use {
        animation: move-forever 25s cubic-bezier(0.55, 0.5, 0.45, 0.5) infinite;
      }
      .parallax > use:nth-child(1) {
        animation-delay: -2s;
        animation-duration: 7s;
      }
      .parallax > use:nth-child(2) {
        animation-delay: -3s;
        animation-duration: 10s;
      }
      .parallax > use:nth-child(3) {
        animation-delay: -4s;
        animation-duration: 13s;
      }
      .parallax > use:nth-child(4) {
        animation-delay: -5s;
        animation-duration: 20s;
      }
      @keyframes move-forever {
        0% {
          transform: translate3d(-90px, 0, 0);
        }
        100% {
          transform: translate3d(85px, 0, 0);
        }
      }
      /*Shrinking for mobile*/
      @media (max-width: 768px) {
        .waves {
          height: 40px;
          min-height: 40px;
        }
        .content {
          height: 30vh;
        }
        h1 {
          font-size: 24px;
        }
      }

      .login-container {
    padding: 20px;
    border-radius: 25px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    
    width: 300px; margin: 0 auto 0;
    text-align: center;
}

.login-container h2 {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
}

.form-group input {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
}

button {
    width: 100%;
    padding: 10px;
    background-color: #ed813e;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

button:hover {
    background-color: #0056b3;
}

.error-message {
    color: red;
    margin-top: 10px;
}

🌟 综上,效果实现了, 后续有什么想要的欢迎大家留言,也可以加喔微信, 18634371151,欢迎~

🌟 往期精彩,可以关注博主看左侧专栏,一定有你需要的!!!

🌟 关注耀南.,探索更多精彩的动画效果!🚀

  • 5
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
### 回答1: 免费的html css js实现登录注册界面.rar是一套基于HTMLCSS和JavaScript开发的前端代码集合,可以方便地实现登录注册功能,为开发者提供了一个免费的选择。该RAR压缩文件包含了许多前端代码文件,包括HTML文件、CSS文件和JavaScript文件,直接使用这些文件可以很方便地创建出一个登录注册界面。 在使用这些文件前,我们需要先了解HTMLCSS和JavaScript的基础知识。HTML是一种标记语言,用于创建网页,CSS是一种用于显示HTML文件的样式表语言,而JavaScript是一种脚本语言,用于在网页中实现动态效果和用户交互。 当我们对这些技术有了一定的掌握后,就可以开始使用RAR压缩文件中的文件进行前端开发。首先,我们可以通过HTML文件创建出登录注册页面的框架,然后使用CSS文件来美化页面的样式,让页面看起来更加符合用户的审美需求。最后,我们可以使用JavaScript文件来实现页面的交互功能,例如实现用户输入信息的验证和自动补全等。 总之,免费的html css js实现登录注册界面.rar提供了一个快速开发前端界面的解决方案,非常适用于初学者和中级开发者。它不仅可以提高开发效率,还能为开发者节省不少时间和资源成本。 ### 回答2: 对于免费的html css js实现登录注册界面.rar,我并不推荐直接使用该文件进行网站的登录注册功能开发,原因如下: 首先,免费的资源未必是最适合我们的资源。向网络上公开的免费资源普遍缺乏鲁棒性,可能会存在代码bug和安全漏洞等隐患,从而影响我们网站的稳定性和安全性。 其次,在进行网站功能开发时,我们应该始终保持代码规范和可读性,方便以后的维护和升级。而免费的资源无法保证这些方面,可能在使用过程中出现代码冗余、变量名混乱等问题,给我们后续的开发和维护带来不便。 最后,为了使网站有更好的用户体验和不断进化的功能,我们应该注重网站的个性化和差异化,使用免费的开源资源可能会让我们在这些方面受到束缚,难以实现个性化需求。 因此,为了更好地开发网站的登录注册功能,我们应该采用更为专业、可靠的开发工具和技术,同时注重开发人员的技能提升和经验积累,从而创造出更为优秀的网站体验。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

耀南.

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

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

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

打赏作者

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

抵扣说明:

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

余额充值