Скрипт падающие снежинки на сайте
К новому году хочется украсить свой сайт. По данному адресу (http://www.schillmania.com/projects/snowstorm/) можно скачать хороший скрипт для снежинок на сайте.
Он настраиваемый и достаточно легкий и адаптивный )) Так что Всех с наступающим новым годом и пользуйтесь на здоровье!
И немного теории по настройке снегопада на экране..
Snowstorm: A JavaScript Snow Effect for HTML
Bringing snow to the web since 2003. This version: 1.44.20131208
Change Wind | Stop Snowing | Bonus widget: Smash Christmas Lights
Let It Snow.
So, you want JavaScript snow on your web site, eh?
Snowstorm is a JavaScript-driven snow effect that can be easily added to web pages. It is free for use, and easy to set up. A single JavaScript file provides the functionality required. No images are used for the snow effect.
I'd like to use this on my site.
This is all you need to get started:
<script src="/snowstorm.js"></script>
See this basic example for reference.
What kind of things can I customize?
You can adjust the snow speed, the amount of snow, the "wind", if and where it should stick (and if it should "melt"), and finally, whether the snow can react to the mouse moving (ie., "wind changes.") See Customizing Snowstorm for more.
And the Christmas Lights?
The christmas lights are a separate experimental script which also has an example. It is undocumented, but the script can be modified to taste if you're the adventurous type.
Download
ZIP file, includes this demo page and source code.
Also on Github: github.com/scottschiller/snowstorm/
License
Snowstorm is provided under a BSD license.
Technical Notes
Snowstorm works under modern browsers, and as far back as IE 6 - possibly even 5.5, if you can find a copy!
If you are seeing snow as you read this, then the script is working as expected.
CPU Use
Snowstorm can eat up a lot of CPU, even on modern computers, because of the number of elements being moved around the screen at once. The basic example may have notably lower CPU use as it doesn't include the christmas lights, and the page layout is much simpler. Consider raising the animation interval, and lowering the amount of snowflakes (active and max) to help reduce CPU use.
Where supported, Snowstorm will attempt to use GPU-based hardware acceleration to draw and animate the snow. Having GPU acceleration can help in reducing CPU load.
Mobile Support
By default, mobile devices are excluded from the snow effect to be nice to their CPUs (and batteries.) If your local marketing department insists, "This must work on mobile!" despite being warned of the downsides, you can setsnowStorm.excludeMobile = false; (or edit the snowstorm.js file directly) to enable Snowstorm on devices like the iPhone, iPad and Android phones etc. This demo page has the effect enabled for mobile devices.
Implementation
One JavaScript reference is required. Aside from customization, that's it!
<script src="/snowstorm.js"></script>
Once you have snowstorm configured, you can use the optimized, minified version of the code (~40% smaller):
<script src="/snowstorm-min.js"></script>
Customizing Snowstorm
Once you have Snowstorm running in your page, you can customize its properties either by editing the snowstorm.js file directly, or assigning new values to the snowStorm object after snowstorm.js has loaded.
For example:
<!-- required snowstorm JS, default behaviour --> <script src="/snowstorm.js"></script> <!-- now, we'll customize the snowStorm object --> <script> snowStorm.snowColor = '#99ccff'; // blue-ish snow!? snowStorm.flakesMaxActive = 96; // show more snow on screen at once snowStorm.useTwinkleEffect = true; // let the snow flicker in and out of view </script>
See this customized example in action.
Configurable Properties
Snowstorm can be fairly easily customized; some of the major properties are listed below.
snowStorm.autoStart = true;- Whether the snow should start automatically or not.
snowStorm.animationInterval = 33;- Theoretical "milliseconds per frame" measurement. 20 = fast + smooth, but high CPU use. 50 = more conservative, but slower
snowStorm.flakeBottom = null;- Limits the "floor" (pixels) of the snow. If unspecified, snow will "stick" to the bottom of the browser window and persists through browser resize/scrolling.
snowStorm.flakesMax = 128;- Sets the maximum number of snowflakes that can exist on the screen at any given time.
snowStorm.flakesMaxActive = 64;- Sets the limit of "falling" snowflakes (ie. moving on the screen, thus considered to be active.)
snowStorm.followMouse = true;- Allows snow to move dynamically with the "wind", relative to the mouse's X (left/right) coordinates.
snowStorm.freezeOnBlur = true;- Stops the snow effect when the browser window goes out of focus, eg., user is in another tab. Saves CPU, nicer to user.
snowStorm.snowColor = '#fff';- Don't eat (or use?) yellow snow.
snowStorm.snowCharacter = '•';- • (•) = bullet. · entity (·) is not used as it's square on some systems etc. Changing this may result in cropping of the character and may require flakeWidth/flakeHeight changes, so be careful.
snowStorm.snowStick = true;- Allows the snow to "stick" to the bottom of the window. When off, snow will never sit at the bottom.
snowStorm.targetElement = null;- An HTML element which snow will be appended to (default: document body.) Can be an element ID string eg. 'myDiv', or a DOM node reference. See relative and absolute-positioned examples.
snowStorm.useMeltEffect = true;- When recycling fallen snow (or rarely, when falling), have it "melt" and fade out if browser supports it
snowStorm.useTwinkleEffect = true;- Allow snow to randomly "flicker" in and out of view while falling
snowStorm.usePositionFixed = false;- true = snow not affected by window scroll. may increase CPU load, disabled by default - if enabled, used only where supported.
snowStorm.vMaxX = 8;
snowStorm.vMaxY = 5;- Defines maximum X and Y velocities for the storm; a random value in this range is selected for each snowflake.
Methods
Snowstorm has a few basic methods for controlling the snow effect.
snowStorm.randomizeWind()- Sets the wind speed with a random value relative to vMaxX and vMaxY properties.
snowStorm.freeze()- Stops the snow effect in place.
snowStorm.resume()- Continues snowing from a "frozen" state.
snowStorm.toggleSnow()- Enables or disables the snow effect depending on state, same as calling freeze() or resume().
snowStorm.stop()- Freezes and kills the snowstorm effect, and removes related event handlers. Snowstorm will not work properly if other methods are called after stop().
Version History
Older versions
- Snowstorm v1.44.20131125
- Snowstorm v1.44.20131111
- Snowstorm v1.43.20111201
- Snowstorm v1.42.20111120
- Snowstorm v1.41.20101113
- Snowstorm v1.4.20091115
- Snowstorm v1.3.20081215
- Snowstorm v1.3.20081208
- Snowstorm v1.2.20041121a
- Snowstorm v1.2.20031218a
- Snowstorm v1.2.20031213a
- Snowstorm v1.1.20031206c
1.44.20131208
- Added
usePixelPositionto allow forcing of pixels for left/top positioning vs. percentage-based values. - Detect and force pixel-based positioning if
targetElementis specified, orbodyis relatively-positioned. - Adjust positioning logic for
targetElementcase.
1.44.20131125
- Fixed regression where
flakeBottomwould result in snow not properly sticking. - Percent based left/right positioning is now applied in all browsers, making resizing better.
1.44.20131111
- GPU (hardware)-accelerated snow, where supported. Faster drawing, less load on CPU.
- Percent-based bottom/right positioning of snow, rather than top/left-based pixel-based positioning (where supported.)
- JSLint cleanup.
- Fixed the color of christmas light fragments to match the lights, finally.
- Design/layout tweaks, slightly more modern.
1.43.20111201
- ImageOptim-optimized image files (byte savings)
- Added snowStorm.autoStart, for those who want to start snow at their own leisure
- Additional Mobile check: Opera Mobile
- cursor:default over snow (instead of text I-beam cursor)
- meltFrame animation counter correction (possible JS error fix)
1.42.20111120
- Tweaked right margin for IE 9 under Windows 7, fixing horizontal scrollbar issue
- Re-appeased the jslint gods
1.41.20101113
- Added formal BSD license (project was previously "free for any use.")
- Modernized event add/remove handlers, wait for window.onload() before starting
- New excludeMobile option, ignore iPhone etc. by default (high CPU use on mobile is evil for both CPU, and batteries.)
- New freezeOnBlur option, allow control of previously-hardcoded behaviour
- Focus-based freezeOnBlur now works under IE 6, too
- Code cleanup, now passes updated (more-strict) jslint validation
1.4.20091115
- Text-based snow (and color options) using "bullet" HTML entity • .. no more images!
- New snowMelt effect, resize + fade where supported
- New twinkle effect (like stars)
- New animationInterval, usePositionFixed, snowColor attributes, common attributes now public on snowStorm object eg. snowStorm.stick = true;
- Code passes jslint validation (2009-10-04 edition, default settings)
- Removed "collect" feature, somewhat-buggy and nobody used it
- Fixed sticky/recycle behaviour
1.3.20081215
- IE doctype rendering tweak: position:absolute used for "BackCompat" (HTML 4 transitional) DOCTYPE in IE.
- Fixed an annoying horizontal scrollbar positioning-related bug with wind affecting snow near the right edge.
1.3.20081208
- New snowStick (snow stickiness) and followMouse (dynamic wind) options.
- Four years later, we still have IE 6 and can't use position:fixed globally for "sticky" snow, but we're really close.
- Position:fixed used for all more modern browsers.
- Improved distribution of initial snow dump, new recycling.
- Focus/blur events (minus IE) for graceful pausing of snow, sparing user's CPU when window not in focus.
- Bonus smashable christmas lights demo, using SoundManager 2 and YUI DOM/Event libraries
- Cleaner, simplified event code, removal of old PNG wrapper stuff.
1.2.20041121a
- Script moved into one file (snowstorm.js) for simplicity
- addEventHandler and PNG support functions updated
1.2.20031218a
- Opera 7 ("O7") support added.. I think.
- Improved initialization speed (less snowflake objects on startup)
- Err.. That's about it.
1.2.20031213a
- Netscape 6.x "sticky" snow behavior fixed (now works)
- IE:mac bug event handler bug fixed (script should now work)
- Snow collection feature added
- Snowflake speed is relative to size (Cheap pseudo-3D effect)
1.1.20031206c
- Initial release
Feedback
Comments, suggestions, questions, criticism?
A few contact options are available. Get in touch via email or IM.
Elsewhere On The Internets
This is a side project by Scott Schiller. Wacky DHTML/JavaScript experiments and other nonsense can be found at schillmania.com.
|
К новому году хочется украсить свой сайт. Скрипт падающие снежинки на сайте. |
РэдЛайн, создание сайта, заказать сайт, разработка сайтов, реклама в Интернете, продвижение, маркетинговые исследования, дизайн студия, веб дизайн, раскрутка сайта, создать сайт компании, сделать сайт, создание сайтов, изготовление сайта, обслуживание сайтов, изготовление сайтов, заказать интернет сайт, создать сайт, изготовить сайт, разработка сайта, web студия, создание веб сайта, поддержка сайта, сайт на заказ, сопровождение сайта, дизайн сайта, сайт под ключ, заказ сайта, реклама сайта, хостинг, регистрация доменов, хабаровск, краснодар, москва, комсомольск |
Дайджест новых статей по интернет-маркетингу на ваш email
Новые статьи и публикации
- 2025-12-02 » Когда ошибка молчит: как бессмысленные сообщения ломают пользовательский опыт
- 2025-12-02 » 9 лучших бесплатных фотостоков
- 2025-12-02 » UTM-метки: ключевой инструмент аналитики для маркетолога
- 2025-12-02 » ПромоСтраницы Яндекса: Что такое и для чего служит
- 2025-12-02 » Метатеги для сайта: исчерпывающее руководство по Title, Description, Canonical, Robots и другим тегам
- 2025-11-26 » Оценка эффективности контента: превращаем информационный балласт в рабочий актив
- 2025-11-26 » 10 причин высокого показателя отказов на сайте
- 2025-11-26 » Когда и зачем обновлять структуру сайта
- 2025-11-26 » Скрытые демотиваторы: как мелочи разрушают эффективность команды
- 2025-11-26 » Зачем запускать MVP и как сделать это грамотно?
- 2025-11-20 » Половина российских компаний сократит расходы на транспорт и маркетинг в 2026 году
- 2025-11-20 » Перенос сайта с большим количеством ссылок
- 2025-11-20 » Перелинковка сайта: Что такое и как ее использовать
- 2025-11-20 » Критерии выбора SEO-специалиста и подрядчика для продвижения сайта
- 2025-11-20 » Применение искусственного интеллекта в рекламных агентствах: комплексное исследование трендов 2025 года
- 2025-11-19 » Геозапросы по-новому: как покорить локальное SEO с помощью ИИ
- 2025-11-14 » Консалтинг: сущность и ключевые направления
- 2025-11-14 » Онлайн-формы: универсальный инструмент для сбора обратной связи
- 2025-11-14 » Факторы конверсии органического трафика
- 2025-11-14 » Планирование рекламного бюджета: самостоятельный подход
- 2025-11-14 » Авторизация на сайте: как выбрать решение для удержания клиентов и сохранения продаж
- 2025-11-13 » Эффективные методы стимулирования клиентов к оставлению положительных отзывов
- 2025-11-13 » Налоговая реформа — 2026: грядущие изменения для предпринимателей
- 2025-11-13 » Альтернативы мессенджерам: что выбрать вместо Telegram и WhatsApp
- 2025-11-13 » Маркировка рекламы для начинающих: полное руководство по требованиям ЕРИР
- 2025-11-13 » ИИ не отберет вашу работу — её займет специалист, владеющий искусственным интеллектом
- 2025-10-29 » Как оценить эффективность работы SEO-специалиста: практическое руководство для маркетологов и владельцев бизнеса
- 2025-10-29 » Киберспорт как маркетинговый инструмент: стратегии привлечения геймеров
- 2025-10-29 » Как говорить с аудиторией о сложном
- 2025-10-29 » Что такое доказательства с нулевым разглашением (ZKP) и их роль в блокчейне
Кто мало хочет, тот дешево стоит |
Мы создаем сайты, которые работают! Профессионально обслуживаем и продвигаем их , а также по всей России и ближнему зарубежью с 2006 года!
Как мы работаем
Заявка
Позвоните или оставьте заявку на сайте.
Консультация
Обсуждаем что именно Вам нужно и помогаем определить как это лучше сделать!
Договор
Заключаем договор на оказание услуг, в котором прописаны условия и обязанности обеих сторон.
Выполнение работ
Непосредственно оказание требующихся услуг и работ по вашему заданию.
Поддержка
Сдача выполненых работ, последующие корректировки и поддержка при необходимости.


Мы создаем практически любые сайты от продающих страниц до сложных, высоконагруженных и нестандартных веб приложений! Наши сайты это надежные маркетинговые инструменты для успеха Вашего бизнеса и увеличения вашей прибыли! Мы делаем красивые и максимально эффектные сайты по доступным ценам уже много лет!
Комплексный подход это не просто продвижение сайта, это целый комплекс мероприятий, который определяется целями и задачами поставленными перед сайтом и организацией, которая за этим стоит. Время однобоких методов в продвижении сайтов уже прошло, конкуренция слишком высока, чтобы была возможность расслабиться и получать \ удерживать клиентов из Интернета, просто сделав сайт и не занимаясь им...
Мы оказываем полный комплекс услуг по сопровождению сайта: информационному и техническому обслуживанию и развитию Интернет сайтов.
Контекстная реклама - это эффективный инструмент в интернет маркетинге, целью которого является увеличение продаж. Главный плюс контекстной рекламы заключается в том, что она работает избирательно.