婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 知識庫 > 逼真的HTML5樹葉飄落動畫

逼真的HTML5樹葉飄落動畫

熱門標簽:南通數據外呼系統推廣 阜陽企業外呼系統 外呼系統電話怎么投訴 地圖標注位置能賺錢嗎 呼和浩特外呼電銷系統排名 外呼線穩定線路 pageadm實現地圖標注 申請400電話流程簡介 邢臺縣地圖標注app

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

源碼下載 演示地址

HTML代碼

XML/HTML Code復制內容到剪貼板
  1. <div id="container">  
  2.   <!-- The container is dynamically populated using the init function in leaves.js -->  
  3.   <!-- Its dimensions and position are defined using its id selector in leaves.css -->  
  4.   <div id="leafContainer"></div>  
  5.   <!-- its appearance, dimensions, and position are defined using its id selector in leaves.css -->  
  6.   <div id="message">  
  7.    <em>這是基于webkit的落葉動畫</em>  
  8.   </div>  
  9. </div>  

CSS代碼

CSS Code復制內容到剪貼板
  1. #container {   
  2.     positionrelative;   
  3.     height700px;   
  4.     width500px;   
  5.     margin10px auto;   
  6.     overflowhidden;   
  7.     border4px solid #5C090A;   
  8.     background#4E4226 url('images/backgroundLeaves.jpg'no-repeat top left;   
  9. }   
  10.   
  11. /* Defines the position and dimensions of the leafContainer div */  
  12. #leafContainer    
  13. {   
  14.     positionabsolute;   
  15.     width: 100%;   
  16.     height: 100%;   
  17. }   
  18.   
  19. /* Defines the appearance, position, and dimensions of the message div */  
  20. #message   
  21. {   
  22.     positionabsolute;   
  23.     top160px;   
  24.     width: 100%;   
  25.     height300px;   
  26.     background:transparent url('images/textBackground.png'repeat-x center;   
  27.     color#5C090A;   
  28.     font-size: 220%;   
  29.     font-family'Georgia';   
  30.     text-aligncenter;   
  31.     padding20px 10px;   
  32.     -webkit-box-sizing: border-box;   
  33.     -webkit-background-size: 100% 100%;   
  34.     z-index: 1;   
  35. }   
  36.   
  37. p {   
  38.   margin15px;   
  39. }   
  40.   
  41. a   
  42. {   
  43.   color#5C090A;   
  44.   text-decorationnone;   
  45. }   
  46.   
  47. /* Sets the color of the "Dino's Gardening Service" message */  
  48. em    
  49. {   
  50.     font-weightbold;   
  51.     font-stylenormal;   
  52. }   
  53.   
  54. .phone {   
  55.   font-size: 150%;   
  56.   vertical-alignmiddle;   
  57. }   
  58.   
  59. /* This CSS rule is applied to all div elements in the leafContainer div.  
  60.    It styles and animates each leafDiv.  
  61. */  
  62. #leafContainer > div    
  63. {   
  64.     positionabsolute;   
  65.     width100px;   
  66.     height100px;   
  67.   
  68.     /* We use the following properties to apply the fade and drop animations to each leaf.  
  69.        Each of these properties takes two values. These values respectively match a setting  
  70.        for fade and drop.  
  71.     */  
  72.     -webkit-animation-iteration-count: infinite, infinite;   
  73.     -webkit-animation-directionnormalnormal;   
  74.     -webkit-animation-timing-function: linear, ease-in;   
  75. }   
  76.   
  77. /* This CSS rule is applied to all img elements directly inside div elements which are  
  78.    directly inside the leafContainer div. In other words, it matches the 'img' elements  
  79.    inside the leafDivs which are created in the createALeaf() function.  
  80. */  
  81. #leafContainer > div > img {   
  82.      positionabsolute;   
  83.      width100px;   
  84.      height100px;   
  85.   
  86.     /* We use the following properties to adjust the clockwiseSpin or counterclockwiseSpinAndFlip  
  87.        animations on each leaf.  
  88.        The createALeaf function in the Leaves.js file determines whether a leaf has the   
  89.        clockwiseSpin or counterclockwiseSpinAndFlip animation.  
  90.     */  
  91.      -webkit-animation-iteration-count: infinite;   
  92.      -webkit-animation-direction: alternate;   
  93.      -webkit-animation-timing-function: ease-in-out;   
  94.      -webkit-transform-origin: 50% -100%;   
  95. }   
  96.   
  97. /* Hides a leaf towards the very end of the animation */  
  98. @-webkit-keyframes fade   
  99. {   
  100.     /* Show a leaf while into or below 95 percent of the animation and hide it, otherwise */  
  101.     0%   { opacity: 1; }   
  102.     95%  { opacity: 1; }   
  103.     100% { opacity: 0; }   
  104. }   
  105.   
  106. /* Makes a leaf fall from -300 to 600 pixels in the y-axis */  
  107. @-webkit-keyframes drop   
  108. {   
  109.     /* Move a leaf to -300 pixels in the y-axis at the start of the animation */  
  110.     0%   { -webkit-transform: translate(0px, -50px); }   
  111.     /* Move a leaf to 600 pixels in the y-axis at the end of the animation */  
  112.     100% { -webkit-transform: translate(0px650px); }   
  113. }   
  114.   
  115. /* Rotates a leaf from -50 to 50 degrees in 2D space */  
  116. @-webkit-keyframes clockwiseSpin   
  117. {   
  118.     /* Rotate a leaf by -50 degrees in 2D space at the start of the animation */  
  119.     0%   { -webkit-transform: rotate(-50deg); }   
  120.     /*  Rotate a leaf by 50 degrees in 2D space at the end of the animation */  
  121.     100% { -webkit-transform: rotate(50deg); }   
  122. }   
  123.   
  124. /* Flips a leaf and rotates it from 50 to -50 degrees in 2D space */  
  125. @-webkit-keyframes counterclockwiseSpinAndFlip    
  126. {   
  127.     /* Flip a leaf and rotate it by 50 degrees in 2D space at the start of the animation */  
  128.     0%   { -webkit-transform: scale(-1, 1) rotate(50deg); }   
  129.     /* Flip a leaf and rotate it by -50 degrees in 2D space at the end of the animation */  
  130.     100% { -webkit-transform: scale(-1, 1) rotate(-50deg); }   
  131. }   

