| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8" />
- <link href="../lib/main.css" rel="stylesheet" />
- <script src="../public/js/jquery.js"></script>
- <script src="../public/js/comm.js"></script>
- <script src="jquery-3.3.1.min.js"></script>
- <script src="julian.js"></script>
- <script src="lune.js"></script>
- <script src="suncalc.js"></script>
- <script src="./planet_position/js/planet-positions.js"></script>
- <script src="../studio/js/fixedsticky.js"></script>
- <script src="../guide/guide.js"></script>
- <link type="text/css" rel="stylesheet" href="../guide/guide.css" />
- <script src="../public/js/marked.js"></script>
- <!--获取语言-->
- <script>
- var g_language = getCookie("language");
- </script>
- <script>
- var localString = new Array();
- localString["zh-cn"] = {
- and_another: "又 ",
- atitude: "纬度",
- BE: "佛历",
- bhumma: "周二",
- budha: "周三",
- canda: "周一",
- confirm: "确认",
- date: "日期",
- day: "日",
- days: "天 ",
- departure_in_detail: "起飞详情",
- dhamma_time: "会延续五千年的教法 ",
- eat: "进餐",
- gama_entry: "入村",
- guru: "周四",
- hori_ref_time: "蒙气差修正 ",
- kala: "适当的时间",
- language_select: "选择语言",
- left: "还剩下",
- loading: "载入中……",
- longitude: "经度",
- māsa: "月",
- mins: "分钟",
- month: "月 ",
- month_1: "月 ",
- months: "个月 ",
- my_loc: "我的位置",
- need_inform: "未告知其他比库",
- no_string: "不能",
- noon_time: "正午",
- noon_time: "正午",
- note: "注释",
- now_time: "现在",
- pacchā_māsa: "下个月",
- pakkha: "月相变化 ",
- past: "已过去",
- pubba_māsa: "上个月",
- ravi: "周日",
- saṃvacchara: "年",
- season: "季节 ",
- sec: "秒",
- sora: "周六",
- sukka: "周五",
- sun_height_degree: "正午太阳高度 ",
- time: "时间",
- twilight_time: "曙光",
- twilight_time: "曙光",
- vikala: "不适当的时间",
- week_day: "星期",
- year_0: "年",
- year_1: "年 ",
- years: "年 ",
- yes_string: "可以",
- timezone: "时区",
- local: "本地",
- loading: "载入中",
- sun_set: "日落",
- unknown: "未知",
- altitude: "海拔",
- today: "今天",
- week: "周",
- list: "列表",
- };
- localString["zh-tw"] = {
- and_another: "又 ",
- atitude: "緯度",
- BE: "佛曆",
- bhumma: "週二",
- budha: "週三",
- canda: "週一",
- confirm: "確認",
- date: "日期",
- day: "日",
- days: "天 ",
- departure_in_detail: "起飛詳情",
- dhamma_time: "會延續五千年的教法 ",
- eat: "進餐",
- gama_entry: "入村",
- guru: "週四",
- hori_ref_time: "蒙氣差修正 ",
- kala: "適當的時間",
- language_select: "選擇語言",
- left: "還剩下",
- loading: "載入中……",
- longitude: "經度",
- māsa: "月",
- mins: "分鐘",
- month: "月 ",
- month_1: "月 ",
- months: "個月 ",
- my_loc: "我的位置",
- need_inform: "未告知其他比庫",
- no_string: "不能",
- noon_time: "正午",
- noon_time: "正午",
- note: "註釋",
- now_time: "現在",
- pacchā_māsa: "下個月",
- pakkha: "月相變化 ",
- past: "已過去",
- pubba_māsa: "上個月",
- ravi: "週日",
- saṃvacchara: "年",
- season: "季節 ",
- sec: "秒",
- sora: "週六",
- sukka: "週五",
- sun_height_degree: "正午太陽高度 ",
- time: "時間",
- twilight_time: "曙光",
- twilight_time: "曙光",
- vikala: "不適當的時間",
- week_day: "星期",
- year_0: "年",
- year_1: "年 ",
- years: "年 ",
- yes_string: "可以",
- timezone: "時區",
- local: "本地",
- loading: "載入中",
- sun_set: "日落",
- unknown: "未知",
- altitude: "海拔",
- today: "今天",
- week: "周",
- list: "列表",
- };
- localString["default"] = {
- and_another: " and ",
- atitude: "Atitude",
- BE: "Buddhist Era ",
- bhumma: "Bhumma",
- budha: "Budha",
- canda: "Canda",
- confirm: "Confirm",
- date: "Date ",
- day: " day(s) ",
- days: " day(s) ",
- departure_in_detail: "departure in detail",
- dhamma_time: "5000 Years of the Buddha’s Dispensation ",
- eat: "eat",
- gama_entry: "entry the village",
- guru: "Guru",
- hori_ref_time: "horizontal refraction correct ",
- kala: "suitable time",
- language_select: "bhāsā",
- left: "Remains ",
- loading: "loading…",
- longitude: "Longitude",
- māsa: "māsa",
- mins: "(min)",
- month: "Month ",
- month_1: "- ",
- months: " month(s) ",
- my_loc: "attasmiṃ",
- need_inform: "without informing other Bhikkhu ",
- no_string: "cannot ",
- noon_time: "NOON",
- noon_time: "NOON",
- note: "Note",
- now_time: "NOW",
- pacchā_māsa: "pacchā-māsa",
- pakkha: "Lunar Phases ",
- past: "Passed ",
- pubba_māsa: "pubba-māsa",
- ravi: "Ravi",
- saṃvacchara: "saṃvacchara",
- season: "Season ",
- sec: "sec ",
- sora: "Sora",
- sukka: "Sukka",
- sun_height_degree: "Max solar altitude ",
- time: "Time",
- twilight_time: "dawn",
- twilight_time: "dawn",
- vikala: "unsuitable time",
- week_day: "Day",
- year_0: "saṃvacchara",
- year_1: "- ",
- years: " year(s) ",
- yes_string: "can ",
- timezone: "Timezone",
- local: "local",
- loading: "loading",
- sun_set: "sunset",
- unknown: "unknown",
- altitude: "Altitude",
- today: "today",
- week: "week",
- list: "list",
- };
- localString["en"] = {
- and_another: " and ",
- atitude: "Atitude",
- BE: "Buddhist Era ",
- bhumma: "Bhumma",
- budha: "Budha",
- canda: "Canda",
- confirm: "Confirm",
- date: "Date",
- day: " day(s) ",
- days: " day(s) ",
- departure_in_detail: "departure in detail",
- dhamma_time: "5000 Years of the Buddha’s Dispensation ",
- eat: "eat",
- gama_entry: "entry the village",
- guru: "Guru",
- hori_ref_time: "horizontal refraction correct ",
- kala: "suitable time",
- language_select: "Language",
- left: "Remains ",
- loading: "loading…",
- longitude: "Longitude",
- māsa: "māsa",
- mins: "(min)",
- month: "Month ",
- month_1: "- ",
- months: " month(s) ",
- my_loc: "my location",
- need_inform: "without informing other Bhikkhu ",
- no_string: "cannot ",
- noon_time: "NOON",
- noon_time: "NOON",
- note: "Note",
- now_time: "NOW",
- pacchā_māsa: "pacchā-māsa",
- pakkha: "Lunar Phases ",
- past: "Passed ",
- pubba_māsa: "pubba-māsa",
- ravi: "Ravi",
- saṃvacchara: "saṃvacchara",
- season: "Season ",
- sec: "sec",
- sora: "Sora",
- sukka: "Sukka",
- sun_height_degree: "Max solar altitude ",
- time: "time",
- twilight_time: "dawn",
- twilight_time: "dawn",
- vikala: "unsuitable time",
- week_day: "Day",
- year_0: "year",
- year_1: "- ",
- years: " year(s) ",
- yes_string: "can ",
- timezone: "Timezone",
- local: "local",
- loading: "loading",
- sun_set: "sunset",
- unknown: "unknown",
- altitude: "Altitude",
- today: "today",
- week: "week",
- list: "list",
- };
- localString["my"] = {
- and_another: " and ",
- atitude: "Atitude",
- BE: "Buddhist Era ",
- bhumma: "ဘုမ္မ",
- budha: "ဗုဓ",
- canda: "စန္ဒ",
- confirm: "Confirm",
- date: "Date ",
- day: " day(s) ",
- days: " day(s) ",
- departure_in_detail: "departure in detail",
- dhamma_time: "5000 Years of the Buddha’s Dispensation ",
- eat: "eat",
- gama_entry: "entry the village",
- guru: "ဂုရု",
- hori_ref_time: "horizontal refraction correct ",
- kala: "ကာလ",
- language_select: "ဘာသာ",
- left: "Remains ",
- loading: "loading…",
- longitude: "Longitude",
- māsa: "မာသ",
- mins: "(min)",
- month: "Month ",
- month_1: "- ",
- months: " month(s) ",
- my_loc: "အတ္တသ္မိံ",
- need_inform: "without informing other Bhikkhu ",
- no_string: "cannot ",
- noon_time: "မဇ္ဈန္ဟိက",
- noon_time: "မဇ္ဈန္ဟိက",
- note: "Note",
- now_time: "ပစ္စုပ္ပန္န",
- pacchā_māsa: "ပစ္ဆာ-မာသ",
- pakkha: "Lunar Phases ",
- past: "Passed ",
- pubba_māsa: "ပုဗ္ဗ-မာသ",
- ravi: "ရဝိ",
- saṃvacchara: "သံဝစ္ဆရ",
- season: "Season ",
- sec: "sec ",
- sora: "သောရ",
- sukka: "သုက္က",
- sun_height_degree: "Max solar altitude ",
- time: "Time",
- twilight_time: "အရုဏုဂ္ဂမန",
- twilight_time: "အရုဏုဂ္ဂမန",
- vikala: "ဝိကာလ",
- week_day: "Day",
- year_0: "year",
- year_1: "- ",
- years: " year(s) ",
- yes_string: "can ",
- timezone: "Timezone",
- local: "local",
- loading: "loading",
- sun_set: "sunset",
- unknown: "unknown",
- altitude: "Altitude",
- today: "today",
- week: "week",
- list: "list",
- };
- localString["si"] = {
- and_another: " ච ",
- atitude: "Atitude",
- BE: "බුද්ධ වර්ෂය ",
- bhumma: "භුම්ම",
- budha: "බුධ",
- canda: "චන්ද",
- confirm: "Confirm",
- date: "දිවස ",
- day: " දිවසා(නි) ",
- days: " දිවසා(නි) ",
- departure_in_detail: "departure in detail",
- dhamma_time: "සම්මා සම්බුද්ධස්ස සාසනං පට්ච-වස්ස-සහස්සානි පවත්තිස්සති ",
- eat: "eat",
- gama_entry: "entry the village",
- guru: "ගුරු",
- hori_ref_time: "horizontal refraction correct ",
- kala: "කාල",
- language_select: "භාෂාව",
- left: "අවසිට්ඨ ",
- loading: "ප්රවේශනය වෙනවා ",
- longitude: "Longitude",
- māsa: "මාස",
- mins: "(min)",
- month: "මාස ",
- month_1: "- ",
- months: " මාසා(නි) ",
- my_loc: "අත්තස්මිං",
- need_inform: "without informing other Bhikkhu ",
- no_string: "cannot ",
- noon_time: "මජ්ඣන්හික",
- noon_time: "මජ්ඣන්හික",
- note: "නෝට්ටුව ",
- now_time: "පච්චුප්පන්න",
- pacchā_māsa: "පච්ඡා-මාස",
- pakkha: "පක්ඛ ",
- past: "අතික්කන්ත ",
- pubba_māsa: "පුබ්බ-මාස",
- ravi: "රවි",
- saṃvacchara: "සංවච්ඡර",
- season: "උතු ",
- sec: "sec",
- sora: "සොර",
- sukka: "සුක්ක",
- sun_height_degree: "Max solar altitude ",
- time: "time",
- twilight_time: "අරුණුග්ගමන",
- twilight_time: "අරුණුග්ගමන",
- vikala: "විකාල",
- week_day: "වාර ",
- year_0: "සංවච්ඡර",
- year_1: "- ",
- years: " සංවච්ඡරා(නි) ",
- yes_string: "can ",
- timezone: "Timezone",
- local: "local",
- loading: "loading",
- sun_set: "sunset",
- unknown: "unknown",
- altitude: "Altitude",
- today: "today",
- week: "week",
- list: "list",
- };
- var pali_month_name = [
- { id: "1", value: "jeṭṭha", season: "gimhāna", season_icon: "☀" }, //5.X-四-十五-心
- { id: "2", value: "asāḷha", season: "gimhāna", season_icon: "☀" }, //6.X-五-十五、十六-箕、斗
- { id: "3", value: "sāvana", season: "vassāna", season_icon: "☔" }, //7.X-六-十五-女
- { id: "4", value: "poṭṭhapāda", season: "vassāna", season_icon: "☔" }, //8.x-七-十五、十六-室、壁
- { id: "5", value: "assajuja", season: "vassāna", season_icon: "☔" }, //9.X-八-十五-樓
- { id: "6", value: "kattika", season: "vassāna", season_icon: "☔" }, //10.X-九-十五-昂
- { id: "7", value: "māgasira", season: "hemanta", season_icon: "❄" }, //11.X-十-十五-觜
- { id: "8", value: "phussa", season: "hemanta", season_icon: "❄" }, //12.X-十一-十五-鬼
- { id: "9", value: "māgha", season: "hemanta", season_icon: "❄" }, //1.X-十二-十五-星
- { id: "10", value: "phagguna", season: "hemanta", season_icon: "❄" }, //2.X-正月-十四、十五-張、異
- { id: "11", value: "citta", season: "gimhāna", season_icon: "☀" }, //3.X-二月-十五-角
- { id: "12", value: "vesākha", season: "gimhāna", season_icon: "☀" }, //4.X-三月-十五-氐
- ];
- var pali_nakkhatta_name = [
- { id: "0", value: "assayuja", name_zh: "娄宿" },
- { id: "1", value: "bharaṇī", name_zh: "胃宿" },
- { id: "2", value: "Kattikā", name_zh: "昂宿" },
- { id: "3", value: "rohiṇī", name_zh: "毕宿" },
- { id: "4", value: "magasira", name_zh: "觜宿" },
- { id: "5", value: "Addā", name_zh: "参宿" },
- { id: "6", value: "punabbasu", name_zh: "井宿" },
- { id: "7", value: "phussa", name_zh: "鬼宿" },
- { id: "8", value: "Asilesā", name_zh: "柳宿" },
- { id: "9", value: "maghā", name_zh: "星宿" },
- { id: "10", value: "pubbaphagguṇī", name_zh: "张宿" },
- { id: "11", value: "uttaraphagguṇī", name_zh: "翼宿" },
- { id: "12", value: "hattha", name_zh: "轸宿" },
- { id: "13", value: "cittā", name_zh: "角宿" },
- { id: "14", value: "sāti", name_zh: "亢宿" },
- { id: "15", value: "visākhā", name_zh: "氐宿" },
- { id: "16", value: "anurādhā", name_zh: "房宿" },
- { id: "17", value: "jeṭṭha", name_zh: "心宿" },
- { id: "18", value: "mūlā", name_zh: "尾宿" },
- { id: "19", value: "pubbāsāḷha", name_zh: "箕宿" },
- { id: "20", value: "uttarāsāḷha", name_zh: "斗宿" },
- { id: "21", value: "savaṇa", name_zh: "女宿" },
- { id: "22", value: "dhaniṭṭhā", name_zh: "虚宿" },
- { id: "23", value: "satabhisaja", name_zh: "危宿" },
- { id: "24", value: "pubbabhaddapadā", name_zh: "室宿" },
- { id: "25", value: "uttarabhaddapadā", name_zh: "壁宿" },
- { id: "26", value: "revatī", name_zh: "奎宿" },
- ];
- var horoscope_name = [
- { id: "0", value: "Aries", name_zh: "白羊", icon: "♈" },
- { id: "1", value: "Taurus", name_zh: "金牛", icon: "♉" },
- { id: "2", value: "Gemini", name_zh: "双子", icon: "♊" },
- { id: "3", value: "Cancer", name_zh: "巨蟹", icon: "♋" },
- { id: "4", value: "Leo", name_zh: "狮子", icon: "♌" },
- { id: "5", value: "Virgo", name_zh: "处女", icon: "♍" },
- { id: "6", value: "Libra", name_zh: "天秤", icon: "♎" },
- { id: "7", value: "Scorpio", name_zh: "天蝎", icon: "♏" },
- { id: "8", value: "Sagittarius", name_zh: "射手", icon: "♐" },
- { id: "9", value: "Capricornus", name_zh: "摩羯", icon: "♑" },
- { id: "10", value: "Aquarius", name_zh: "水瓶", icon: "♒" },
- { id: "11", value: "Pisces", name_zh: "双鱼", icon: "♓" },
- ];
- </script>
- <script>
- var current_phase = phase();
- console.log(current_phase); //输出到控制台
- //$("#title_text").html(localString[g_language].BE);
- var new_list = new Array(); //新月列表
- var first_list = new Array(); //上弦月列表
- var full_list = new Array(); //满月列表
- var last_list = new Array(); //下弦月列表
- var planets = new Array(); //
- var lunar_position = new Object();
- var g_coordinate_this = new Object();
- var g_now_date = new Date();
- var today = new Date();
- var start_day = new Date();
- var next_year = new Date();
- var sun_times = new Object();
- var curr_position = localStorage.getItem("local_position");
- if (curr_position) {
- g_coordinate_this.AT = curr_position.split("#")[0];
- g_coordinate_this.LT = curr_position.split("#")[1];
- g_coordinate_this.height = curr_position.split("#")[2];
- var AT_string =
- angle_trans(g_coordinate_this.AT)[0] +
- "°" +
- angle_trans(g_coordinate_this.AT)[1] +
- "’" +
- angle_trans(g_coordinate_this.AT)[2] +
- "”";
- if (g_coordinate_this.AT >= 0) {
- AT_string += "N";
- } else {
- AT_string += "S";
- }
- var LT_string =
- angle_trans(g_coordinate_this.LT)[0] +
- "°" +
- angle_trans(g_coordinate_this.LT)[1] +
- "’" +
- angle_trans(g_coordinate_this.LT)[2] +
- "”";
- if (g_coordinate_this.LT >= 0) {
- LT_string += "E";
- } else {
- LT_string += "W";
- }
- if (g_coordinate_this.height != "null") {
- var height_string = g_coordinate_this.height + "M";
- } else {
- var height_string = localString[g_language].unknown;
- }
- } else {
- getLocation();
- }
- function show_time() {
- if ($("#input_time").val()) {
- today = new Date($("#input_time").val());
- } else {
- today = g_now_date;
- }
- lunar_phase_list_refresh();
- get_position(today);
- let d_earth_to_moon =
- lunar_position.position.x ^
- (2 + lunar_position.position.y) ^
- (2 + lunar_position.position.z) ^
- 2 ^
- 0.5;
- let d_earth_to_moon_0 = phase(today).distance;
- sun_times = SunCalc.getTimes(
- today,
- g_coordinate_this.AT,
- g_coordinate_this.LT,
- g_coordinate_this.height / 1000
- );
- sun_position = SunCalc.getPosition(today, g_coordinate_this.AT, g_coordinate_this.LT);
- moon_position = SunCalc.getMoonPosition(today, g_coordinate_this.AT, g_coordinate_this.LT);
- moon_Illumination = SunCalc.getMoonIllumination(today);
- }
- //根据时间计算偏角,输出
- function get_position(date_time) {
- let planets_position = new Object();
- planets = window.lagrange.planet_positions.getPositions(date_time);
- //planets = global.planet_positions.getPositions(today);
- //console.log(planets)//输出到控制台
- earth_position = window.lagrange.planet_positions.getPositions(date_time)[3];
- lunar_position = window.lagrange.planet_positions.getPositions(date_time)[11];
- let lunar_position_angle = 0;
- let lunar_station = 0;
- let earth_position_angle = 0;
- let earth_station = 0;
- let earth_position_angle_round = 0;
- let lunar_position_angle_round = 0;
- //太阳相对地球的黄道偏角
- if (earth_position.position.y >= 0) {
- earth_position_angle = Math.atan2(earth_position.position.y, earth_position.position.x);
- } else {
- earth_position_angle =
- Math.PI * 2 + Math.atan2(earth_position.position.y, earth_position.position.x);
- }
- earth_position_angle_round = earth_position_angle / Math.PI / 2 + 0.5;
- earth_position_angle_round = earth_position_angle_round - Math.floor(earth_position_angle_round);
- earth_station = earth_position_angle_round * 12;
- planets_position.solar_station = earth_station;
- planets_position.solar_position_angle = earth_position_angle_round * Math.PI * 2;
- planets_position.solar_position_angle_round = earth_position_angle_round;
- //月球相对地球的黄道偏角——角度差算法
- lunar_position_angle_round = earth_position_angle_round + phase(date_time).phase;
- lunar_position_angle_round = lunar_position_angle_round - Math.floor(lunar_position_angle_round);
- lunar_position_angle = lunar_position_angle_round * Math.PI * 2;
- lunar_station = lunar_position_angle_round * 27;
- //月球相对地球的黄道偏角算法——向量差算法
- let lunar_to_earth = new Object();
- lunar_to_earth.y = lunar_position.position.y - earth_position.position.y;
- lunar_to_earth.x = lunar_position.position.x - earth_position.position.x;
- if (lunar_to_earth.y >= 0) {
- lunar_position_angle2 = Math.atan2(lunar_to_earth.y, lunar_to_earth.x);
- } else {
- lunar_position_angle2 = Math.PI * 2 + Math.atan2(lunar_to_earth.y, lunar_to_earth.x);
- }
- lunar_position_angle_round2 = lunar_position_angle2 / Math.PI / 2;
- //lunar_position_angle_round = lunar_position_angle_round - Math.floor(lunar_position_angle_round)
- lunar_position_angle2 = lunar_position_angle_round2 * Math.PI * 2;
- lunar_station2 = lunar_position_angle_round2 * 27;
- planets_position.lunar_station = lunar_station; //月站值【角度差算夹角】
- planets_position.lunar_position_angle = lunar_position_angle; //月站角【角度差算夹角】
- planets_position.lunar_position_angle_round = lunar_position_angle_round; //月站圆周比率【角度差算夹角】
- planets_position.lunar_station2 = lunar_station2; //月站值【矢量差算夹角】
- planets_position.lunar_position_angle2 = lunar_position_angle2; //月站角【矢量差算夹角】
- planets_position.lunar_position_angle_round2 = lunar_position_angle_round2; //月站圆周比率【矢量差算夹角】
- return planets_position;
- }
- //根据;
- function get_station_name(data_time) {
- //获取星象信息
- let solar_num = 0;
- let lunar_num = 0;
- solar_num = get_position(data_time).solar_station;
- solar_num = Math.floor(solar_num);
- lunar_num = get_position(data_time).lunar_station;
- lunar_num = Math.floor(lunar_num);
- let result = new Object();
- result.solar = horoscope_name[solar_num]; //黄道十二宫星象名称
- result.lunar = pali_nakkhatta_name[lunar_num]; //27星宿月站名称
- return result;
- }
- function getLocation() {
- //自动定位
- if (navigator.geolocation) {
- navigator.geolocation.getCurrentPosition(showPosition, showError);
- } else {
- $("#selected_position_string").html("Geolocation is not supported by this browser.");
- }
- }
- function position_input() {
- //手动输入
- var LT = Number($("#LT_°")[0].value);
- LT += Number($("#LT_’")[0].value) / 60;
- LT += Number($("#LT_”")[0].value) / 3600;
- LT = Number($("#WE")[0].value + LT);
- var AT = Number($("#AT_°")[0].value);
- AT += Number($("#AT_’")[0].value) / 60;
- AT += Number($("#AT_”")[0].value) / 3600;
- AT = Number($("#NS")[0].value + AT);
- if (AT != 0) {
- g_coordinate_this.LT = LT;
- g_coordinate_this.AT = AT;
- }
- }
- function showError(error) {
- switch (error.code) {
- case error.PERMISSION_DENIED:
- alert("定位失败,用户拒绝请求地理定位");
- break;
- case error.POSITION_UNAVAILABLE:
- alert("定位失败,位置信息是不可用");
- break;
- case error.TIMEOUT:
- alert("定位失败,请求获取用户位置超时");
- break;
- case error.UNKNOWN_ERROR:
- alert("定位失败,定位系统失效");
- break;
- }
- }
- function angle_trans(angle) {
- var angle_str = new Array();
- var num_d = Math.floor(angle);
- var num_m = Math.floor((angle - num_d) * 60);
- var num_s = Math.round((angle - num_d) * 60 - num_m);
- angle_str.push(num_d);
- angle_str.push(num_m);
- angle_str.push(num_s);
- return angle_str;
- }
- function input_position() {
- $("#position_input").show();
- }
- var g_event_list_arr = new Array();
- function get_event_arr() {
- let today = new Date();
- let date = new Date();
- for (i = -360; i < 360; i++) {
- date.setTime(today.getTime() + i * 3600 * 24 * 1000);
- let info_obj = new Object();
- info_obj.id = "dawn" + i;
- info_obj.title = localString[g_language].twilight_time;
- info_obj.start = SunCalc.getTimes(
- date,
- g_coordinate_this.AT,
- g_coordinate_this.LT,
- g_coordinate_this.height / 1000
- ).dawn;
- g_event_list_arr.push(info_obj);
- info_obj = new Object();
- info_obj.id = "noon" + i;
- info_obj.title = localString[g_language].noon_time;
- info_obj.start = SunCalc.getTimes(
- date,
- g_coordinate_this.AT,
- g_coordinate_this.LT,
- g_coordinate_this.height / 1000
- ).solarNoon;
- g_event_list_arr.push(info_obj);
- info_obj = new Object();
- info_obj.id = "sunset" + i;
- info_obj.title = localString[g_language].sun_set;
- info_obj.start = SunCalc.getTimes(
- date,
- g_coordinate_this.AT,
- g_coordinate_this.LT,
- g_coordinate_this.height / 1000
- ).sunset;
- g_event_list_arr.push(info_obj);
- }
- next_year.setDate(start_day.getDate() + 360);
- start_day.setDate(today.getDate() - 360);
- last_list = phaseRange(start_day, next_year, LAST); //获取下弦月列表
- for (i_last in last_list) {
- info_obj = new Object();
- info_obj.id = "last_moon" + i_last;
- info_obj.title = "🌗" + get_station_name(last_list[i_last]).lunar.value;
- info_obj.start = last_list[i_last];
- g_event_list_arr.push(info_obj);
- }
- new_list = phaseRange(start_day, next_year, NEW); //获取新月列表
- for (i_new in new_list) {
- info_obj = new Object();
- info_obj.id = "new_moon" + i_new;
- info_obj.title = "🌑" + get_station_name(new_list[i_new]).lunar.value;
- info_obj.start = new_list[i_new];
- g_event_list_arr.push(info_obj);
- }
- first_list = phaseRange(start_day, next_year, FIRST); //获取上弦月列表
- for (i_first in first_list) {
- info_obj = new Object();
- info_obj.id = "first_moon" + i_first;
- info_obj.title = "🌓" + get_station_name(first_list[i_first]).lunar.value;
- info_obj.start = first_list[i_first];
- g_event_list_arr.push(info_obj);
- }
- full_list = phaseRange(start_day, next_year, FULL); //获取满月列表
- for (i_full in full_list) {
- info_obj = new Object();
- info_obj.id = "full_moon" + i_full;
- info_obj.title = "🌕" + get_station_name(full_list[i_full]).lunar.value;
- info_obj.start = full_list[i_full];
- g_event_list_arr.push(info_obj);
- }
- /*console.log(last_list); //输出到控制台
- console.log(new_list); //输出到控制台
- console.log(first_list); //输出到控制台
- console.log(full_list); //输出到控制台*/
- }
- get_event_arr();
- </script>
- <script src="../lib/main.js"></script>
- <script>
- function getCookie(name) {
- var start = document.cookie.indexOf(name + "=");
- var len = start + name.length + 1;
- if (!start && name != document.cookie.substring(0, name.length)) {
- return null;
- }
- if (start == -1) return null;
- var end = document.cookie.indexOf(";", len);
- if (end == -1) end = document.cookie.length;
- return decodeURI(document.cookie.substring(len, end));
- }
- document.addEventListener("DOMContentLoaded", function () {
- var initialTimeZone = "local";
- var timeZoneSelectorEl = document.getElementById("time-zone-selector");
- var loadingEl = document.getElementById("loading");
- var calendarEl = document.getElementById("calendar");
- var calendar = new FullCalendar.Calendar(calendarEl, {
- timeZone: initialTimeZone,
- locale: getCookie("language"),
- headerToolbar: {
- left: "prev,next today",
- center: "title",
- right: "dayGridMonth,timeGridWeek,timeGridDay,listWeek",
- },
- //initialDate: "2020-12-12",
- navLinks: true, // can click day/week names to navigate views
- editable: true,
- selectable: true,
- dayMaxEvents: true, // allow "more" link when too many events
- //resources: g_event_list_arr,
- events: g_event_list_arr,
- defaultTimedEventDuration: "00:01",
- eventClick: function (info) {
- info.jsEvent.preventDefault(); // don't let the browser navigate
- if (info.event.url) {
- window.open(info.event.url);
- }
- },
- loading: function (bool) {
- if (bool) {
- loadingEl.style.display = "inline"; // show
- } else {
- loadingEl.style.display = "none"; // hide
- }
- },
- eventTimeFormat: { hour: "numeric", minute: "2-digit" },
- dateClick: function (arg) {
- console.log("dateClick", calendar.formatIso(arg.date));
- },
- select: function (arg) {
- console.log("select", calendar.formatIso(arg.start), calendar.formatIso(arg.end));
- },
- });
- calendar.render();
- // load the list of available timezones, build the <select> options
- // it's HIGHLY recommended to use a different library for network requests, not this internal util func
- FullCalendar.requestJson(
- "GET",
- "php/get-time-zones.php",
- {},
- function (timeZones) {
- timeZones.forEach(function (timeZone) {
- var optionEl;
- if (timeZone !== "UTC") {
- // UTC is already in the list
- optionEl = document.createElement("option");
- optionEl.value = timeZone;
- optionEl.innerText = timeZone;
- timeZoneSelectorEl.appendChild(optionEl);
- }
- });
- },
- function () {
- // TODO: handle error
- }
- );
- // when the timezone selector changes, dynamically change the calendar option
- timeZoneSelectorEl.addEventListener("change", function () {
- calendar.setOption("timeZone", this.value);
- });
- });
- </script>
- <style>
- body {
- margin: 0;
- padding: 0;
- font-family: Arial, Helvetica Neue, Helvetica, sans-serif;
- font-size: 14px;
- }
- #top {
- background: #eee;
- border-bottom: 1px solid #ddd;
- padding: 0 10px;
- line-height: 40px;
- font-size: 12px;
- }
- .left {
- float: left;
- }
- .right {
- float: right;
- }
- .clear {
- clear: both;
- }
- #script-warning,
- #loading {
- display: none;
- }
- #script-warning {
- font-weight: bold;
- color: red;
- }
- #calendar {
- max-width: 1100px;
- margin: 40px auto;
- padding: 0 10px;
- }
- .tzo {
- color: #000;
- }
- input[type="number" i] {
- width: 2.5em;
- }
- </style>
- </head>
- <body>
- <div id="top">
- <div class="left">
- <script>
- document.write(localString[g_language].timezone + ":");
- </script>
- <select id="time-zone-selector">
- <option value="local" selected>
- <script>
- document.write(localString[g_language].local);
- </script>
- </option>
- <option value="UTC">UTC</option>
- </select>
- </div>
- <div style="display: inline-block; width: 50%; justify-content: center; margin-left: 20%">
- <div style="line-height: 2em; margin-top: 7px">
- <script>
- document.write(localString[g_language].atitude);
- </script>
- <span id="AT_str" onclick="show_ele(this)"></span>
- <span class="coordinate_input" style="flex: 7; white-space: nowrap; display: none">
- <input id="AT_°" type="number" min="0" max="89" /> °
- <input id="AT_’" type="number" min="0" max="59" /> ’
- <input id="AT_”" type="number" min="0" max="59" /> ”
- <select id="NS">
- <option value="+">N</option>
- <option value="-">S</option>
- </select>
- <button onclick="show_ele('#AT_str')">
- <script>
- document.write(localString[g_language].confirm);
- </script>
- </button>
- </span>
- </div>
- <div style="line-height: 2em">
- <script>
- document.write(localString[g_language].longitude);
- </script>
- <span id="LT_str" onclick="show_ele(this)"></span>
- <span
- class="coordinate_input"
- onblur="show_ele(this)"
- style="flex: 7; white-space: nowrap; display: none"
- >
- <input id="LT_°" type="number" min="0" max="179" style="width: 3em" /> °
- <input id="LT_’" type="number" min="0" max="59" /> ’
- <input id="LT_”" type="number" min="0" max="59" /> ”
- <select id="WE">
- <option value="+">E</option>
- <option value="-">W</option>
- </select>
- <button onclick="show_ele('#LT_str')">
- <script>
- document.write(localString[g_language].confirm);
- </script>
- </button>
- </span>
- </div>
- <div style="line-height: 2em">
- <script>
- document.write(localString[g_language].altitude);
- </script>
- <span id="altitude_string" onclick="show_ele(this)"></span>
- <span class="coordinate_input" style="flex: 7; white-space: nowrap; display: none">
- <input id="HT_M" type="number" min="0" max="19999" style="width: 4em" /> M
- <button onclick="show_ele('#altitude_string')">
- <script>
- document.write(localString[g_language].confirm);
- </script>
- </button>
- </span>
- </div>
- </div>
- <div class="right">
- <span id="loading">
- <script>
- document.write(localString[g_language].loading + "…");
- </script>
- </span>
- <span id="script-warning"><code>php/get-events.php</code> must be running.</span>
- </div>
- <div class="clear"></div>
- </div>
- <div id="calendar"></div>
- </body>
- <script>
- function position_modify() {
- var LT = Number($("#LT_°")[0].value);
- LT += Number($("#LT_’")[0].value) / 60;
- LT += Number($("#LT_”")[0].value) / 3600;
- LT = Number($("#WE")[0].value + LT);
- var AT = Number($("#AT_°")[0].value);
- AT += Number($("#AT_’")[0].value) / 60;
- AT += Number($("#AT_”")[0].value) / 3600;
- AT = Number($("#NS")[0].value + AT);
- if (AT != 0) {
- g_coordinate_this.LT = LT;
- g_coordinate_this.AT = AT;
- }
- //将新的坐标数据存到localStorage
- let position_string = g_coordinate_this.AT + "#" + g_coordinate_this.LT + "#" + g_coordinate_this.height;
- localStorage.setItem("local_position", position_string);
- }
- function position_modify_confirm(obj) {
- position_modify();
- show_ele(obj);
- }
- function show_ele(obj) {
- if ($(obj).siblings("span").css("display") == "none") {
- $(obj).hide();
- $(obj).siblings("span").show();
- } else {
- $(obj).show();
- $(obj).siblings("span").hide();
- }
- }
- function getLocation() {
- //自动定位
- if (navigator.geolocation) {
- navigator.geolocation.getCurrentPosition(showPosition, showError);
- } else {
- $("#selected_position_string").html("Geolocation is not supported by this browser.");
- }
- }
- function position_input() {
- //手动输入
- var LT = Number($("#LT_°")[0].value);
- LT += Number($("#LT_’")[0].value) / 60;
- LT += Number($("#LT_”")[0].value) / 3600;
- LT = Number($("#WE")[0].value + LT);
- var AT = Number($("#AT_°")[0].value);
- AT += Number($("#AT_’")[0].value) / 60;
- AT += Number($("#AT_”")[0].value) / 3600;
- AT = Number($("#NS")[0].value + AT);
- if (AT != 0) {
- g_coordinate_this.LT = LT;
- g_coordinate_this.AT = AT;
- }
- }
- function showError(error) {
- switch (error.code) {
- case error.PERMISSION_DENIED:
- alert("定位失败,用户拒绝请求地理定位");
- break;
- case error.POSITION_UNAVAILABLE:
- alert("定位失败,位置信息是不可用");
- break;
- case error.TIMEOUT:
- alert("定位失败,请求获取用户位置超时");
- break;
- case error.UNKNOWN_ERROR:
- alert("定位失败,定位系统失效");
- break;
- }
- }
- $("#AT_str").html(AT_string);
- $("#LT_str").html(LT_string);
- $("#altitude_string").html(height_string);
- $("#AT_°")[0].value = angle_trans(g_coordinate_this.AT)[0];
- $("#AT_’")[0].value = angle_trans(g_coordinate_this.AT)[1];
- $("#AT_”")[0].value = angle_trans(g_coordinate_this.AT)[2];
- $("#LT_°")[0].value = angle_trans(g_coordinate_this.LT)[0];
- $("#LT_’")[0].value = angle_trans(g_coordinate_this.LT)[1];
- $("#LT_”")[0].value = angle_trans(g_coordinate_this.LT)[2];
- $("#HT_M")[0].value = g_coordinate_this.height;
- $(document).ready(function () {
- $("button").each(function () {
- if ($(this).html() == "today") {
- $(this).html(localString[g_language].today);
- }
- if ($(this).html() == "list") {
- $(this).html(localString[g_language].list);
- }
- if ($(this).html() == "week") {
- $(this).html(localString[g_language].week);
- }
- if ($(this).html() == "month") {
- $(this).html(localString[g_language].month);
- }
- if ($(this).html() == "day") {
- $(this).html(localString[g_language].day);
- }
- });
- });
- $(document).ready(function () {
- $("button").click(function () {
- $("button").each(function () {
- if ($(this).html().indexOf("today") != -1) {
- $(this).html(localString[g_language].today);
- }
- if ($(this).html().indexOf("list") != -1) {
- $(this).html(localString[g_language].list);
- }
- if ($(this).html().indexOf("week") != -1) {
- $(this).html(localString[g_language].week);
- }
- if ($(this).html().indexOf("month") != -1) {
- $(this).html(localString[g_language].month);
- }
- if ($(this).html().indexOf("day") != -1 && $(this).html().indexOf("today") == -1) {
- $(this).html(localString[g_language].day);
- }
- });
- });
- });
- $(document).ready(function () {
- $("div").click(function () {
- $("button").each(function () {
- if ($(this).html().indexOf("today") != -1) {
- $(this).html(localString[g_language].today);
- }
- if ($(this).html().indexOf("list") != -1) {
- $(this).html(localString[g_language].list);
- }
- if ($(this).html().indexOf("week") != -1) {
- $(this).html(localString[g_language].week);
- }
- if ($(this).html().indexOf("month") != -1) {
- $(this).html(localString[g_language].month);
- }
- if ($(this).html().indexOf("day") != -1 && $(this).html().indexOf("today") == -1) {
- $(this).html(localString[g_language].day);
- }
- });
- });
- });
- </script>
- </html>
|