今天要给大家介绍一款纯css3实现的机器人看书动画效果。整个画面完全由css3实现的绘制,没有使用任何图片元素。机器人的眼睛使用了动画元素。我们一起看下效果图:

在线预览   源码下载

实现的代码。

html代码:

 <div class='szene'>
<div class='image i1'>
< HTML >
<div class='nail'>
</div>
</div>
<div class='image i2'>
{ CSS }
<div class='nail'>
</div>
</div>
<div class='head'>
<div class='eyes'>
</div>
</div>
<div class='body'>
</div>
<div class='table'>
</div>
<div class='laptop'>
</div>
<div class='mouse'>
</div>
<div class='notes'>
</div>
<div class='lamp'>
<div class='top'>
</div>
</div>
<div class='headphones'>
</div>
<div class='trash'>
<div class='paper p1'>
</div>
<div class='paper p2'>
</div>
<div class='paper p3'>
</div>
<div class='paper p4'>
</div>
</div>
</div>

css代码:

* {
margin:;
padding:;
-moz-box-sizing: border-box;
box-sizing: border-box;
} *:before, *:after {
content: '';
display: block;
position: absolute;
-moz-box-sizing: border-box;
box-sizing: border-box;
} html, body {
height: 100%;
} body {
background: #d93;
} .szene {
position: absolute;
left: 50%;
bottom:;
width: 800px;
height: 400px;
margin-left: -400px;
overflow: hidden;
} .szene div {
position: absolute;
} .image {
width: 120px;
height: 120px;
line-height: 100px;
text-align: center;
font-family: 'Open Sans', sans-serif;
font-size: 18px;
font-weight:;
color: #888;
border: 8px solid #444;
background: #eee;
} .image.i1 { top: 100px; left: 100px; }
.image.i2 { top: 50px; left: 300px; } .image .nail {
top: -30px;
left: 50%;
width: 8px;
height: 8px;
margin-left: -4px;
border-radius: 50%;
background: #444;
} .image .nail:before,
.image .nail:after {
top: -5px;
width: 1px;
height: 35px;
background: #444;
} .image .nail:before { left: -11px; -webkit-transform: rotate(55deg); -ms-transform: rotate(55deg); transform: rotate(55deg); }
.image .nail:after { left: 19px; -webkit-transform: rotate(-55deg); -ms-transform: rotate(-55deg); transform: rotate(-55deg); } .head {
bottom: 90px;
left: 575px;
width: 85px;
height: 85px;
border-radius: 50%;
background: #eee;
} .head .eyes {
top: 58px;
left: 30px;
width: 6px;
height: 6px;
border-radius: 50%;
background: #444;
box-shadow: 20px 0 0 #444;
-webkit-animation: 8s eyes ease infinite;
animation: 8s eyes ease infinite;
} @-webkit-keyframes eyes {
0% { -webkit-transform: translate3d(0,0,0); transform: translate3d(0,0,0); }
5% { -webkit-transform: translate3d(0,-18px,0); transform: translate3d(0,-18px,0); }
10% { -webkit-transform: translate3d(0,-19px,0); transform: translate3d(0,-19px,0); }
15% { -webkit-transform: translate3d(-15px,-18px,0); transform: translate3d(-15px,-18px,0); }
20% { -webkit-transform: translate3d(-15px,-18px,0); transform: translate3d(-15px,-18px,0); }
25% { -webkit-transform: translate3d(15px,-18px,0); transform: translate3d(15px,-18px,0); }
30% { -webkit-transform: translate3d(15px,-18px,0); transform: translate3d(15px,-18px,0); }
35% { -webkit-transform: translate3d(0,-18px,0); transform: translate3d(0,-18px,0); }
40% { -webkit-transform: translate3d(0,-18px,0); transform: translate3d(0,-18px,0); }
45% { -webkit-transform: translate3d(0,0,0); transform: translate3d(0,0,0); }
100% { -webkit-transform: translate3d(0,0,0); transform: translate3d(0,0,0); }
} @keyframes eyes {
0% { -webkit-transform: translate3d(0,0,0); transform: translate3d(0,0,0); }
5% { -webkit-transform: translate3d(0,-18px,0); transform: translate3d(0,-18px,0); }
10% { -webkit-transform: translate3d(0,-19px,0); transform: translate3d(0,-19px,0); }
15% { -webkit-transform: translate3d(-15px,-18px,0); transform: translate3d(-15px,-18px,0); }
20% { -webkit-transform: translate3d(-15px,-18px,0); transform: translate3d(-15px,-18px,0); }
25% { -webkit-transform: translate3d(15px,-18px,0); transform: translate3d(15px,-18px,0); }
30% { -webkit-transform: translate3d(15px,-18px,0); transform: translate3d(15px,-18px,0); }
35% { -webkit-transform: translate3d(0,-18px,0); transform: translate3d(0,-18px,0); }
40% { -webkit-transform: translate3d(0,-18px,0); transform: translate3d(0,-18px,0); }
45% { -webkit-transform: translate3d(0,0,0); transform: translate3d(0,0,0); }
100% { -webkit-transform: translate3d(0,0,0); transform: translate3d(0,0,0); }
} .body {
bottom: -20px;
left: 578px;
width: 82px;
height: 110px;
border-radius: 0 0 50% 50%;
background: #eee;
} .table {
bottom: 15px;
left: 280px;
width: 500px;
height: 15px;
background: #444;
} .table:before,
.table:after {
top: 15px;
width: 10px;
height: 20px;
border-top: 3px solid #aaa;
background: #eee;
} .table:before { left: 20px; }
.table:after { right: 20px; } .laptop {
bottom: 35px;
left: 550px;
width: 140px;
height: 70px;
border-radius: 2px 2px 0 0;
background: #ddd;
} .laptop:before {
top: 50%;
left: 50%;
width: 18px;
height: 18px;
margin: -9px 0 0 -9px;
border-radius: 50%;
background: #fff;
} .laptop:after {
top: 70px;
left: -5px;
width: 150px;
height: 5px;
border-radius: 2px 2px 0 0;
background: #888;
} .mouse {
bottom: 30px;
left: 510px;
width: 20px;
height: 6px;
border-bottom: 2px solid #888;
border-radius: 25%;
background: #ddd;
} .notes {
bottom: 30px;
left: 705px;
width: 60px;
height: 12px;
background: #fff;
border: 4px solid #222;
border-radius: 4px;
border-left:;
} .lamp {
bottom: 30px;
left: 410px;
width: 40px;
height: 20px;
border-radius: 80px 80px 0 0;
background: #eee;
} .lamp:before,
.lamp:after {
z-index: -1;
width: 6px;
height: 80px;
background: #ccc;
} .lamp:before { top: -70px; left: 8px; -webkit-transform: rotate(-15deg); -ms-transform: rotate(-15deg); transform: rotate(-15deg); }
.lamp:after { top: -108px; left: 30px; -webkit-transform: rotate(75deg); -ms-transform: rotate(75deg); transform: rotate(75deg) } .lamp .top {
top: -75px;
left: 45px;
width: 50px;
height: 25px;
border-radius: 100px 100px 0 0;
background: #eee;
-webkit-transform: rotate(-15deg);
-ms-transform: rotate(-15deg);
transform: rotate(-15deg);
} .headphones {
bottom: 85px;
left: 563px;
width: 110px;
height: 100px;
border-radius: 50%;
border-top: 10px solid #444;
} .headphones:before,
.headphones:after {
width: 20px;
height: 40px;
top: 20px;
background: #ddd;
} .headphones:before {
left: -8px;
border-radius: 80px 0 0 80px;
border-right: 3px solid #444;
} .headphones:after {
right: -7px;
border-radius: 0 80px 80px 0;
border-left: 3px solid #444;
} .trash {
bottom: 10px;
left: 20px;
width: 100px;
height: 8px;
background: #444;
} .trash:after {
top: 8px;
left: 3px;
width: 94px;
height: 25px;
border-radius: 0 0 50px 50px;
background: #555;
} .trash .paper {
z-index: -1;
width: 25px;
height: 50px;
border: 2px solid #555;
background: #ddd;
} .trash .paper.p1 {
top: -15px;
left: 10px;
-webkit-transform: rotate(-20deg);
-ms-transform: rotate(-20deg);
transform: rotate(-20deg);
} .trash .paper.p2 {
top: -12px;
left: 30px;
-webkit-transform: rotate(-40deg);
-ms-transform: rotate(-40deg);
transform: rotate(-40deg);
} .trash .paper.p3 {
top: -15px;
left: 60px;
-webkit-transform: rotate(10deg);
-ms-transform: rotate(10deg);
transform: rotate(10deg);
} .trash .paper.p4 {
top: -12px;
left: 30px;
-webkit-transform: rotate(65deg);
-ms-transform: rotate(65deg);
transform: rotate(65deg);
}

