Jump to content

Snowfall effect on your website!


Rook

12 posts in this topic

Recommended Posts

Updated

oMFeO03.jpg

Since the Holidays are here, it's time to spice up your website with some snow falling effect!

 

The simplest way to do it is by inserting this script before the closing </head> tag or another place of your choice.

<script>
var snowmax=145;
var snowcolor=new Array("#aaaacc","#ddddff","#ccccdd","#f3f3f3","#f0ffff");
var snowtype=new Array("Times","Arial","Times","Verdana");
var snowletter=".";
var sinkspeed=0.8;
var snowmaxsize=20;
var snowminsize=12;
var snowingzone=1;
var snow=new Array();
var marginbottom;
var marginright;
var timer;
var i_snow=0;
var x_mv=new Array();
var crds=new Array();
var lftrght=new Array();
var browserinfos=navigator.userAgent;
var ie5=document.all&&document.getElementById&&!browserinfos.match(/Opera/);
var ns6=document.getElementById&&!document.all;
var opera=browserinfos.match(/Opera/);
var browserok=ie5||ns6||opera;
function randommaker(range) {
        rand=Math.floor(range*Math.random())
    return rand
}
function initsnow() {
        if (ie5 || opera) {
                marginbottom = document.body.scrollHeight
                marginright = document.body.clientWidth-15
        }
        else if (ns6) {
                marginbottom = document.body.scrollHeight
                marginright = window.innerWidth-15
        }
        var snowsizerange=snowmaxsize-snowminsize
        for (i=0;i<=snowmax;i++) {
                crds[i] = 0;
            lftrght[i] = Math.random()*15;
            x_mv[i] = 0.03 + Math.random()/10;
                snow[i]=document.getElementById("s"+i)
                snow[i].style.fontFamily=snowtype[randommaker(snowtype.length)]
                snow[i].size=randommaker(snowsizerange)+snowminsize
                snow[i].style.fontSize=snow[i].size+'px';
                snow[i].style.color=snowcolor[randommaker(snowcolor.length)]
                snow[i].style.zIndex=1000
                snow[i].sink=sinkspeed*snow[i].size/5
                if (snowingzone==1) {snow[i].posx=randommaker(marginright-snow[i].size)}
                if (snowingzone==2) {snow[i].posx=randommaker(marginright/2-snow[i].size)}
                if (snowingzone==3) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/4}
                if (snowingzone==4) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/2}
                snow[i].posy=randommaker(2*marginbottom-marginbottom-2*snow[i].size)
                snow[i].style.left=snow[i].posx+'px';
                snow[i].style.top=snow[i].posy+'px';
        }
        movesnow()
}
function movesnow() {
        for (i=0;i<=snowmax;i++) {
                crds[i] += x_mv[i];
                snow[i].posy+=snow[i].sink
                snow[i].style.left=snow[i].posx+lftrght[i]*Math.sin(crds[i])+'px';
                snow[i].style.top=snow[i].posy+'px';

                if (snow[i].posy>=marginbottom-2*snow[i].size || parseInt(snow[i].style.left)>(marginright-3*lftrght[i])){
                        if (snowingzone==1) {snow[i].posx=randommaker(marginright-snow[i].size)}
                        if (snowingzone==2) {snow[i].posx=randommaker(marginright/2-snow[i].size)}
                        if (snowingzone==3) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/4}
                        if (snowingzone==4) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/2}
                        snow[i].posy=0
                }
        }
        var timer=setTimeout("movesnow()",50)
}
for (i=0;i<=snowmax;i++) {
        document.write("<span id='s"+i+"' style='position:absolute;top:-"+snowmaxsize+"'>"+snowletter+"</span>")
}
if (browserok) {
        window.onload=initsnow
}
</script>

You can customise the script above the way you like it and you don't need to know JavaScript to do so. It's pretty readable. :3

 

-----------------------------

