css3动画、边框、投影知识
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Robot</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="robot">
<div class="piston"><!--外框-->
<div class="block"><!--字母框-->
A
<div class="arm"></div><!--摆杆-->
</div>
<div class="rotator"><!--低圈--> </div>
</div> <div class="piston"><!--外框-->
<div class="block"><!--字母框-->
A
<div class="arm"></div><!--摆杆-->
</div>
<div class="rotator"><!--低圈--> </div>
</div> <div class="piston"><!--外框-->
<div class="block"><!--字母框-->
A
<div class="arm"></div><!--摆杆-->
</div>
<div class="rotator"><!--低圈--> </div>
</div> <div class="piston"><!--外框-->
<div class="block"><!--字母框-->
A
<div class="arm"></div><!--摆杆-->
</div>
<div class="rotator"><!--低圈--> </div>
</div> <div class="piston"><!--外框-->
<div class="block"><!--字母框-->
A
<div class="arm"></div><!--摆杆-->
</div>
<div class="rotator"><!--低圈--> </div>
</div>
</div>
</body>
</html>
css
/*定义动画*/
/*上下摆动*/
@-webkit-keyframes topbottom{
0% { margin-top:; }
50% { margin-top: 80px; }
100% { margin-top:; }
}
@keyframes topbottom{
0% { margin-top:; }
50% { margin-top: 80px; }
100% { margin-top:; }
}
/*左右摇摆*/
@-webkit-keyframes rightleft {
0% { -webkit-transform: rotate(0); }
25% { -webkit-transform: rotate(-18deg); }
50% { -webkit-transform: rotate(0); }
75% { -webkit-transform: rotate(18deg); }
100% { -webkit-transform: rotate(0); }
}
@keyframes rightleft {
0% { -webkit-transform: rotate(0); }
25% { -webkit-transform: rotate(-18deg); }
50% { -webkit-transform: rotate(0); }
75% { -webkit-transform: rotate(18deg); }
100% { -webkit-transform: rotate(0); }
}
*{
margin:;
padding:;
list-style: none;
}
img{
border:none;
}
body{
text-align: center;
margin: 60px 0 0;
background:linear-gradient(to bottom, #333, tomato);
/*渐变 上到下*/
}
html{
height: 100%;
}
#robot{
position: absolute;
width: 540px;
height: 250px;
margin: auto;
left:;
top:;
bottom:;
right:;
color: #444;
font-weight:;
text-shadow:0 -1px 1px rgba(0,0,0,0.7),0 1px 1px rgba(255,255,255,0.4);
/*投影*/
font-family: 'Oswald', sans-serif;
}
.piston{
float: left;
margin-right: 10px;
position: relative;
width: 100px;
height: 250px;
background: rgba(0,0,0,0.1);
border-radius: 10px 10px 50px 50px;
box-shadow: 0 -4px 0 rgba(0,0,0,0.2), 0 4px 0 rgba(255,255,255,0.2);
}
.piston:last-child{
margin:;
}
.block{
position: relative;
width: 100px;
height: 60px;
line-height: 60px;
background: #555;
border-radius: 10px;
animation:topbottom 1.2s cubic-bezier(0.5,0,0.5,1) infinite;
/*cubic-bezier动画方式(曲线)*/
-webkit-animation:topbottom 1.2s cubic-bezier(0.5,0,0.5,1) infinite;
box-shadow: inset 0 -4px 0 rgba(0,0,0,0.2), inset 0 4px 0 rgba(255,255,255,0.2)
}
.piston:nth-child(1) .block { -webkit-animation-delay: 0s; animation-delay: 0s; }
.piston:nth-child(2) .block { -webkit-animation-delay: .1s; animation-delay: .1s; }
.piston:nth-child(3) .block { -webkit-animation-delay: .2s; animation-delay: .2s; }
.piston:nth-child(4) .block { -webkit-animation-delay: .3s; animation-delay: .3s; }
.piston:nth-child(5) .block { -webkit-animation-delay: .4s; animation-delay: .4s; }
.arm{
position: absolute;
top:50%; left:50%;
margin: -10px 0 0 -10px;
width: 20px;
height: 150px;
background: #555;
border-radius: 10px;
box-shadow: inset 0 -22px 0 rgba(0,0,0,.2);
z-index: -110;
-webkit-transform-origin: center 10px;
-webkit-animation: arm 1.2s linear infinite;
-webkit-animation-delay: inherit;
transform-origin: center 10px;
animation: rightleft 1.2s linear infinite;
animation-delay: inherit;
}
.arm:before,.arm:after{
content:"";
position: absolute;
left:;
right:;
height: 16px;
width: 16px;
border-radius: 50%;
margin: 2px;
background:#eee;
}
.arm:before{
top:;
}
.arm:after{
bottom:;
}
.rotator{
position: absolute;
bottom:;
width: 100px;
height: 100px;
border:20px solid rgba(0,0,0,0.1);
box-sizing:border-box;
z-index: -110;
border-radius: 50%;
}

