好看的水滴登录页面

news2024/9/28 7:17:40

css 如何绘制水滴

  • 可以通过box-shadow 来显示阴影
  • 可以通过border-radius 改变水滴的形状
  • 当然如果像要使其更加灵活,可以使用animation+keyframes关键帧+border-radius,让水滴动起来

是不是很简单

来吧展示效果

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

html代码,就只有一个div,然后使用一些伪类结合


<div class="water-container">
    <div class="water"></div>
</div>

css代码

.water-container {
    width: 50vw;
    height: 50vh;
    background-color: #eff0f4;
    display: flex;
    justify-content: center;
    align-items: center;
}

.water {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    box-shadow: inset 20px 20px 20px rgba(0, 0, 0, .05),
    25px 35px 20px rgba(0, 0, 0, .05),
    25px 30px 30px rgba(0, 0, 0, .05),
    inset -20px -20px 25px hsla(0, 0%, 100%, .9);
    position: relative;
}

.water::before {
    content: "";
    position: absolute;
    left: 24%;
    top: 25%;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
}

效果:
在这里插入图片描述

圆形水滴做好了,那我们是不是可以改变其现状呢,只要改变border-radius就可以了

.water {
    width: 120px;
    height: 120px;
    /*改变形状,使其弯曲*/
    border-radius: 30% 70% 70% 30% / 30% 35% 65% 70%;
    box-shadow: inset 20px 20px 20px rgba(0, 0, 0, .05),
    25px 35px 20px rgba(0, 0, 0, .05),
    25px 30px 30px rgba(0, 0, 0, .05),
    inset -20px -20px 25px hsla(0, 0%, 100%, .9);
    position: relative;
}

效果:
在这里插入图片描述

形状改变了,我们就让其动起来,动起来就算加上关键帧改变border-radius

.water {
  width: 120px;
  height: 120px;
  /*改变形状,使其弯曲*/
  border-radius: 30% 70% 70% 30% / 30% 35% 65% 70%;
  box-shadow: inset 20px 20px 20px rgba(0, 0, 0, .05),
  25px 35px 20px rgba(0, 0, 0, .05),
  25px 30px 30px rgba(0, 0, 0, .05),
  inset -20px -20px 25px hsla(0, 0%, 100%, .9);
  position: relative;
  /*添加动画关键帧*/
  animation: waterMove 4s linear infinite;
}

.water::before {
  content: "";
  position: absolute;
  left: 24%;
  top: 25%;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 30% 70% 70% 30% / 30% 35% 65% 70%;
  animation: waterMove 4s linear infinite;
}
/* 关键帧 */
@keyframes waterMove {
    20% {
        border-radius: 30% 70% 53% 47% / 28% 44% 56% 72%;
    }

    40% {
        border-radius: 30% 70% 39% 61% / 34% 39% 61% 66%;
    }

    60% {
        border-radius: 25% 75% 45% 55% / 40% 55% 45% 60%;
    }

    80% {
        border-radius: 28% 72% 31% 69% / 32% 39% 61% 68%;
    }
}

效果:
在这里插入图片描述

完成后我们就可以在这个水滴里面添加东西了,比如设计登录页面

 <div class="login-container">
    <div class="login-content">
      <div class="login-box">
        <form action="" class="login-form">
          <h2>LOGIN</h2>
          <div class="input-box">
            <input type="text" placeholder="用户名"/>
          </div>
          <div class="input-box">
            <input type="password" placeholder="密码"/>
          </div>
          <div class="input-box">
            <input type="submit" value="登录"/>
          </div>
        </form>
      </div>
      <div class="login-btn forget-pwd">
        <span>忘记</span>
        <span>密码</span>
      </div>
      <div class="login-btn register"><span>注册</span></div>
    </div>
  </div>
.login-container {
    width: 50vw;
    height: 50vh;
    background: #eff0f4;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0.9;
}

