热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

表单标签动画畅想【HTML】

web前端|html教程表单标签动画畅想web前端-html教程企业java源码,vscode在终端里ssh,ubuntu退出gnu,tomcat怎么没图标,爬虫小兼职,php字符

web前端|html教程表单标签动画畅想【HTML】
表单标签动画畅想
web前端-html教程
企业java源码,vscode在终端里ssh,ubuntu退出gnu,tomcat怎么没图标,爬虫小兼职,php 字符串 异或,金华seo优化价格表,校园网站html模板,wordpress技术博客模板lzw

引言

今天来看一组表单标签动画效果,希望可以对大家有所帮助,灵感来自于Inspiration for Text Input和Text Input Love,一并致谢。

下载网页视频源码下载,ubuntu+桌面美化,爬虫找定位技巧,快速 php,小福星seolzw
效果照例放在Codepen,虽少效果较慢,但值得期待。在线编辑,下载收藏。
dhcp server 源码下载,ubuntu 怎么用共享,卧室的大爬虫,parent php,seo销售团队lzw

搭建根基

我们同样使用了haml来简化html书写。

#container -(1..15).each do %div.row %label %input{:type=>"text"} %span姓名 %label %input{:type=>"text"} %span性别 %label %input{:type=>"text"} %span邮箱

css部分我们使用了scss,首先我们来搭建页面布局和基础设置。

/* 重置*/*, *:before, *:after { box-sizing: border-box; } /*容器设置*/#container{ counter-reset: counterA;}/*布局实现*/div.row{ position: relative; width: 100%; height:20vw; padding-left:15vw; counter-increment: counterA; &:before{ content:counter(counterA); color:rgba(255,255,255,.05); font-size:10vw; position: absolute; left:0px; } label{ position: relative; display: block; float: left; margin:8vw 2vw; input{ width:160px; height:30px; line-height:30px; background: rgba(255,255,255,.1); border:none; outline:none; border:1px solid #fff; color: #377D6A; padding:4px 10px; border-radius:4px; text-indent: 38px; transition: all .3s ease-in-out; ::-webkit-input-placeholder { color: transparent; } +span{ position: absolute; left:0; top:0; color:#fff; background: #7AB893; display: inline-block; padding: 7px 4px; transform-origin:left center; transform: perspective(300px); transition: all .3s ease-in-out; border-radius:4px 0 0 4px; } } input:focus, input:active { text-indent: 0; background: rgba(255,255,255,.2); ::-webkit-input-placeholder { color: #f00; } +span{ background: darken(#7AB893,20%); } } } /*设置背景色,随机颜色*/ @for $i from 1 through 15{ &:nth-child(#{$i}){ background:hsl(random(360),60%,30%); } } //设置每一行的动画效果 //&:nth-child(1){}}

效果一

//设置每一行的动画效果 //&:nth-child(1){} //效果一,标签左移 &:nth-child(1){ input:focus, input:active{ border-radius:0 4px 4px 0; +span{ border-radius:4px 0 0 4px; transform: translateX(-100%); } } }

效果二

//效果二,标签右移 &:nth-child(2){ input:focus, input:active{ +span{ border-radius:0 4px 4px 0; transform: translateX(300%); } } }

效果三

//效果三,标签上移 &:nth-child(3){ input:focus, input:active{ text-indent: 0px; +span{ background-color: transparent; transform: translateY(-100%); } } }

效果四

//效果四,标签下移 &:nth-child(4){ input:focus, input:active{ text-indent: 0px; +span{ background-color: transparent; transform: translateY(100%); } } }

效果五

//效果五,标签上旋 &:nth-child(5){ input+span{ transform-origin:left bottom; } input:focus, input:active{ border-radius:0 4px 4px 0; text-indent: 20px; +span{ transform: rotate(-60deg); border-radius:0 4px 4px 0; } } }

效果六

//效果六,标签下旋 &:nth-child(6){ input+span{ transform-origin:left bottom; } input:focus, input:active{ border-radius:0 4px 4px 0; +span{ animation:swing 1s; animation-fill-mode: forwards; border-radius:0 4px 4px 0; } } } //第6个动画 @keyframes swing{ 0% { transform: rotate(0); } 20% { transform: rotate(116deg); } 40% { transform: rotate(60deg); } 60% { transform: rotate(98deg); } 80% { transform: rotate(76deg); } 100% { transform: rotate(82deg); } }

效果七

//效果七,标签左折 &:nth-child(7){ input+span{ transform-origin:right center; } input:focus, input:active{ border-radius:0 4px 4px 0; +span{ transform:perspective(300px) translateX(-100%) rotateY(60deg); } } }

效果八

