<HTML> <HEAD> <TITLE>000 m</TITLE> <SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript"> <!-- var snowImgSizeW = new Array(); var snowImgSizeH = new Array(); var move = true; // 00000k0T0[0f0RK0Y0K00RK0Y0:true RK0U0j0D0:false var santaImg_r = "sori_anime_01R.gif" // STM0000n0;uP var santaImg_l = "sori_anime_01.gif" // ]TM0000n0;uP var santaSizeW = 100; // ;uPn0*jE^ var santaSizeH = 44; // ;uPn0&~E^ var santaNo = 6; // 000n0pe var santaSpeedMin = 4; // 000n00000g\ var santaSpeedMax = 7; // 000n00000g'Y var snowArea = 0; // n0M0{V00:TOPn0Window000n0001:PAGEhQSO02:00000k0T0[0f0RO00 var snowNo = 20; // n0pe var snowImg = "yuki.gif"; // n0;uPn000 snowImgSizeW[0] = 9; // ;uPn0E^ snowImgSizeH[0] = 9; // ;uPn0ؚU0 var _dom=(document.all?3:(document.getElementById?1:(document.layers?2:0))); var dx = new Array(), snowPosX = new Array(), snowPosY = new Array(), size = new Array(); var yure = new Array(), cycle = new Array(), sonwSpeed = new Array(), way = new Array(); snowImgSizeW[1] = Math.round((snowImgSizeW[0] / 3) * 2); snowImgSizeH[1] = Math.round((snowImgSizeH[0] / 3) * 2); snowImgSizeW[2] = Math.round(snowImgSizeW[0] / 3); snowImgSizeH[2] = Math.round(snowImgSizeH[0] / 3); var starCount = 0, i, sclX = 0, sclY = 0; var santaX = new Array(), santaY = new Array(), santaStep = new Array(); function getSnowArea() { if(_dom == 1 || _dom == 2) { docWidth = self.innerWidth; docHeight = (snowArea == 1 && document.height > window.innerHeight) ? document.height : window.innerHeight; } if (_dom == 3) { docWidth = document.body.clientWidth; docHeight = (snowArea == 1 && document.body.scrollHeight > document.body.clientHeight) ? document.body.scrollHeight : document.body.clientHeight; } } function getWindowSize() { if(_dom == 1 || _dom == 2) { win_width = self.innerWidth; win_height = self.innerHeight; } if (_dom == 3) { win_width = document.body.clientWidth; win_height = document.body.clientHeight; } } function getScrollPosX() { if (_dom == 1) return scrollX; if (_dom == 2) return pageXOffset; if (_dom == 3) return document.body.scrollLeft } function getScrollPosY() { if (_dom == 1) return scrollY; if (_dom == 2) return pageYOffset; if (_dom == 3) return document.body.scrollTop; } function snowPosInit(num, start) { yure[num] = Math.random()*10; snowPosX[num] = Math.random()*(docWidth - yure[num] - snowImgSizeW[0] - 10); snowPosY[num] = 0; cycle[num] = 0.5 + Math.random(); if (size[num] == 0) sonwSpeed[num] = 2.0 + Math.random() * 0.5; // 'Y000n00000 if (size[num] == 1) sonwSpeed[num] = 1.5 + Math.random() * 0.0; // -N000 if (size[num] == 2) sonwSpeed[num] = 1.0 + Math.random() * 0.5; // \000 way[num] = Math.random() * 1 - 0.5; if (start) { dx[num] = 0; snowPosY[num] = Math.random()*(docHeight - snowImgSizeH[0] - 10); } } function moveLayerTo(layerName, x, y){ if (_dom == 1) { document.getElementById(layerName).style.left = x; document.getElementById(layerName).style.top = y; } if (_dom == 2) { document.layers[layerName].left = x; document.layers[layerName].top = y; } if (_dom == 3) { document.all(layerName).style.pixelLeft = x; document.all(layerName).style.pixelTop = y; } } function moveSanta() { if (move) sclY = getScrollPosY(); else sclY = 0; for (i=0; i<santaNo; i++) { if (santaX[i] > win_width+10 || santaX[i] < 0-santaSizeW-10) { getWindowSize(); santaY[i] = Math.floor(Math.random() * (win_height - santaSizeH - 5)); santaStep[i] = santaSpeedMin + Math.random() * (santaSpeedMax - santaSpeedMin); if (i%2 == 0) santaX[i] = 0-santaSizeW-10; else santaX[i] = win_width+10; } else { if (i%2 == 0) santaX[i] += santaStep[i]; else santaX[i] -= santaStep[i]; moveLayerTo("santa"+i,santaX[i],santaY[i]+sclY); } } setTimeout("moveSanta()",50); } function moveSnow() { for (i=0; i<snowNo; i++) { snowPosY[i] += sonwSpeed[i]; if (snowPosY[i] > (docHeight + snowImgSizeH[0] + 10) || snowPosX[i] < (0 - snowImgSizeW[0] -5) || snowPosX[i] > (docWidth + 5)) snowPosInit(i); dx[i] += cycle[i]; if ((Math.random() * 1000) < 10) { if (way[i] < 0) way[i] = 0 - Math.random() * 0.5 + 0.1; if (way[i] > 0) way[i] = Math.random() * 0.5 - 0.1; } if ((Math.random() * 3000) < 10 && (docHeight / 2) < snowPosY[i]) snowPosInit(i); snowPosX[i] += way[i]; sclY = snowArea == 2 ? getScrollPosY() : sclY = 0; moveLayerTo("snow"+i,Math.floor(snowPosX[i]+yure[i]*(Math.sin(dx[i]*Math.PI/180))), Math.floor(snowPosY[i])+sclY); } setTimeout("moveSnow()", 10); } function resize(){ if (_dom == 2) location.reload(); getSnowArea(); if (_dom==1 || _dom==3) moveLayerTo("dmy", docWidth + snowImgSizeW[0] + 15, docHeight + snowImgSizeH[0] + 15); } window.onresize = resize; // --> </SCRIPT> </HEAD> <BODY bgcolor="#000000" text="#ffffff"> <SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript"> <!-- if (_dom) { var santaLay = '<DIV ID="dmy" STYLE="position:absolute; width:1; left:-100; top:-100; z-index:10; visibility:hidden;">&nbsp;</DIV>'; getWindowSize(); for (i=0; i<santaNo; i++) { santaY[i] = Math.floor(Math.random() * (win_height - santaSizeH - 5)); santaX[i] = Math.floor(Math.random() * (win_width - santaSizeH - 5)); santaStep[i] = santaSpeedMin + Math.random() * (santaSpeedMax - santaSpeedMin); if (i%2 == 0) var santaImg = santaImg_r; else var santaImg = santaImg_l; santaLay += '<DIV ID="santa' + i + '" STYLE="position:absolute; width:' + santaSizeW + '; height:' + santaSizeH + '; left:-100; top:-100; z-index:10;"><IMG src="' + santaImg + '" border="0" width="' + santaSizeW + '" height="'+santaSizeH+'"></DIV>'; } getSnowArea(); var j = 0; var snowLay = ''; for (i=0; i<snowNo; i++) { size[i] = j; snowPosInit(i, true); if (_dom==2) snowLay += '<LAYER name="snow' + i + '" left="-100" top="-100" visibility="show"><img src="' + snowImg + '" border="0" width="' + snowImgSizeW[j] + '" height="' + snowImgSizeH[j] + '"></LAYER>'; if (_dom==1 || _dom==3) snowLay += '<DIV id="snow' + i + '" style="position:absolute; top:-100px; left:-100px; width:1;"><IMG src="' + snowImg + '" border="0" width="' + snowImgSizeW[j] + '" height="' + snowImgSizeH[j] + '"></DIV>' if (j == 2) { j = 0; } else { j += 1; } } document.writeln(santaLay,snowLay); if (_dom != 2) moveLayerTo("dmy",win_width+20+santaSizeW,win_height+20); moveSanta(); moveSnow(); } // --> </SCRIPT> </BODY> </HTML>
Make your own free website on Tripod.com