moon phases




JavaScript Source Code 3000: Messages: Moon Phases






























Moon Phases







Displays the moon's current phase and estimates the time of the next full moon, using a calculation of the moon's rotation and the date.













You must also save these images
to your server to use this script.
Right-click the images below and
select "Save Image As..."





JavaScript Source Code 3000: Messages: Moon Phases
Simply click inside the window below, use your cursor to highlight the script, and copy (type Control-c or Apple-c) the script into a new file in your text editor (such as Note Pad or Simple Text) and save (Control-s or Apple-s). The script is yours!!!





    





<!-- ONE STEP TO INSTALL MOON PHASES:

1. Copy the coding into the BODY of your HTML document -->

<!-- STEP ONE: Paste this code into the BODY of your HTML document -->

<BODY>

<SCRIPT LANGUAGE="JavaScript">
<!-- Original: James Thiele (mailto:jet@eskimo.com) -->

<! >
<! >

<!-- Begin

// Save the two necessary images from our example page at:
// http://messages.javascriptsource.com/moon-phases.html

var black = "http://www.your-web-site-address-here.com/images/moon-pics/black.gif";
var white = "http://www.your-web-site-address-here.com/images/moon-pics/white.gif";

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) ? black : white;
var right = (percentRaw >= 0.5) ? white : black;
var time = Math.round((lunarPeriod-moonPhaseTime)/(24*3600*1000));

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("<BR><FONT SIZE=4>Next full moon is in about ",time," day");
if (time > 1) document.write("s");
document.write("");
// End -->
</script>



<!-- Script Size: 1.83 KB -->










Wyszukiwarka

Podobne podstrony:
Twilight Saga New Moon 2009 CAM XviD POISON
Sailor Moon SuperS ep 139
Sailor Moon SuperS ep 135
Moon Over Manifest
Sailor Moon SuperS ep 129
Sailor Moon SuperS ep 144
Sailor Moon SuperS ep 128
UFO Unclassified Documents (EN) Moon Dust Reporting
Twilight New Moon TELESYNC new
Sailor Moon SuperS ep 156a
circuit phasesplit
Sailor Moon SuperS ep 151
Saga Zmierzch Księżyc w nowiu New Moon DVDRip XviD NeDiVx rmvb
Saga Zmierzch Księżyc w nowiu Twilight New Moon 2009
Sailor Moon SuperS ep 153
Sailor Moon SuperS ep 164a
plan phases and iterations*B1A5C9
Sailor Moon SuperS ep 162

więcej podobnych podstron