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 ...
随机推荐
- 16.1-Jenkins持续集成01—Jenkins服务搭建和部署
分类: Linux架构篇 一.介绍Jenkins 1.Jenkins概念 Jenkins是一个功能强大的应用程序,允许持续集成和持续交付项目,无论用的是什么平台.这是一个免费的源代码,可以处理任何 ...
- 第三章JavaScript 内置对象
1 Number 1.1 属性 MAX_VALUE JS可以表示的最大的数字 MIN_VALUE JS可以表示的最小的数字 1.2 方法 toFixed(length) 指定保留长度的小数 toExp ...
- vue.js devtools安装
在调试的时候chrome会提示安装vue devtools,我以为是要在chrome的程序商店直接安装,但是国内对谷歌的和谐,无法访问谷歌商店内容 官方有源代码,可以下载下来自行编译安装 官方地址:h ...
- Pychram基本操作
1. 更改pychram页面为黑色背景主题.更改主题: File ->Settings -> Editor -> Color Scheme -> Scheme -> Mo ...
- Windows下安装配置SQLite和使用的教程
什么是SQLite SQLite是一款非常轻量级的关系数据库系统,支持多数SQL92标准.SQLite在使用前不需要安装设置,不需要进程来启动.停止或配置,而其他大多数SQL数据库引擎是作为一个单独的 ...
- 三次样条插值matlab实现
三次样条插值matlab实现 %三次样条差值-matlab通用程序 - zhangxiaolu2015的专栏 - CSDN博客 https://blog.csdn.net/zhangxiaolu201 ...
- loj2062 [HAOI2016]地图
ref #include <algorithm> #include <iostream> #include <cstdio> #include <cmath& ...
- laravel5.2总结--集合
类(Laravel集合基类) Illuminate\Support\Collection 类提供一个流畅.便利的封装来操控数组数据,官方提供了很多辅助函数,方便对数据进行各种处理,Coll ...
- 图文详解安装PHP运行环境
一.什么是PHP运行环境 能够理解人与计算机交流时语言软件,通常指解释PHP编程语言的软件. 例如: PHP(代码) 需要PHP超文本预编译器(软件). Java需要JVM虚拟机 二.安装PHP运行环 ...
- ArrayList以及Map小练
ArrayList常用方法 public static void main(String[] args) { List list = new ArrayList(); List list1 = new ...