中文字幕免费精品_亚洲视频自拍_亚洲综合国产激情另类一区_色综合咪咪久久

逼真的HTML5樹葉飄落動畫
來源:易賢網 閱讀:1802 次 日期:2016-07-07 14:02:30
溫馨提示:易賢網小編為您整理了“逼真的HTML5樹葉飄落動畫”,方便廣大網友查閱!

這款HTML5樹葉飄落動畫是基于webkit內核的,也就是說要在webkit內核的瀏覽器上才能使用這款動畫。

名單

HTML代碼

XML/HTML Code

<div id="container">  

  <!-- The container is dynamically populated using the init function in leaves.js -->  

  <!-- Its dimensions and position are defined using its id selector in leaves.css -->  

  <div id="leafContainer"></div>  

  <!-- its appearance, dimensions, and position are defined using its id selector in leaves.css -->  

  <div id="message">  

   <em>這是基于webkit的落葉動畫</em>  

  </div>  

</div>  

CSS代碼

CSS Code

#container {   

    position: relative;   

    height: 700px;   

    width: 500px;   

    margin: 10px auto;   

    overflow: hidden;   

    border: 4px solid #5C090A;   

    background: #4E4226 url('images/backgroundLeaves.jpg') no-repeat top left;   

}   

/* Defines the position and dimensions of the leafContainer div */  

#leafContainer    

{   

    position: absolute;   

    width: 100%;   

    height: 100%;   

}   

/* Defines the appearance, position, and dimensions of the message div */  

#message   

{   

    position: absolute;   

    top: 160px;   

    width: 100%;   

    height: 300px;   

    background:transparent url('images/textBackground.png') repeat-x center;   

    color: #5C090A;   

    font-size: 220%;   

    font-family: 'Georgia';   

    text-align: center;   

    padding: 20px 10px;   

    -webkit-box-sizing: border-box;   

    -webkit-background-size: 100% 100%;   

    z-index: 1;   

}   

p {   

  margin: 15px;   

}   

a   

{   

  color: #5C090A;   

  text-decoration: none;   

}   

/* Sets the color of the "Dino's Gardening Service" message */  

em    

{   

    font-weight: bold;   

    font-style: normal;   

}   

.phone {   

  font-size: 150%;   

  vertical-align: middle;   

}   

/* This CSS rule is applied to all div elements in the leafContainer div.  

   It styles and animates each leafDiv.  

*/  

#leafContainer > div    

{   

    position: absolute;   

    width: 100px;   

    height: 100px;   

    /* We use the following properties to apply the fade and drop animations to each leaf.  

       Each of these properties takes two values. These values respectively match a setting  

       for fade and drop.  

    */  

    -webkit-animation-iteration-count: infinite, infinite;   

    -webkit-animation-direction: normal, normal;   

    -webkit-animation-timing-function: linear, ease-in;   

}   

/* This CSS rule is applied to all img elements directly inside div elements which are  

   directly inside the leafContainer div. In other words, it matches the 'img' elements  

   inside the leafDivs which are created in the createALeaf() function.  

*/  

#leafContainer > div > img {   

     position: absolute;   

     width: 100px;   

     height: 100px;   

    /* We use the following properties to adjust the clockwiseSpin or counterclockwiseSpinAndFlip  

       animations on each leaf.  

       The createALeaf function in the Leaves.js file determines whether a leaf has the   

       clockwiseSpin or counterclockwiseSpinAndFlip animation.  

    */  

     -webkit-animation-iteration-count: infinite;   

     -webkit-animation-direction: alternate;   

     -webkit-animation-timing-function: ease-in-out;   

     -webkit-transform-origin: 50% -100%;   

}   

/* Hides a leaf towards the very end of the animation */  

@-webkit-keyframes fade   

{   

    /* Show a leaf while into or below 95 percent of the animation and hide it, otherwise */  

    0%   { opacity: 1; }   

    95%  { opacity: 1; }   

    100% { opacity: 0; }   

}   

/* Makes a leaf fall from -300 to 600 pixels in the y-axis */  

@-webkit-keyframes drop   

{   

    /* Move a leaf to -300 pixels in the y-axis at the start of the animation */  

    0%   { -webkit-transform: translate(0px, -50px); }   

    /* Move a leaf to 600 pixels in the y-axis at the end of the animation */  

    100% { -webkit-transform: translate(0px, 650px); }   

}   

/* Rotates a leaf from -50 to 50 degrees in 2D space */  

@-webkit-keyframes clockwiseSpin   

{   

    /* Rotate a leaf by -50 degrees in 2D space at the start of the animation */  

    0%   { -webkit-transform: rotate(-50deg); }   

    /*  Rotate a leaf by 50 degrees in 2D space at the end of the animation */  

    100% { -webkit-transform: rotate(50deg); }   

}   

/* Flips a leaf and rotates it from 50 to -50 degrees in 2D space */  

@-webkit-keyframes counterclockwiseSpinAndFlip    

{   

    /* Flip a leaf and rotate it by 50 degrees in 2D space at the start of the animation */  

    0%   { -webkit-transform: scale(-1, 1) rotate(50deg); }   

    /* Flip a leaf and rotate it by -50 degrees in 2D space at the end of the animation */  

    100% { -webkit-transform: scale(-1, 1) rotate(-50deg); }   

}   

JavaScript代碼

JavaScript Code復制內容到剪貼板

/* Define the number of leaves to be used in the animation */  

const NUMBER_OF_LEAVES = 30;   

/*   

    Called when the "Falling Leaves" page is completely loaded.  

*/  

function init()   

{   

    /* Get a reference to the element that will contain the leaves */  

    var container = document.getElementById('leafContainer');   

    /* Fill the empty container with new leaves */  

    for (var i = 0; i < NUMBER_OF_LEAVES; i++)    

    {   

        container.appendChild(createALeaf());   

    }   

}   

/*  

    Receives the lowest and highest values of a range and  

    returns a random integer that falls within that range.  

*/  

function randomInteger(low, high)   

{   

    return low + Math.floor(Math.random() * (high - low));   

}   

/*  

   Receives the lowest and highest values of a range and  

   returns a random float that falls within that range.  

*/  

function randomFloat(low, high)   

{   

    return low + Math.random() * (high - low);   

}   

/*  

    Receives a number and returns its CSS pixel value.  

*/  

function pixelValue(value)   

{   

    return value + 'px';   

}   

/*  

    Returns a duration value for the falling animation.  

*/  

function durationValue(value)   

{   

    return value + 's';   

}   

/*  

    Uses an img element to create each leaf. "Leaves.css" implements two spin   

    animations for the leaves: clockwiseSpin and counterclockwiseSpinAndFlip. This  

    function determines which of these spin animations should be applied to each leaf.  

*/  

function createALeaf()   

{   

    /* Start by creating a wrapper div, and an empty img element */  

    var leafDiv = document.createElement('div');   

    var image = document.createElement('img');   

    /* Randomly choose a leaf image and assign it to the newly created element */  

    image.src = 'images/realLeaf' + randomInteger(1, 5) + '.png';   

    leafDiv.style.top = "-100px";   

    /* Position the leaf at a random location along the screen */  

    leafDiv.style.left = pixelValue(randomInteger(0, 500));   

    /* Randomly choose a spin animation */  

    var spinAnimationName = (Math.random() < 0.5) ? 'clockwiseSpin' : 'counterclockwiseSpinAndFlip';   

    /* Set the -webkit-animation-name property with these values */  

    leafDiv.style.webkitAnimationName = 'fade, drop';   

    image.style.webkitAnimationName = spinAnimationName;   

    /* Figure out a random duration for the fade and drop animations */  

    var fadeAndDropDuration = durationValue(randomFloat(5, 11));   

    /* Figure out another random duration for the spin animation */  

    var spinDuration = durationValue(randomFloat(4, 8));   

    /* Set the -webkit-animation-duration property with these values */  

    leafDiv.style.webkitAnimationDuration = fadeAndDropDuration + ', ' + fadeAndDropDuration;   

    var leafDelay = durationValue(randomFloat(0, 5));   

    leafDiv.style.webkitAnimationDelay = leafDelay + ', ' + leafDelay;   

    image.style.webkitAnimationDuration = spinDuration;   

    // add the <img> to the <div>   

    leafDiv.appendChild(image);   

    /* Return this img element so it can be added to the document */  

    return leafDiv;   

}   