Another way you can add snow to your website is using Schillmania's Snowstorm.js file. It works better than the script above and that's what iOSGods is using atm ^_^.

 

More info and how to install: http://schillmania.com/projects/snowstorm/

-----------------------------

 

jQuery snow:

 

Add this inside your <head> tags:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script> // Includes jQuery from Google Servers
<script type="text/javascript" src="jsnow.js"></script>
<script type="text/javascript">
$(function() {
$().jSnow();
});
</script>

Download jsnow.js from here and upload it to the same path where your index file is or change the file paths to where you saved your jsnow.js file. Example: src="/folder/jsnow.js"

 

-----------------------------

 

Snowfall effect using images & Javascript:

 

Add this inside the <head> tags:

<script type="text/javascript"> 
imageDir = "path/snow/"; 
sflakesMax = 65; 
sflakesMaxActive = 65; 
svMaxX = 2; 
svMaxY = 6; 
ssnowStick = 1; 
ssnowCollect = 0; 
sfollowMouse = 1; 
sflakeBottom = 0; 
susePNG = 1; 
sflakeTypes = 5; 
sflakeWidth = 15; 
sflakeHeight = 15; 
</script> 
<script type="text/javascript" src="path/snow/snow.js"></script>

Download this archive and upload the contents inside to your server or to an external server then link it using the script above.

 

The snowflakes here are actual images floating around on your screen so it may cause extra load on browsers and lag weak PCs. They have the best view though, true snowflakes with the edges, ^_^

Posted

I might add this to my new website! Thanks for this DiDA :D

awesome!

 

  

cool...thnx!  happy holidays!

Happy holidays to you too! :)

:xmas:

Archived

