FAZA MESIACA

ID
Nazov / Name:
Popis / Description:
Dlzka / Length:
Testovane pod / Tested under:

 

149
p149.html / p149.zip
Nakresli aktualnu fazu mesiaca
1543b
NN 4.04

UKAZKA / CLICK HERE

Zdrojovy tvar / Source code:

<HTML> <HEAD> <TITLE>JavaScript DESTINATION - P149</TITLE> </HEAD> <script language=JavaScript> <!-- function showMoon() { var height=1; var size = 50; var i; var currentDate = new Date(); var x = currentDate; currentDate.setTime(currentDate.getTime() + (currentDate.getTimezoneOffset()*60000)); var blueMoonDate = new Date(96, 1, 3, 16, 15, 0); var lunarPeriod = 29*(24*3600*1000) + 12*(3600*1000) + 44.05*(60*1000); var moonPhaseTime = (currentDate.getTime() - blueMoonDate.getTime()) % lunarPeriod; var percentRaw = (moonPhaseTime / lunarPeriod); var percent = Math.round(100*percentRaw) / 100; var percentBy2 = Math.round(200*percentRaw); var left = (percentRaw >= 0.5) ? "images/mblack.gif" : "images/mwhite.gif"; var right = (percentRaw >= 0.5) ? "images/mwhite.gif" : "images/mblack.gif"; document.write("<center>") if (percentBy2 > 100) { percentBy2 = percentBy2 - 100 } for (i = -(size-1); i < size; ++i) { var wid=2*parseFloat(Math.sqrt((size*size)-(i*i))); if (percentBy2 != 100) document.write ("<img src="+left +" height=1 width="+(wid*((100-percentBy2)/100))+">") if (percentBy2 != 0) document.write ("<img src="+right+" height=1 width="+(wid*((percentBy2)/100))+">") document.write ("<br>") } document.write( "</center>", "<h1>Pozrite sa na mesiac !</h1>", "Dalsi mesiac v splne bude o ", Math.round((lunarPeriod-moonPhaseTime)/(24*3600*1000)), " dni", "") } // --> </script> <script> showMoon(); </script> </body> </HTML>
[ Navrat / BACK ]