Главная » Файлы » Прочие скрипты » jQuery

Falling Leaves - падающие осенние листья на фоне вашего сайта на CSS3
[ Скачать с сервера (71.7 Kb) ] 07.10.14, 13:19:05



Продолжаем искать вкусности на осеннюю тематику. Перерыв кучу проектов и тонну старых скриптов осенних листопадов, которые, к моему удивлению, работают, но ужасно, я наконец-то набрёл на демонстрационную разработку листопада от Apple, немного подкорректировал её и теперь предоставляю вам на обозрение

Для начала посмотрите ДЕМО

Моё тестирование в фидле: КЛИК

Установка:

В самый низ вашего css вставляйте:
Код
#leafContainer
  {  
position: absolute;  
width: 100%;  
height: 300px;  
z-index:-1;  
  }  

  #leafContainer > div
  {  
position: absolute;  
width: 100px;  
height: 100px;  
z-index:-1;  
/* 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;  
z-index:-1;  
/* 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); }  
  }


Следующий код в самый верх страницы после тега < /head >:
Код
<script type='text/javascript' src="/js/leaves.js"></script>  
  <div id="leafContainer"></div>


Дальше настраивайте всё по своему вкусу как в css, так и в js файле

Скрипт из прикреплённого архива залейте в папку js, картинки - в папку img

Авторство данной разработки указано в копирайтах js файла

Материал подготовлен Apocalypse
Категория: jQuery | Добавил: Apocalypse | Теги: leaves, Листья, Осенние, Падающие, на, Вашего, фоне, Falling, сайта
Просмотров: 2892 | Загрузок: 335 | Комментарии: 4 | Рейтинг: 1.2/5
Всего комментариев: 4
0
Но в "лисичке" не робит (просьба ) Ярослав ,дружище подправь код ,

0
К сожалению, рассчитано только на вебкит браузеры sad

0
Клаззззз, забрал !Посмотреть тут

0
Ничёшно так smile

Имя *:
Email: