You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.7 KiB
JavaScript

// test zone for other date
// first new moon of 2000 according to:
// https://www.calendar-12.com/moon_phases/2000
// let now = new Date(Date.parse('06 Jan 2000 19:14:00 GMT+1'));
// let now = new Date(Date.parse('21 Jan 2000 05:41:00 GMT+1'));
// let now = new Date(Date.parse('13 Jan 2000 05:41:00 GMT+1'));
let now = new Date();
// MOON COMPUTATION
// ==========================================================================
function updateCurrentMoonWatch(date){
let lat = window.walk_calendar["latitude"];
let long = window.walk_calendar["longitude"];
let moon = getMoonStateFromDate(date, lat, long);
let phase_name = moon["name"].split(" ").join(" <br>");
let formated_date = format_date_time(date);
// sunset
// let distance = moon["distance"];
// let sun_calc = SunCalc.getTimes(date, lat, long);
// let sunset = format_date_time(sun_calc["sunset"])[2];
// --- PRIMARY INFO ---
let $watch = $('#moon-watch-section');
$watch.find('.phase-name').html(phase_name);
$watch.find('.date').html(formated_date['date']);
// scheme position
// let [cx, cy] = getCircle(moon["phase"]);
// cx = mapValue(cx,-1,1,50,-50);
// cy = mapValue(cy,-1,1,50,-50);
// $('#current-phase-scheme svg .svg-moon').attr('cx', cx);
// $('#current-phase-scheme svg .svg-moon').attr('cy', cy);
// change the font
updateAxis($watch, moon["phase"]);
}
function updateCurrentMoonTypo(date){
let lat = window.walk_calendar["latitude"];
let long = window.walk_calendar["longitude"];
let moon = getMoonStateFromDate(date, lat, long);
updateAxis($(".moon-phased-typo > p"), moon["phase"], false);
updateAxis($(".moon-phased-typo > *:not(p)"), moon["phase"], true);
updateAxis($("#about-section .about-box p:first-child"), moon["phase"], true);
}