OLD | NEW |
(Empty) | |
| 1 |
| 2 <!DOCTYPE html> |
| 3 <html> |
| 4 <head> |
| 5 <meta http-equiv="content-type" content="text/html; charset=UTF-8"> |
| 6 <title> - jsFiddle demo by jmgoog</title> |
| 7 <link href='http://fonts.googleapis.com/css?family=Roboto:300' rel='stylesheet'
type='text/css'> |
| 8 |
| 9 <style type='text/css'> |
| 10 @-webkit-keyframes clip-animation { |
| 11 0% { |
| 12 -webkit-clip-path: polygon(-200px 0px, 0px 0px, -200px 200px, -200px 200
px, -200px 0px); |
| 13 } |
| 14 90% { |
| 15 -webkit-clip-path: polygon(-200px 0px, 400px 0px, 200px 200px, -200px 20
0px, -200px 0px); |
| 16 } |
| 17 } |
| 18 |
| 19 @-webkit-keyframes slide-animation |
| 20 { |
| 21 0% {left: -30px;} |
| 22 100% {left: 0px;} |
| 23 } |
| 24 |
| 25 .div1 |
| 26 { |
| 27 position: absolute; |
| 28 width:200px; |
| 29 height:200px; |
| 30 color:gray; |
| 31 font-size: 100pt; |
| 32 font-family: 'Roboto Light' sans-serif; |
| 33 font-weight: 300; |
| 34 } |
| 35 |
| 36 .div2 |
| 37 { |
| 38 -webkit-clip-path: polygon(0px 0px, 0px 0px, -40px 80px, 0px 80px, 0px 0px); |
| 39 position: absolute; |
| 40 width:240px; |
| 41 height:240px; |
| 42 color:gray; |
| 43 background-color: white; |
| 44 font-size: 100pt; |
| 45 font-family: 'Roboto Light' sans-serif; |
| 46 font-weight: 300; |
| 47 } |
| 48 |
| 49 .div2.hover { |
| 50 -webkit-animation: clip-animation 0.5s; |
| 51 -webkit-clip-path: polygon(0px 0px, 200px 0px, 200px 200px, 0px 200px, 0px 0
px); |
| 52 } |
| 53 |
| 54 .div3 |
| 55 { |
| 56 position: absolute; |
| 57 } |
| 58 |
| 59 .div3.hover { |
| 60 -webkit-animation: slide-animation 1.0s; |
| 61 } |
| 62 |
| 63 </style> |
| 64 |
| 65 |
| 66 |
| 67 <script type='text/javascript'>//<![CDATA[ |
| 68 window.onload=function(){ |
| 69 |
| 70 }//]]> |
| 71 setInterval(function() { |
| 72 document.querySelector('.div2').classList.toggle('hover'); |
| 73 document.querySelector('.div3').classList.toggle('hover'); |
| 74 }, 1500); |
| 75 </script> |
| 76 |
| 77 |
| 78 </head> |
| 79 <body> |
| 80 <body> |
| 81 |
| 82 <div class="div1">9°</div> |
| 83 <div class="div2"><div class="div3">23°</div> |
| 84 </div> |
| 85 |
| 86 </body> |
| 87 |
| 88 |
| 89 </body> |
| 90 |
| 91 |
| 92 </html> |
OLD | NEW |