/* Calls the init function when the "Falling Leaves" page is full loaded */  

window.addEventListener('load', init, false);   

以上就是本文的全部內容,希望對大家學習有所幫助。

更多信息請查看網頁制作
易賢網手機網站地址:逼真的HTML5樹葉飄落動畫
由于各方面情況的不斷調整與變化,易賢網提供的所有考試信息和咨詢回復僅供參考,敬請考生以權威部門公布的正式信息和咨詢為準!
關于我們 | 聯系我們 | 人才招聘 | 網站聲明 | 網站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 新媒體/短視頻平臺 | 手機站點

版權所有:易賢網

中文字幕免费精品_亚洲视频自拍_亚洲综合国产激情另类一区_色综合咪咪久久
欧美日韩在线播放一区| 欧美日韩国产免费| 粉嫩高潮美女一区二区三区| 国产福利一区二区三区在线视频| 日韩国产精品久久久久久亚洲| 亚洲成av人片www| 性久久久久久久久久久久| 亚洲风情在线资源站| 日本中文字幕一区| 国产美女精品一区二区三区| 国产999精品久久| 国产suv一区二区三区88区| 丁香六月久久综合狠狠色| 99久久亚洲一区二区三区青草| 色婷婷综合久久久久中文| 欧洲精品在线观看| 日韩一区二区三区电影在线观看| 欧美精品一区二区三区在线播放| 国产欧美视频一区二区三区| 亚洲欧美日韩国产手机在线 | 亚洲综合久久久久| 男女男精品视频| 国产一区不卡在线| 精品久久久久香蕉网| 欧美videossexotv100| 中文字幕乱码一区二区免费| 亚洲精品日日夜夜| 麻豆精品国产91久久久久久| 成人国产亚洲欧美成人综合网| 在线看国产日韩| 26uuu国产日韩综合| 一区二区在线免费| 国产一区二区伦理片| 欧美性受xxxx黑人xyx性爽| 日韩欧美国产电影| ...xxx性欧美| 日韩av电影一区| 成人app网站| 欧美一区二区三区不卡| 国产精品福利影院| 免费不卡在线观看| 91免费国产在线观看| 欧美变态tickle挠乳网站| 亚洲精品免费看| 成人激情免费视频| 日韩一级大片在线观看| 亚洲最快最全在线视频| 国产馆精品极品| 欧美一级夜夜爽| 樱花影视一区二区| 成人视屏免费看| 精品久久久久久无| 亚洲成人av一区二区| 97se狠狠狠综合亚洲狠狠| 精品成人一区二区| 日韩在线一区二区三区| 一本色道亚洲精品aⅴ| 中日韩免费视频中文字幕| 久久精品国产免费看久久精品| 色婷婷久久综合| 中文字幕av一区二区三区| 国内一区二区在线| 日韩精品一区二区三区四区 | 91麻豆国产自产在线观看| 久久久久久一级片| 麻豆91在线观看| 91精品国产欧美一区二区18| 亚洲午夜免费电影| 欧美在线|欧美| 亚洲综合色自拍一区| 91成人免费在线| 亚洲精品伦理在线| 欧美在线免费观看亚洲| 亚洲bt欧美bt精品777| 欧美色网一区二区| 日本中文一区二区三区| 欧美一级搡bbbb搡bbbb| 极品少妇xxxx偷拍精品少妇| 精品粉嫩aⅴ一区二区三区四区| 久久99精品久久久| 国产日韩欧美综合在线| 从欧美一区二区三区| 国产精品久久福利| 日本久久一区二区三区| 亚洲成av人影院| 日韩女同互慰一区二区| 久久黄色级2电影| 国产亚洲欧美日韩在线一区| 成人禁用看黄a在线| 曰韩精品一区二区| 91精品久久久久久久91蜜桃| 久久99热这里只有精品| 国产精品免费久久| 日本韩国欧美在线| 五月天亚洲精品| 久久免费电影网| 99久久免费国产| 视频一区欧美日韩| 久久亚洲一级片| 91国内精品野花午夜精品| 天天色天天操综合| 国产精品网站在线观看| 欧美性生活一区| 国产综合色在线视频区| 亚洲婷婷综合久久一本伊一区| 7777精品伊人久久久大香线蕉的| 久久99日本精品| 依依成人精品视频| 欧美xxxxx裸体时装秀| 91原创在线视频| 久久精品国产久精国产| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆 | 国产一区视频在线看| 亚洲精品国产第一综合99久久| 日韩欧美一二区| 97久久精品人人做人人爽| 美国毛片一区二区三区| 日韩一区在线免费观看| 精品日韩在线一区| 欧美日韩一区二区三区四区五区| 国产一区二区电影| 热久久一区二区| 亚洲情趣在线观看| 久久品道一品道久久精品| 欧美肥妇bbw| 色综合天天综合网天天看片| 国产中文一区二区三区| 午夜一区二区三区视频| 亚洲欧洲精品一区二区精品久久久| 欧美成人高清电影在线| 欧美另类变人与禽xxxxx| 白白色 亚洲乱淫| 国产精品亚洲第一| 免费av成人在线| 亚洲高清免费视频| 洋洋成人永久网站入口| 自拍偷拍欧美精品| 国产精品毛片久久久久久久| 久久青草欧美一区二区三区| 日韩欧美中文一区二区| 欧美精品在线观看一区二区| 欧美性猛片aaaaaaa做受| 91小视频免费观看| 99热国产精品| 99久久精品一区| 972aa.com艺术欧美| 成人精品gif动图一区| 成人黄动漫网站免费app| 国产激情偷乱视频一区二区三区| 国产做a爰片久久毛片| 国产真实乱对白精彩久久| 国产iv一区二区三区| 国产剧情一区在线| 成人午夜电影小说| 成人做爰69片免费看网站| 成人午夜在线视频| 91丨porny丨最新| 91久久免费观看| 欧美网站大全在线观看| 欧美精品乱码久久久久久按摩| 欧美午夜精品免费| 4438成人网| 久久久国产精品午夜一区ai换脸| 国产女人水真多18毛片18精品视频| 日本一区二区三区电影| 亚洲天堂网中文字| 亚洲高清视频的网址| 日日夜夜一区二区| 黄网站免费久久| 国产成人精品综合在线观看| 成人免费电影视频| 欧美日韩一区中文字幕| 日韩一区二区三区精品视频 | 欧美日韩中文字幕精品| 正在播放亚洲一区| 久久女同互慰一区二区三区| 自拍偷自拍亚洲精品播放| 午夜精品一区二区三区免费视频| 久久精品噜噜噜成人av农村| 国产成a人无v码亚洲福利| 色88888久久久久久影院按摩 | 欧美一区二区三区爱爱| 精品国产一区二区三区av性色 | 678五月天丁香亚洲综合网| 日韩午夜在线观看视频| 亚洲国产高清在线| 天堂va蜜桃一区二区三区漫画版| 精品一区二区三区av| 91老师国产黑色丝袜在线| 日韩精品一区二区三区老鸭窝 | 国产福利91精品一区| 欧美在线观看视频一区二区| 精品电影一区二区| 亚洲一区二区综合| www.日韩av| 精品三级av在线| 丝袜美腿高跟呻吟高潮一区| av网站免费线看精品| 久久久综合视频| 日本在线不卡视频|