2
0

index1.html 36 KB

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