.login-content {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-box {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 350px;
    position: relative;
    width: 350px;
    border-radius: 52% 48% 33% 67% / 38% 45% 55% 62%;
    box-shadow: inset 20px 20px 20px rgba(0, 0, 0, .05),
    25px 35px 20px rgba(0, 0, 0, .05),
    25px 30px 30px rgba(0, 0, 0, .05),
    inset -20px -20px 25px hsla(0, 0%, 100%, .9);
    /*transition: .5s;*/
    animation: waterMove 9s linear infinite;
}

/* 关键帧 */
@keyframes waterMove {
    20% {
        border-radius: 30% 70% 53% 47% / 28% 44% 56% 72%;
    }

    40% {
        border-radius: 30% 70% 39% 61% / 34% 39% 61% 66%;
    }

    60% {
        border-radius: 25% 75% 45% 55% / 40% 55% 45% 60%;
    }

    80% {
        border-radius: 28% 72% 31% 69% / 32% 39% 61% 68%;
    }
}

.login-box::before {
    content: '';
    position: absolute;
    top: 50px;
    left: 85px;
    width: 35px;
    height: 35px;
    background: #fff;
    border-radius: 52% 48% 33% 67% / 38% 45% 55% 62%;
    opacity: .9;
    animation: waterMove 9s linear infinite;
}

.login-box::after {
    content: '';
    top: 90px;
    position: absolute;
    left: 70px;
    width: 15px;
    height: 15px;
    border-radius: 52% 48% 33% 67% / 38% 45% 55% 62%;
    background: #fff;
    opacity: .9;
    animation: waterMove 9s linear infinite;
}

.login-form {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 40px;
    gap: 15px;
}

.login-form h2 {
    gap: 20px;
    letter-spacing: .3em;
}


.input-box {
    width: 225px;
    box-shadow: inset 2px 5px 10px rgba(0, 0, 0, .1),
    inset -2px -5px 10px rgba(255, 255, 255, 1),
    15px 15px 10px rgba(0, 0, 0, .05),
    15px 10px 15px rgba(0, 0, 0, .025);
    position: relative;
    border-radius: 25px;
}

.input-box:last-child {
    width: 120px;
    background: rgb(105, 199, 199);
    transition: .6s;
    box-shadow: inset 2px 5px 10px rgba(0, 0, 0, .1),
    15px 15px 10px rgba(0, 0, 0, .05),
    15px 10px 15px rgba(0, 0, 0, .025);
}

.input-box:last-child:hover {
    width: 150px;
}

.input-box::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 65%;
    height: 5px;
    background: rgba(255, 255, 255, .5);
    border-radius: 5px;
}

.input-box input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    font-size: 1em;
    padding: 10px 15px;
    box-sizing: border-box;
}

.input-box:last-child input {
    color: #fff;
    text-transform: uppercase;
    font-size: 1em;
    cursor: pointer;
    letter-spacing: .1em;
    font-weight: 500;
}

.login-btn {
    position: absolute;
    right: -120px;
    bottom: 0;
    width: 120px;
    height: 120px;
    background: #c61dff;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    cursor: pointer;
    text-decoration: none;
    letter-spacing: .1em;
    font-size: 1em;
    transition: .25s;
    box-shadow: inset 10px 10px 10px rgba(190, 1, 254, .05),
    25px 35px 20px rgba(190, 1, 254, .1),
    25px 30px 30px rgba(190, 1, 254, .1),
    inset -10px -10px 15px rgba(255, 255, 255, .5);
    border-radius: 44% 56% 65% 35% / 57% 58% 42% 43%;
    user-select: none;
    animation: waterMove2 9s linear infinite;
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 30px;
    width: 20px;
    height: 20px;
    border-radius: 44% 56% 35% / 57% 58% 42% 43%;
    background: #fff;
    opacity: .45;
}

.login-btn:hover, .login-btn:hover::before {
    border-radius: 50%;
}

.register {
    bottom: 150px;
    right: -120px;
    width: 80px;
    height: 80px;
    background: #01b4ff;
    border-radius: 49% 51% 52% 48% / 63% 59% 41% 37%;
    box-shadow: inset 10px 10px 10px rgba(1, 180, 255, .005),
    25px 35px 20px rgba(1, 180, 255, .1),
    25px 30px 30px rgba(1, 180, 255, .1),
    inset -10px -10px 15px rgba(255, 255, 255, .5);
}

.register::before {
    left: 20px;
    width: 15px;
    height: 15px;
    border-radius: 49% 51% 52% 48% / 63% 59% 41% 37%;
}


@keyframes waterMove2 {
    20% {
        border-radius: 44% 56% 65% 35% / 57% 58% 42% 43%;
    }

    40% {
        border-radius: 44% 56% 45% 45% / 67% 50% 46% 37%;
    }

    60% {
        border-radius: 39% 61% 70% 30% / 60% 68% 50% 43%;
    }

    80% {
        border-radius: 41% 58% 60% 40% / 52% 48% 70% 52%;
    }
}

效果展示:
在这里插入图片描述
在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1073720.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

在宝塔面板环境下安装nps服务端

在宝塔面板环境下安装nps服务端 一、所需环境二、开始安装三、打开nps控制台四、更改默认账号密码和连接秘钥五、反向代理挂载SSL证书 一、所需环境 阿里云轻应用服务器&#xff08;选择宝塔应用镜像&#xff09;域名&#xff08;最好也是阿里注册的域名&#xff09;对应的ssl…

RT-Thread 中断管理(学习三)

中断与轮询 当驱动外设工作时&#xff0c;其编程模式到底采用中断模式触发还是轮训模式触发往往是驱动开发人员首先需要考虑的问题&#xff0c;并且这个问题在实时操作系统与分时操作系统中差异非常大。 轮询模式本身采用顺序执行的方式&#xff1a;查询到相应的事件然后进行…

探索跑腿配送App的未来:技术和创新的前沿

跑腿配送App正经历着快速的技术演进&#xff0c;为提供更智能、高效和个性化的服务而不断创新。本文将探讨其中一个可能的创新方向&#xff1a;使用机器学习和实时数据分析来改进配送路线&#xff0c;提高效率&#xff0c;并为用户提供更好的体验。 技术背景 要实现这个创新…

Flink之Watermark源码解析

1. WaterMark源码分析 在Flink官网中介绍watermark和数据是异步处理的,通过分析源码得知这个说法不够准确或者说不够详细,这个异步处理要分为两种情况: watermark源头watermark下游 这两种情况的处理方式并不相同,在watermark的源头确实是异步处理的,但是在下游只是做的判断,这…

【Monorepo实战】pnpm+turbo+vitepress构建公共组件库文档系统

Monorepo架构可以把多个独立的系统放到一起联调&#xff0c;本文记录基于pnpm > workspace功能&#xff0c;如何构建将vitepress和组件库进行联调&#xff0c;并且使用turbo进行任务顺序编排。 技术栈清单&#xff1a; pnpm 、vitepress 、turbo 一、需求分析 1、最终目标…

Maven 自动化构建

自动化构建定义了这样一种场景: 在一个项目成功构建完成后&#xff0c;其相关的依赖工程即开始构建&#xff0c;这样可以保证其依赖项目的稳定。 比如一个团队正在开发一个项目 bus-core-api&#xff0c; 并且有其他两个项目 app-web-ui 和 app-desktop-ui 依赖于这个项目。 …

面试算法22:链表中环的入口节点(1)

题目 如果一个链表中包含环&#xff0c;那么应该如何找出环的入口节点&#xff1f;从链表的头节点开始顺着next指针方向进入环的第1个节点为环的入口节点。 例如&#xff0c;在如图4.3所示的链表中&#xff0c;环的入口节点是节点3。 分析 第1步&#xff1a;确认是否包含环…

产线运作中如何实现sop无纸化的作业?

在车间产线的运作中&#xff0c;及时准确地获取作业指导书是至关重要的。然而&#xff0c;传统的纸质作业指导书往往需要花费大量时间和精力来查找和更新。而有了SOP电子作业指导书系统&#xff0c;车间工人们只需要通过电子设备登录系统&#xff0c;就可以轻松地找到所需的作业…

导引服务机器人 通用技术条件

声明 本文是学习GB-T 42831-2023 导引服务机器人 通用技术条件. 而整理的学习笔记,分享出来希望更多人受益,如果存在侵权请及时联系我们 6 检验规则 6.1 检验项目 检验分为型式检验和出厂检验。检验项目见表2。 表 2 检验项目 序号 检验项目 技术要求 检验方法 出厂检验 型…

【C++】哈希与布隆过滤器

&#x1f307;个人主页&#xff1a;平凡的小苏 &#x1f4da;学习格言&#xff1a;命运给你一个低的起点&#xff0c;是想看你精彩的翻盘&#xff0c;而不是让你自甘堕落&#xff0c;脚下的路虽然难走&#xff0c;但我还能走&#xff0c;比起向阳而生&#xff0c;我更想尝试逆风…

二叉树题目:二叉树的所有路径

文章目录 题目标题和出处难度题目描述要求示例数据范围 解法思路和算法代码复杂度分析 题目 标题和出处 标题&#xff1a;二叉树的所有路径 出处&#xff1a;257. 二叉树的所有路径 难度 4 级 题目描述 要求 给你一个二叉树的根结点 root \texttt{root} root&#xff…

Go 并发编程

并发编程 1.1 并发与并⾏ 并⾏与并发是两个不同的概念&#xff0c;普通解释&#xff1a; 并发&#xff1a;交替做不同事情的能⼒并⾏&#xff1a;同时做不同事情的能⼒ 如果站在程序员的⻆度去解释是这样的&#xff1a; 并发&#xff1a;不同的代码块交替执⾏并⾏&#xf…

慢 SQL 的致胜法宝

大促备战&#xff0c;最大的隐患项之一就是慢SQL&#xff0c;对于服务平稳运行带来的破坏性最大&#xff0c;也是日常工作中经常带来整个应用抖动的最大隐患&#xff0c;在日常开发中如何避免出现慢SQL&#xff0c;出现了慢SQL应该按照什么思路去解决是我们必须要知道的。本文主…

C++对象模型(5)-- 数据语义学:继承的对象布局(不含虚函数)

1、单继承的对象布局 (1) 在普通继承&#xff08;没有虚函数、没有继承虚基类&#xff09;的情况下&#xff0c;按父对象、子对象的顺序布局 我们来看下面的例子&#xff1a; class Base { protected:int x;int y; };class Derive : public Base { private:int z; };int mai…

vue2项目中使用element ui组件库的table,制作表格,改表格的背景颜色为透明的

el-table背景颜色变成透明_el-table背景透明_讲礼貌的博客-CSDN博客 之前是白色的&#xff0c;现在变透明了&#xff0c;背景颜色是蓝色

短视频矩阵系统源码--源头技术独立自研框架开发

目录 一、批量剪辑&#xff08;采用php语言&#xff0c;数学建模&#xff09; 短视频合成批量剪辑的算法主要有以下几种&#xff1a; 1. 帧间插值算法&#xff1a;通过对多个视频的帧进行插帧处理&#xff0c;从而合成一段平滑的短视频。 2. 特征提取算法&#xff1a;提取多…

RedissonClient中Stream流的简单使用

1、pub端 //获取一个流 RStream rStream redissonClient.getStream("testStream"); //创建一个map&#xff0c;添加数据 Map<String, Object> rr new HashMap<>(); rr.put("xx", RandomUtil.randomString(5)); //添加到流 rStream.addAll(r…

TypeScript 笔记:String 字符串

1 对象属性 length 返回字符串的长度 2 对象方法 charAt() 返回在指定位置的字符 charCodeAt() 返回在指定的位置的字符的 Unicode 编码 concat 连接两个或更多的字符串 indexOf 返回某个指定的字符串值在字符串中首次出现的位置 lastIndexOf 从后向前搜索字符串&…

c语言练习题83:#include“ “和#include<>的区别

#include" "和#include<>的区别 #include<> 默认根据环境变量的值去先搜索标准库&#xff0c;搜索系统文件会比较快。 #include“” 先搜索当前工程的路径&#xff0c;搜索自己自定义的文件会比较快。 因此自定义的头文件的名称包含在<>中的话…

LeetCode 24.两两交换链表中的结点

题目链接 力扣&#xff08;LeetCode&#xff09;官网 - 全球极客挚爱的技术成长平台 题目解析 首先可以特判一下&#xff0c;如果结点数目小于等于1&#xff0c;则直接返回即可&#xff0c;因为数目小于等于1就不需要交换了。 然后我们可以创建一个虚拟的头结点&#xff0c;然…