//效果八,标签左翻 &:nth-child(8){ input:focus, input:active{ border-radius:0 4px 4px 0; +span{ transform: rotateY(180deg); border-radius:0 4px 4px 0; } } }

效果九

//效果九,标签上移变提示框 &:nth-child(9){ input{ +span{ background: transparent; &:before{ content:""; width:0; height:0; position: absolute; left:20px; bottom:-10px; border:5px solid #000; border-color:darken(#7AB893,20%) transparent transparent transparent; transition:all .3s; opacity: 0; } } } input:focus, input:active{ +span{ padding:3px 10px; border-radius:6px; transform:translateY(-150%); &:before{ opacity: 1; } } } }

效果十

//效果十,标签上移,框变色 &:nth-child(10){ input{ border-width:1px 0; border-radius:0; +span{ background: transparent; } } input:focus, input:active{ border-width:2px 0; border-color:#000; +span{ background:transparent; transform:translateY(-120%); } } }

效果十一

//效果十一,标签左弹性&:nth-child(11){ input{ border-radius:0; border-width:1px 0; +span{ background: transparent; } } input:focus, input:active{ +span{ background:transparent; border:1px solid #fff; border-radius:0; border-width:0 0 0 1px; animation:halfLeft .6s ease-in; animation-fill-mode: forwards; } } @keyframes halfLeft{ 20%{ transform:translateX(-60%); } 40%{ transform:translateX(-42%); } 60%{ transform:translateX(-56%); } 80%{ transform:translateX(-46%); } 100%{ transform:translateX(-50%); } } }

效果十二

//效果十二,横线上移 &:nth-child(12){ input{ border-radius:0; border-width:0; background:transparent; +span{ background: transparent; &:before{ content:""; width:160px; height:1px; background-color: #fff; position: absolute; left:0; bottom:0; } } } input:focus, input:active{ +span{ background:transparent; transform:translateY(-100%); } } }

效果十三

//效果十三,边框动画 &:nth-child(13){ input{ border-radius:0; border:1px solid #fff; border-top-color:rgba(255,255,255,0); border-right-color:rgba(255,255,255,0); border-bottom-color:rgba(255,255,255,1); border-left-color:rgba(255,255,255,0); background:transparent; +span{ background: transparent; } } input:focus, input:active{ transition:none; animation:borderAnim 3s; animation-fill-mode:forward; border:1px solid #fff; +span{ background:transparent; transform:translateY(-100%); } } } @keyframes borderAnim{ 25%{ border-top-color:rgba(255,255,255,0); border-right-color:rgba(255,255,255,1); border-bottom-color:rgba(255,255,255,1); border-left-color:rgba(255,255,255,0); } 50%{ border-top-color:rgba(255,255,255,1); border-right-color:rgba(255,255,255,1); border-bottom-color:rgba(255,255,255,1); border-left-color:rgba(255,255,255,0); } 75%{ border-top-color:rgba(255,255,255,1); border-right-color:rgba(255,255,255,1); border-bottom-color:rgba(255,255,255,1); border-left-color:rgba(255,255,255,1); } }

效果十四

//效果十四,前后立体变化 &:nth-child(14){ input{ border-radius:0; border:1px solid #fff; transform-origin:left center; color:#fff; +span{ background: transparent; } } input:focus, input:active{ transform:scale(1.2); box-shadow:0px 0px 2px #000; color:#fff; border:2px solid #fff; +span{ background:transparent; transform:translateY(-100%) scale(0.8); } } }

效果十五

//效果十五,背景条纹动画 &:nth-child(15){ input{ border-radius:0; border:1px solid #fff; background-color: #026873; background-image: linear-gradient(90deg, rgba(255,255,255,.07) 50%, transparent 50%), linear-gradient(90deg, rgba(255,255,255,.13) 50%, transparent 50%), linear-gradient(90deg, transparent 50%, rgba(255,255,255,.17) 50%), linear-gradient(90deg, transparent 50%, rgba(255,255,255,.19) 50%); background-size: 13px, 29px, 37px, 53px; animation: shadowGo 10s linear infinite; animation-play-state:running; +span{ background: transparent; } } input:focus, input:active{ background-color: #137884; background-size: 13px, 29px, 37px, 53px; animation-play-state:paused; +span{ transform:translateY(-100%) scale(0.8); background:transparent; color:#137884; } } } @keyframes shadowGo{ 0% {background-position: 0 0} 100% {background-position: -600% 0%} };

十五种动画效果,希望可以对您有所帮助。如果你耐着性子读到这里,是我的莫大荣幸,感谢感谢。
欢迎评论,欢迎拍砖。

前端开发whqet,关注前端开发,分享相关资源。csdn专家博客,王海庆希望能对您有所帮助。

本文原文链接,


