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

逼真的HTML5樹葉飄落動畫
來源:易賢網 閱讀:1703 次 日期: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樹葉飄落動畫
由于各方面情況的不斷調整與變化,易賢網提供的所有考試信息和咨詢回復僅供參考,敬請考生以權威部門公布的正式信息和咨詢為準!

2026上岸·考公考編培訓報班

  • 報班類型
  • 姓名
  • 手機號
  • 驗證碼
關于我們 | 聯系我們 | 人才招聘 | 網站聲明 | 網站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 新媒體/短視頻平臺 | 手機站點 | 投訴建議
工業和信息化部備案號:滇ICP備2023014141號-1 云南省教育廳備案號:云教ICP備0901021 滇公網安備53010202001879號 人力資源服務許可證:(云)人服證字(2023)第0102001523號
云南網警備案專用圖標
聯系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢關注公眾號:hfpxwx
咨詢QQ:1093837350(9:00—18:00)版權所有:易賢網
云南網警報警專用圖標
中文字幕免费精品_亚洲视频自拍_亚洲综合国产激情另类一区_色综合咪咪久久
激情五月婷婷综合| 欧美日韩中文在线观看| 亚洲成色777777在线观看影院| 免费高清在线一区| 欧美日韩精品一区二区三区四区| 日韩视频一区二区三区在线播放| 亚洲精品乱码久久久久久日本蜜臀| 国产欧美欧洲在线观看| 在线中文字幕一区| 国内外成人在线视频| 日韩视频永久免费观看| 麻豆精品在线播放| 国产欧美日韩在线视频| 国产精品久久久一区二区三区 | 国产精品最新自拍| 国产精品看片资源| 亚洲国产天堂久久综合| 一本色道久久加勒比精品| 国产精品一区二区久久| 亚洲免费影视第一页| 亚洲另类黄色| 亚洲伊人网站| 在线观看成人网| 韩国av一区二区三区四区| 国产精品乱看| 国产精品www.| 国产精品国产福利国产秒拍| 欧美伦理在线观看| 欧美激情视频在线播放| 欧美激情女人20p| 欧美精品国产精品| 欧美精品三级日韩久久| 欧美精品观看| 欧美日韩亚洲激情| 欧美日韩亚洲一区二区三区在线观看| 老司机一区二区三区| 久久亚洲午夜电影| 免费在线成人av| 欧美二区在线| 欧美日韩国产一区二区| 欧美日韩播放| 国产精品国内视频| 国产女优一区| 国模吧视频一区| 1000部精品久久久久久久久| 在线日韩视频| 亚洲国产99| 亚洲狼人综合| 亚洲小说欧美另类社区| 欧美一级网站| 久久人人爽爽爽人久久久| 麻豆成人综合网| 欧美激情精品久久久久久变态| 欧美电影在线播放| 欧美日韩国产成人在线观看| 欧美性理论片在线观看片免费| 国产精品高潮呻吟视频| 国产免费成人av| 在线播放豆国产99亚洲| 亚洲精品一级| 亚洲伊人色欲综合网| 久久国产精品网站| 免费看精品久久片| 欧美日韩在线一区二区| 国产日韩亚洲欧美精品| 亚洲激情网址| 亚洲欧美日韩在线一区| 久久精品国语| 欧美日韩精品免费在线观看视频| 国产精品高潮视频| 国内精品久久久久久影视8| 亚洲区国产区| 午夜亚洲影视| 欧美大片免费观看| 国产精品你懂的在线| 激情亚洲一区二区三区四区| 亚洲美女网站| 久久av一区二区三区| 欧美激情视频一区二区三区在线播放 | 久久男人资源视频| 欧美区一区二| 国产视频观看一区| 亚洲激情影视| 欧美有码视频| 欧美日韩免费一区二区三区| 国产在线欧美| 一本不卡影院| 久久久久久久一区二区| 欧美日韩精品欧美日韩精品一| 国产在线观看91精品一区| 一本色道久久加勒比88综合| 久久精品国产亚洲高清剧情介绍| 欧美日韩视频专区在线播放 | 红桃视频欧美| 亚洲无亚洲人成网站77777| 久久婷婷综合激情| 国产精品久久久| 亚洲高清自拍| 欧美综合二区| 国产精品美女www爽爽爽视频| 亚洲第一福利在线观看| 亚洲综合日韩| 欧美日韩国产成人| 伊人久久成人| 欧美一区二区三区婷婷月色 | 国产精品青草综合久久久久99 | 久久免费的精品国产v∧| 国产精品久久久久久久浪潮网站| 亚洲国产国产亚洲一二三| 欧美一区二区精品在线| 欧美日韩1080p| 亚洲国产精品123| 久久成人在线| 国产精品萝li| 一区二区三区精品视频在线观看| 久久亚洲精品视频| 国产一区二区三区奇米久涩| 亚洲在线视频| 国产精品成人免费| 一区二区三区|亚洲午夜| 美女91精品| 激情五月***国产精品| 久久精品2019中文字幕| 国产情侣一区| 欧美一级久久久| 国产精品一区二区三区乱码| 亚洲狼人综合| 亚洲女同精品视频| 国产自产在线视频一区| 欧美日韩国产在线播放网站| 性欧美大战久久久久久久久| 国产一区二区高清不卡| 久久综合电影一区| 91久久精品日日躁夜夜躁欧美| 久久成人精品无人区| 国产精品理论片在线观看| 在线亚洲免费视频| 免费看的黄色欧美网站| 国产一区二区三区在线观看免费视频| 欧美日产国产成人免费图片| 国内精品久久久久影院优| 欧美日韩三级视频| 欧美激情成人在线视频| 久久久久久亚洲综合影院红桃 | 99精品国产热久久91蜜凸| 国内成人在线| 在线成人av网站| 国模吧视频一区| 国产亚洲亚洲| 在线成人激情黄色| 亚洲国产中文字幕在线观看| 国产精品电影网站| 欧美99久久| 亚洲免费在线观看视频| 亚洲深夜福利在线| 亚洲精品乱码久久久久久黑人| 国内激情久久| 国产三区二区一区久久| 欧美精品一二三| 国产精品一区在线观看你懂的| 国产精品有限公司| 亚洲一级片在线看| 老牛影视一区二区三区| 欧美α欧美αv大片| 国产日韩欧美三级| 激情综合五月天| 宅男66日本亚洲欧美视频| 久久久久一区二区| 国产精品久久夜| 夜夜躁日日躁狠狠久久88av| 久久久久国产精品一区| 欧美日韩亚洲高清| 亚洲一区二区三区四区五区午夜| 久久精品视频在线播放| 国产精品欧美日韩一区| 一区二区免费在线播放| 欧美紧缚bdsm在线视频| 国产一区二区三区的电影| 久久电影一区| 亚洲国产成人av在线| 欧美人成在线| 亚洲男人av电影| 国产精品夜色7777狼人| 亚洲主播在线观看| 国产精品一区在线观看| 性欧美大战久久久久久久久| 欧美精品七区| 一区二区日韩欧美| 欧美成人精品一区二区| 国产一区在线免费观看| 亚洲一区影院| 国产精品盗摄久久久| 亚洲少妇最新在线视频| 欧美日韩一区二区在线视频 | 在线观看中文字幕不卡| 久久亚洲欧美| 国产综合色一区二区三区| 欧美一级免费视频| 狠狠色狠狠色综合日日小说| 久久精品亚洲一区二区|