index1.html 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <link type="text/css" rel="stylesheet" href="../pcdl/css/font.css" />
  7. <link type="text/css" rel="stylesheet" href="../pcdl/css/basic_style.css" />
  8. <link type="text/css" rel="stylesheet" href="../pcdl/css/style.css" />
  9. <link type="text/css" rel="stylesheet" href="../pcdl/css/color_day.css" id="colorchange" />
  10. <link type="text/css" rel="stylesheet" href="../pcdl/css/style_mobile.css" media="screen and (max-width:767px)">
  11. <script src="../public/js/jquery.js"></script>
  12. <script src="../public/js/comm.js"></script>
  13. <script src="jquery-3.3.1.min.js"></script>
  14. <script src="julian.js"></script>
  15. <script src="lune.js"></script>
  16. <script src="suncalc.js"></script>
  17. <script src="./planet_position/js/planet-positions.js"></script>
  18. <script src="../studio/js/fixedsticky.js"></script>
  19. <script src="../guide/guide.js"></script>
  20. <link type="text/css" rel="stylesheet" href="../guide/guide.css" />
  21. <script src="../public/js/marked.js"></script>
  22. <!--获取语言-->
  23. <script>
  24. var g_language = "en";
  25. var g_currLink = "";
  26. function lang_init(strPage) {
  27. g_currLink = strPage;
  28. }
  29. function setLang(strLang) {
  30. g_language = strLang;
  31. setCookie('language', g_language, 365);
  32. window.location.assign(location.pathname + "?language=" + g_language);
  33. }
  34. </script>
  35. <script>
  36. var localString = new Array();
  37. localString["zh-cn"] = {
  38. "and_another": "又 ",
  39. "atitude": "纬度",
  40. "BE": "佛历",
  41. "bhumma": "周二",
  42. "budha": "周三",
  43. "canda": "周一",
  44. "confirm": "确认",
  45. "date": "日期",
  46. "day": "日",
  47. "days": "天 ",
  48. "departure_in_detail": "起飞详情",
  49. "dhamma_time": "会延续五千年的教法 ",
  50. "eat": "进餐",
  51. "gama_entry": "入村",
  52. "guru": "周四",
  53. "hori_ref_time": "蒙气差修正 ",
  54. "kala": "适当的时间",
  55. "language_select": "选择语言",
  56. "left": "还剩下",
  57. "loading": "载入中……",
  58. "longitude": "经度",
  59. "māsa": "月",
  60. "mins": "分钟",
  61. "month": "月 ",
  62. "month_1": "月 ",
  63. "months": "个月 ",
  64. "my_loc": "我的位置",
  65. "need_inform": "未告知其他比库",
  66. "no_string": "不能",
  67. "noon_time": "正午",
  68. "noon_time": "正午",
  69. "note": "注释",
  70. "now_time": "现在",
  71. "pacchā_māsa": "下个月",
  72. "pakkha": "月相变化 ",
  73. "past": "已过去",
  74. "pubba_māsa": "上个月",
  75. "ravi": "周日",
  76. "saṃvacchara": "年",
  77. "season": "季节 ",
  78. "sec": "秒",
  79. "sora": "周六",
  80. "sukka": "周五",
  81. "sun_height_degree": "正午太阳高度 ",
  82. "time": "时间",
  83. "twilight_time": "曙光",
  84. "twilight_time": "曙光",
  85. "vikala": "不适当的时间",
  86. "week_day": "星期",
  87. "year_0": "年",
  88. "year_1": "年 ",
  89. "years": "年 ",
  90. "yes_string": "可以"
  91. };
  92. localString["zh-tw"] = {
  93. "and_another": "又 ",
  94. "atitude": "緯度",
  95. "BE": "佛曆",
  96. "bhumma": "週二",
  97. "budha": "週三",
  98. "canda": "週一",
  99. "confirm": "確認",
  100. "date": "日期",
  101. "day": "日",
  102. "days": "天 ",
  103. "departure_in_detail": "起飛詳情",
  104. "dhamma_time": "會延續五千年的教法 ",
  105. "eat": "進餐",
  106. "gama_entry": "入村",
  107. "guru": "週四",
  108. "hori_ref_time": "蒙氣差修正 ",
  109. "kala": "適當的時間",
  110. "language_select": "選擇語言",
  111. "left": "還剩下",
  112. "loading": "載入中……",
  113. "longitude": "經度",
  114. "māsa": "月",
  115. "mins": "分鐘",
  116. "month": "月 ",
  117. "month_1": "月 ",
  118. "months": "個月 ",
  119. "my_loc": "我的位置",
  120. "need_inform": "未告知其他比庫",
  121. "no_string": "不能",
  122. "noon_time": "正午",
  123. "noon_time": "正午",
  124. "note": "註釋",
  125. "now_time": "現在",
  126. "pacchā_māsa": "下個月",
  127. "pakkha": "月相變化 ",
  128. "past": "已過去",
  129. "pubba_māsa": "上個月",
  130. "ravi": "週日",
  131. "saṃvacchara": "年",
  132. "season": "季節 ",
  133. "sec": "秒",
  134. "sora": "週六",
  135. "sukka": "週五",
  136. "sun_height_degree": "正午太陽高度 ",
  137. "time": "時間",
  138. "twilight_time": "曙光",
  139. "twilight_time": "曙光",
  140. "vikala": "不適當的時間",
  141. "week_day": "星期",
  142. "year_0": "年",
  143. "year_1": "年 ",
  144. "years": "年 ",
  145. "yes_string": "可以"
  146. };
  147. localString["default"] = {
  148. "and_another": " and ",
  149. "atitude": "Atitude",
  150. "BE": "Buddhist Era ",
  151. "bhumma": "Bhumma",
  152. "budha": "Budha",
  153. "canda": "Canda",
  154. "confirm": "Confirm",
  155. "date": "Date ",
  156. "day": " day(s) ",
  157. "days": " day(s) ",
  158. "departure_in_detail": "departure in detail",
  159. "dhamma_time": "5000 Years of the Buddha’s Dispensation ",
  160. "eat": "eat",
  161. "gama_entry": "entry the village",
  162. "guru": "Guru",
  163. "hori_ref_time": "horizontal refraction correct ",
  164. "kala": "suitable time",
  165. "language_select": "bhāsā",
  166. "left": "Remains ",
  167. "loading": "loading…",
  168. "longitude": "Longitude",
  169. "māsa": "māsa",
  170. "mins": "(min)",
  171. "month": "Month ",
  172. "month_1": "- ",
  173. "months": " month(s) ",
  174. "my_loc": "attasmiṃ",
  175. "need_inform": "without informing other Bhikkhu ",
  176. "no_string": "cannot ",
  177. "noon_time": "NOON",
  178. "noon_time": "NOON",
  179. "note": "Note",
  180. "now_time": "NOW",
  181. "pacchā_māsa": "pacchā-māsa",
  182. "pakkha": "Lunar Phases ",
  183. "past": "Passed ",
  184. "pubba_māsa": "pubba-māsa",
  185. "ravi": "Ravi",
  186. "saṃvacchara": "saṃvacchara",
  187. "season": "Season ",
  188. "sec": "sec ",
  189. "sora": "Sora",
  190. "sukka": "Sukka",
  191. "sun_height_degree": "Max solar altitude ",
  192. "time": "Time",
  193. "twilight_time": "dawn",
  194. "twilight_time": "dawn",
  195. "vikala": "unsuitable time",
  196. "week_day": "Day",
  197. "year_0": "saṃvacchara",
  198. "year_1": "- ",
  199. "years": " year(s) ",
  200. "yes_string": "can "
  201. };
  202. localString["en"] = {
  203. "and_another": " and ",
  204. "atitude": "Atitude",
  205. "BE": "Buddhist Era ",
  206. "bhumma": "Bhumma",
  207. "budha": "Budha",
  208. "canda": "Canda",
  209. "confirm": "Confirm",
  210. "date": "Date",
  211. "day": " day(s) ",
  212. "days": " day(s) ",
  213. "departure_in_detail": "departure in detail",
  214. "dhamma_time": "5000 Years of the Buddha’s Dispensation ",
  215. "eat": "eat",
  216. "gama_entry": "entry the village",
  217. "guru": "Guru",
  218. "hori_ref_time": "horizontal refraction correct ",
  219. "kala": "suitable time",
  220. "language_select": "Language",
  221. "left": "Remains ",
  222. "loading": "loading…",
  223. "longitude": "Longitude",
  224. "māsa": "māsa",
  225. "mins": "(min)",
  226. "month": "Month ",
  227. "month_1": "- ",
  228. "months": " month(s) ",
  229. "my_loc": "my location",
  230. "need_inform": "without informing other Bhikkhu ",
  231. "no_string": "cannot ",
  232. "noon_time": "NOON",
  233. "noon_time": "NOON",
  234. "note": "Note",
  235. "now_time": "NOW",
  236. "pacchā_māsa": "pacchā-māsa",
  237. "pakkha": "Lunar Phases ",
  238. "past": "Passed ",
  239. "pubba_māsa": "pubba-māsa",
  240. "ravi": "Ravi",
  241. "saṃvacchara": "saṃvacchara",
  242. "season": "Season ",
  243. "sec": "sec",
  244. "sora": "Sora",
  245. "sukka": "Sukka",
  246. "sun_height_degree": "Max solar altitude ",
  247. "time": "time",
  248. "twilight_time": "dawn",
  249. "twilight_time": "dawn",
  250. "vikala": "unsuitable time",
  251. "week_day": "Day",
  252. "year_0": "year",
  253. "year_1": "- ",
  254. "years": " year(s) ",
  255. "yes_string": "can "
  256. };
  257. localString["my"] = {
  258. "and_another": " and ",
  259. "atitude": "Atitude",
  260. "BE": "Buddhist Era ",
  261. "bhumma": "ဘုမ္မ",
  262. "budha": "ဗုဓ",
  263. "canda": "စန္ဒ",
  264. "confirm": "Confirm",
  265. "date": "Date ",
  266. "day": " day(s) ",
  267. "days": " day(s) ",
  268. "departure_in_detail": "departure in detail",
  269. "dhamma_time": "5000 Years of the Buddha’s Dispensation ",
  270. "eat": "eat",
  271. "gama_entry": "entry the village",
  272. "guru": "ဂုရု",
  273. "hori_ref_time": "horizontal refraction correct ",
  274. "kala": "ကာလ",
  275. "language_select": "ဘာသာ",
  276. "left": "Remains ",
  277. "loading": "loading…",
  278. "longitude": "Longitude",
  279. "māsa": "မာသ",
  280. "mins": "(min)",
  281. "month": "Month ",
  282. "month_1": "- ",
  283. "months": " month(s) ",
  284. "my_loc": "အတ္တသ္မိံ",
  285. "need_inform": "without informing other Bhikkhu ",
  286. "no_string": "cannot ",
  287. "noon_time": "မဇ္ဈန္ဟိက",
  288. "noon_time": "မဇ္ဈန္ဟိက",
  289. "note": "Note",
  290. "now_time": "ပစ္စုပ္ပန္န",
  291. "pacchā_māsa": "ပစ္ဆာ-မာသ",
  292. "pakkha": "Lunar Phases ",
  293. "past": "Passed ",
  294. "pubba_māsa": "ပုဗ္ဗ-မာသ",
  295. "ravi": "ရဝိ",
  296. "saṃvacchara": "သံဝစ္ဆရ",
  297. "season": "Season ",
  298. "sec": "sec ",
  299. "sora": "သောရ",
  300. "sukka": "သုက္က",
  301. "sun_height_degree": "Max solar altitude ",
  302. "time": "Time",
  303. "twilight_time": "အရုဏုဂ္ဂမန",
  304. "twilight_time": "အရုဏုဂ္ဂမန",
  305. "vikala": "ဝိကာလ",
  306. "week_day": "Day",
  307. "year_0": "year",
  308. "year_1": "- ",
  309. "years": " year(s) ",
  310. "yes_string": "can "
  311. };
  312. localString["si"] = {
  313. "and_another": " ච ",
  314. "atitude": "Atitude",
  315. "BE": "බුද්ධ වර්ෂය ",
  316. "bhumma": "භුම්ම",
  317. "budha": "බුධ",
  318. "canda": "චන්ද",
  319. "confirm": "Confirm",
  320. "date": "දිවස ",
  321. "day": " දිවසා(නි) ",
  322. "days": " දිවසා(නි) ",
  323. "departure_in_detail": "departure in detail",
  324. "dhamma_time": "සම්මා සම්බුද්ධස්ස සාසනං පට්ච-වස්ස-සහස්සානි පවත්තිස්සති ",
  325. "eat": "eat",
  326. "gama_entry": "entry the village",
  327. "guru": "ගු‍රු",
  328. "hori_ref_time": "horizontal refraction correct ",
  329. "kala": "කාල",
  330. "language_select": "භාෂාව",
  331. "left": "අවසිට්ඨ ",
  332. "loading": "ප්‍රවේශනය වෙනවා ",
  333. "longitude": "Longitude",
  334. "māsa": "මාස",
  335. "mins": "(min)",
  336. "month": "මාස ",
  337. "month_1": "- ",
  338. "months": " මාසා(නි) ",
  339. "my_loc": "අත‍්තස‍්මිං",
  340. "need_inform": "without informing other Bhikkhu ",
  341. "no_string": "cannot ",
  342. "noon_time": "මජ්ඣන්හික",
  343. "noon_time": "මජ්ඣන්හික",
  344. "note": "නෝට්ටුව ",
  345. "now_time": "පච්චුප්පන්න",
  346. "pacchā_māsa": "පච්ඡා-මාස",
  347. "pakkha": "පක්ඛ ",
  348. "past": "අතික්කන්ත ",
  349. "pubba_māsa": "පුබ්බ-මාස",
  350. "ravi": "රවි",
  351. "saṃvacchara": "සංවච්ඡ‍ර",
  352. "season": "උතු ",
  353. "sec": "sec",
  354. "sora": "සො‍ර",
  355. "sukka": "සුක්ක",
  356. "sun_height_degree": "Max solar altitude ",
  357. "time": "time",
  358. "twilight_time": "අ‍රුණුග්ගමන",
  359. "twilight_time": "අ‍රුණුග්ගමන",
  360. "vikala": "විකාල",
  361. "week_day": "වා‍ර ",
  362. "year_0": "සංවච්ඡ‍ර",
  363. "year_1": "- ",
  364. "years": " සංවච්ඡ‍රා(නි) ",
  365. "yes_string": "can "
  366. };
  367. var pali_month_name = [
  368. { "id": "1", "value": "jeṭṭha", "season": "gimhāna", "season_icon": "☀" },//5.X-四-十五-心
  369. { "id": "2", "value": "asāḷha", "season": "gimhāna", "season_icon": "☀" },//6.X-五-十五、十六-箕、斗
  370. { "id": "3", "value": "sāvana", "season": "vassāna", "season_icon": "☔" },//7.X-六-十五-女
  371. { "id": "4", "value": "poṭṭhapāda", "season": "vassāna", "season_icon": "☔" },//8.x-七-十五、十六-室、壁
  372. { "id": "5", "value": "assajuja", "season": "vassāna", "season_icon": "☔" },//9.X-八-十五-樓
  373. { "id": "6", "value": "kattika", "season": "vassāna", "season_icon": "☔" },//10.X-九-十五-昂
  374. { "id": "7", "value": "māgasira", "season": "hemanta", "season_icon": "❄" },//11.X-十-十五-觜
  375. { "id": "8", "value": "phussa", "season": "hemanta", "season_icon": "❄" },//12.X-十一-十五-鬼
  376. { "id": "9", "value": "māgha", "season": "hemanta", "season_icon": "❄" },//1.X-十二-十五-星
  377. { "id": "10", "value": "phagguna", "season": "hemanta", "season_icon": "❄" },//2.X-正月-十四、十五-張、異
  378. { "id": "11", "value": "citta", "season": "gimhāna", "season_icon": "☀" },//3.X-二月-十五-角
  379. { "id": "12", "value": "vesākha", "season": "gimhāna", "season_icon": "☀" }//4.X-三月-十五-氐
  380. ]
  381. var pali_nakkhatta_name = [
  382. { "id": "0", "value": "assayuja", "name_zh": "娄宿" },
  383. { "id": "1", "value": "bharaṇī", "name_zh": "胃宿" },
  384. { "id": "2", "value": "Kattikā", "name_zh": "昂宿" },
  385. { "id": "3", "value": "rohiṇī", "name_zh": "毕宿" },
  386. { "id": "4", "value": "magasira", "name_zh": "觜宿" },
  387. { "id": "5", "value": "Addā", "name_zh": "参宿" },
  388. { "id": "6", "value": "punabbasu", "name_zh": "井宿" },
  389. { "id": "7", "value": "phussa", "name_zh": "鬼宿" },
  390. { "id": "8", "value": "Asilesā", "name_zh": "柳宿" },
  391. { "id": "9", "value": "maghā", "name_zh": "星宿" },
  392. { "id": "10", "value": "pubbaphagguṇī", "name_zh": "张宿" },
  393. { "id": "11", "value": "uttaraphagguṇī", "name_zh": "翼宿" },
  394. { "id": "12", "value": "hattha", "name_zh": "轸宿" },
  395. { "id": "13", "value": "cittā", "name_zh": "角宿" },
  396. { "id": "14", "value": "sāti", "name_zh": "亢宿" },
  397. { "id": "15", "value": "visākhā", "name_zh": "氐宿" },
  398. { "id": "16", "value": "anurādhā", "name_zh": "房宿" },
  399. { "id": "17", "value": "jeṭṭha", "name_zh": "心宿" },
  400. { "id": "18", "value": "mūlā", "name_zh": "尾宿" },
  401. { "id": "19", "value": "pubbāsāḷha", "name_zh": "箕宿" },
  402. { "id": "20", "value": "uttarāsāḷha", "name_zh": "斗宿" },
  403. { "id": "21", "value": "savaṇa", "name_zh": "女宿" },
  404. { "id": "22", "value": "dhaniṭṭhā", "name_zh": "虚宿" },
  405. { "id": "23", "value": "satabhisaja", "name_zh": "危宿" },
  406. { "id": "24", "value": "pubbabhaddapadā", "name_zh": "室宿" },
  407. { "id": "25", "value": "uttarabhaddapadā", "name_zh": "壁宿" },
  408. { "id": "26", "value": "revatī", "name_zh": "奎宿" }
  409. ]
  410. var horoscope_name = [
  411. { "id": "0", "value": "Aries", "name_zh": "白羊", "icon": "♈" },
  412. { "id": "1", "value": "Taurus", "name_zh": "金牛", "icon": "♉" },
  413. { "id": "2", "value": "Gemini", "name_zh": "双子", "icon": "♊" },
  414. { "id": "3", "value": "Cancer", "name_zh": "巨蟹", "icon": "♋" },
  415. { "id": "4", "value": "Leo", "name_zh": "狮子", "icon": "♌" },
  416. { "id": "5", "value": "Virgo", "name_zh": "处女", "icon": "♍" },
  417. { "id": "6", "value": "Libra", "name_zh": "天秤", "icon": "♎" },
  418. { "id": "7", "value": "Scorpio", "name_zh": "天蝎", "icon": "♏" },
  419. { "id": "8", "value": "Sagittarius", "name_zh": "射手", "icon": "♐" },
  420. { "id": "9", "value": "Capricornus", "name_zh": "摩羯", "icon": "♑" },
  421. { "id": "10", "value": "Aquarius", "name_zh": "水瓶", "icon": "♒" },
  422. { "id": "11", "value": "Pisces", "name_zh": "双鱼", "icon": "♓" }
  423. ]
  424. </script>
  425. <style>
  426. .card {
  427. box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
  428. font-size: 1em;
  429. line-height: 1.3;
  430. }
  431. .card>.title>a,
  432. .card>.title>a:link {
  433. color: var(--main-color);
  434. }
  435. .card a:hover {
  436. color: var(--tool-link-hover-color);
  437. }
  438. .index_inner {
  439. width: 960px;
  440. margin-left: auto;
  441. margin-right: auto;
  442. }
  443. .table_line {
  444. display: flex;
  445. border-bottom: solid;
  446. }
  447. .table_column {
  448. flex: 1;
  449. }
  450. .correct {
  451. background-color: gold;
  452. }
  453. </style>
  454. <title id='title_text'>
  455. </title>
  456. </head>
  457. <body>
  458. <!--多语言范例
  459. <script>
  460. document.write(localString["language"].XXXX);
  461. </script>
  462. -->
  463. <div id='position_change'>
  464. <span id='selected_position_string'>
  465. <script>
  466. document.write(localString[g_language].loading);
  467. //localString[g_language].loading;
  468. </script>
  469. </span>
  470. <!--自动定位-->
  471. <button onclick='getLocation()' style='font-size: 100%; padding: 2px 6px;'>
  472. <svg class='icon' style='min-width: 1.8em; min-height: 1.8em;'>
  473. <path
  474. d='M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm8.94 3A8.994 8.994 0 0 0 13 3.06V1h-2v2.06A8.994 8.994 0 0 0 3.06 11H1v2h2.06A8.994 8.994 0 0 0 11 20.94V23h2v-2.06A8.994 8.994 0 0 0 20.94 13H23v-2h-2.06zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z' />
  475. </svg>
  476. <script>
  477. document.write(localString[g_language].my_loc);
  478. //localString[g_language].my_loc
  479. </script>
  480. </button>
  481. <input id="input_time" type="datetime-local">
  482. </div>
  483. <div>
  484. <div onclick="show_time()">Sun time table</div>
  485. <div>破晓<span id="today_dawn"></span></div>
  486. <div>正午<span id="today_solarNoon"></span></div>
  487. <div>日落<span id="today_sunset"></span></div>
  488. <div>月相<span id="today_moon_phase"></span></div>
  489. <div>圆满度<span id="today_moon_percent"></span></div>
  490. <div>太阳相位于南偏西<span id="today_sun_azimuth"></span></div>
  491. <div>月亮相位于北偏东<span id="today_moon_azimuth"></span></div>
  492. <div>日月角<span id="angle_sun_e_moon"></span></div>
  493. <div>月相角<span id="today_moon_angle"></span></div>
  494. <div>当前时间<span id="curr_time"></span></div>
  495. <div>现在时间<span id="now_time"></span></div>
  496. <div>当前時間戳<span id="curr_time_unix"></span></div>
  497. <div>地球角度<span id="earth_angle"></span></div>
  498. <div>月亮角度<span id="moon_angle"></span></div>
  499. <div>月亮角度2<span id="moon_angle2"></span></div>
  500. <div>
  501. <span>精准月相时间及星宿(强化戒德之日)</span>
  502. <table id="lunar_phase_list" style="max-width: 70vw;width: -webkit-fill-available;">
  503. </table>
  504. </div>
  505. </div>
  506. <script>
  507. var current_phase = phase()
  508. console.log(current_phase)//输出到控制台
  509. $("#title_text").html(localString[g_language].BE);
  510. var new_list = new Array()//新月列表
  511. var first_list = new Array()//上弦月列表
  512. var full_list = new Array()//满月列表
  513. var last_list = new Array()//下弦月列表
  514. var planets = new Array()//
  515. var lunar_position = new Object
  516. var g_coordinate_this = new Object();
  517. var g_now_date = new Date();
  518. var today = new Date()
  519. var start_day = new Date()
  520. var next_year = new Date();
  521. var sun_times = new Object();
  522. var curr_position = localStorage.getItem("local_position");
  523. if (curr_position) {
  524. g_coordinate_this.AT = curr_position.split("#")[0];
  525. g_coordinate_this.LT = curr_position.split("#")[1];
  526. g_coordinate_this.height = curr_position.split("#")[2];
  527. if (g_coordinate_this.AT >= 0) {
  528. var AT_string = angle_trans(g_coordinate_this.AT) + "N";
  529. }
  530. else {
  531. var AT_string = angle_trans(g_coordinate_this.AT) + "S";
  532. }
  533. if (g_coordinate_this.LT >= 0) {
  534. var LT_string = angle_trans(g_coordinate_this.LT) + "E";
  535. }
  536. else {
  537. var LT_string = angle_trans(g_coordinate_this.LT) + "W";
  538. }
  539. let height_string = g_coordinate_this.height + "M"
  540. $("#selected_position_string").html(AT_string + " " + LT_string + " " + height_string);
  541. }
  542. else {
  543. getLocation();
  544. }
  545. function show_time() {
  546. if ($("#input_time").val()) {
  547. today = new Date($("#input_time").val());
  548. }
  549. else {
  550. today = g_now_date
  551. }
  552. if (phase(today).phase <= 0.5) {
  553. start_day.setDate(today.getDate() - 16)//退到本月的新月之前
  554. start_day = phaseHunt(start_day).full_date//得到之前最近的满月日
  555. start_day.setDate(start_day.getDate() + 1)
  556. }
  557. else {
  558. start_day.setDate(today.getDate() - 31)//退到本月的新月之前
  559. start_day = phaseHunt(start_day).full_date//得到之前最近的满月日
  560. start_day.setDate(start_day.getDate() + 1)
  561. }
  562. next_year.setDate(start_day.getDate() + 360)
  563. last_list = phaseRange(start_day, next_year, LAST)//获取下弦月列表
  564. new_list = phaseRange(start_day, next_year, NEW)//获取新月列表
  565. first_list = phaseRange(start_day, next_year, FIRST)//获取上弦月列表
  566. full_list = phaseRange(start_day, next_year, FULL)//获取满月列表
  567. console.log(last_list)//输出到控制台
  568. console.log(new_list)//输出到控制台
  569. console.log(first_list)//输出到控制台
  570. console.log(full_list)//输出到控制台
  571. lunar_phase_list_refresh()
  572. get_position(today)
  573. let d_earth_to_moon = (lunar_position.position.x ^ 2 + lunar_position.position.y ^ 2 + lunar_position.position.z ^ 2) ^ 0.5
  574. let d_earth_to_moon_0 = phase(today).distance
  575. sun_times = SunCalc.getTimes(today, g_coordinate_this.AT, g_coordinate_this.LT, g_coordinate_this.height / 1000);
  576. sun_position = SunCalc.getPosition(today, g_coordinate_this.AT, g_coordinate_this.LT);
  577. moon_position = SunCalc.getMoonPosition(today, g_coordinate_this.AT, g_coordinate_this.LT);
  578. moon_Illumination = SunCalc.getMoonIllumination(today)
  579. $("#today_dawn").html(sun_times.dawn.toLocaleTimeString());
  580. $("#today_solarNoon").html(sun_times.solarNoon.toLocaleTimeString());
  581. $("#today_sunset").html(sun_times.sunset.toLocaleTimeString());
  582. $("#today_sun_azimuth").html(angle_trans(sun_position.azimuth / Math.PI * 180));//太阳水平弧度
  583. $("#today_moon_azimuth").html(angle_trans(moon_position.azimuth / Math.PI * 180));//月亮水平弧度
  584. $("#today_moon_phase").html(phase(today).phase);//月相值
  585. $("#today_moon_percent").html(phase(today).illuminated);//月照度
  586. $("#today_moon_angle").html(angle_trans(moon_Illumination.angle / Math.PI * 180));//月相角
  587. $("#angle_sun_e_moon").html(angle_trans(Math.abs(Math.PI + sun_position.azimuth - moon_position.azimuth) / Math.PI * 180));//月亮水平弧度
  588. $("#curr_time").html(today.toLocaleTimeString());//当前时间
  589. $("#now_time").html(g_now_date.toLocaleTimeString());//现在
  590. $("#curr_time_unix").html(today.getTime());//時間戳
  591. let earth_angle_string = ""
  592. earth_angle_string += get_position(today).solar_position_angle + "——"
  593. earth_angle_string += get_position(today).solar_position_angle_round + "——"
  594. earth_angle_string += get_position(today).solar_station + "——"
  595. earth_angle_string += get_station_name(today).solar.icon
  596. $("#earth_angle").html(earth_angle_string);//地球角度
  597. let moon_angle_string = ""
  598. moon_angle_string += get_position(today).lunar_position_angle + "——"
  599. moon_angle_string += get_position(today).lunar_position_angle_round + "——"
  600. moon_angle_string += get_position(today).lunar_station + "——"
  601. moon_angle_string += get_station_name(today).lunar.value
  602. $("#moon_angle").html(moon_angle_string);//月亮角度——角度差算法
  603. let moon_angle_string2 = ""
  604. moon_angle_string2 += get_position(today).lunar_position_angle2 + "——"
  605. moon_angle_string2 += get_position(today).lunar_position_angle_round2 + "——"
  606. moon_angle_string2 += get_position(today).lunar_station2 + "——"
  607. moon_angle_string2 += get_station_name(today).lunar.value
  608. $("#moon_angle2").html(moon_angle_string2);//月亮角度——向量差算法
  609. }
  610. function get_position(date_time) {
  611. let planets_position = new Object
  612. planets = window.lagrange.planet_positions.getPositions(date_time);
  613. //planets = global.planet_positions.getPositions(today);
  614. //console.log(planets)//输出到控制台
  615. earth_position = window.lagrange.planet_positions.getPositions(date_time)[3]
  616. lunar_position = window.lagrange.planet_positions.getPositions(date_time)[11]
  617. let lunar_position_angle = 0
  618. let lunar_station = 0
  619. let earth_position_angle = 0
  620. let earth_station = 0
  621. let earth_position_angle_round = 0
  622. let lunar_position_angle_round = 0
  623. //太阳相对地球的黄道偏角
  624. if (earth_position.position.y >= 0) {
  625. earth_position_angle = Math.atan2(earth_position.position.y, earth_position.position.x)
  626. }
  627. else {
  628. earth_position_angle = Math.PI * 2 + Math.atan2(earth_position.position.y, earth_position.position.x)
  629. }
  630. earth_position_angle_round = earth_position_angle / Math.PI / 2 + 0.5
  631. earth_position_angle_round = earth_position_angle_round - Math.floor(earth_position_angle_round)
  632. earth_station = earth_position_angle_round * 12
  633. planets_position.solar_station = earth_station
  634. planets_position.solar_position_angle = earth_position_angle_round * Math.PI * 2
  635. planets_position.solar_position_angle_round = earth_position_angle_round
  636. //月球相对地球的黄道偏角——角度差算法
  637. lunar_position_angle_round = earth_position_angle_round + phase(date_time).phase
  638. lunar_position_angle_round = lunar_position_angle_round - Math.floor(lunar_position_angle_round)
  639. lunar_position_angle = lunar_position_angle_round * Math.PI * 2
  640. lunar_station = lunar_position_angle_round * 27
  641. //月球相对地球的黄道偏角算法——向量差算法
  642. let lunar_to_earth = new Object
  643. lunar_to_earth.y = lunar_position.position.y - earth_position.position.y
  644. lunar_to_earth.x = lunar_position.position.x - earth_position.position.x
  645. if (lunar_to_earth.y >= 0) {
  646. lunar_position_angle2 = Math.atan2(lunar_to_earth.y, lunar_to_earth.x)
  647. }
  648. else {
  649. lunar_position_angle2 = Math.PI * 2 + Math.atan2(lunar_to_earth.y, lunar_to_earth.x)
  650. }
  651. lunar_position_angle_round2 = lunar_position_angle2 / Math.PI / 2
  652. //lunar_position_angle_round = lunar_position_angle_round - Math.floor(lunar_position_angle_round)
  653. lunar_position_angle2 = lunar_position_angle_round2 * Math.PI * 2
  654. lunar_station2 = lunar_position_angle_round2 * 27
  655. planets_position.lunar_station = lunar_station
  656. planets_position.lunar_position_angle = lunar_position_angle
  657. planets_position.lunar_position_angle_round = lunar_position_angle_round
  658. planets_position.lunar_station2 = lunar_station2
  659. planets_position.lunar_position_angle2 = lunar_position_angle2
  660. planets_position.lunar_position_angle_round2 = lunar_position_angle_round2
  661. return (planets_position)
  662. }
  663. function get_station_name(data_time) {//获取星象信息
  664. let solar_num = 0
  665. let lunar_num = 0
  666. solar_num = get_position(data_time).solar_station
  667. solar_num = Math.floor(solar_num)
  668. lunar_num = get_position(data_time).lunar_station
  669. lunar_num = Math.floor(lunar_num)
  670. let result = new Object
  671. result.solar = horoscope_name[solar_num]
  672. result.lunar = pali_nakkhatta_name[lunar_num]
  673. return (result)
  674. }
  675. function lunar_phase_list_refresh() {
  676. let output = ""
  677. //画表头
  678. output += "<tr class='table_line'>"
  679. output += "<th class='table_column'>月份</th>"
  680. output += "<th class='table_column'>下弦</th>"
  681. output += "<th class='table_column'>新月(诵戒)</th>"
  682. output += "<th class='table_column'>上弦</th>"
  683. output += "<th class='table_column'>满月(诵戒)</th>"
  684. output += "</tr>"
  685. //画内容
  686. let month_num = Math.min(last_list.length, new_list.length, first_list.length, full_list.length)
  687. for (let i_month = 0; i_month < month_num; i_month++) {
  688. output += "<tr class='table_line'>"
  689. output += "<td class='table_column'>"
  690. output += Math.round(get_position(full_list[i_month]).solar_station * 100) / 100
  691. //output += "—"
  692. //output += get_station_name(full_list[i_month]).lunar.value
  693. //output += "—"
  694. //output += get_station_name(full_list[i_month]).solar.name_zh
  695. //output += "—"
  696. //output += get_station_name(full_list[i_month]).solar.icon
  697. output += "</td>"
  698. //下弦月
  699. if (SunCalc.getTimes(last_list[i_month], g_coordinate_this.AT, g_coordinate_this.LT, g_coordinate_this.height / 1000).dawn - last_list[i_month] <= 0) {//如果在破晓之后,不修正
  700. output += "<td class='table_column' title='" + last_list[i_month].toLocaleTimeString() + "'>"
  701. output += last_list[i_month].toLocaleDateString()
  702. output += "<br />"
  703. output += get_station_name(last_list[i_month]).lunar.value
  704. //output += Math.round(get_position(last_list[i_month]).lunar_station * 100) / 100
  705. output += "</td>"
  706. }
  707. else {//如果在破晓之前,修正提前一天
  708. output += "<td class='table_column correct' title='" + last_list[i_month].toLocaleString() + "'>"
  709. let temp_date = last_list[i_month]
  710. temp_date.setDate(temp_date.getDate() - 1)
  711. output += temp_date.toLocaleDateString()
  712. output += "<br />"
  713. output += get_station_name(last_list[i_month]).lunar.value
  714. //output += Math.round(get_position(last_list[i_month]).lunar_station * 100) / 100
  715. output += "</td>"
  716. }
  717. //新月
  718. if (SunCalc.getTimes(new_list[i_month], g_coordinate_this.AT, g_coordinate_this.LT, g_coordinate_this.height / 1000).dawn - new_list[i_month] <= 0) {//如果在破晓之后,不修正
  719. output += "<td class='table_column' title='" + new_list[i_month].toLocaleTimeString() + "'>"
  720. output += new_list[i_month].toLocaleDateString()
  721. output += "<br />"
  722. output += get_station_name(new_list[i_month]).lunar.value
  723. //output += Math.round(get_position(new_list[i_month]).lunar_station * 100) / 100
  724. output += "</td>"
  725. }
  726. else {//如果在破晓之前,修正提前一天
  727. output += "<td class='table_column correct' title='" + new_list[i_month].toLocaleString() + "'>"
  728. let temp_date = new_list[i_month]
  729. temp_date.setDate(temp_date.getDate() - 1)
  730. output += temp_date.toLocaleDateString()
  731. output += "<br />"
  732. output += get_station_name(new_list[i_month]).lunar.value
  733. //output += Math.round(get_position(new_list[i_month]).lunar_station * 100) / 100
  734. output += "</td>"
  735. }
  736. //上弦月
  737. if (SunCalc.getTimes(first_list[i_month], g_coordinate_this.AT, g_coordinate_this.LT, g_coordinate_this.height / 1000).dawn - first_list[i_month] <= 0) {//如果在破晓之后,不修正
  738. output += "<td class='table_column' title='" + first_list[i_month].toLocaleTimeString() + "'>"
  739. output += first_list[i_month].toLocaleDateString()
  740. output += "<br />"
  741. output += get_station_name(first_list[i_month]).lunar.value
  742. //output += Math.round(get_position(first_list[i_month]).lunar_station * 100) / 100
  743. output += "</td>"
  744. }
  745. else {//如果在破晓之前,修正提前一天
  746. output += "<td class='table_column correct' title='" + first_list[i_month].toLocaleString() + "'>"
  747. let temp_date = first_list[i_month]
  748. temp_date.setDate(temp_date.getDate() - 1)
  749. output += temp_date.toLocaleDateString()
  750. output += "<br />"
  751. output += get_station_name(first_list[i_month]).lunar.value
  752. //output += Math.round(get_position(first_list[i_month]).lunar_station * 100) / 100
  753. output += "</td>"
  754. }
  755. //满月
  756. if (SunCalc.getTimes(full_list[i_month], g_coordinate_this.AT, g_coordinate_this.LT, g_coordinate_this.height / 1000).dawn - full_list[i_month] <= 0) {//如果在破晓之后,不修正
  757. output += "<td class='table_column' title='" + full_list[i_month].toLocaleTimeString() + "'>"
  758. output += full_list[i_month].toLocaleDateString()
  759. output += "<br />"
  760. output += get_station_name(full_list[i_month]).lunar.value
  761. //output += Math.round(get_position(full_list[i_month]).lunar_station * 100) / 100
  762. output += "</td>"
  763. }
  764. else {//如果在破晓之前,修正提前一天
  765. output += "<td class='table_column correct' title='" + full_list[i_month].toLocaleString() + "'>"
  766. let temp_date = full_list[i_month]
  767. temp_date.setDate(temp_date.getDate() - 1)
  768. output += temp_date.toLocaleDateString()
  769. output += "<br />"
  770. output += get_station_name(full_list[i_month]).lunar.value
  771. //output += Math.round(get_position(full_list[i_month]).lunar_station * 100) / 100
  772. output += "</td>"
  773. }
  774. output += "</tr>"
  775. }
  776. $("#lunar_phase_list").html(output)
  777. }
  778. function getLocation() {//自动定位
  779. if (navigator.geolocation) {
  780. navigator.geolocation.getCurrentPosition(showPosition, showError);
  781. }
  782. else {
  783. $("#selected_position_string").html("Geolocation is not supported by this browser.");
  784. }
  785. }
  786. function showPosition(position) {
  787. alert("get cordinate success");
  788. g_coordinate_this.AT = position.coords.latitude;//纬度
  789. g_coordinate_this.LT = position.coords.longitude;//经度
  790. g_coordinate_this.height = position.coords.altitude;//海拔高度
  791. let position_string = g_coordinate_this.AT + "#" + g_coordinate_this.LT + "#" + g_coordinate_this.height
  792. localStorage.setItem("local_position", position_string);
  793. if (g_coordinate_this.AT >= 0) {
  794. var AT_string = angle_trans(g_coordinate_this.AT) + "N";
  795. }
  796. else {
  797. var AT_string = angle_trans(g_coordinate_this.AT) + "S";
  798. }
  799. if (g_coordinate_this.LT >= 0) {
  800. var LT_string = angle_trans(g_coordinate_this.LT) + "E";
  801. }
  802. else {
  803. var LT_string = angle_trans(g_coordinate_this.LT) + "W";
  804. }
  805. let height_string = g_coordinate_this.height + "M"
  806. $("#selected_position_string").html(AT_string + " " + LT_string + " " + height_string);
  807. }
  808. function showError(error) {
  809. switch (error.code) {
  810. case error.PERMISSION_DENIED:
  811. alert("定位失败,用户拒绝请求地理定位");
  812. break;
  813. case error.POSITION_UNAVAILABLE:
  814. alert("定位失败,位置信息是不可用");
  815. break;
  816. case error.TIMEOUT:
  817. alert("定位失败,请求获取用户位置超时");
  818. break;
  819. case error.UNKNOWN_ERROR:
  820. alert("定位失败,定位系统失效");
  821. break;
  822. }
  823. }
  824. function angle_trans(angle) {
  825. var angle_str = "";
  826. var num_d = Math.floor(angle);
  827. var num_m = Math.floor((angle - num_d) * 60);
  828. var num_s = Math.round((angle - num_d) * 60 - num_m);
  829. if (num_d != 0) {
  830. angle_str += num_d + "°";
  831. }
  832. if (num_m != 0) {
  833. angle_str += num_m + "’";
  834. }
  835. if (num_s != 0) {
  836. angle_str += num_s + "”";
  837. }
  838. return (angle_str);
  839. }
  840. </script>
  841. </body>
  842. </html>