zoukankan      html  css  js  c++  java
  • 【CSS3】横屏引导小动画

    演示地址:http://codepen.io/anon/pen/oXbXdX

    主要知识点:

     @media all and (orientation : landscape) { /*  这是匹配横屏的状态,横屏时的css代码  */} 

     @media all and (orientation : portrait){ /*  这是匹配竖屏的状态,竖屏时的css代码  */}

    animation:

    name( keyframe 名称)
    duration (规定完成动画所花费的时间,以秒或毫秒计)
    timing-function (规定动画的速度曲线)
    delay (规定在动画开始之前的延迟)
    iteration-count (规定动画应该播放的次数)
    direction(规定是否应该轮流反向播放动画)

    HTML

    <!DOCTYPE html>
    <html lang="en">
    <head>
    	<meta charset="UTF-8">
         <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" name="viewport">
         <meta content="yes" name="apple-mobile-web-app-capable">
         <meta content="black" name="apple-mobile-web-app-status-bar-style">
         <meta content="telephone=no" name="format-detection">
         <meta content="email=no" name="format-detection">
    	<title>@keyframes Screen Rotation</title>
    </head>
    <body>
    <div class="cubic">
    	<img  class="oMove" src="http://note.youdao.com/yws/public/resource/5f8d8cc6e6722e4514141c815c87c1b8/803E63652A65490D8B80D1A4AAD902AC">
    	<p>横屏观看,体验更佳</p>
    </div>
    	
    </body>
    
    
    </html>
    

      

     

    CSS

    	body{
    		background-color: #000000;
    		color:#fff;
    		font-size: 13px;
    	}
    
    	.cubic{
    		 200px;
    		height: 200px;
    		position: absolute;
        	top: 0;
        	right:0;
        	bottom: 0;
        	left: 0;  
        	margin:auto;
            text-align: center;
    	}
        
        .oMove{
        	/*animation: 
        	name( keyframe 名称) 
        	duration (规定完成动画所花费的时间,以秒或毫秒计)
        	timing-function (规定动画的速度曲线)
        	delay (规定在动画开始之前的延迟)
        	iteration-count (规定动画应该播放的次数)
        	direction(规定是否应该轮流反向播放动画)
        	*/
        	-webkit-animation:oReverse 2.5s infinite 1.0s linear;
        	-webkit-transform:rotate(90deg);
        	animation:oReverse 2.5s infinite 1.0s linear;
        	transform:rotate(90deg);
        }
    
    		@-webkit-keyframes oReverse{
    		0%{-webkit-transform:rotate(90deg);}
    		25%{-webkit-transform:translate(0);}
    		75%{-webkit-transform:translate(0);}
    		100%{-webkit-transform:translate(90deg);}
    		}
    		@keyframes oReverse{
    		0%{-webkit-transform:rotate(90deg);}
    		25%{-webkit-transform:translate(0);}
    		75%{-webkit-transform:translate(0);}
    		100%{-webkit-transform:translate(90deg);}
    		}
    		@media screen and (orientation:landscape){
    		 /*横屏的时候*/
    		.oReverse{display:none!important}
    		}
    

      

      

  • 相关阅读:
    往Matlab中添加工具包
    Deeplearning——Logistics回归
    String类
    机器学习概念性内容整理
    系统的响应与解
    将MathType公式转换为LaTex格式
    【转载】【翻译】Breaking things is easy///机器学习中安全与隐私问题(对抗性攻击)
    在LaTex中插入电路图的方法(插入图片)
    第三章——供机器读取的数据(CSV与JSON)
    第一、二章——Python简介与Python基础
  • 原文地址:https://www.cnblogs.com/kevinCoder/p/4487583.html
Copyright © 2011-2022 走看看