Widget:Lunar Rift Chronometer

This widget is used to embed the Chronometer.

// <![CDATA[ function upd{ // // Current Date Time: var currentdate = new Date; // document.getElementById("lblcurrtimedsp").innerHTML = currentdate;

var datetime = (currentdate.getMonth+1) + "/" + currentdate.getDate + "/" + currentdate.getFullYear + " " + currentdate.getHours + ":" + currentdate.getMinutes + ":" + currentdate.getSeconds; // document.getElementById("lblcurrtime").innerHTML = datetime;

// // Time Zone Differance // We are EST at 240 min off UTC

var dtoffset = currentdate.getTimezoneOffset; // document.getElementById("lbldtoffset").innerHTML = dtoffset; var minoffset = dtoffset - 320; // var minoffset = dtoffset - 240; // document.getElementById("lblminoffset").innerHTML = minoffset; // Adjust users time to EST

var currentdate2 = new Date(currentdate.getTime + minoffset*60000); // document.getElementById("lbleqoffset").innerHTML = currentdate2;

var datetime2 = (currentdate2.getMonth+1) + "/" + currentdate2.getDate + "/" + currentdate2.getFullYear + " " + currentdate2.getHours + ":" + currentdate2.getMinutes + ":" + currentdate2.getSeconds;

// document.getElementById("lblcurrtime2").innerHTML = datetime2;

// // Start of Phase: var startofphase = new Date(2016, 8, 7, 13, 50, 0, 0); // var startofphase = new Date(2016, 8, 7, 12, 50, 0, 0); Original Seed. Daylight Savings put me off 1 hour // document.getElementById("lblstartofphase").innerHTML = startofphase;

// // Difference (seconds) // Change by Aartemis to use currentdate2 instead of currentdate in formulas. var differ = (currentdate2 - startofphase) / 1000; // document.getElementById("lbldifference").innerHTML = differ;

// // Number of cycles: var numcycles = differ / 525; // document.getElementById("lblnumcycles").innerHTML = numcycles;

// // Actual Cycle: var actualcycle = Math.floor(numcycles % 8); // document.getElementById("lblactualcycle").innerHTML = actualcycle;

// // time until next flip var nextflip = (1 - ((numcycles % 8) - Math.floor(numcycles % 8))) * 525 // document.getElementById("lblnextflip").innerHTML = nextflip;

// //-- // # Destination //-- // 0 unkn 0 // 1 Blood River // 2 unkn 2 // 3 Solace Bridge // 4 unkn 4 // 5 unkn 5 // 6 Highvale // 7 unkn 7 // // Desination: var PH0sec = 0; var BRsec = 0; var PH2sec = 0; var SBsec = 0; var PH4sec = 0; var PH5sec = 0; var HVsec = 0; var PH7sec = 0;

var dest = "closed"; var moonphase = "None";

switch(actualcycle) { case 0: BRsec = nextflip PH2sec = nextflip + 525; SBsec = nextflip + 1050; PH4sec = nextflip + 1575; PH5sec = nextflip + 2100; HVsec = nextflip + 2625; PH7sec = nextflip + 3150; PH0sec = nextflip dest = "Dest. New Moon"; moonphase = "New Moon"; break;

case 1: PH2sec = nextflip SBsec = nextflip + 525; PH4sec = nextflip + 1050; PH5sec = nextflip + 1575; HVsec = nextflip + 2100; PH7sec = nextflip + 2625; PH0sec = nextflip + 3150; BRsec = nextflip dest = "Blood River"; moonphase = "Waxing Crescent"; break;

case 2: SBsec = nextflip PH4sec = nextflip + 525; PH5sec = nextflip + 1050; HVsec = nextflip + 1575; PH7sec = nextflip + 2100; PH0sec = nextflip + 2625; BRsec = nextflip + 3150; PH2sec = nextflip dest = "Dest. First Quarter"; moonphase = "First Quarter"; break;

case 3: PH4sec = nextflip PH5sec = nextflip + 525; HVsec = nextflip + 1050; PH7sec = nextflip + 1575; PH0sec = nextflip + 2100; BRsec = nextflip + 2625; PH2sec = nextflip + 3150; SBsec = nextflip dest = "Solace Bridge"; moonphase = "Waxing Gibbous"; break;

case 4: PH5sec = nextflip HVsec = nextflip + 525; PH7sec = nextflip + 1050; PH0sec = nextflip + 1575; BRsec = nextflip + 2100; PH2sec = nextflip + 2625; SBsec = nextflip + 3150; PH4sec = nextflip dest = "Dest. Full Moon"; moonphase = "Full Moon"; break;

case 5: HVsec = nextflip PH7sec = nextflip + 525; PH0sec = nextflip + 1050; BRsec = nextflip + 1575; PH2sec = nextflip + 2100; SBsec = nextflip + 2625; PH4sec = nextflip + 3150; PH5sec = nextflip dest = "Dest. Waning Gibbous"; moonphase = "Waning Gibbous"; break;

case 6: PH7sec = nextflip PH0sec = nextflip + 525; BRsec = nextflip + 1050; PH2sec = nextflip + 1575; SBsec = nextflip + 2100; PH4sec = nextflip + 2625; PH5sec = nextflip + 3150; HVsec = nextflip dest = "Highvale"; moonphase = "Third Quarter"; break;

case 7: PH0sec = nextflip BRsec = nextflip + 525; PH2sec = nextflip + 1050; SBsec = nextflip + 1575; PH4sec = nextflip + 2100; PH5sec = nextflip + 2625; HVsec = nextflip + 3150; PH7sec = nextflip dest = "Dest. Waning Crescent"; moonphase = "Waning Crescent"; break;

} // document.getElementById("lbldestination").innerHTML = dest;

