图片/图形

自动视频播放手机360度旋转效果

阿里云


这款作品给人的第一感觉是 flash 做的,但其实不然,它出自 css3 之手。并且它没有使用任何的图片,看过效果之后是不是觉得非常不可思议。iPhone 手机展示中的视频部分使用的是 html5 的 video,整个手机不论是高光、阴影,还是旋转动画都是使用 css3 完成。

HTML 结构

  1. <div id="scene3D">
  2.   <div id="iphone">
  3.     <div class="slab black">          
  4.       <div class="top"></div>
  5.       <div class="right"></div>
  6.       <div class="bottom"></div>
  7.       <div class="left"></div>
  8.       <div id="webcam">
  9.         <div id="flash"></div>
  10.       </div>
  11.       <div id="speaker-front">
  12.         <div class="dot"></div>
  13.         ...
  14.       </div>
  15.       <div id="screen">
  16.         <video controls autoplay muted loop src="http://www.htmleaf.com/assist/apple-html5-demo-tron-us_848x352.m4v" width="328.2" height="218"></video>
  17.       </div>
  18.       <div id="home-button">
  19.         <div id="square"></div>
  20.       </div>
  21.       <div class="front thickness-end"></div>
  22.       <div class="front thickness"></div>
  23.       <div class="front"></div>
  24.       <div class="back"></div>
  25.     </div>
  26.     <div class="slab">
  27.       <div class="top">
  28.         <div class="join"></div>
  29.         <div class="on-off">
  30.           <div class="on-off on-off-1"></div>
  31.           ...
  32.         </div>
  33.         <div id="earphone"></div>
  34.         <div id="click"></div>
  35.       </div>
  36.       <div class="right">
  37.         <div class="join"></div>
  38.         <div id="sim">
  39.           <div id="hole"></div>
  40.         </div>
  41.       </div>
  42.       <div class="bottom">
  43.         <div class="speaker">
  44.           <div class="dot"></div>
  45.           ...
  46.         </div>
  47.         <div class="screws">X</div>
  48.         <div id="dock">
  49.           <div id="connector"></div>
  50.         </div>
  51.         <div class="screws screws-right">X</div>
  52.         <div class="speaker speaker-right">
  53.           <div class="dot"></div>
  54.           ...
  55.         </div>
  56.       </div>
  57.       <div class="left">
  58.         <div id="ringtone">
  59.           <div class="lock">
  60.             <div class="lock lock-1"></div>
  61.             ...
  62.           </div>
  63.         </div>
  64.         <div class="volume">
  65.           <div class="volume volume-1"></div>
  66.           ...
  67.         </div>
  68.         <div class="volume volume-less">
  69.           <div class="volume volume-1"></div>
  70.           ...
  71.         </div>
  72.         <div class="join"></div>              
  73.       </div>
  74.       <div class="front"></div>
  75.       <div class="back"></div>
  76.     </div>
  77.     <div class="slab black black-back">
  78.       <div class="top"></div>
  79.       ...
  80.     </div>
  81.   </div>
  82. </div>
也想出现在这里?联系我们
创客主机

动画 css

  1. * {
  2.   -webkit-transform-style: preserve-3d;
  3.   transform-style: preserve-3d;
  4. }
  5. #scene3D {  
  6.   -webkit-perspective: 1200px;        
  7.   perspective: 1200px;  
  8. }
  9. #iphone {
  10.   width: 254px;
  11.   height: 500px;
  12.   margin: 50px auto 0;
  13.   -webkit-animation: rotateiphone 15s infinite linear;
  14.   animation: rotateiphone 15s infinite linear;
  15.   /*-webkit-transform: rotateX(45deg) rotateY(0deg) rotateZ(45deg);
  16.   transform: rotateX(45deg) rotateY(0deg) rotateZ(45deg);*/
  17. }
  18. @-webkit-keyframes rotateiphone {
  19.   from { 
  20.     -webkit-transform: rotateX(45deg ) rotateY(0deg ) rotateZ(45deg );
  21.   }
  22.   to {
  23.     -webkit-transform: rotateX(405deg ) rotateY(360deg ) rotateZ(405deg );
  24.   }
  25. }
  26. @keyframes rotateiphone {
  27.   from { 
  28.     transform: rotateX(45deg ) rotateY(0deg ) rotateZ(45deg );
  29.   }
  30.   to {
  31.     transform: rotateX(405deg ) rotateY(360deg ) rotateZ(405deg );
  32.   }
  33. }
  34. @-webkit-keyframes reflection {       
  35.   from { 
  36.     background-position: 300px 0, 0 0;
  37.   }
  38.   12% {
  39.     background-position: 0 0, 0 0;
  40.   }
  41.   15% { 
  42.     background-position: 300px 0, 0 0;
  43.   }       
  44.   43% {
  45.     background-position: 0 0, 0 0;
  46.   }
  47.   57% {
  48.     background-position: 300px 0, 0 0;
  49.   }         
  50.   to {
  51.     background-position: 300px 0, 0 0;
  52.   }       
  53. }
  54. @keyframes reflection {       
  55.   from { 
  56.     background-position: 300px 0, 0 0;
  57.   }
  58.   12% {
  59.     background-position: 0 0, 0 0;
  60.   }
  61.   15% { 
  62.     background-position: 300px 0, 0 0;
  63.   }       
  64.   43% {
  65.     background-position: 0 0, 0 0;
  66.   }
  67.   57% {
  68.     background-position: 300px 0, 0 0;
  69.   }         
  70.   to {
  71.     background-position: 300px 0, 0 0;
  72.   }       
  73. }

完整代码请参考下载包中的文件。

自动视频播放手机 360 度旋转效果

已有 516 人购买
查看演示升级 VIP立刻购买

演示地址 下载地址
收藏
(0)

发表回复

热销模板

Ashade - 作品展示摄影相册WordPress汉化主题
LensNews

本站承接 WordPress / PbootCMS / DedeCMS 等
系统建站、仿站、开发、定制等业务!