推荐阅读
  • html锚点是什么详解
    web前端|html教程html,锚点,web前端-html教程学习网页知识入门的肯定是HTML,其中html的锚点到底是干吗的?企业文件微信管理系统源码下载,ubuntu学习网站 ... [详细]
  • mui框架offcanvas侧滑超出部分隐藏无法滚动如何解决
    web前端|js教程off-canvas,部分,超出web前端-js教程mui框架中off-canvas侧滑的一个缺点就是无法出现滚动条,因为它主要用途是设置类似于qq界面的那种格 ... [详细]
  • 本文介绍了Web学习历程记录中关于Tomcat的基本概念和配置。首先解释了Web静态Web资源和动态Web资源的概念,以及C/S架构和B/S架构的区别。然后介绍了常见的Web服务器,包括Weblogic、WebSphere和Tomcat。接着详细讲解了Tomcat的虚拟主机、web应用和虚拟路径映射的概念和配置过程。最后简要介绍了http协议的作用。本文内容详实,适合初学者了解Tomcat的基础知识。 ... [详细]
  • ASP.NET2.0数据教程之十四:使用FormView的模板
    本文介绍了在ASP.NET 2.0中使用FormView控件来实现自定义的显示外观,与GridView和DetailsView不同,FormView使用模板来呈现,可以实现不规则的外观呈现。同时还介绍了TemplateField的用法和FormView与DetailsView的区别。 ... [详细]
  • 分享css中提升优先级属性!important的用法总结
    web前端|css教程css!importantweb前端-css教程本文分享css中提升优先级属性!important的用法总结微信门店展示源码,vscode如何管理站点,ubu ... [详细]
  • 本文介绍了在Web应用系统中,数据库性能是导致系统性能瓶颈最主要的原因之一,尤其是在大规模系统中,数据库集群已经成为必备的配置之一。文章详细介绍了主从数据库架构的好处和实验环境的搭建方法,包括主数据库的配置文件修改和设置需要同步的数据库等内容。MySQL的主从复制功能在国内外大型网站架构体系中被广泛采用,本文总结了作者在实际的Web项目中的实践经验。 ... [详细]
  • Servlet多用户登录时HttpSession会话信息覆盖问题的解决方案
    本文讨论了在Servlet多用户登录时可能出现的HttpSession会话信息覆盖问题,并提供了解决方案。通过分析JSESSIONID的作用机制和编码方式,我们可以得出每个HttpSession对象都是通过客户端发送的唯一JSESSIONID来识别的,因此无需担心会话信息被覆盖的问题。需要注意的是,本文讨论的是多个客户端级别上的多用户登录,而非同一个浏览器级别上的多用户登录。 ... [详细]
  • nginx+多个tomcat
    学习nginx的时候遇到的问题:nginx怎么部署两台tomcat?upstream在网上找的资源,我在nginx配置文件(nginx.conf)中添加了两个server。结果只显 ... [详细]
  • 最近帮人用Apache+Tomcat在同一台IP的服务器上设置多域名指向不同网站站点,花费了不少的时间。尤其是配置信息的时候,从网上找的资料有很多是错误的,误认不浅。所以今天特意把 ... [详细]
  • PHP输出缓冲控制Output Control系列函数详解【PHP】
    后端开发|php教程PHP,输出缓冲,Output,Control后端开发-php教程概述全景网页源码,vscode如何打开c,ubuntu强制解锁,sts启动tomcat慢,sq ... [详细]
  • 用PHP连接MySQL代码的参数说明【PHP】
    后端开发|php教程PHP,连接,MySQL,参数后端开发-php教程代码是这样的:大图标网站源码,怎么在vscode中调试css,ubuntu退出命令行,系统默认开tomcat, ... [详细]
  • 无法打开install.wim怎么办
    运维|windows运维install.wim运维-windows运维空间留言网站源码,vscode标准代码,adamsubuntu,tomcat连接共享,sqlite软件基本操作 ... [详细]
  • php实现文件下载代码一例,
    php教程|php手册php,实现,文件下载,代码,一例,php,实现,文件下载,代码,一例,我们,需要,用到,header,函数,来,发送,php教程-php手册php实现文件下 ... [详细]
  • (九)Docker常用安装
    一、总体步骤1、搜索镜像2、拉取镜像3、查看镜像4、启动镜像5、停止镜像6、移除镜像二、安装tomcat1、dockerhub上面查找tomcat镜像 dockersearchto ... [详细]
  • ORACLE空间管理实验5:块管理之ASSM下高水位的影响
    数据库|mysql教程ORACLE,空间,管理,实验,ASSM,下高,水位,影响,数据库-mysql教程易语言黑客软件源码,vscode左侧搜索,ubuntu怎么看上一页,ecs搭 ... [详细]
author-avatar
小馨小慧
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有