<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<style>
*{margin:0; padding:0;}
.main{width:400px; height:340px; margin-top:150px; margin-left:150px;}
.main .container{width:300px; height:150px; position:relative; perspective:150px;}
.main .container .box{width:100%; height:100%; position:absolute; transform-style:preserve-3d;}
.main .container .box figure{display:block; position:absolute;}
.main .container .box .front{width:300px; height:150px; background-color:rgba(255, 160, 122, .7);}
.main .container .box .front h1{width:50px; height:20px; line-height:20px; text-align:center; font-size:14px; color:#FFF; margin-left:20px; margin-top:20px;}
.main .container .box .front span{width:60px; height:30px; line-height:35px; font-size:20px; color:#FFF; text-align:center; position:absolute; top:40px; right:30px; background-color:rgba(95, 95, 95, 1); display:inline-block; border-radius:5px;}
.main .container .box .front .light-1{width:6px; height:6px; border-radius:6px; background-color:#ceccc8; position:absolute; top:85px; right:40px; display:inline-block;}
.main .container .box .front .light-2{width:6px; height:6px; border-radius:6px; background-color:#ceccc8; position:absolute; top:85px; right:60px; display:inline-block;}
.main .container .box .front .light-2.active{background-color:#56FA0A; box-shadow:0 0 10px 1px #FFF;}
.main .container .box .back{width:300px; height:150px; transform:translateZ(-20px); background-color:rgba(50, 50, 50, 1);}
.main .container .box .right{width:20px; height:150px; left:290px; transform:translateZ(-10px) rotateY(90deg); background-color:rgba(254, 205, 82, .8);}
.main .container .box .left{width:20px; height:150px; left:-10px; transform:translateZ(-10px) rotateY(-90deg); background-color:rgba(254, 205, 82, .8);}
.main .container .box .top{width:300px; height:20px; top:-10px; transform:translateZ(-10px) rotateX(90deg); background-color:rgba(18, 20, 80, .8);}
.main .container .box .bottom{width:300px; height:20px; top:140px; transform:translateZ(-10px) rotateX(-90deg); background-color:rgba(18, 20, 80, .8); box-shadow:40px -10px 30px 4px gray;}
.main .container .box .div-1{width:260px; height:10px; position:absolute; top:110px; left:20px; background-color:rgba(255, 255, 255, .8); transform:translateZ(-5px) rotateX(90deg);}
.main .container .box .div-1:nth-of-type(2){top:120px;}
.animate-cycle{animation:cycle 12s linear infinite both;}
@keyframes cycle{
0% {transform:translateZ(-5px) rotateX(90deg);}
25% {transform:translateZ(-5px) rotateX(20deg);}
50% {transform:translateZ(-5px) rotateX(90deg);}
75% {transform:translateZ(-5px) rotateX(160deg);}
100% {transform:translateZ(-5px) rotateX(90deg);}
}
.main .box-1{width:80px; height:150px; border:1px solid #F57E0F; margin-top:20px; margin-left:20px; background-color:#19e6f8;}
.main .box-1 span{width:50px; height:25px; background-color:#F57E0F; color:#FFF; display:block; line-height:25px; text-align:center; margin-top:10px; margin-left:15px; font-size:14px; cursor:pointer;}
.main .box-1 span:hover{background-color:#fcd05a;}
</style>
</head>
<body>
<div class="main">
<div class="container">
<div class="box">
<figure class="front">
<h1>GREE</h1>
<span id="num">18 ºC</span>
<div class="light-1"></div>
<div class="light-2" id="light"></div>
</figure>
<figure class="back"></figure>
<figure class="right"></figure>
<figure class="left"></figure>
<figure class="top"></figure>
<figure class="bottom"></figure>
<div class="div-1" id="div_1"></div>
<div class="div-1" id="div_2"></div>
</div><!--box-->
</div><!--container-->
<div class="box-1">
<span id="openOrClose">开/关</span>
<span id="add">+</span>
<span id="reduce">-</span>
<span id="wind">风向</span>
</div><!--box-1-->
</div><!--main-->
<script>
window.onload = function(){

var getIdObject = function(id){
return document.getElementById(id);
}
var openOrClose = getIdObject('openOrClose'),
add = getIdObject('add'),
reduce = getIdObject('reduce'),
wind = getIdObject('wind'),
num = getIdObject('num'),
light = getIdObject('light'),
div_1 = getIdObject('div_1'),
div_2 = getIdObject('div_2'),
windStatus = 0,
status = 0;
openOrClose.onclick = function(){
if(!status){
status = 1;
light.className = 'light-2 active';
}else{
status = 0;
light.className = 'light-2';
windStatus = 0;
div_1.className = 'div-1';
div_2.className = 'div-1';
}
}
add.onclick = function(){
var numVal = parseInt(num.innerHTML);
if(!status || numVal >= 32){
return;
}else{
num.innerHTML = ++numVal + ' ºC';
}
}
reduce.onclick = function(){
var numVal = parseInt(num.innerHTML);
if(!status || numVal <= 16){
return;
}else{
num.innerHTML = --numVal + ' ºC';
}
}
wind.onclick = function(){
if(!status) return;
if(!windStatus){
windStatus = 1;
div_1.className = 'div-1 animate-cycle';
div_2.className = 'div-1 animate-cycle';
}else{
windStatus = 0;
div_1.className = 'div-1';
div_2.className = 'div-1';
}
}

}
</script>
</body>
</html>

CSS3简单的空调的更多相关文章

  1. css3简单几步画一个乾坤图

    原文:[原创]css3简单几步画一个乾坤图 效果如上,鼠标移上去会有动画. 代码如下非常简单: <html> <head> <style> .outer{heigh ...

  2. [原创]css3简单几步画一个乾坤图

    效果如上,鼠标移上去会有动画. 代码如下非常简单: <html> <head> <style> .outer{height:100px;width:200px;bo ...

  3. CSS3简单动画

    css3的动画确实非常绚丽!浏览器兼容性很重要!. 分享两个小动画 <!doctype html> <html lang="en"> <head> ...

  4. css3简单介绍

    关于css3我先介绍几个简单的选择器: 先进行设置: 字符串匹配属性选择器: E[alt^="a"]  选择属性中以a开头的元素: E[alt$="a"]  选 ...

  5. 纯css3简单实用的checkbox复选框和radio单选框

    昨天为大家分享了一款很炫的checkbox复选框和radio单选框,今天再给大家带来一款简单实用的checkbox复选框和radio单选框.界面清淅.舒服.先给大家来张效果图: 在线预览   源码下载 ...

  6. H5+CSS3简单动画 知识点 汇总

    乱入几个:  1.h5的一个语义化标签   figure :用于规定独立的流内容(图像 图表 照片 代码等)   figcapition:与figure配套使用,用于标签定义figure元素标题 2. ...

  7. web前端学习(三)css学习笔记部分(5)-- CSS动画--页面特效、HTML与CSS3简单页面效果实例

    CSS动画--页面特效部分内容目前仅仅观看了解内容,记录简单笔记,之后工作了进行内容的补充 7.  CSS动画--页面特效 7.1  2D.3D转换 7.1.1  通过CSS3转换,我们能够对元素进行 ...

  8. css3 简单动画

    <script> <!-- var x,y,n=0,ny=0,rotINT,rotYINT function rotateDIV() { x=document.getElementB ...

  9. CSS3简单的栅格系统

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

随机推荐

  1. 转:Java架构师与开发者提高效率的10个工具

    原文来自于:http://www.importnew.com/14624.html Java受到全球百万计开发者的追捧,已经演变为一门出色的编程语言.最终,这门语言随着技术的变化,不断的被改善以迎合变 ...

  2. BZOJ 1028 麻将

    Description 麻将是中国传统的娱乐工具之一.麻将牌的牌可以分为字牌(共有东.南.西.北.中.发.白七种)和序数牌(分为条子.饼子.万子三种花色,每种花色各有一到九的九种牌),每种牌各四张.在 ...

  3. python MySQLdb segmentation fault

    import MySQLdb conn = MySQLdb.connect(host=_host,user=_user,passwd=_passwd,db=_db,charset=_charset,p ...

  4. X-Plosives

    uvaLive 3644:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&pa ...

  5. Context Switch Definition

    A context switch (also sometimes referred to as a process switch or a task switch) is the switching ...

  6. Light OJ 1004 - Monkey Banana Problem(DP)

    题目大意: 给你一菱形的数字阵,问从最上面走到最下面所能获得的最大值是多少? #include<cstdio> #include<cstring> #include<io ...

  7. App自动更新之通知栏下载

    见证过博客园的多次升级,你也希望你的软件通过更新发布新特性通知用户吧,是的.这篇文章是android开发人员的必备知识,是我特别为大家整理和总结的,不求完美,但是有用. 1.设计思路,使用Versio ...

  8. 解决wordpress的fonts.googleapis.com在国内无法访问的问题

    因为wordpress及主题的样式中几乎都使用了fonts.googleapis.com,而国内因为你知道的原因,是无法正常使用google服务的,因此导致在很多国内设备上打不开wordpress页面 ...

  9. Android Json数据解析

    1.通过主Activity的Button按钮进行解析 public class MainActivity extends Activity { private Button button=null; ...

  10. poj1019

    有一个序列 1 12 123 1234 ..... ........ ........... 12345678910 ................................ 求第n个数字是什 ...