JavaScript代碼

JavaScript Code復制內容到剪貼板
  1. /* Define the number of leaves to be used in the animation */  
  2. const NUMBER_OF_LEAVES = 30;   
  3.   
  4. /*   
  5.     Called when the "Falling Leaves" page is completely loaded.  
  6. */  
  7. function init()   
  8. {   
  9.     /* Get a reference to the element that will contain the leaves */  
  10.     var container = document.getElementById('leafContainer');   
  11.     /* Fill the empty container with new leaves */  
  12.     for (var i = 0; i < NUMBER_OF_LEAVES; i++)    
  13.     {   
  14.         container.appendChild(createALeaf());   
  15.     }   
  16. }   
  17.   
  18. /*  
  19.     Receives the lowest and highest values of a range and  
  20.     returns a random integer that falls within that range.  
  21. */  
  22. function randomInteger(low, high)   
  23. {   
  24.     return low + Math.floor(Math.random() * (high - low));   
  25. }   
  26.   
  27. /*  
  28.    Receives the lowest and highest values of a range and  
  29.    returns a random float that falls within that range.  
  30. */  
  31. function randomFloat(low, high)   
  32. {   
  33.     return low + Math.random() * (high - low);   
  34. }   
  35.   
  36. /*  
  37.     Receives a number and returns its CSS pixel value.  
  38. */  
  39. function pixelValue(value)   
  40. {   
  41.     return value + 'px';   
  42. }   
  43.   
  44. /*  
  45.     Returns a duration value for the falling animation.  
  46. */  
  47.   
  48. function durationValue(value)   
  49. {   
  50.     return value + 's';   
  51. }   
  52.   
  53. /*  
  54.     Uses an img element to create each leaf. "Leaves.css" implements two spin   
  55.     animations for the leaves: clockwiseSpin and counterclockwiseSpinAndFlip. This  
  56.     function determines which of these spin animations should be applied to each leaf.  
  57.  
  58. */  
  59. function createALeaf()   
  60. {   
  61.     /* Start by creating a wrapper div, and an empty img element */  
  62.     var leafDiv = document.createElement('div');   
  63.     var image = document.createElement('img');   
  64.   
  65.     /* Randomly choose a leaf image and assign it to the newly created element */  
  66.     image.src = 'images/realLeaf' + randomInteger(1, 5) + '.png';   
  67.   
  68.     leafDiv.style.top = "-100px";   
  69.   
  70.     /* Position the leaf at a random location along the screen */  
  71.     leafDiv.style.left = pixelValue(randomInteger(0, 500));   
  72.   
  73.     /* Randomly choose a spin animation */  
  74.     var spinAnimationName = (Math.random() < 0.5) ? 'clockwiseSpin' : 'counterclockwiseSpinAndFlip';   
  75.   
  76.     /* Set the -webkit-animation-name property with these values */  
  77.     leafDiv.style.webkitAnimationName = 'fade, drop';   
  78.     image.style.webkitAnimationName = spinAnimationName;   
  79.   
  80.     /* Figure out a random duration for the fade and drop animations */  
  81.     var fadeAndDropDuration = durationValue(randomFloat(5, 11));   
  82.   
  83.     /* Figure out another random duration for the spin animation */  
  84.     var spinDuration = durationValue(randomFloat(4, 8));   
  85.     /* Set the -webkit-animation-duration property with these values */  
  86.     leafDiv.style.webkitAnimationDuration = fadeAndDropDuration + ', ' + fadeAndDropDuration;   
  87.   
  88.     var leafDelay = durationValue(randomFloat(0, 5));   
  89.     leafDiv.style.webkitAnimationDelay = leafDelay + ', ' + leafDelay;   
  90.   
  91.     image.style.webkitAnimationDuration = spinDuration;   
  92.   
  93.     // add the <img> to the <div>   
  94.     leafDiv.appendChild(image);   
  95.   
  96.     /* Return this img element so it can be added to the document */  
  97.     return leafDiv;   
  98. }   
  99.   
  100. /* Calls the init function when the "Falling Leaves" page is full loaded */  
  101. window.addEventListener('load', init, false);   

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

