<!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>

最新文章

  1. C#进阶系列——DDD领域驱动设计初探(七):Web层的搭建
  2. 还原数据库:The backup set holds a backup of a database other than the existing database……
  3. 原生js tab 栏切换
  4. Windows下修改Oracle监听端口
  5. Oracle中的Temporary tablespace的作用
  6. extjs基础 使用图标字体来美化按钮)
  7. java 静态构造函数
  8. Headfirst设计模式的C++实现——工厂方法(Factory Method)
  9. 自学Zabbix3.5.6-监控项item-Value mapping值映射
  10. MM-移动类型
  11. Java中String直接赋字符串和new String的区别(面试常考)
  12. webpack 自动发现 entry 的配置和引用方式
  13. 浅尝辄止之MongoDB
  14. SQL Performance Analyzer
  15. BZOJ3672: [Noi2014]购票【CDQ分治】【点分治】【斜率优化DP】
  16. mini-parser
  17. Bean的自动装配及作用域
  18. [Pytorch]Pytorch 保存模型与加载模型(转)
  19. java入门---对象和类&amp;概念详解&amp;实例
  20. Unity5.1 新的网络引擎UNET(九) UNET 官方推荐视频教程

热门文章

  1. 项目管理模式——Projects
  2. cocos creater 简单的跳跃动作。
  3. 关于wtl的一个实验
  4. 转:六百字读懂Git
  5. 转:Google技术开发指南:给大学生自学的建议
  6. Java 可视化垃圾回收
  7. C# IOCP服务器
  8. ESXI转HYPER-V,问题接二连三啊(VMDK转VHD)
  9. JSP页面的异常处理&lt;转&gt;
  10. bzoj3230