PH0sec = Math.floor(PH0sec); BRsec = Math.floor(BRsec); PH2sec = Math.floor(PH2sec); SBsec = Math.floor(SBsec); PH4sec = Math.floor(PH4sec); PH5sec = Math.floor(PH5sec); HVsec = Math.floor(HVsec); PH7sec = Math.floor(PH7sec);

// var PH0time = "Available in " + Math.floor(PH0sec / 60) + "m " + (PH0sec - (Math.floor(PH0sec / 60)*60)) + "s"; // var BRtime = "Available in " + Math.floor(BRsec / 60) + "m " + (BRsec - (Math.floor(BRsec / 60)*60)) + "s"; // var PH2time = "Available in " + Math.floor(PH2sec / 60) + "m " + (PH2sec - (Math.floor(PH2sec / 60)*60)) + "s"; // var SBtime = "Available in " + Math.floor(SBsec / 60) + "m " + (SBsec - (Math.floor(SBsec / 60)*60)) + "s"; // var PH4time = "Available in " + Math.floor(PH4sec / 60) + "m " + (PH4sec - (Math.floor(PH4sec / 60)*60)) + "s"; // var PH5time = "Available in " + Math.floor(PH5sec / 60) + "m " + (PH5sec - (Math.floor(PH5sec / 60)*60)) + "s"; // var HVtime = "Available in " + Math.floor(HVsec / 60) + "m " + (HVsec - (Math.floor(HVsec / 60)*60)) + "s"; // var PH7time = "Available in " + Math.floor(PH7sec / 60) + "m " + (PH7sec - (Math.floor(PH7sec / 60)*60)) + "s";

var PH0time = "Available in " + Math.floor(PH0sec / 60) + "m "; var BRtime = "Available in " + Math.floor(BRsec / 60) + "m "; var PH2time = "Available in " + Math.floor(PH2sec / 60) + "m "; var SBtime = "Available in " + Math.floor(SBsec / 60) + "m "; var PH4time = "Available in " + Math.floor(PH4sec / 60) + "m "; var PH5time = "Available in " + Math.floor(PH5sec / 60) + "m "; var HVtime = "Available in " + Math.floor(HVsec / 60) + "m "; var PH7time = "Available in " + Math.floor(PH7sec / 60) + "m ";

switch(actualcycle) { case 0: PH0time = "Open for another " + Math.floor(PH0sec / 60) + "m " + (PH0sec - (Math.floor(PH0sec / 60)*60)) + "s"; break;

case 1: BRtime = "Open for another " + Math.floor(BRsec / 60) + "m " + (BRsec - (Math.floor(BRsec / 60)*60)) + "s"; break;

case 2: PH2time = "Open for another " + Math.floor(PH2sec / 60) + "m " + (PH2sec - (Math.floor(PH2sec / 60)*60)) + "s"; break;

case 3: SBtime = "Open for another " + Math.floor(SBsec / 60) + "m " + (SBsec - (Math.floor(SBsec / 60)*60)) + "s"; break;

case 4: PH4time = "Open for another " + Math.floor(PH4sec / 60) + "m " + (PH4sec - (Math.floor(PH4sec / 60)*60)) + "s"; break;

case 5: PH5time = "Open for another " + Math.floor(PH5sec / 60) + "m " + (PH5sec - (Math.floor(PH5sec / 60)*60)) + "s"; break;

case 6: HVtime = "Open for another " + Math.floor(HVsec / 60) + "m " + (HVsec - (Math.floor(HVsec / 60)*60)) + "s"; break;

case 7: PH7time = "Open for another " + Math.floor(PH7sec / 60) + "m " + (PH7sec - (Math.floor(PH7sec / 60)*60)) + "s"; break;

}

document.getElementById("cellPH0").innerHTML = PH0time; document.getElementById("cellPH0").style.color = '#ffff99';

document.getElementById("cellBR").innerHTML = BRtime; document.getElementById("cellBR").style.color = '#ffff99';

document.getElementById("cellPH2").innerHTML = PH2time; document.getElementById("cellPH2").style.color = '#ffff99';

document.getElementById("cellSB").innerHTML = SBtime; document.getElementById("cellSB").style.color = '#ffff99';

document.getElementById("cellPH4").innerHTML = PH4time; document.getElementById("cellPH4").style.color = '#ffff99';

document.getElementById("cellPH5").innerHTML = PH5time; document.getElementById("cellPH5").style.color = '#ffff99';

document.getElementById("cellHV").innerHTML = HVtime; document.getElementById("cellHV").style.color = '#ffff99';

document.getElementById("cellPH7").innerHTML = PH7time; document.getElementById("cellPH7").style.color = '#ffff99';

document.getElementById("cellPhase").innerHTML = "Current Phase: " + moonphase; document.getElementById("cellPhase").style.color = '#ffff99';

setTimeout(upd, 1000); }

upd; // ]]>