This topic is now archived and is closed to further replies.

  • Our picks

    • SimCity BuildIt Cheats v1.69.1 +1 [ Freeze Currencies ]
      Modded/Hacked App: SimCity BuildIt By EA Swiss Sarl
      Bundle ID: com.ea.simcitymobile.bv
      iTunes Store Link: https://apps.apple.com/us/app/simcity-buildit/id913292932?uo=4


      Hack Features:
      - Infinite Currencies


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/topic/124792-arm64-simcity-buildit-v1412-jailed-cheats-1/


      iOS Hack Download Link: https://iosgods.com/topic/157687-simcity-buildit-cheats-v1415-1/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 695 replies
    • WorldBox - God Sandbox v0.51.2 Jailed Cheats +1
      Modded/Hacked App: WorldBox - God Sandbox By Maxim Karpenko
      Bundle ID: com.mkarpenko.worldbox
      iTunes Store Link: https://apps.apple.com/us/app/worldbox-god-sandbox/id1450941371?uo=4


      Hack Features:
      - PREMIUM


      Jailbreak required hack(s):  https://iosgods.com/topic/176685-worldbox-god-sandbox-cheats-all-versions-1/#


      iOS Hack Download IPA Link: https://iosgods.com/topic/176686-worldbox-god-sandbox-v02217-jailed-cheats-1/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 432 replies
    • PGA TOUR Golf Shootout Cheats v5.4.0 +4
      Modded/Hacked App: PGA TOUR Golf Shootout by Concrete Software, Inc.
      Bundle ID: com.concretesoftware.golf
      iTunes Store Link: https://apps.apple.com/us/app/pga-tour-golf-shootout/id1446458226?uo=4&at=1010lce4


      Hack Features:
      - Infinite Coin
      - Infinite Gold


      iOS Hack Download Link: https://iosgods.com/topic/129508-arm64-pga-tour-golf-shootout-cheats-all-versions-2/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 201 replies
    • Super Stylist Fashion Makeover Cheats v3.6.8 +1
      Modded/Hacked App: Super Stylist Fashion Makeover By CRAZY STYLE LTD
      Bundle ID: com.babyeducationtoys.fashionstyle
      iTunes Store Link: https://apps.apple.com/us/app/super-stylist-fashion-makeover/id1441648201?uo=4


      Hack Features:
      - Free Store (not iAP)


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/topic/112404-super-stylist-fashion-makeover-v352-jailed-cheats-1/


      iOS Hack Download Link: https://iosgods.com/topic/190368-super-stylist-fashion-makeover-cheats-v352-1/
        • Agree
        • Thanks
        • Like
      • 21 replies
    • Raising Beast Friends Cheats v1.3.2 +3
      Modded/Hacked App: 짐승친구들 키우기 By Bigpicture Team Inc.
      Bundle ID: com.bigpictureteam.raisingbeastfriends
      iTunes Store Link: https://apps.apple.com/kr/app/%EC%A7%90%EC%8A%B9%EC%B9%9C%EA%B5%AC%EB%93%A4-%ED%82%A4%EC%9A%B0%EA%B8%B0/id6503225529?uo=4


      Hack Features:
      - God Mode
      - Multiply Attack
      - Multiply Defense


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/topic/187879-raising-beast-friends-%EC%A7%90%EC%8A%B9%EC%B9%9C%EA%B5%AC%EB%93%A4-%ED%82%A4%EC%9A%B0%EA%B8%B0-v114-jailed-cheats-3/


      iOS Hack Download Link: https://iosgods.com/topic/187878-raising-beast-friends-%EC%A7%90%EC%8A%B9%EC%B9%9C%EA%B5%AC%EB%93%A4-%ED%82%A4%EC%9A%B0%EA%B8%B0-cheats-v114-3/
        • Like
      • 8 replies
    • Super Stylist Fashion Makeover v3.6.8 Jailed Cheats +1
      Modded/Hacked App: Super Stylist by Baby Education Animal Weather Toys LTD.
      Bundle ID: com.babyeducationtoys.fashionstyle
      iTunes Store Link: https://apps.apple.com/us/app/super-stylist/id1441648201?uo=4&at=1010lce4



      Hack Features:
      - Free iAP (Turn on inside iOSGods Mod Menu first)


      iOS Hack Download Link: https://iosgods.com/topic/112404-arm64-super-stylist-v129-jailed-cheats-1/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 139 replies
    • PewDiePie's Tuber Simulator Cheats v2.60.0 +3
      Modded/Hacked App: PewDiePie's Tuber Simulator By Outerminds Inc.
      Bundle ID: com.outerminds.tubular
      iTunes Store Link: https://apps.apple.com/us/app/pewdiepies-tuber-simulator/id1093190533?uo=4

       

      📌 Mod Requirements

      - Jailbroken iPhone or iPad.
      - iGameGod / Filza / iMazing.
      - Cydia Substrate, ElleKit, Substitute or libhooker depending on your jailbreak (from Sileo, Cydia or Zebra).

       

      🤩 Hack Features

      - Infinite Subscriber
      - Infinite Views
      - Infinite Bux

      NOTE: Please complete tutorial first before enabling the hacks otherwise it won't work

      NOTe 2: Please make a youtube video to get some views first (without hack) then before enable infinite views

       

      Non-Jailbroken Hack: https://iosgods.com/topic/86411-pewdiepies-tuber-simulator-v2450-jailed-cheats-3/

       

      ⬇️ iOS Hack Download Link: https://iosgods.com/topic/86366-pewdiepies-tuber-simulator-cheats-v2460-3/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 1,159 replies
    • Sniper 3D: Gun Shooting Games Cheats v6.0.1 +7
      Modded/Hacked App: Sniper 3D Assassin: FPS Battle By Fun Games For Free
      Bundle ID: com.fungames.sniper3d
      iTunes Store Link: https://itunes.apple.com/us/app/sniper-3d-assassin-fps-battle/id930574573?mt=8&uo=4&at=1010lce4



      Hack Features:
      - Infinite Coins Only (Upgrade Weapon and Speed up Delivery with Coins)
      - Infinite Energy
      - Infinite Ammo / No Reload
      - No Spread
      - Unlock Premium Weapon - Semi

      NOTE: The game diamond currency is completely server-sided so do not request


      Hack Download Link: https://iosgods.com/topic/74114-arm64-sniper-3d-fps-battle-shoot-to-kill-2018-cheats-all-versions-7/

      Credits:
      - @Laxus
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 3,919 replies
    • Fun Run 3 - Multiplayer Games Cheats v4.53.0 +1
      Modded/Hacked App: Fun Run 3: Arena Running Game By Dirtybit
      Bundle ID: com.dirtybit.fra
      iTunes Store Link: https://itunes.apple.com/us/app/fun-run-3-arena-running-game/id1118878857?mt=8&uo=4&at=1010lce4


      Hack Features:
      - God Mode
       

      Hack Download Link: https://iosgods.com/topic/75790-arm64-fun-run-3-arena-running-game-cheats-v210-1/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 1,288 replies
    • Candy Crush Friends Saga v4.16.0 Jailed Cheats +3
      Modded/Hacked App: Candy Crush Friends Saga By King.com Limited
      Bundle ID: com.midasplayer.apps.candycrush4
      iTunes Store Link: https://apps.apple.com/us/app/candy-crush-friends-saga/id1225867923?uo=4

       

      🔧 Mod Requirements

      - Non-Jailbroken/Jailed or Jailbroken iPhone or iPad.
      - Sideloadly or alternatives.
      - Computer running Windows/macOS/Linux with iTunes installed.

       

      🚀 Hack Features

      - Freeze Moves
      - Freeze Lives
      - Freeze Boosters
       


      🍏 Jailbreak iOS hacks: https://iosgods.com/topic/198853-candy-crush-friends-saga-cheats-v4160-3/

       

      📥 iOS Hack Download IPA Link: https://iosgods.com/topic/80354-candy-crush-friends-saga-v4160-jailed-cheats-3/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 429 replies
    • Dummynation Cheats v3.4.4 +3
      Modded/Hacked App: Dummynation By ALEJANDRO HERNANDEZ FERRERO
      Bundle ID: ahf.dummynation
      iTunes Store Link: https://apps.apple.com/us/app/dummynation/id6444295551?uo=4

       

      📌 Mod Requirements

      - Jailbroken iPhone or iPad.
      - iGameGod / Filza / iMazing.
      - Cydia Substrate, ElleKit, Substitute or libhooker depending on your jailbreak (from Cydia, Sileo or Zebra).

       

      🤩 Hack Features

      - Premium + No Ads
      - Infinite Research Point
      - Infinite Liquidity (Gold)


      🍏 For Non-Jailbroken & No Jailbreak required hacks: https://iosgods.com/topic/191828-dummynation-v313-jailed-cheats-3/

       

      ⬇️ iOS Hack Download Link: https://iosgods.com/topic/191829-dummynation-cheats-v313-3/
        • Informative
        • Agree
        • Thanks
        • Winner
        • Like
      • 21 replies
    • Cats & Soup Cheats v4.1.0 +2
      Modded/Hacked App: Cats & Soup By HIDEA Co.,Ltd
      Bundle ID: com.hidea.cat
      iTunes Store Link: https://apps.apple.com/us/app/cats-soup/id1581431235?uo=4

       

      📌 Mod Requirements

      - Jailbroken iPhone or iPad.
      - iGameGod / Filza / iMazing.
      - Cydia Substrate, ElleKit, Substitute or libhooker depending on your jailbreak (from Sileo, Cydia or Zebra).

       

      🤩 Hack Features

      - Infinite Currencies
      - Unlocked All Specials and No Ads

       

      Non-Jailbroken Hack: https://iosgods.com/topic/157486-cats-soup-v2630-jailed-cheats-2/

       

      ⬇️ iOS Hack Download Link: https://iosgods.com/topic/157484-cats-soup-cheats-v2640-2/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 318 replies
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines