服务粉丝

我们一直在努力
当前位置:首页 > 财经 >

【每日一练】107—一款好玩的注册登录UI效果

日期: 来源:web前端开发收集编辑:

文 | 杨小爱


写在前面

注册登录的组件,在前面也分享过一些,今天我们再来看一个注册登录的UI样式效果,截图如下:

为了能方便看到鼠标效果,我录了一个GIF的动图,如下:

看完了实现后的效果,我们再来看一下实现的代码,具体的代码如下:
HTML代码:
<!DOCTYPE html><html><head>  <title>【每日一练】107—CSS实现一款水滴注册登录页面的效果</title>  <link rel="stylesheet" type="text/css" href="style.css"></head><body>  <div class="container">    <div class="drop">      <div class="content">        <h2>登录</h2>        <form>          <div class="inputBox">            <input type="text" placeholder="用户名">          </div>          <div class="inputBox">            <input type="password" placeholder="密码">          </div>          <div class="inputBox">            <input type="submit" value="登录">          </div>        </form>      </div>    </div>    <a href="http://www.webqdkf.com" class="btns" target="_blank">忘记密码</a>    <a href="http://www.webqdkf.com" class="btns signup" target="_blank">注册</a>  </div></body></html>
CSS代码:
*{  margin: 0;  padding: 0;  box-sizing: border-box;  font-family: 'Poppins', sans-serif;}body {  display: flex;  justify-content: center;  align-items: center;  min-height: 100vh;  background: #eff0f4;}.container {  position: relative;  left: -80px;  display: flex;  justify-content: center;  align-items: center;}.container .drop {  position: relative;  width: 350px;  height: 350px;  box-shadow: inset 20px 20px 20px rgba(0,0,0,0.05),  25px 35px 20px rgba(0,0,0,0.05),  25px 30px 30px rgba(0,0,0,0.05),  inset -20px -20px 25px rgba(255,255,255,0.9);  transition: 0.5s;  display: flex;  justify-content: center;  align-items: center;  border-radius: 50%;}.container .drop:hover {  border-radius: 10%;}.container .drop::before {  content: '';  position: absolute;  top: 50px;  left: 85px;  width: 35px;  height: 35px;  border-radius: 50%;  background: #fff;  opacity: 0.9;}.container .drop::after {  content: '';  position: absolute;  top: 90px;  left: 110px;  width: 15px;  height: 15px;  border-radius: 50%;  background: #fff;  opacity: 0.9;}.container .drop .content {  position: relative;  display: flex;  justify-content: center;  align-items: center;  flex-direction: column;  text-align: center;  padding: 40px;  gap: 15px;}.container .drop .content h2 {  position: relative;  color: #333;  font-size: 1.5em;  }.container .drop .content form {  display: flex;  flex-direction: column;  gap: 20px;  justify-content: center;  align-items: center;}.container .drop .content form .inputBox {  position: relative;  width: 225px;  box-shadow: inset 2px 5px 10px rgba(0,0,0,0.1),  inset -2px -5px 10px rgba(255,255,255,1),  15px 15px 10px rgba(0,0,0,0.05),  15px 10px 15px rgba(0,0,0,0.025);  border-radius: 25px;}.container .drop .content form .inputBox::before {  content: '';  position: absolute;  top: 8px;  left: 50%;  transform: translateX(-50%);  width: 65%;  height: 5px;  background: rgba(255,255,255,0.5);  border-radius: 5px;}.container .drop .content form .inputBox input {  border: none;  outline: none;  background: transparent;  width: 100%;  font-size: 1em;  padding: 10px 15px;}.container .drop .content form .inputBox input[type="submit"]{  color: #fff;  text-transform: uppercase;  font-size: 1em;  cursor: pointer;  letter-spacing: 0.1em;  font-weight: 500;}.container .drop .content form .inputBox:last-child {  width: 120px;  background: #00a6bc;  box-shadow: inset 2px 5px 10px rgba(0,0,0,0.1),  15px 15px 10px rgba(0,0,0,0.05),  15px 10px 15px rgba(0,0,0,0.025);  transition: 0.5s;}.container .drop .content form .inputBox:last-child:hover {  width: 150px;}.btns {  position: absolute;  right: -120px;  bottom: 0;  width: 120px;  height: 120px;  background: #00a6bc;  display: flex;  justify-content: center;  align-items: center;  cursor: pointer;  text-decoration: none;  color: #fff;  line-height: 1.2em;  letter-spacing: 0.1em;  font-size: 0.8em;  transition: 0.25s;  text-align: center;  box-shadow: inset 10px 10px 10px rgba(0,166,188,0.05),  15px 25px 10px rgba(0,166,188,0.1),  15px 20px 20px rgba(0,166,188,0.1),  inset -10px -10px 15px rgba(0,166,188,0.5);  border-radius: 50%;}.btns::before {  content: '';  position: absolute;  top: 15px;  left: 30px;  width: 20px;  height: 20px;  border-radius: 50%;  background: #fff;  opacity: 0.45;}.btns.signup {  bottom: 150px;  right: -120px;  width: 80px;  height: 80px;  border-radius:50%;  background: #00a6bc;  box-shadow: inset 10px 10px 10px rgba(0,166,188,0.05),  15px 25px 10px rgba(0,166,188,0.1),  15px 20px 20px rgba(0,166,188,0.1),  inset -10px -10px 15px rgba(0,166,188,0.5);}.btns.signup::before {  left: 20px;  width: 15px;  height: 15px;}.btns:hover {  border-radius: 10%;}
写在最后

以上就是【每日一练】的全部内容,希望今天的小练习对你有用,如果你觉得有帮助的话,请点赞我,关注我,并将它分享给你身边做开发的朋友,也许能够帮助到他。

我是杨小爱,我们明天见。

推荐阅读

【每日一练】01~100练大合集汇总


学习更多技能

请点击下方公众号

相关阅读

  • 设计师必看 | 背景处理的深入浅出

  • 在内容化消费的今天,越来越多的应用开始强调针对内容的沉浸式设计,虽然只是很小的细节,但却可以让你的界面愈发的活力,甚至充满情绪。我们都知道iOS在一些诸如背景设计的处理上
  • 这 7 种表现最直观的评估一个程序的水平

  • 作者 | Lokajit Tikayatray;策划 | 李俊辰;来源 | InfoQ知道这些表现,你才能在自己的程序员职业生涯中不犯相同的错误。软件行业的工作经验和你从事这个行业的工作年限直接相关
  • 学习一下 nowinandroid 的构建脚本

  • 前言nowinandroid 项目是谷歌开源的示例项目,它遵循 Android 设计和开发的最佳实践,并旨在成为开发人员的有用参考这个项目在架构演进,模块化方案,单元测试,Jetpack Compose,启动

热门文章

  • “复活”半年后 京东拍拍二手杀入公益事业

  • 京东拍拍二手“复活”半年后,杀入公益事业,试图让企业捐的赠品、家庭闲置品变成实实在在的“爱心”。 把“闲置品”变爱心 6月12日,“益心一益·守护梦想每一步”2018年四

最新文章

  • 【每日一练】107—一款好玩的注册登录UI效果

  • 文 | 杨小爱写在前面注册登录的组件,在前面也分享过一些,今天我们再来看一个注册登录的UI样式效果,截图如下:为了能方便看到鼠标效果,我录了一个GIF的动图,如下:看完了实现后的效果
  • 我老板:你根本不懂 React!

  • 英文 | https://javascript.plainenglish.io/my-boss-you-dont-know-react-at-all-f493970f1807翻译 | 杨小爱前言我已经使用 React 多年,我确信我非常了解它,但最近我的老板
  • 8 个实用的 NPM 技术

  • 英文 | https://javascript.plainenglish.io/8-useful-javascript-coding-techniques-that-you-should-use-d5d63f7c7037翻译 | web前端开发(ID:web_qdkf)这篇文章,跟大家分享8
  • 【每日一练】108—一个登录页面的实现

  • 写在前面今天我们来写一个登录页面,这个在很多企业系统上都会用到,当然,一些网站上也用应用到,所以,它的应用场景还是很多的。现在,我们一起来看一下它的最终效果:以下是实现的源码
  • 一些顶级 JavaScript 技巧汇总

  • 英文 | https://medium.com/stackanatomy/top-javascript-shorthand-techniques-64920294f0c8JavaScript包含各种对典型编程思想有用的一些技巧,在实际开发中,我们通常希望减