css3动画、边框、投影知识的更多相关文章
- 鼠标悬停显示CSS3动画边框
效果体验:http://keleyi.com/keleyi/phtml/css3/14.htm 以下是代码: <!DOCTYPE html> <html xmlns="ht ...
- css3动画--超级基础知识
这么乱的笔记....供自己阅读!
- CSS3动画详解(结合实例)
一.使用CSS3动画代替JS动画 JS动画频繁操作DOM导致效率非常低 在频繁的操作DOM和CSS时,浏览器会不停的执行重排(reflow)和重绘(repaint) 可以避免占用JS主线程 这边就不细 ...
- 6种炫酷的CSS3按钮边框动画特效
6种炫酷的CSS3按钮边框动画特效Button border animate 用鼠标滑过下面的按钮看看效果! Draw Draw Meet Center Spin Spin Circle Spin T ...
- CSS3动画:流彩文字效果+图片模糊效果+边框伸展效果实现
前言 首先第一步,先布局html代码如下: <div class="wrap"> <img src="images/1.jpg" class= ...
- CSS3动画基本的转换和过渡
理论知识不扎实,在一定程度上能体现你解决问题的能力.今天我们拿CSS3动画来说,简单回忆下他的一些基本属性,这些我们在平常应用中会经常用到. 常用动画属性: transform:translate(x ...
- CSS3动画那么强,requestAnimationFrame还有毛线用?
一.哟,requestAnimationFrame, 新同学,先自我介绍下 Hello, 大家好,我就是风姿卓越,万种迷人的requestAnimationFrame,呵呵呵呵.很高兴和大家见面,请多 ...
- CSS3动画那么强,requestAnimationFrame还有毛线用--摘抄
CSS3动画那么强,requestAnimationFrame还有毛线用? 这篇文章发布于 2013年09月30日,星期一,19:12,归类于 web综合. 阅读 197124 次, 今日 84 次 ...
- JavaScript - 基于CSS3动画的实现
在痛苦的IE8时代,所有的动画都只能基于自己计算相关动画属性,开定时器setTimeout/setInterval轮询动画任务. 而肩负重任的HTML5,早已注意到了日益增强的动画,随着HTML5的降 ...
- css3动画简介以及动画库animate.css的使用
在这个年代,你要是不懂一点点css3的知识,你都不好意思说你是个美工.美你妹啊,请叫我前端工程师好不好.呃..好吧,攻城尸...呵呵,作为一个攻城尸,没有点高端大气上档次的东西怎么能行呢,那么css3 ...
随机推荐
- python字典按照k,v来排序
按照 k 排序 按照 v 排序
- 企业shell面试题及解答
1.面试题:使用for循环在/tmp目录下批量创建10个html文件,其中每个文件需要包含10个随机小写字母加固定字符串template,示例如下 aaesdffbnv_template.html 方 ...
- Emgu.CV.CvInvoke的类型初始值设定项引发异常
被这个问题蛋疼了一个下午,终于解决了.我的服务器出现这个问题的原因:可能是没有安装emgucv. 解决方法: 1.下载并安装emgucv 下载地址:链接: https://pan.baidu.com/ ...
- tomcat8+idea远程调试
window下 setenv.bat增加 set JPDA_OPTS=-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n lin ...
- Redis实现之压缩列表
压缩列表 压缩列表(ziplist)是列表键和哈希键的底层实现之一,当一个列表键只包含少量列表项,并且每个列表项要嘛是整数值,要嘛是比较短的字符串,那么Redis就会使用压缩列表来做列表键的底层实现. ...
- TCP/IP网络编程之套接字的多种可选项
套接字可选项进而I/O缓冲大小 我们进行套接字编程时往往只关注数据通信,而忽略了套接字具有的不同特性.但是,理解这些特性并根据实际需要进行更改也十分重要.之前我们写的程序在创建好套接字后都是未经特别操 ...
- WTForm
Flask-WTForm: from flask import Flask,render_template,request,redirect from wtforms.fields import co ...
- Careercup - Microsoft面试题 - 5485521224597504
2014-05-12 06:19 题目链接 原题: Given an input list of lists.. flatten the list. For e.g. {{,}, {}, {,}} . ...
- Feign请求报请求超时
Feign的底层基于Rabbion实现的,一般情况下直接导入feign的依赖,然后调用feignClient去发送请求,报请求超时. application.yml #hystrix的超时时间 hys ...
- 项目实战:CRM客户关系管理系统开发
21-CRM第一节内容概要 21.1 Stark组件介绍:实现基本的增删改查+自定义复杂操作: 21.2 单例模式:最简单的单例模式: 21.3 路由系统(分发): 21.4 制作启动文件-Djang ...