標簽:德州 蚌埠 內蒙古 辛集 黃山 楊凌 撫順 鶴崗

巨人網絡通訊聲明:本文標題《逼真的HTML5樹葉飄落動畫》,本文關鍵詞  逼,真的,HTML5,樹葉,飄落,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《逼真的HTML5樹葉飄落動畫》相關的同類信息!
  • 本頁收集關于逼真的HTML5樹葉飄落動畫的相關信息資訊供網民參考!
  • 推薦文章
    婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av
    久久99精品国产麻豆婷婷| 欧美一区中文字幕| 日韩三级视频在线观看| av在线这里只有精品| 91在线你懂得| 日韩三级视频在线观看| 欧美白人最猛性xxxxx69交| 日韩免费福利电影在线观看| 日韩亚洲欧美综合| 精品伦理精品一区| 欧美日韩mp4| 一区二区三区高清不卡| 久久久久青草大香线综合精品| av在线不卡观看免费观看| 色欲综合视频天天天| 日本怡春院一区二区| 99久久国产免费看| 欧美精品第1页| 亚洲日本在线看| 成人性生交大片免费看视频在线| 在线观看亚洲专区| www国产成人| 亚洲一级电影视频| 99国产一区二区三精品乱码| 久久久久亚洲综合| 国产电影精品久久禁18| 日韩欧美高清dvd碟片| 一区二区三区日韩精品视频| 在线免费观看视频一区| 亚洲视频在线观看一区| 不卡一区在线观看| 亚洲天堂成人网| 91网站黄www| 亚洲欧美日韩国产一区二区三区| 国产成人免费在线观看不卡| 欧美国产日韩精品免费观看| www.亚洲色图.com| 亚洲欧美中日韩| 99久久er热在这里只有精品15| 亚洲色图欧美在线| 91在线观看免费视频| 日韩一区中文字幕| 国产精品77777| 欧美一区二区网站| 国内精品伊人久久久久av一坑| 日韩欧美中文字幕公布| 国精产品一区一区三区mba视频 | 欧美一区二区日韩| 一区二区三区在线免费| 欧美视频三区在线播放| 久久成人综合网| 国产色产综合色产在线视频| 91小视频免费观看| 久久99在线观看| 精品va天堂亚洲国产| 一区2区3区在线看| 色先锋aa成人| 青青草97国产精品免费观看无弹窗版| 精品剧情在线观看| 国产又黄又大久久| 自拍偷拍亚洲综合| 宅男在线国产精品| 处破女av一区二区| 亚洲一区二区三区四区五区中文| 精品处破学生在线二十三| 99国产精品久久久久久久久久| 一区二区三区日韩欧美精品| 欧美一区日本一区韩国一区| 成人网页在线观看| 青青国产91久久久久久| 久久久国产午夜精品| 欧美亚洲一区二区三区四区| 国产精品一二三四五| 亚洲成人tv网| 亚洲欧美日韩小说| 久久久精品免费免费| 欧美性一二三区| 国产成人综合在线播放| 国产精品 日产精品 欧美精品| 国产精品久久久一本精品 | 亚洲男人电影天堂| 日韩免费一区二区| 国产成人午夜片在线观看高清观看| 国产午夜精品久久久久久免费视| 欧美日韩一区二区三区免费看| 国产精品毛片久久久久久久| 成人av片在线观看| 国产精品久久久久久久第一福利| 色综合久久66| 粉嫩av一区二区三区| 国产亚洲欧美色| 在线成人高清不卡| 国产精品亚洲第一| 亚洲你懂的在线视频| 精品国产乱码久久久久久免费| 欧美影院午夜播放| 成人丝袜视频网| 性做久久久久久久免费看| 亚洲人成电影网站色mp4| 国产亚洲综合性久久久影院| 精品国产成人在线影院 | 日韩一级完整毛片| 丁香六月综合激情| 狠狠狠色丁香婷婷综合久久五月| 亚洲国产视频一区二区| 国产精品久久久久久久久动漫| 久久精品视频网| 欧美视频一区二区在线观看| 欧美在线视频你懂得| 狠狠色2019综合网| 精品亚洲aⅴ乱码一区二区三区| 日本成人中文字幕| 亚洲在线免费播放| 一区二区三区资源| 中文字幕中文字幕一区二区| 久久久夜色精品亚洲| 精品日韩一区二区| 日韩精品一区二| 精品卡一卡二卡三卡四在线| 99精品久久久久久| 成人听书哪个软件好| 色诱视频网站一区| 欧美日韩精品免费| 666欧美在线视频| 欧美一级xxx| 欧美一区二区三区日韩| 7777女厕盗摄久久久| 9191久久久久久久久久久| 欧美日韩国产免费| 欧美日本乱大交xxxxx| 欧美日韩视频在线观看一区二区三区 | 亚洲国产精品视频| 亚洲最大成人综合| 北条麻妃一区二区三区| 91看片淫黄大片一级在线观看| 91亚洲男人天堂| 欧美精品久久99| 精品剧情在线观看| 亚洲丝袜另类动漫二区| 亚洲乱码国产乱码精品精的特点 | 欧美一区二区二区| 久久精品免费在线观看| 亚洲天堂av老司机| 免费观看在线色综合| 午夜影院在线观看欧美| 寂寞少妇一区二区三区| 粉嫩久久99精品久久久久久夜| 色哦色哦哦色天天综合| 欧美日韩不卡一区| 久久女同互慰一区二区三区| 波多野结衣的一区二区三区| 欧美精品日韩一区| 91视频国产资源| 久久一日本道色综合| 亚洲狼人国产精品| 偷拍日韩校园综合在线| 麻豆久久久久久久| 日本高清视频一区二区| 日本人妖一区二区| 天堂一区二区在线免费观看| 亚洲三级在线免费观看| 在线观看91视频| 欧美三级电影在线看| 精品奇米国产一区二区三区| 亚洲三级在线播放| 尤物av一区二区| 老司机精品视频在线| 91麻豆成人久久精品二区三区| 欧美性大战久久久久久久| 亚洲免费观看高清完整| 毛片av中文字幕一区二区| 午夜精品一区二区三区电影天堂| 国产v综合v亚洲欧| 一本色道久久综合精品竹菊| 亚洲精品在线免费播放| 亚洲综合免费观看高清完整版在线 | 欧美午夜视频网站| 欧美成人vps| 欧美精品一区二区三区视频| 亚洲综合激情另类小说区| 国产精品456| 这里只有精品99re| 亚洲电影一级黄| 99re成人精品视频| 国产欧美日韩一区二区三区在线观看| 视频一区二区国产| gogo大胆日本视频一区| 日本韩国欧美一区二区三区| 国产精品青草综合久久久久99| 青青国产91久久久久久| 7799精品视频| 亚洲一区二区三区视频在线播放 | 精品成a人在线观看| 日日夜夜免费精品| 色狠狠综合天天综合综合| 国产精品久久夜| 欧美一区二区女人| 欧美国产欧美综合| 午夜a成v人精品| 国产成人精品www牛牛影视|