注:本文爱编程原创文章,转载请注明原文地址:http://www.w2bc.com/Article/8316

一款纯css3实现的机器人看书动画效果的更多相关文章

  1. 16款纯CSS3实现的loading加载动画

    分享16款纯CSS3实现的loading加载动画.这是一款实用的可替代GIF格式图片的CSS3加载动画代码.效果图如下: 在线预览   源码下载 实现的代码. html代码: <div clas ...

  2. 纯css3圆形从中心向四周扩散动画效果

    查看效果:http://hovertree.com/texiao/css3/37/ 先来个简单的示例,例如: @keyframes hovertreemove{from {top:30px;}to { ...

  3. 纯css3实现的win8加载动画

    今天给大家分享一款纯css3实现的win8加载动画.在这款实例中动画效果完全由css3实现.一起看下效果图: 在线预览   源码下载 实现的代码. html代码: <div class=&quo ...

  4. 一款纯css3实现的漂亮的404页面

    之前为大家分享了那些创意有趣的404页面, html5和css3打造一款创意404页面, HTML5可爱的404页面动画很逗的机器人.今天再给大家分享一款纯css3实现的漂亮的404页面.效果图如下: ...

  5. 一款纯css3实现的动画按钮

    今天给大家分享一款纯css3实现的动画按钮.第一排的按钮当鼠标经过的背景色动画切换,图标从右侧飞入,第二排的按钮当鼠标经过的时候边框动画切换,图标右侧飞入,效果非常好,一起看下效果图: 在线预览    ...

  6. 一款纯css3实现的颜色渐变按钮

    之前为大家分享了推荐10款纯css3实现的实用按钮,今天给大家带来一款纯css3实现的颜色渐变按钮.这款按钮的边框和文字的颜色通过css3实现两种颜色的渐变,效果非常好看,一起看下效果图: 在线预览  ...

  7. 推荐10款纯css3实现的实用按钮

    在2014年的双11即将来临之季,爱编程小编为大家整理10款纯css3实现的按钮.希望这对坚守在前端的码农们有所帮助.亲,如果你有好的资源也可在本文留言,让从事编码的程序员们抱团.工作更轻松. No1 ...

  8. 一款纯css3实现的数字统计游戏

    今天给大家分享一款纯css3实现的数字统计游戏.这款游戏的规则的是将所有的数字相加等于72.这款游戏的数字按钮做得很美观,需要的时候可以借用下.一起看下效果图: 在线预览   源码下载 实现的代码. ...

  9. 一款纯css3实现的鼠标经过按钮特效

    今天再给大家带来一款纯css3实现的鼠标经过按钮特效.这款按钮非常简单,但效果很好,非常漂亮.一起看下效果图: 在线预览   源码下载 实现的代码. html代码: <div align=&qu ...

随机推荐

  1. history设置时间戳

    Linux查看历史命令,很关键!history,默认没有时间戳... 01.设置系统环境变量 echo 'export HISTTIMEFORMAT="%F %T  `whoami` &qu ...

  2. 【laravel5.4】引入自定义类库+卸载已有的自定义库(以引入钉钉应用为例)composer dumpautoload -o

    本文之前,首先感谢: Azeroth_Yang  传送门:https://blog.csdn.net/zwrj1130/article/details/73467320 强烈建议引入的类 都是含有命名 ...

  3. 原创:微信小程序+WEB使用JS实现注册【60s】倒计时功能

    1.效果图: 2.页面仅仅利用了JS的相关功能,包含:wxml.js.wxss 2.1wxml页面代码: <text>绑定手机</text> <form bindsubm ...

  4. 【LeetCode】64. Minimum Path Sum

    Minimum Path Sum Given a m x n grid filled with non-negative numbers, find a path from top left to b ...

  5. 【js】appendChild

    appendChild主要是用来追加节点插入到最后:循环的时候由于不停的搬家导致length在改变.     使用for循环 <!Doctype html> <html xmlns= ...

  6. vue学习01

    vue学习01   1. 创建一个Vue实例官网-学习-教程-安装-(开发/生产版本)-与jQuery的引用相似 <!DOCTYPE html> <html> <head ...

  7. Selenium-Grid工作原理

    selenium-grid是由一个hub节点和若干个代理节点组成.hub用来管理各个代理节点的注册和状态信息,并且接受远程客户端代码的请求调用,然后把请求的命令再转发给代理节点来执行.使用seleni ...

  8. CodeForces 550A Two Substrings(模拟)

    [题目链接]click here~~  [题目大意]:  You are given string s. Your task is to determine if the given string s ...

  9. 谈谈CListCtrl如何调整行高

    原文链接: http://blog.csdn.net/sstower/article/details/9094939 调整CListCtrl 行高通常有3种方法: 1.设定字体2.设定图片3.处理Me ...

  10. Python rstrip() 方法

    描述 Python rstrip() 方法用于删除字符串尾部指定的字符,默认字符为所有空字符,包括空格.换行(\n).制表符(\t)等. 语法 rstrip() 方法语法: S.rstrip([cha ...