egatari 0.6.14 → 0.6.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +62 -1
- package/README.ja.md +65 -64
- package/README.md +40 -39
- package/bin/egatari.mjs +3 -3
- package/components.lock.json +507 -153
- package/components2.lock.json +1710 -33
- package/kit/check-messages.mjs +105 -71
- package/kit/check.mjs +17 -11
- package/kit/core/article-messages.mjs +15 -15
- package/kit/core/article-render.mjs +1 -1
- package/kit/core/article-text.mjs +3 -1
- package/kit/core/build-core.mjs +23 -1
- package/kit/core/check-parity.mjs +2 -2
- package/kit/core/check-rules.mjs +12 -7
- package/kit/core/colab-core.mjs +2 -2
- package/kit/core/comment-core.mjs +6 -0
- package/kit/core/export-name.mjs +2 -2
- package/kit/core/geometry-check.mjs +363 -25
- package/kit/core/layout-scan.mjs +75 -5
- package/kit/core/live-policy.mjs +2 -2
- package/kit/core/live.mjs +2 -2
- package/kit/core/llm-fix.mjs +24 -13
- package/kit/core/llm-insert.mjs +11 -11
- package/kit/core/llm-outline.mjs +7 -7
- package/kit/core/llm-pack-assemble.mjs +5 -2
- package/kit/core/llm-pack-data.mjs +225 -39
- package/kit/core/llm-pack.mjs +3 -3
- package/kit/core/new-deck.mjs +17 -3
- package/kit/core/part-labels.mjs +6 -0
- package/kit/core/parts2.mjs +5 -5
- package/kit/core/player.mjs +18 -0
- package/kit/core/portable.mjs +26 -8
- package/kit/core/purposes.mjs +2 -2
- package/kit/core/ref-voice.mjs +1 -1
- package/kit/core/scorm.mjs +1 -1
- package/kit/core/sound-preferences.mjs +1 -1
- package/kit/core/theme-derive.mjs +209 -0
- package/kit/core/themes-list.mjs +1 -1
- package/kit/core/themes-lock.mjs +1 -1
- package/kit/core/tier-a.mjs +20 -8
- package/kit/deck.js +7 -4
- package/kit/instruction-version.json +1 -1
- package/kit/live.js +20 -20
- package/kit/player.json +1 -1
- package/kit/player.lock.json +2 -2
- package/kit/presenter.js +5 -3
- package/kit/templates/new-deck.mjs +6 -6
- package/kit/tools.js +13 -6
- package/kit/track.js +1 -1
- package/package.json +4 -2
- package/server/dev.mjs +3 -2
- package/server/editor-ui.js +28 -20
- package/server/hints.js +22 -2
- package/tts/yomi.yaml +8 -0
- package/vendor/components/CATALOG.md +21 -14
- package/vendor/components/sha256/000cc8b85d22854d93587d53fe07585e0d9f0abee86d863c5ed1f6c53967912b/README.en.md +40 -0
- package/vendor/components/sha256/000cc8b85d22854d93587d53fe07585e0d9f0abee86d863c5ed1f6c53967912b/index.js +408 -0
- package/vendor/components/sha256/0396a1895978803ae342b7f598f187b17ead47800e8f8317a5cb041111349813/index.js +278 -0
- package/vendor/components/sha256/07b8bfd9240585ee76082632c6f9483017d46ad3c74e509e715c27294970606c/README.en.md +26 -0
- package/vendor/components/sha256/07b8bfd9240585ee76082632c6f9483017d46ad3c74e509e715c27294970606c/index.js +322 -0
- package/vendor/components/sha256/08778858e2fb42765077b50e08f848089b1d11ea394909a4f611557b94b3acf2/README.en.md +54 -0
- package/vendor/components/sha256/08778858e2fb42765077b50e08f848089b1d11ea394909a4f611557b94b3acf2/index.js +470 -0
- package/vendor/components/sha256/0a08eb254e59cb306adb32c940ffe54e88efa3c9b7ef05ee021c38995996e742/README.en.md +18 -0
- package/vendor/components/sha256/0a08eb254e59cb306adb32c940ffe54e88efa3c9b7ef05ee021c38995996e742/index.js +279 -0
- package/vendor/components/sha256/1001b3cfcd3fbc34370accbb37aa550c8cadbb54bf8e8155d417219de3797be9/README.en.md +31 -0
- package/vendor/components/sha256/1001b3cfcd3fbc34370accbb37aa550c8cadbb54bf8e8155d417219de3797be9/index.js +267 -0
- package/vendor/components/sha256/109c302247e0c62720872be35392a73bea72804b0ed421ef8ced3f030f72e537/README.en.md +53 -0
- package/vendor/components/sha256/109c302247e0c62720872be35392a73bea72804b0ed421ef8ced3f030f72e537/index.js +171 -0
- package/vendor/components/sha256/1117758820dc561f41cf9d1cc0bab8cf3173cde7771ac10a12b94c96007c0f55/index.js +268 -0
- package/vendor/components/sha256/137017ad452afe209bdff81bc02ffae99c6b60a1c4aed2383515974f65511ff2/index.js +205 -0
- package/vendor/components/sha256/1a1471ba5f68e54304825a64e736afeda421e3763cdcbcdab2e45509562a0291/index.js +607 -0
- package/vendor/components/sha256/1b15fcc12b2fa43821e6299e87aae31aa69dbbc5a0d1b80088a5d7c5f8b8f7f5/index.js +429 -0
- package/vendor/components/sha256/1cc1732d052e58f7913ee50c0fc834d896db6b00ba779164de11b442347863db/README.en.md +23 -0
- package/vendor/components/sha256/1cc1732d052e58f7913ee50c0fc834d896db6b00ba779164de11b442347863db/index.js +147 -0
- package/vendor/components/sha256/21c099461befc0d382ddfe982f2a6cd8eeb6dd731252164ac619525e4bacdf0d/index.js +242 -0
- package/vendor/components/sha256/2352e0e22460f4a3c46dca6cef27cd9c63f161a411f1cf56c75c585e9124503c/index.js +315 -0
- package/vendor/components/sha256/2564dd8096be4cb3ba43703dc76029c1ba3965b831e430597c754865df4b67f4/README.en.md +53 -0
- package/vendor/components/sha256/2564dd8096be4cb3ba43703dc76029c1ba3965b831e430597c754865df4b67f4/index.js +171 -0
- package/vendor/components/sha256/2bae0f89ba91574c6ffb654e246365acd9aaf16a7aae92d95e1bad045671fbd2/README.en.md +38 -0
- package/vendor/components/sha256/2bae0f89ba91574c6ffb654e246365acd9aaf16a7aae92d95e1bad045671fbd2/index.js +414 -0
- package/vendor/components/sha256/2c68c355d60fdc879728c39245b7cf964b193628b63e9ab87df09c6bc2bfa7d3/README.en.md +45 -0
- package/vendor/components/sha256/2c68c355d60fdc879728c39245b7cf964b193628b63e9ab87df09c6bc2bfa7d3/index.js +211 -0
- package/vendor/components/sha256/2f111b900898579b3ec1611c2110db336a46d9133171a0cbb125ee37bd1f24f8/index.js +592 -0
- package/vendor/components/sha256/2fd81df4107ecb28c0dcecfdb3fd8fb9a474b5a7e0aeb16d8c0c6b1275c3a178/README.en.md +45 -0
- package/vendor/components/sha256/2fd81df4107ecb28c0dcecfdb3fd8fb9a474b5a7e0aeb16d8c0c6b1275c3a178/index.js +211 -0
- package/vendor/components/sha256/337febae1374670413653c453feee7cec169892e130248617c6642a91678564e/README.en.md +20 -0
- package/vendor/components/sha256/337febae1374670413653c453feee7cec169892e130248617c6642a91678564e/index.js +310 -0
- package/vendor/components/sha256/38f6385118112c679b520909d677935176e0c7aa2183a877324eeb5108606eae/README.en.md +35 -0
- package/vendor/components/sha256/38f6385118112c679b520909d677935176e0c7aa2183a877324eeb5108606eae/index.js +179 -0
- package/vendor/components/sha256/3af0b84b1799fc64ec74d6da9cbd343eccd89e8a11c81bfb444562c911284442/index.js +342 -0
- package/vendor/components/sha256/3c69bf3b3c6b9f76048fbc0839b3aa9699723570086d3d44bac799230ed6de5b/index.js +121 -0
- package/vendor/components/sha256/3f2f66da34496213cf6140ae041122c31f13c77e5ee18ad11a3390fbc4a6ecca/README.en.md +37 -0
- package/vendor/components/sha256/3f2f66da34496213cf6140ae041122c31f13c77e5ee18ad11a3390fbc4a6ecca/index.js +501 -0
- package/vendor/components/sha256/41b82d13037c4597e560cf2b3adebea4495ebb4711a8bb82b1a84495839b8fc8/README.en.md +38 -0
- package/vendor/components/sha256/41b82d13037c4597e560cf2b3adebea4495ebb4711a8bb82b1a84495839b8fc8/index.js +414 -0
- package/vendor/components/sha256/4220949efd68ff86e73ee6a0920b9f5b53f445cfcd657db72ecb2b55da1cc019/README.en.md +30 -0
- package/vendor/components/sha256/4220949efd68ff86e73ee6a0920b9f5b53f445cfcd657db72ecb2b55da1cc019/index.js +305 -0
- package/vendor/components/sha256/47f7ea3e2551abb250a9f5883716791026f0f54ae9cca6d82fabdb92478c69ae/README.en.md +31 -0
- package/vendor/components/sha256/47f7ea3e2551abb250a9f5883716791026f0f54ae9cca6d82fabdb92478c69ae/index.js +236 -0
- package/vendor/components/sha256/4b515bfb3a39a6c1e2b04f235affc5bc84e74d80bfd7f9e6d9b5d84d0a9eeb57/README.en.md +21 -0
- package/vendor/components/sha256/4b515bfb3a39a6c1e2b04f235affc5bc84e74d80bfd7f9e6d9b5d84d0a9eeb57/index.js +108 -0
- package/vendor/components/sha256/4e7ba7759ddebfa5432b733e5f10abfd336ef7d6cc4d46305d5ff7d00ed3a423/README.en.md +28 -0
- package/vendor/components/sha256/4e7ba7759ddebfa5432b733e5f10abfd336ef7d6cc4d46305d5ff7d00ed3a423/index.js +213 -0
- package/vendor/components/sha256/52149f061935e65502b8353cf70285bba93ab24451d2daac26b994d3901d3864/README.en.md +35 -0
- package/vendor/components/sha256/52149f061935e65502b8353cf70285bba93ab24451d2daac26b994d3901d3864/index.js +179 -0
- package/vendor/components/sha256/5644e63364f46ee53d5f8623355149753147cdc4720e4c66fc9b8a32627e68a5/README.en.md +53 -0
- package/vendor/components/sha256/5644e63364f46ee53d5f8623355149753147cdc4720e4c66fc9b8a32627e68a5/index.js +171 -0
- package/vendor/components/sha256/5662bea8cc48f484ccf14c5a8ac12d64b2c5ab032a26176d133ed3a8eb33a557/fixtures/ABCJS-ADAPTER.md +101 -0
- package/vendor/components/sha256/5662bea8cc48f484ccf14c5a8ac12d64b2c5ab032a26176d133ed3a8eb33a557/fixtures/LICENSE-abcjs.txt +21 -0
- package/vendor/components/sha256/5662bea8cc48f484ccf14c5a8ac12d64b2c5ab032a26176d133ed3a8eb33a557/fixtures/chords.json +89 -0
- package/vendor/components/sha256/5662bea8cc48f484ccf14c5a8ac12d64b2c5ab032a26176d133ed3a8eb33a557/fixtures/doremi.json +261 -0
- package/vendor/components/sha256/5662bea8cc48f484ccf14c5a8ac12d64b2c5ab032a26176d133ed3a8eb33a557/fixtures/extras.json +192 -0
- package/vendor/components/sha256/5662bea8cc48f484ccf14c5a8ac12d64b2c5ab032a26176d133ed3a8eb33a557/fixtures/kaeru.json +521 -0
- package/vendor/components/sha256/5662bea8cc48f484ccf14c5a8ac12d64b2c5ab032a26176d133ed3a8eb33a557/fixtures/rhythm.json +248 -0
- package/vendor/components/sha256/5662bea8cc48f484ccf14c5a8ac12d64b2c5ab032a26176d133ed3a8eb33a557/fixtures/ties.json +360 -0
- package/vendor/components/sha256/5662bea8cc48f484ccf14c5a8ac12d64b2c5ab032a26176d133ed3a8eb33a557/index.js +508 -0
- package/vendor/components/sha256/59996a56df462b36e24a928d4397c9308d9e39ad8224ebd19fb5c981608ef458/index.js +521 -0
- package/vendor/components/sha256/5afcaf27e9209a32a8a8e6667b637ea434326b76f563689552716de953c94a98/README.en.md +30 -0
- package/vendor/components/sha256/5afcaf27e9209a32a8a8e6667b637ea434326b76f563689552716de953c94a98/index.js +305 -0
- package/vendor/components/sha256/5cf9baec12bac716d9218d6fbc4f95446adf31658da62564aa403bb5bdee542e/README.en.md +30 -0
- package/vendor/components/sha256/5cf9baec12bac716d9218d6fbc4f95446adf31658da62564aa403bb5bdee542e/index.js +192 -0
- package/vendor/components/sha256/5ffac218340cc51ce842a530f6021fc916090376b243e2ad5d4c0ef48a040ce9/README.en.md +20 -0
- package/vendor/components/sha256/5ffac218340cc51ce842a530f6021fc916090376b243e2ad5d4c0ef48a040ce9/index.js +307 -0
- package/vendor/components/sha256/6084fd3102b7d450db3804120ac27aa585ab44937734d980fb50c51f39fc98a7/README.en.md +24 -0
- package/vendor/components/sha256/6084fd3102b7d450db3804120ac27aa585ab44937734d980fb50c51f39fc98a7/index.js +554 -0
- package/vendor/components/sha256/60e3e41c34034e16f9f7ee9ce6c8d669ebb753614989fc2e5e181ef295e83631/README.en.md +25 -0
- package/vendor/components/sha256/60e3e41c34034e16f9f7ee9ce6c8d669ebb753614989fc2e5e181ef295e83631/index.js +316 -0
- package/vendor/components/sha256/6156a8a03235e1ed92d3cd3ba1f40df86667059003d82e47297bd3917ef562b8/README.en.md +18 -0
- package/vendor/components/sha256/6156a8a03235e1ed92d3cd3ba1f40df86667059003d82e47297bd3917ef562b8/index.js +279 -0
- package/vendor/components/sha256/624acb997c4975ace65570b529b3ba00baa421c80ecb7fc80f392a64e8c573a7/index.js +107 -0
- package/vendor/components/sha256/62602488ee33dd4bdef8516de16da5ab27d7f7265d5041681beab80e08f1d482/index.js +97 -0
- package/vendor/components/sha256/67eaf344bddac79b74ed03fdcd70285c7b52b160e6c5ffbd6897848179aa5230/index.js +818 -0
- package/vendor/components/sha256/682c9c8871eccd19ff1264e0323a2e4c5798b0488b612ba0339c6fe85aab5914/index.js +926 -0
- package/vendor/components/sha256/6937967bbf62098aca7cef99f14f97fa11c861a12da6a1d8fe5fa55a6b4551f2/README.en.md +51 -0
- package/vendor/components/sha256/6937967bbf62098aca7cef99f14f97fa11c861a12da6a1d8fe5fa55a6b4551f2/index.js +230 -0
- package/vendor/components/sha256/72138936ed0b8fd3cb0214ae7ed250ae3f1f8b21ed6fd593544947774064ba0d/index.js +250 -0
- package/vendor/components/sha256/74c1a0f3ed1370c5003aa5770ee28cea2ce994d415680116a92fdbcd5854ba62/index.js +198 -0
- package/vendor/components/sha256/76125035eb153b98befa9c735bcd9fc4f99f774dc1d082fdae40acaadfe7d95b/index.js +818 -0
- package/vendor/components/sha256/7728cf7dde88a6688aba0ed70f23f7e21362a147beac09c1fa1a4b773e08e93b/index.js +354 -0
- package/vendor/components/sha256/7822f137d446604a83c1dbc3b40fdb455001dc55da12276ff3e7079d270dd143/README.en.md +23 -0
- package/vendor/components/sha256/7822f137d446604a83c1dbc3b40fdb455001dc55da12276ff3e7079d270dd143/index.js +289 -0
- package/vendor/components/sha256/7c2b93508a09a5dd36639ab1329ca6d00487b326c53db436b14295174dc03369/README.en.md +31 -0
- package/vendor/components/sha256/7c2b93508a09a5dd36639ab1329ca6d00487b326c53db436b14295174dc03369/index.js +236 -0
- package/vendor/components/sha256/7d50e50fbb6c5ec636b62509bd88ddaac1870e0522cf11bcc293ce924d48072d/index.js +312 -0
- package/vendor/components/sha256/82ffee434e7f2213031190f832f3a75a8cdf59554fdbc092c0b079d6b0753cad/README.en.md +42 -0
- package/vendor/components/sha256/82ffee434e7f2213031190f832f3a75a8cdf59554fdbc092c0b079d6b0753cad/index.js +549 -0
- package/vendor/components/sha256/87fc302c41b2bfeea88951ed689ec01b4dc79218c4bc69b310dc2228dfa2e153/index.js +926 -0
- package/vendor/components/sha256/8886ccd82d68dc1bbf5b7ffcef746074ce8a3d26414d55691dc5e691e4976ded/README.en.md +24 -0
- package/vendor/components/sha256/8886ccd82d68dc1bbf5b7ffcef746074ce8a3d26414d55691dc5e691e4976ded/index.js +103 -0
- package/vendor/components/sha256/89c8c16788e24df17920542ed6eb6557dea4a10e835de8fe839e439ccbba8014/index.js +69 -0
- package/vendor/components/sha256/8beed7e471fa0d6b801b5c540f69ab77220e228c58ff16b0bc2b1a6eef30800e/README.en.md +44 -0
- package/vendor/components/sha256/8beed7e471fa0d6b801b5c540f69ab77220e228c58ff16b0bc2b1a6eef30800e/index.js +304 -0
- package/vendor/components/sha256/8d9af78aef44ad2f98101c67d32473373d39725a09c923969aa621d5f5b124bb/index.js +121 -0
- package/vendor/components/sha256/8f861d71df72a82be86a3e63abf7d69bbab5aac6fa68be6e077c4e19c3519ed8/index.js +312 -0
- package/vendor/components/sha256/90415da5ad04e1944258e29c929c5de65c8152c829414e911ba55a84ac89f348/README.en.md +54 -0
- package/vendor/components/sha256/90415da5ad04e1944258e29c929c5de65c8152c829414e911ba55a84ac89f348/index.js +470 -0
- package/vendor/components/sha256/91a1e0e48e20cac705cbe6e33e66a24a2851b1dc88c5164ed906bcecba4d943f/README.en.md +24 -0
- package/vendor/components/sha256/91a1e0e48e20cac705cbe6e33e66a24a2851b1dc88c5164ed906bcecba4d943f/index.js +214 -0
- package/vendor/components/sha256/91a9353a0c3b3744765944783aa1537b3f6ff1677c67caede643cdf2f52289cf/README.en.md +33 -0
- package/vendor/components/sha256/91a9353a0c3b3744765944783aa1537b3f6ff1677c67caede643cdf2f52289cf/index.js +390 -0
- package/vendor/components/sha256/9289efef4a75afe011e54a17e34db08cfb16a450b2e0653e6a98525495cfba99/index.js +315 -0
- package/vendor/components/sha256/93256a923199ea51108cdb7491c3c96f376dbef15b64cbf1a1aa7cc5726b4970/index.js +429 -0
- package/vendor/components/sha256/94f4891971b26f5bc157ef9f7f630b1528fc7e2a4c63e84e01951a5a3f94cedc/README.en.md +24 -0
- package/vendor/components/sha256/94f4891971b26f5bc157ef9f7f630b1528fc7e2a4c63e84e01951a5a3f94cedc/index.js +550 -0
- package/vendor/components/sha256/94f4f798fdd070fc1693494e772ff479d3e694a07a0c97b6e97c3b3895cad478/README.en.md +28 -0
- package/vendor/components/sha256/94f4f798fdd070fc1693494e772ff479d3e694a07a0c97b6e97c3b3895cad478/index.js +213 -0
- package/vendor/components/sha256/95583538da2982ec5f508217a8f2821796e6a34cf755baa66f2aaeb1c6dae814/README.en.md +40 -0
- package/vendor/components/sha256/95583538da2982ec5f508217a8f2821796e6a34cf755baa66f2aaeb1c6dae814/index.js +348 -0
- package/vendor/components/sha256/97c074a5473618c65f4c23263f056870a0b7940e73475f2a1f32f68c08d8eb0f/index.js +198 -0
- package/vendor/components/sha256/98e1957b1fac2d55d9bfa6a0990ead6a2730d571c988055ca280df05a0e9ea37/README.en.md +66 -0
- package/vendor/components/sha256/98e1957b1fac2d55d9bfa6a0990ead6a2730d571c988055ca280df05a0e9ea37/index.js +984 -0
- package/vendor/components/sha256/99a26795f8b351ade4a4cbbea845aeb149c96b09fe96151edda57128082185fa/README.en.md +34 -0
- package/vendor/components/sha256/99a26795f8b351ade4a4cbbea845aeb149c96b09fe96151edda57128082185fa/index.js +244 -0
- package/vendor/components/sha256/a18b2b15d00c76462a43823b5c270c7ddd7c31794da9c236f74f20f80ec2ffdb/index.js +354 -0
- package/vendor/components/sha256/a744049fc56e0a5d5b1638bef597a4e65f99d0776a35d830a389f216f314f1bc/README.en.md +32 -0
- package/vendor/components/sha256/a744049fc56e0a5d5b1638bef597a4e65f99d0776a35d830a389f216f314f1bc/index.js +222 -0
- package/vendor/components/sha256/a979207c60fbd2a12cb557297eb0217eb098d660de684530a0f43d0d9c64e6ef/index.js +312 -0
- package/vendor/components/sha256/aba898152e40ca44e1e7bea22242bd6897a31e0254cbfd70e426907b65379af2/README.en.md +34 -0
- package/vendor/components/sha256/aba898152e40ca44e1e7bea22242bd6897a31e0254cbfd70e426907b65379af2/index.js +244 -0
- package/vendor/components/sha256/af7ed69b8969f6da14784b6e9d26e4dfd20147772ea172a99bd936a71be10fcd/index.js +278 -0
- package/vendor/components/sha256/b08a536a07498629c026f8fc2962acda791c83a99268ac715db5e764087000e2/fixtures/ABCJS-ADAPTER.md +101 -0
- package/vendor/components/sha256/b08a536a07498629c026f8fc2962acda791c83a99268ac715db5e764087000e2/fixtures/LICENSE-abcjs.txt +21 -0
- package/vendor/components/sha256/b08a536a07498629c026f8fc2962acda791c83a99268ac715db5e764087000e2/fixtures/chords.json +89 -0
- package/vendor/components/sha256/b08a536a07498629c026f8fc2962acda791c83a99268ac715db5e764087000e2/fixtures/doremi.json +261 -0
- package/vendor/components/sha256/b08a536a07498629c026f8fc2962acda791c83a99268ac715db5e764087000e2/fixtures/extras.json +192 -0
- package/vendor/components/sha256/b08a536a07498629c026f8fc2962acda791c83a99268ac715db5e764087000e2/fixtures/kaeru.json +521 -0
- package/vendor/components/sha256/b08a536a07498629c026f8fc2962acda791c83a99268ac715db5e764087000e2/fixtures/rhythm.json +248 -0
- package/vendor/components/sha256/b08a536a07498629c026f8fc2962acda791c83a99268ac715db5e764087000e2/fixtures/ties.json +360 -0
- package/vendor/components/sha256/b08a536a07498629c026f8fc2962acda791c83a99268ac715db5e764087000e2/index.js +508 -0
- package/vendor/components/sha256/b28d136dffb03a3e855b2ff959712a143da9a84c3a4fd13a1126d7711083a2d6/README.en.md +66 -0
- package/vendor/components/sha256/b28d136dffb03a3e855b2ff959712a143da9a84c3a4fd13a1126d7711083a2d6/index.js +990 -0
- package/vendor/components/sha256/b2d9c417f258745c56c04e05dc9463a412a4978d46c3ffff2556f0b0fafbbfc2/README.en.md +24 -0
- package/vendor/components/sha256/b2d9c417f258745c56c04e05dc9463a412a4978d46c3ffff2556f0b0fafbbfc2/index.js +550 -0
- package/vendor/components/sha256/b8096d7a60609520981273673761a110e40e3bdf52a7ab5548363b20e16f6e93/index.js +404 -0
- package/vendor/components/sha256/b9e27e84b2c534b87d6da5da30ee808d7863cbd1b818082b4c11d1f8b7129b1a/README.en.md +32 -0
- package/vendor/components/sha256/b9e27e84b2c534b87d6da5da30ee808d7863cbd1b818082b4c11d1f8b7129b1a/index.js +222 -0
- package/vendor/components/sha256/bd8e3893df02411deccc1d6d7b02292ca0d59dfeddfafcf99419430981572c82/index.js +351 -0
- package/vendor/components/sha256/c201dbc3f1f790c59cc010b3be3566daa9085754614402e9dc1296dba9e87769/fixtures/ABCJS-ADAPTER.md +101 -0
- package/vendor/components/sha256/c201dbc3f1f790c59cc010b3be3566daa9085754614402e9dc1296dba9e87769/fixtures/LICENSE-abcjs.txt +21 -0
- package/vendor/components/sha256/c201dbc3f1f790c59cc010b3be3566daa9085754614402e9dc1296dba9e87769/fixtures/chords.json +89 -0
- package/vendor/components/sha256/c201dbc3f1f790c59cc010b3be3566daa9085754614402e9dc1296dba9e87769/fixtures/doremi.json +261 -0
- package/vendor/components/sha256/c201dbc3f1f790c59cc010b3be3566daa9085754614402e9dc1296dba9e87769/fixtures/extras.json +192 -0
- package/vendor/components/sha256/c201dbc3f1f790c59cc010b3be3566daa9085754614402e9dc1296dba9e87769/fixtures/kaeru.json +521 -0
- package/vendor/components/sha256/c201dbc3f1f790c59cc010b3be3566daa9085754614402e9dc1296dba9e87769/fixtures/rhythm.json +248 -0
- package/vendor/components/sha256/c201dbc3f1f790c59cc010b3be3566daa9085754614402e9dc1296dba9e87769/fixtures/ties.json +360 -0
- package/vendor/components/sha256/c201dbc3f1f790c59cc010b3be3566daa9085754614402e9dc1296dba9e87769/index.js +508 -0
- package/vendor/components/sha256/c5226220649a5854d56ceeaea16722fe54a79b4197f71c51c4e1523bf22bec32/README.en.md +31 -0
- package/vendor/components/sha256/c5226220649a5854d56ceeaea16722fe54a79b4197f71c51c4e1523bf22bec32/index.js +267 -0
- package/vendor/components/sha256/c691f9c83d06502bf20f86df02ee5a516063d6af1e9ee8204aad8fd8c1a44a71/LICENSE-strokesvg.txt +115 -0
- package/vendor/components/sha256/c691f9c83d06502bf20f86df02ee5a516063d6af1e9ee8204aad8fd8c1a44a71/OFL.txt +93 -0
- package/vendor/components/sha256/c691f9c83d06502bf20f86df02ee5a516063d6af1e9ee8204aad8fd8c1a44a71/index.js +749 -0
- package/vendor/components/sha256/c691f9c83d06502bf20f86df02ee5a516063d6af1e9ee8204aad8fd8c1a44a71/strokes-CHANGES.md +20 -0
- package/vendor/components/sha256/c791e69e722f64146242f97acb29a341160d0c327cfe1d76307954d80e70db85/index.js +268 -0
- package/vendor/components/sha256/c8c0de41d603b61c6ec4dc1da5b50559e213dd1f3693ee5019df858016fd6daf/index.js +747 -0
- package/vendor/components/sha256/c99d4f2ab443484b9f462e405c72ea4794838b88f8823f27c606d12cbbedb996/index.js +404 -0
- package/vendor/components/sha256/cbde046e30c35db60259911a88e2ae0bedaf545e29b1da8b8ce13bc602a33c19/index.js +465 -0
- package/vendor/components/sha256/ccdd16ed76838ac9d6abb4ee695769bfecb802ae490ac91914ed68131ad04434/README.en.md +51 -0
- package/vendor/components/sha256/ccdd16ed76838ac9d6abb4ee695769bfecb802ae490ac91914ed68131ad04434/index.js +228 -0
- package/vendor/components/sha256/ce0a52fa13ae579020d1172845647daee9ba78e070736e47740f2d2feabffe7e/README.en.md +35 -0
- package/vendor/components/sha256/ce0a52fa13ae579020d1172845647daee9ba78e070736e47740f2d2feabffe7e/index.js +179 -0
- package/vendor/components/sha256/cf0985ffcd8e7cbe2175ddb9a4342b2a4aa3f322794188fc99af8789b494460d/index.js +521 -0
- package/vendor/components/sha256/cff7ed8a0e0708bcef2e13105b28810bda867251a9f205ad9c2f1a5b4f759866/LICENSE-strokesvg.txt +115 -0
- package/vendor/components/sha256/cff7ed8a0e0708bcef2e13105b28810bda867251a9f205ad9c2f1a5b4f759866/OFL.txt +93 -0
- package/vendor/components/sha256/cff7ed8a0e0708bcef2e13105b28810bda867251a9f205ad9c2f1a5b4f759866/index.js +749 -0
- package/vendor/components/sha256/cff7ed8a0e0708bcef2e13105b28810bda867251a9f205ad9c2f1a5b4f759866/strokes-CHANGES.md +20 -0
- package/vendor/components/sha256/d01dc7fd78d08dd720ed86b39d7877dc0913d72e914036088a86af2df2faee52/index.js +484 -0
- package/vendor/components/sha256/d448fec2aeb436f187875c493b1592b373c6a18274ffc64231dbe3f1b54f8cbc/README.en.md +24 -0
- package/vendor/components/sha256/d448fec2aeb436f187875c493b1592b373c6a18274ffc64231dbe3f1b54f8cbc/index.js +214 -0
- package/vendor/components/sha256/d4aa3ffb394d5db7f47081b1818958547fe164bb968df03131f9400c103b97c4/README.en.md +31 -0
- package/vendor/components/sha256/d4aa3ffb394d5db7f47081b1818958547fe164bb968df03131f9400c103b97c4/index.js +271 -0
- package/vendor/components/sha256/d582d02ceeaf1ec4d94115b806852ddb66c009788e67728ae0e08cb8d29ca546/README.en.md +25 -0
- package/vendor/components/sha256/d582d02ceeaf1ec4d94115b806852ddb66c009788e67728ae0e08cb8d29ca546/index.js +316 -0
- package/vendor/components/sha256/d75ab2c8f6c01082bfcaeaba44290367d6b49654e2bf538422b7b3e499de9acf/README.en.md +23 -0
- package/vendor/components/sha256/d75ab2c8f6c01082bfcaeaba44290367d6b49654e2bf538422b7b3e499de9acf/index.js +120 -0
- package/vendor/components/sha256/d8f5272dac33066a04ecefa9a828ca11d18dec581866899f55433573ba4472d6/README.en.md +40 -0
- package/vendor/components/sha256/d8f5272dac33066a04ecefa9a828ca11d18dec581866899f55433573ba4472d6/index.js +405 -0
- package/vendor/components/sha256/dd1ff8de877573e30635928e9abce0b1fba8dfc95a079eca86703a884d3c3d59/README.en.md +66 -0
- package/vendor/components/sha256/dd1ff8de877573e30635928e9abce0b1fba8dfc95a079eca86703a884d3c3d59/index.js +984 -0
- package/vendor/components/sha256/ddd4b9cbbc282cbb3117ff662e1a14ecdb3cc7c16072a574418ec6a6eecef4d8/index.js +107 -0
- package/vendor/components/sha256/e24a4235a661bfda4049e1c72b6c376066fcc65e27a2bdfe77942a3394726c81/README.en.md +22 -0
- package/vendor/components/sha256/e24a4235a661bfda4049e1c72b6c376066fcc65e27a2bdfe77942a3394726c81/index.js +145 -0
- package/vendor/components/sha256/e2da948daac7bfac158857877b5a6932dbd2369e73901abcef118c92dd20b725/index.js +747 -0
- package/vendor/components/sha256/e40201a655bf5c556d70fbf45b5052dd48c33fc8030b331a9d9cbc96913d02a6/README.en.md +42 -0
- package/vendor/components/sha256/e40201a655bf5c556d70fbf45b5052dd48c33fc8030b331a9d9cbc96913d02a6/index.js +268 -0
- package/vendor/components/sha256/e653a4da80f7761442dc5b504ea5b0700fd0acf1979beeff56122cfdb3d4654c/index.js +607 -0
- package/vendor/components/sha256/ea217c6821e931b2d8474bf56d38f2dcc89ec705fe1d276f313e1c7e8db2b98a/index.js +233 -0
- package/vendor/components/sha256/ea2e4e24838574f607879c7d05556281258c018331e4da3e6f3a5263173f2e99/index.js +75 -0
- package/vendor/components/sha256/eb0b402dc4738b2dca2918c7f64a4d6fc3c27b4ba419270bbe8240a3c8a77f0c/README.en.md +42 -0
- package/vendor/components/sha256/eb0b402dc4738b2dca2918c7f64a4d6fc3c27b4ba419270bbe8240a3c8a77f0c/index.js +549 -0
- package/vendor/components/sha256/f219b47f32b0a78e8f8f5dac83596acfed24dd6e8bfe3f05f8ebfb9582d64485/README.en.md +44 -0
- package/vendor/components/sha256/f219b47f32b0a78e8f8f5dac83596acfed24dd6e8bfe3f05f8ebfb9582d64485/index.js +203 -0
- package/vendor/components/sha256/f4204773037ae296786e3614b5bfd7487b0f5ba6d5cf92ce20262bb7613e1b6b/README.en.md +34 -0
- package/vendor/components/sha256/f4204773037ae296786e3614b5bfd7487b0f5ba6d5cf92ce20262bb7613e1b6b/index.js +244 -0
- package/vendor/components/sha256/fa1a09c10181456143d125d68dbbdcacde6bab2e4a2b3e573367103ce28ebf55/index.js +228 -0
- package/vendor/components/sha256/fa9c9f63d74a514636961bcb8af75063e00e39bdf85655ecf5d4d7bbc05a831a/README.en.md +51 -0
- package/vendor/components/sha256/fa9c9f63d74a514636961bcb8af75063e00e39bdf85655ecf5d4d7bbc05a831a/index.js +228 -0
- package/vendor/components/sha256/facebe095849528396ee91d7d6856cb6945ba89ca8b1f34dce488dccb29e9d40/README.en.md +23 -0
- package/vendor/components/sha256/facebe095849528396ee91d7d6856cb6945ba89ca8b1f34dce488dccb29e9d40/index.js +147 -0
- package/vendor/components/sha256/fb0a77a344098c53cc90215685cee32b0d31362a1de5b5ac0eee422ed2c3c430/README.en.md +20 -0
- package/vendor/components/sha256/fb0a77a344098c53cc90215685cee32b0d31362a1de5b5ac0eee422ed2c3c430/index.js +307 -0
- package/vendor/components/sha256/fc48e703adab4715157f8dbb0e33c8b5c00099358ae522484290a7098fda2910/README.en.md +26 -0
- package/vendor/components/sha256/fc48e703adab4715157f8dbb0e33c8b5c00099358ae522484290a7098fda2910/index.js +322 -0
- package/vendor/components-2/manifest-2.12.0.json +2348 -0
- package/vendor/components-2/manifest-2.13.0.json +2477 -0
- package/vendor/components-2/manifest-2.14.0.json +2460 -0
- package/vendor/components-2/manifest-2.14.1.json +2460 -0
- package/vendor/components-2/manifest-2.15.0.json +2460 -0
- package/vendor/egatari-spec/SOURCE.json +3 -3
- package/vendor/egatari-spec/schema/deck-meta.schema.json +16 -1
- package/vendor/egatari-spec/schema/egatari-metadata.schema.json +17 -2
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
// m-orbit:月の満ち欠け(mode="moon"、既定)と金星の満ち欠け(mode="venus")。左に北極の上から見た図、右に地球から見た形を並べ、同じ角度で動かす
|
|
2
|
+
// <m-orbit style="height:440px"></m-orbit>(データは省ける。8 つの位置を新月から順に回り、最後に新月へ戻る)
|
|
3
|
+
// <m-orbit mode="venus" style="height:440px"><script type="application/json">{"visit": [3, 4, 5]}</script></m-orbit>
|
|
4
|
+
// 形は絵ではなく位置から計算する:太陽・地球・天体の角度から、光っている側(地球から見て右か左か)と欠け方(明暗の境の楕円)を決める。
|
|
5
|
+
// 大きさと距離は実際の比ではない(教えるための図)。比は earth・moon の属性で変えられる。
|
|
6
|
+
// 月:位置 i は太陽の向きから反時計回りに 360°·i/N(0 が新月)。太陽の光は sun の側から来る。地球の上の人(observer)は、
|
|
7
|
+
// 月が真夜中の側にあるとき(90°〜270°)は月が南中する時刻に、夕方の側(0°〜90°)は日の入り、明け方の側(270°〜360°)は日の出に立つ。
|
|
8
|
+
// 新月は正午。人の時刻は段階の間で反時計回りに進む。
|
|
9
|
+
// 金星:太陽を中心に、地球を下に止めて(地球との位置の関係だけを見せる)、位置 i は外合から反時計回りに 360°·i/N。
|
|
10
|
+
// 地球から見た大きさは距離に反比例し、太陽からの離角で夕方の西の空か明け方の東の空かを決める。
|
|
11
|
+
// 字は部品の中の表から授業の言語(ctx.lang)で選ぶ。データの labels・notes で位置ごとに上書きできる(null は表のまま、"" は字なし)。
|
|
12
|
+
// eclipse(月だけ):新月と満月の位置で、太陽・月・地球がそろったときの影(日食・月食)を描く。月の軌道の傾きは描かない(README)。
|
|
13
|
+
// 2.0(Egatari spec §6.1 の部品):base の MotionElement・el・prog・lerp だけを使い、プレイヤーのグローバルは使わない。
|
|
14
|
+
egatariParts.define({name: "orbit", version: "2.0.7", requires: {base: "1.3.0"}, element: "m-orbit"}, function(deps){
|
|
15
|
+
"use strict";
|
|
16
|
+
var base = deps.base;
|
|
17
|
+
var TAU = 2 * Math.PI;
|
|
18
|
+
// 字の表。ja と en。位置の名前は角度(度)で引く
|
|
19
|
+
var TEXT = {
|
|
20
|
+
ja: {top: "北極の上から見た図", moonView: "地球から見た月", venusView: "地球から見た金星", light: "太陽の光", sun: "太陽", earth: "地球",
|
|
21
|
+
moon: {0: "新月", 45: "三日月", 90: "上弦の月", 180: "満月", 270: "下弦の月"},
|
|
22
|
+
venusEast: "よいの明星", venusWest: "明けの明星",
|
|
23
|
+
solar: "日食", lunar: "月食", solarNote: "月が太陽をかくす", lunarNote: "月が地球の影に入る",
|
|
24
|
+
hidden: "見えない", nearSun: "太陽に近くて見えない", eveningSky: "夕方・西の空", dawnSky: "明け方・東の空",
|
|
25
|
+
time: function(h){ return h === 0 ? "真夜中" : h === 6 ? "明け方" : h === 12 ? "正午" : h === 18 ? "夕方" : h + "時ごろ"; },
|
|
26
|
+
sky: function(d){ return d + "の空"; }, join: "・",
|
|
27
|
+
dirs: {S: "南", SE: "南東", SW: "南西", E: "東", W: "西", N: "北", NE: "北東", NW: "北西"}},
|
|
28
|
+
en: {top: "Seen from above the North Pole", moonView: "The Moon from Earth", venusView: "Venus from Earth", light: "Sunlight", sun: "Sun", earth: "Earth",
|
|
29
|
+
moon: {0: "new moon", 45: "waxing crescent", 90: "first quarter", 180: "full moon", 270: "last quarter"},
|
|
30
|
+
venusEast: "evening star", venusWest: "morning star",
|
|
31
|
+
solar: "solar eclipse", lunar: "lunar eclipse", solarNote: "the Moon hides the Sun", lunarNote: "the Moon is in Earth's shadow",
|
|
32
|
+
hidden: "not visible", nearSun: "too close to the Sun to see", eveningSky: "evening, western sky", dawnSky: "dawn, eastern sky",
|
|
33
|
+
time: function(h){ return h === 0 ? "midnight" : h === 6 ? "dawn" : h === 12 ? "noon" : h === 18 ? "evening" : "about " + (h % 12 || 12) + (h < 12 ? " am" : " pm"); },
|
|
34
|
+
sky: function(d){ return d + " sky"; }, join: ", ",
|
|
35
|
+
dirs: {S: "southern", SE: "southeastern", SW: "southwestern", E: "eastern", W: "western", N: "northern", NE: "northeastern", NW: "northwestern"}},
|
|
36
|
+
};
|
|
37
|
+
// 金星の軌道の半径(地球の軌道を 1 とした比。距離と最大離角はこの値から計算する)
|
|
38
|
+
var VENUS_R = 0.723;
|
|
39
|
+
// 光っている面と影の面の色(テーマの色だけ)。明るい地(地が字より明るい):明るい面は --accent2 を地に薄く混ぜ、影の面は字の色を
|
|
40
|
+
// 地に混ぜた灰。暗い地:明るい面は --accent2 を字の色に混ぜ、影の面は字の色を地に少し混ぜる。どちらの地でも明るい面が影の面より明るい
|
|
41
|
+
var FILLS = {
|
|
42
|
+
// 光っている面はテーマの --lit(光とそれが照らすもの。形式 §8.4)。テーマが持たなければ今までの色
|
|
43
|
+
light: {lit: "var(--lit, color-mix(in srgb, var(--accent2) 22%, var(--bg)))", dark: "color-mix(in srgb, var(--fg) 42%, var(--bg))", eclipse: "var(--muted)"},
|
|
44
|
+
dark: {lit: "var(--lit, color-mix(in srgb, var(--accent2) 55%, var(--fg)))", dark: "color-mix(in srgb, var(--fg) 22%, var(--bg))", eclipse: "color-mix(in srgb, var(--muted) 45%, var(--bg))"},
|
|
45
|
+
};
|
|
46
|
+
var Part = class extends base.MotionElement {
|
|
47
|
+
static partName = "orbit";
|
|
48
|
+
// 先の形は答え(どう欠けるかを予想させる):授業の表示でも先を見せない
|
|
49
|
+
static preview = "none";
|
|
50
|
+
static shape = {
|
|
51
|
+
schema: {type: "object", additionalProperties: false, properties: {
|
|
52
|
+
positions: {type: "integer"}, start: {type: "integer"}, visit: {type: "array", items: {type: "integer"}},
|
|
53
|
+
labels: {type: "array", items: {type: ["string", "null"]}}, notes: {type: "array", items: {type: ["string", "null"]}},
|
|
54
|
+
eclipse: {type: "boolean"}}},
|
|
55
|
+
example: {positions: 8, visit: [1, 2, 3, 4, 5, 6, 7, 0]},
|
|
56
|
+
};
|
|
57
|
+
static props = {
|
|
58
|
+
mode: {type: "string", default: "moon", doc: "moon(月の満ち欠け)か venus(金星の満ち欠け)"},
|
|
59
|
+
hemisphere: {type: "string", default: "north", doc: "north(北半球から見た形。満ちていく月は右が光る)か south(南半球。左右が逆)"},
|
|
60
|
+
sun: {type: "string", default: "right", doc: "月の図で太陽の光が来る側(right か left)"},
|
|
61
|
+
earth: {type: "number", default: 0.2, doc: "地球の半径(月の軌道の半径に対する比。金星の図では地球の軌道に対する比の半分)"},
|
|
62
|
+
moon: {type: "number", default: 0.5, doc: "月の半径(地球の半径に対する比。実際の月は 0.27。金星の図では金星をこの 1.4 倍に)"},
|
|
63
|
+
observer: {type: "bool", default: true, doc: "月の図で、地球の上の人と、月を見る向きを描く"},
|
|
64
|
+
size: {type: "number", default: 28, doc: "地球から見た形の名前の字の大きさ(px。24 以上)"},
|
|
65
|
+
dur: {type: "number", default: 1.2, doc: "となりの位置へ動く秒数(2 つ先なら 2 倍)"},
|
|
66
|
+
};
|
|
67
|
+
get steps(){
|
|
68
|
+
if (this.getAttribute("steps") !== null) return +this.getAttribute("steps");
|
|
69
|
+
return this.plan().visit.length;
|
|
70
|
+
}
|
|
71
|
+
plan(){
|
|
72
|
+
if (this._plan) return this._plan;
|
|
73
|
+
var notes = this._notes = [], d = this.data || {}, venus = this.props.mode === "venus";
|
|
74
|
+
var N = d.positions !== undefined ? d.positions : 8;
|
|
75
|
+
if (!(N >= 4 && N <= 24)){ notes.push("[orbit] positions must be 4 to 24 (got " + N + "); using 8"); N = 8; }
|
|
76
|
+
var fix = function(i, what){
|
|
77
|
+
if (i >= 0 && i < N) return i;
|
|
78
|
+
notes.push("[orbit] " + what + " " + i + " is not a position 0 to " + (N - 1) + " (wrapped)");
|
|
79
|
+
return ((i % N) + N) % N;
|
|
80
|
+
};
|
|
81
|
+
var start = d.start !== undefined ? fix(d.start, "start") : 0;
|
|
82
|
+
var visit = d.visit ? d.visit.map(function(i){ return fix(i, "visit"); }) : null;
|
|
83
|
+
if (!visit){ visit = []; for (var i = 1; i <= N; i++) visit.push((start + i) % N); }
|
|
84
|
+
// 段階ごとの出発点・到着点と、反時計回りに進む位置の数
|
|
85
|
+
var legs = [], prev = start;
|
|
86
|
+
visit.forEach(function(v){ legs.push({from: prev, to: v, n: ((v - prev) % N + N) % N}); prev = v; });
|
|
87
|
+
return (this._plan = {N: N, venus: venus, start: start, visit: visit, legs: legs, eclipse: !venus && !!d.eclipse});
|
|
88
|
+
}
|
|
89
|
+
duration(k){
|
|
90
|
+
var l = this.plan().legs[k - 1];
|
|
91
|
+
return l ? l.n * this.props.dur : 0;
|
|
92
|
+
}
|
|
93
|
+
mount(ctx){
|
|
94
|
+
var P = this.props, D = base, self = this, pl = this.plan();
|
|
95
|
+
this._notes.forEach(function(m){ ctx.report("data", m); });
|
|
96
|
+
["mode", "hemisphere", "sun"].forEach(function(a){
|
|
97
|
+
var ok = {mode: ["moon", "venus"], hemisphere: ["north", "south"], sun: ["right", "left"]}[a];
|
|
98
|
+
if (ok.indexOf(P[a]) < 0) ctx.report("attr", "[orbit] " + a + "=\"" + P[a] + "\" is not one of " + ok.join(", ") + "; using " + ok[0]);
|
|
99
|
+
});
|
|
100
|
+
// earth・moon:正の数でなければ既定に(NaN の図にしない)
|
|
101
|
+
[["earth", 0.2, 0.5], ["moon", 0.5, 2]].forEach(function(a){
|
|
102
|
+
var v = P[a[0]];
|
|
103
|
+
if (!(typeof v === "number" && v > 0 && v <= a[2])){
|
|
104
|
+
ctx.report("attr", "[orbit] " + a[0] + "=\"" + self.getAttribute(a[0]) + "\" is not a number above 0 and up to " + a[2] + "; using " + a[1]);
|
|
105
|
+
P[a[0]] = a[1];
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
this.F = isDarkBg(this) ? FILLS.dark : FILLS.light;
|
|
109
|
+
this.south = P.hemisphere === "south";
|
|
110
|
+
this.sunLeft = !pl.venus && P.sun === "left";
|
|
111
|
+
this.T = /^ja\b/i.test(ctx.lang || "") ? TEXT.ja : TEXT.en;
|
|
112
|
+
this.labels = this.positionLabels();
|
|
113
|
+
this.noteData = (this.data && this.data.notes) || [];
|
|
114
|
+
this.style.display = "block"; this.style.position = "relative"; this.style.writingMode = "horizontal-tb";
|
|
115
|
+
var W = this.W = this.clientWidth, H = this.H = this.clientHeight;
|
|
116
|
+
this.svg = D.el("svg", {viewBox: "0 0 " + W + " " + H, width: W, height: H, style: "display:block;overflow:visible"}, this);
|
|
117
|
+
var L = this.L = this.arrange();
|
|
118
|
+
if (!L.fits) ctx.report("size", "[orbit] the diagram does not fit its box (" + L.why + "); make the element larger");
|
|
119
|
+
this.draw(L);
|
|
120
|
+
// 読み上げ:最後の状態(最後の位置と、その名前か説明)。作者の aria-label はそのまま
|
|
121
|
+
this.setAttribute("role", "img");
|
|
122
|
+
if (!this.getAttribute("aria-label")){
|
|
123
|
+
var last = pl.visit.length ? pl.visit[pl.visit.length - 1] : pl.start, ja = this.T === TEXT.ja;
|
|
124
|
+
var what = this.labels[last] || this.caption(last, this.observerAngleAt(last));
|
|
125
|
+
this.setAttribute("aria-label", ja
|
|
126
|
+
? (pl.venus ? "金星の満ち欠け" : "月の満ち欠け") + ":位置 " + last + (what ? "、" + what : "") + (pl.venus ? "" : "(地球から見た形)")
|
|
127
|
+
: (pl.venus ? "Phases of Venus" : "Phases of the Moon") + ": position " + last + (what ? ", " + what : "") + (pl.venus ? "" : " (as seen from Earth)"));
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
// 位置ごとの名前:データの labels が先、なければ表(月は角度で、金星は最大離角に近い位置)
|
|
131
|
+
positionLabels(){
|
|
132
|
+
var pl = this.plan(), N = pl.N, T = this.T, given = (this.data && this.data.labels) || [], out = [];
|
|
133
|
+
for (var i = 0; i < N; i++){
|
|
134
|
+
var def = "";
|
|
135
|
+
if (!pl.venus){
|
|
136
|
+
var deg = 360 * i / N;
|
|
137
|
+
if (Math.abs(deg - Math.round(deg)) < 1e-9 && T.moon[Math.round(deg)]) def = T.moon[Math.round(deg)];
|
|
138
|
+
} else {
|
|
139
|
+
var ge = Math.round(N * (180 - Math.acos(VENUS_R) * 180 / Math.PI) / 360);
|
|
140
|
+
if (i === ge) def = T.venusEast; else if (i === N - ge) def = T.venusWest;
|
|
141
|
+
}
|
|
142
|
+
out.push(given[i] === undefined || given[i] === null ? def : given[i]);
|
|
143
|
+
}
|
|
144
|
+
return out;
|
|
145
|
+
}
|
|
146
|
+
// 配置:左に上から見た図(正方形に近い)、右に地球から見た形。上に 2 つの図の題
|
|
147
|
+
arrange(){
|
|
148
|
+
var W = this.W, H = this.H, P = this.props, pl = this.plan(), N = pl.N, why = [];
|
|
149
|
+
var head = 40, gap = 24, fs = Math.max(24, P.size);
|
|
150
|
+
var rightW = Math.max(300, Math.min(420, W * 0.32)), topW = W - rightW - gap, rightX = topW + gap;
|
|
151
|
+
var lab = 24, lh = 30, labelW = 0, self = this;
|
|
152
|
+
this.labels.forEach(function(s){ labelW = Math.max(labelW, est(s, lab, self)); });
|
|
153
|
+
var L = {head: head, topW: topW, rightX: rightX, rightW: rightW, fs: fs, lab: lab, why: why};
|
|
154
|
+
var areaTop = head, areaH = H - head;
|
|
155
|
+
if (!pl.venus){
|
|
156
|
+
// 太陽の光の矢印の列(太陽の側の端)。題の字の幅だけ取る
|
|
157
|
+
var col = Math.max(70, est(this.T.light, 24, self) + 8);
|
|
158
|
+
var side = this.sunLeft ? -1 : 1;
|
|
159
|
+
// 軌道の半径 R:横は(光の列を除いた幅)、縦は(高さ)に、月と名前が入る最大
|
|
160
|
+
var mr = function(R){ return R * P.earth * P.moon; };
|
|
161
|
+
// 軌道と名前の幅(blockW)の太陽の側に、16px あけて光の列を置き、全体を左の図の幅の中ほどに
|
|
162
|
+
var blockW = function(R){ return 2 * (R + mr(R) + 10 + labelW); };
|
|
163
|
+
var fitsR = function(R){
|
|
164
|
+
var hNeed = 2 * (R + mr(R) + 8 + (labelW ? lh : 0));
|
|
165
|
+
return blockW(R) + 16 + col <= topW && hNeed <= areaH;
|
|
166
|
+
};
|
|
167
|
+
var lo = 20, hi = Math.max(lo, Math.min(topW, areaH));
|
|
168
|
+
for (var it = 0; it < 40; it++){ var mid = (lo + hi) / 2; if (fitsR(mid)) lo = mid; else hi = mid; }
|
|
169
|
+
var R = lo, bw = blockW(R), x0 = Math.max(0, (topW - bw - 16 - col) / 2);
|
|
170
|
+
L.R = R; L.cy = areaTop + areaH / 2; L.er = R * P.earth; L.mr = mr(R); L.col = col; L.side = side;
|
|
171
|
+
L.cx = side > 0 ? x0 + bw / 2 : x0 + col + 16 + bw / 2;
|
|
172
|
+
L.colX = side > 0 ? x0 + bw + 16 : x0;
|
|
173
|
+
if (L.er + (P.observer ? 34 : 0) + L.mr + 6 > R) why.push("the Earth and the Moon touch; lower earth or moon");
|
|
174
|
+
if (R < 60) why.push("the orbit is " + Math.round(R) + "px");
|
|
175
|
+
} else {
|
|
176
|
+
// 金星:太陽が中心、地球の軌道 RE。地球は下、名前は右の図だけ
|
|
177
|
+
// 地球の名前を地球の下に置く分(34px)を下にあける
|
|
178
|
+
var RE = Math.max(0, Math.min(topW / 2 - 12, (areaH - 34) / 2 - 12) / (1 + P.earth * 0.5));
|
|
179
|
+
L.R = RE; L.cx = topW / 2; L.cy = areaTop + (areaH - 34) / 2; L.er = RE * P.earth * 0.5; L.mr = L.er * P.moon * 1.4; L.sr = RE * 0.14;
|
|
180
|
+
if (RE < 80) why.push("the orbit is " + Math.round(RE) + "px");
|
|
181
|
+
}
|
|
182
|
+
// 右の図:大きな円盤と、その下の名前(fs)と説明(24px)の 2 行
|
|
183
|
+
var textH = fs * 1.3 + 24 * 1.3 + 12;
|
|
184
|
+
L.dr = Math.max(10, Math.min(150, rightW / 2 - 12, (areaH - textH) / 2 - 8));
|
|
185
|
+
L.dcx = rightX + rightW / 2; L.dcy = areaTop + 8 + L.dr;
|
|
186
|
+
L.nameY = L.dcy + L.dr + 12 + fs; L.noteY = L.nameY + 10 + 24;
|
|
187
|
+
var noteW = 0;
|
|
188
|
+
this.L = L; // caption が位置の幾何を使う
|
|
189
|
+
for (var i = 0; i < N; i++) noteW = Math.max(noteW, est(this.caption(i, this.observerAngleAt(i)), 24, self), est(this.labels[i], fs, self));
|
|
190
|
+
if (noteW > rightW) why.push("a caption is " + Math.round(noteW) + "px wide, the right side " + Math.round(rightW) + "px");
|
|
191
|
+
if (L.dr < 50) why.push("the view from Earth is " + Math.round(L.dr) + "px");
|
|
192
|
+
L.fits = !why.length; L.why = why.join("; ");
|
|
193
|
+
return L;
|
|
194
|
+
}
|
|
195
|
+
// ---- 幾何(数学の向き:x は右、y は上。描くときに SVG の向きに直す)
|
|
196
|
+
// 位置 a(小数可)の天体の中心(上から見た図)と、太陽の向き(天体から太陽への単位ベクトル)
|
|
197
|
+
bodyAt(a){
|
|
198
|
+
var L = this.L, pl = this.plan(), th = TAU * a / pl.N;
|
|
199
|
+
if (!pl.venus){
|
|
200
|
+
var s = this.sunLeft ? Math.PI : 0, g = s + th;
|
|
201
|
+
return {x: L.R * Math.cos(g), y: L.R * Math.sin(g), sun: [Math.cos(s), Math.sin(s)], earth: [0, 0]};
|
|
202
|
+
}
|
|
203
|
+
// 金星:外合(地球の反対側、上)から反時計回り
|
|
204
|
+
var psi = Math.PI / 2 + th, r = L.R * VENUS_R, x = r * Math.cos(psi), y = r * Math.sin(psi), d = Math.hypot(x, y);
|
|
205
|
+
return {x: x, y: y, sun: [-x / d, -y / d], earth: [0, -L.R]};
|
|
206
|
+
}
|
|
207
|
+
// 地球から見た形:照らされた割合のもとの cos(位相角)、光っている側(+1 右、-1 左)、地球からの距離と離角
|
|
208
|
+
phaseAt(a){
|
|
209
|
+
var b = this.bodyAt(a), ex = b.earth[0], ey = b.earth[1], dx = b.x - ex, dy = b.y - ey, d = Math.hypot(dx, dy) || 1;
|
|
210
|
+
var ux = dx / d, uy = dy / d;
|
|
211
|
+
// 天体から地球への向きと、天体から太陽への向きのなす角(位相角)
|
|
212
|
+
var cosP = b.sun[0] * (-ux) + b.sun[1] * (-uy);
|
|
213
|
+
// 見る人の左(上から見て反時計回りに 90°)は東。太陽が西(右)にあれば右が光る
|
|
214
|
+
var east = b.sun[0] * (-uy) + b.sun[1] * ux;
|
|
215
|
+
var side = east < 0 ? 1 : -1;
|
|
216
|
+
if (this.south) side = -side;
|
|
217
|
+
// 地球から見た太陽の向きと天体の向きの離角(東が正)
|
|
218
|
+
var sx = -ex, sy = -ey, sd = Math.hypot(sx, sy);
|
|
219
|
+
var elong = sd ? Math.atan2(sx * uy - sy * ux, sx * ux + sy * uy) : 0;
|
|
220
|
+
if (!this.plan().venus){ elong = Math.atan2(this.bodyAt(0).sun[0] * uy - this.bodyAt(0).sun[1] * ux, this.bodyAt(0).sun[0] * ux + this.bodyAt(0).sun[1] * uy); }
|
|
221
|
+
return {cosP: Math.max(-1, Math.min(1, cosP)), side: side, d: d, elong: elong};
|
|
222
|
+
}
|
|
223
|
+
// 位置 i にいるときの地球の上の人の角度(太陽の向きから反時計回り、度)。0 は正午、90 は夕方、180 は真夜中、270 は明け方
|
|
224
|
+
observerAngleAt(i){
|
|
225
|
+
var e = 360 * i / this.plan().N;
|
|
226
|
+
if (e === 0) return 0;
|
|
227
|
+
if (e < 90) return 90;
|
|
228
|
+
if (e > 270) return 270;
|
|
229
|
+
return e;
|
|
230
|
+
}
|
|
231
|
+
caption(i, w){
|
|
232
|
+
var T = this.T, pl = this.plan();
|
|
233
|
+
var given = this.noteData && this.noteData[i];
|
|
234
|
+
if (given !== undefined && given !== null) return given;
|
|
235
|
+
var ph = this.phaseAt(i), lit = (1 + ph.cosP) / 2;
|
|
236
|
+
if (pl.venus){
|
|
237
|
+
var deg = ph.elong * 180 / Math.PI;
|
|
238
|
+
if (Math.abs(deg) < 10) return T.nearSun;
|
|
239
|
+
return deg > 0 ? T.eveningSky : T.dawnSky;
|
|
240
|
+
}
|
|
241
|
+
if (pl.eclipse){
|
|
242
|
+
var e0 = (360 * i / pl.N) % 360;
|
|
243
|
+
if (e0 === 0) return T.solarNote;
|
|
244
|
+
if (e0 === 180) return T.lunarNote;
|
|
245
|
+
}
|
|
246
|
+
var h = Math.round(((12 + w / 15) % 24 + 24) % 24);
|
|
247
|
+
// 見る向き:人の真上から月への角(東が正)。南(南半球は北)の空を基準に 45° ごと
|
|
248
|
+
var a = ((360 * i / pl.N - w) % 360 + 540) % 360 - 180, n = this.south ? "N" : "S";
|
|
249
|
+
var dir = Math.abs(a) <= 22.5 ? n : Math.abs(a) < 67.5 ? n + (a > 0 ? "E" : "W") : (a > 0 ? "E" : "W");
|
|
250
|
+
var s = T.time(h) + T.join + T.sky(T.dirs[dir]);
|
|
251
|
+
if (lit < 0.02) s = T.time(h) + T.join + T.hidden;
|
|
252
|
+
return s;
|
|
253
|
+
}
|
|
254
|
+
draw(L){
|
|
255
|
+
var D = base, svg = this.svg, pl = this.plan(), N = pl.N, self = this, T = this.T, P = this.props;
|
|
256
|
+
var X = function(x){ return L.cx + x; }, Y = function(y){ return L.cy - y; };
|
|
257
|
+
// 題
|
|
258
|
+
D.el("text", {x: 0, y: 28, "font-size": 24, fill: "var(--muted)"}, svg).textContent = T.top;
|
|
259
|
+
D.el("text", {x: L.dcx, y: 28, "font-size": 24, fill: "var(--muted)", "text-anchor": "middle"}, svg).textContent = pl.venus ? T.venusView : T.moonView;
|
|
260
|
+
var fig = D.el("g", {}, svg);
|
|
261
|
+
if (!pl.venus){
|
|
262
|
+
// 太陽の光:端の列に、地球の側へ向かう矢印
|
|
263
|
+
var side = L.side, x0 = L.colX + (side > 0 ? L.col - 4 : 4), x1 = L.colX + (side > 0 ? 4 : L.col - 4);
|
|
264
|
+
var lg = D.el("g", {}, fig);
|
|
265
|
+
for (var j = 0; j < 4; j++){
|
|
266
|
+
var yy = L.cy - L.R * 0.75 + j * L.R * 0.5;
|
|
267
|
+
D.el("line", {x1: x0, y1: yy, x2: x1 + (side > 0 ? 10 : -10), y2: yy, stroke: "var(--accent2)", "stroke-width": 3}, lg);
|
|
268
|
+
D.el("path", {d: "M" + x1 + "," + yy + "l" + (side > 0 ? 14 : -14) + ",-7v14z", fill: "var(--accent2)"}, lg);
|
|
269
|
+
}
|
|
270
|
+
D.el("text", {x: side > 0 ? L.colX + L.col : L.colX, y: L.cy - L.R * 0.75 - 18, "font-size": 24, fill: "var(--fg)", "text-anchor": side > 0 ? "end" : "start"}, lg).textContent = T.light;
|
|
271
|
+
// 軌道
|
|
272
|
+
D.el("circle", {cx: X(0), cy: Y(0), r: L.R, fill: "none", stroke: "var(--muted)", "stroke-width": 2, "stroke-dasharray": "6 6"}, fig);
|
|
273
|
+
} else {
|
|
274
|
+
D.el("circle", {cx: X(0), cy: Y(0), r: L.R, fill: "none", stroke: "var(--muted)", "stroke-width": 2, "stroke-dasharray": "6 6"}, fig);
|
|
275
|
+
D.el("circle", {cx: X(0), cy: Y(0), r: L.R * VENUS_R, fill: "none", stroke: "var(--muted)", "stroke-width": 2, "stroke-dasharray": "6 6"}, fig);
|
|
276
|
+
D.el("circle", {cx: X(0), cy: Y(0), r: L.sr, fill: "var(--lit, var(--accent2))", stroke: "var(--muted)", "stroke-width": 1.5}, fig);
|
|
277
|
+
}
|
|
278
|
+
// 影(食)。render が濃さを決める
|
|
279
|
+
this.shadow = D.el("path", {d: "", fill: "var(--fg)", opacity: 0}, fig);
|
|
280
|
+
// 位置の印:薄い天体(光っている半分は太陽の側)
|
|
281
|
+
this.ghosts = [];
|
|
282
|
+
for (var i = 0; i < N; i++){
|
|
283
|
+
var b = this.bodyAt(i), g = D.el("g", {opacity: 0.35}, fig);
|
|
284
|
+
body(g, X(b.x), Y(b.y), L.mr, b.sun, null, this.F);
|
|
285
|
+
this.ghosts.push(g);
|
|
286
|
+
}
|
|
287
|
+
// 地球
|
|
288
|
+
var eb = pl.venus ? {x: 0, y: -L.R} : {x: 0, y: 0}, esun = pl.venus ? [0, 1] : this.bodyAt(0).sun;
|
|
289
|
+
body(D.el("g", {}, fig), X(eb.x), Y(eb.y), L.er, esun, "var(--term)", this.F);
|
|
290
|
+
if (pl.venus) D.el("text", {x: X(eb.x), y: Y(eb.y) + L.er + 28, "font-size": 24, fill: "var(--fg)", "text-anchor": "middle"}, fig).textContent = T.earth;
|
|
291
|
+
// 見る線(地球の上の人、または地球から天体へ)と人
|
|
292
|
+
this.sight = D.el("path", {d: "", fill: "none", stroke: "var(--fg)", "stroke-width": 2, "stroke-dasharray": "4 5"}, fig);
|
|
293
|
+
this.person = D.el("g", {}, fig);
|
|
294
|
+
if (!pl.venus && P.observer){
|
|
295
|
+
// 地球の表面に立つ人(上が外向き)。render が回す
|
|
296
|
+
D.el("line", {x1: 0, y1: 0, x2: 0, y2: -16, stroke: "var(--fg)", "stroke-width": 3}, this.person);
|
|
297
|
+
D.el("line", {x1: -7, y1: -10, x2: 7, y2: -10, stroke: "var(--fg)", "stroke-width": 3}, this.person);
|
|
298
|
+
D.el("circle", {cx: 0, cy: -22, r: 6, fill: "var(--bg)", stroke: "var(--fg)", "stroke-width": 3}, this.person);
|
|
299
|
+
}
|
|
300
|
+
// 今の天体
|
|
301
|
+
this.cur = D.el("g", {}, fig);
|
|
302
|
+
// 上から見た図の位置の名前(月だけ):軌道の外、天体の外側に
|
|
303
|
+
this.posLabels = [];
|
|
304
|
+
if (!pl.venus){
|
|
305
|
+
for (i = 0; i < N; i++){
|
|
306
|
+
if (!this.labels[i]) { this.posLabels.push(null); continue; }
|
|
307
|
+
var th = (this.sunLeft ? Math.PI : 0) + TAU * i / N, c = Math.cos(th), s = Math.sin(th), rr = L.R + L.mr + 10;
|
|
308
|
+
var anchor = c > 0.3 ? "start" : c < -0.3 ? "end" : "middle";
|
|
309
|
+
var ty = Y(rr * s) + (s > 0.3 ? -6 : s < -0.3 ? 24 : 8) + (anchor === "middle" ? 0 : 0);
|
|
310
|
+
var tx = X(rr * c);
|
|
311
|
+
var t = D.el("text", {x: tx.toFixed(1), y: ty.toFixed(1), "font-size": L.lab, fill: "var(--fg)", "text-anchor": anchor, opacity: 0}, fig);
|
|
312
|
+
t.textContent = this.labels[i];
|
|
313
|
+
this.posLabels.push(t);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
// 右:地球から見た形
|
|
317
|
+
var view = D.el("g", {}, svg);
|
|
318
|
+
this.vSun = D.el("circle", {cx: L.dcx, cy: L.dcy, r: L.dr, fill: "var(--lit, var(--accent2))", stroke: "var(--muted)", "stroke-width": 1.5, opacity: 0}, view);
|
|
319
|
+
this.vDark = D.el("circle", {cx: L.dcx, cy: L.dcy, r: L.dr, fill: this.F.dark}, view);
|
|
320
|
+
this.vLit = D.el("path", {d: "", fill: this.F.lit}, view);
|
|
321
|
+
this.vRim = D.el("circle", {cx: L.dcx, cy: L.dcy, r: L.dr, fill: "none", stroke: "var(--muted)", "stroke-width": 2}, view);
|
|
322
|
+
this.vName = D.el("text", {x: L.dcx, y: L.nameY, "font-size": L.fs, "font-weight": 700, fill: "var(--fg)", "text-anchor": "middle"}, view);
|
|
323
|
+
this.vNote = D.el("text", {x: L.dcx, y: L.noteY, "font-size": 24, fill: "var(--muted)", "text-anchor": "middle"}, view);
|
|
324
|
+
}
|
|
325
|
+
render(k, t, ctx){
|
|
326
|
+
var pl = this.plan(), L = this.L, N = pl.N, self = this, D = base;
|
|
327
|
+
if (!L) return;
|
|
328
|
+
var X = function(x){ return L.cx + x; }, Y = function(y){ return L.cy - y; };
|
|
329
|
+
var leg = k >= 1 ? pl.legs[Math.min(k, pl.legs.length) - 1] : null;
|
|
330
|
+
var from = leg ? leg.from : pl.start, to = leg ? leg.to : pl.start, n = leg ? leg.n : 0;
|
|
331
|
+
var dur = n * this.props.dur, e = k > pl.legs.length || !leg || !n ? 1 : D.prog(t, 0, dur);
|
|
332
|
+
var a = from + n * e; // 位置(小数)
|
|
333
|
+
// 天体
|
|
334
|
+
var b = this.bodyAt(a), ph = this.phaseAt(a);
|
|
335
|
+
while (this.cur.firstChild) this.cur.removeChild(this.cur.firstChild);
|
|
336
|
+
body(this.cur, X(b.x), Y(b.y), L.mr, b.sun, null, this.F);
|
|
337
|
+
// 地球の上の人と見る線
|
|
338
|
+
if (!pl.venus){
|
|
339
|
+
var w0 = this.observerAngleAt(from), w1 = this.observerAngleAt(to);
|
|
340
|
+
// 位置 0(新月)を通る段階だけ一回り足す。同じ向きの位置どうし(夕方に寄せた 1→2 など)は回さない
|
|
341
|
+
if (n && from + n >= N) w1 += 360;
|
|
342
|
+
var w = n ? D.lerp(w0, w1, e) : w1;
|
|
343
|
+
var wr = (this.sunLeft ? 180 : 0) + w, wrad = wr * Math.PI / 180;
|
|
344
|
+
var ox = (L.er + 22) * Math.cos(wrad), oy = (L.er + 22) * Math.sin(wrad);
|
|
345
|
+
if (this.props.observer){
|
|
346
|
+
setIf(this.person, "transform", "translate(" + X(L.er * Math.cos(wrad)).toFixed(2) + " " + Y(L.er * Math.sin(wrad)).toFixed(2) + ") rotate(" + (90 - wr).toFixed(2) + ")");
|
|
347
|
+
sightLine(this.sight, X(ox), Y(oy), X(b.x), Y(b.y), L.mr + 4);
|
|
348
|
+
} else setIf(this.sight, "d", "");
|
|
349
|
+
} else sightLine(this.sight, X(0), Y(-L.R + L.er + 4), X(b.x), Y(b.y), L.mr + 4);
|
|
350
|
+
// 位置の名前(上から見た図):着いた位置から出る
|
|
351
|
+
var seen = {};
|
|
352
|
+
seen[pl.start] = 1;
|
|
353
|
+
for (var s = 1; s < k && s <= pl.legs.length; s++) seen[pl.legs[s - 1].to] = 1;
|
|
354
|
+
this.posLabels.forEach(function(el, i){
|
|
355
|
+
if (!el) return;
|
|
356
|
+
var op = seen[i] ? 1 : i === to && leg && k <= pl.legs.length ? D.prog(t, Math.max(0, dur - 0.3), 0.3) : 0;
|
|
357
|
+
if (i === to && k > pl.legs.length) op = 1;
|
|
358
|
+
setIf(el, "opacity", (+op).toFixed(3));
|
|
359
|
+
});
|
|
360
|
+
// 右の図
|
|
361
|
+
var R = L.dr, scale = 1;
|
|
362
|
+
if (pl.venus){
|
|
363
|
+
// 大きさは距離に反比例。いちばん近い位置を R にする
|
|
364
|
+
var dmin = Infinity;
|
|
365
|
+
for (var i = 0; i < N; i++) dmin = Math.min(dmin, this.phaseAt(i).d);
|
|
366
|
+
var near = Math.max(dmin, L.R * (1 - VENUS_R) * 1.4);
|
|
367
|
+
scale = Math.min(1, near / ph.d);
|
|
368
|
+
}
|
|
369
|
+
var r = R * scale;
|
|
370
|
+
setIf(this.vDark, "r", r.toFixed(2));
|
|
371
|
+
setIf(this.vRim, "r", r.toFixed(2));
|
|
372
|
+
setIf(this.vLit, "d", litPath(L.dcx, L.dcy, r, ph.cosP, ph.side));
|
|
373
|
+
// 食:そろった位置のまわり 12° で濃くなる
|
|
374
|
+
var deg = ((360 * a / N) % 360 + 360) % 360, solar = 0, lunar = 0;
|
|
375
|
+
if (pl.eclipse){
|
|
376
|
+
solar = Math.max(0, 1 - Math.min(deg, 360 - deg) / 12);
|
|
377
|
+
lunar = Math.max(0, 1 - Math.abs(deg - 180) / 12);
|
|
378
|
+
}
|
|
379
|
+
setIf(this.vSun, "opacity", solar.toFixed(3));
|
|
380
|
+
setIf(this.vSun, "r", (r * 1.1).toFixed(2)); // 日食:月のまわりに太陽の縁が少し出る
|
|
381
|
+
// 月食:影に入った月は暗く(明るい地では --muted)
|
|
382
|
+
setIf(this.vDark, "style", "fill:" + (lunar > 0.5 ? this.F.eclipse : this.F.dark) + ";"); // base.el と同じ書き方
|
|
383
|
+
if (lunar > 0) setIf(this.vLit, "opacity", (1 - lunar).toFixed(3)); else setIf(this.vLit, "opacity", "1");
|
|
384
|
+
// 影の形:日食は月から地球へ、月食は地球から月の先へ
|
|
385
|
+
var sd = "";
|
|
386
|
+
if (solar > 0 || lunar > 0){
|
|
387
|
+
var sun = this.bodyAt(0).sun, px = -sun[1], py = sun[0];
|
|
388
|
+
if (solar > 0){
|
|
389
|
+
sd = poly([[b.x + px * L.mr, b.y + py * L.mr], [b.x - px * L.mr, b.y - py * L.mr], [-sun[0] * L.er * 0.2 - px * 2, -sun[1] * L.er * 0.2 - py * 2], [-sun[0] * L.er * 0.2 + px * 2, -sun[1] * L.er * 0.2 + py * 2]], X, Y);
|
|
390
|
+
} else {
|
|
391
|
+
var far = L.R + L.mr * 2.5;
|
|
392
|
+
sd = poly([[px * L.er, py * L.er], [-px * L.er, -py * L.er], [-sun[0] * far - px * L.er * 0.7, -sun[1] * far - py * L.er * 0.7], [-sun[0] * far + px * L.er * 0.7, -sun[1] * far + py * L.er * 0.7]], X, Y);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
setIf(this.shadow, "d", sd);
|
|
396
|
+
setIf(this.shadow, "opacity", (0.22 * Math.max(solar, lunar)).toFixed(3));
|
|
397
|
+
// 名前と説明:前半は出発点のものが消え、後半に到着点のものが出る
|
|
398
|
+
var useTo = !n || e >= 0.5 || k > pl.legs.length;
|
|
399
|
+
var idx = useTo ? to : from, op = !n || k > pl.legs.length ? 1 : useTo ? D.prog(t, dur * 0.75, dur * 0.25) : 1 - D.prog(t, 0, dur * 0.25);
|
|
400
|
+
var name = this.labels[idx] || "";
|
|
401
|
+
if (pl.eclipse && useTo){
|
|
402
|
+
var dg = (360 * idx / N) % 360;
|
|
403
|
+
if (dg === 0) name = (name ? name + "(" : "") + this.T.solar + (name ? ")" : "");
|
|
404
|
+
if (dg === 180) name = (name ? name + "(" : "") + this.T.lunar + (name ? ")" : "");
|
|
405
|
+
}
|
|
406
|
+
if (this.T === TEXT.en) name = name.replace("(", " (").replace(")", ")");
|
|
407
|
+
setText(this.vName, name);
|
|
408
|
+
setText(this.vNote, this.caption(idx, this.observerAngleAt(idx)));
|
|
409
|
+
setIf(this.vName, "opacity", op.toFixed(3));
|
|
410
|
+
setIf(this.vNote, "opacity", op.toFixed(3));
|
|
411
|
+
}
|
|
412
|
+
};
|
|
413
|
+
|
|
414
|
+
// ---- 下の関数は m-orbit の中だけで使う
|
|
415
|
+
function setIf(el, a, v){ v = String(v); if (el.getAttribute(a) !== v) el.setAttribute(a, v); }
|
|
416
|
+
function setText(el, s){ if (el.textContent !== s) el.textContent = s; }
|
|
417
|
+
// 字の幅(px):base の textWidth(font の要素の字で測った幅)
|
|
418
|
+
function est(s, fs, font){ return base.textWidth(s || "", fs, {font: font}); }
|
|
419
|
+
// 地が字の色より暗いか(テーマの変数を読む。読めなければ明るい地)
|
|
420
|
+
function isDarkBg(el){
|
|
421
|
+
var cs = getComputedStyle(el), bg = rgbOf(cs.getPropertyValue("--bg").trim()), fg = rgbOf(cs.getPropertyValue("--fg").trim());
|
|
422
|
+
return !!(bg && fg) && luma(bg) < luma(fg);
|
|
423
|
+
}
|
|
424
|
+
// 色を sRGB で読む(m-map-world と同じ:キャンバスに 1 点塗って読む。読めなければ null)
|
|
425
|
+
function rgbOf(css){
|
|
426
|
+
try {
|
|
427
|
+
if (!css) return null;
|
|
428
|
+
var cv = document.createElement("canvas"); cv.width = cv.height = 1;
|
|
429
|
+
var g = cv.getContext("2d", {willReadFrequently: true});
|
|
430
|
+
if (!g) return null;
|
|
431
|
+
g.fillStyle = "#010203"; g.fillStyle = css;
|
|
432
|
+
if (/^#010203$/i.test(g.fillStyle) && !/^#010203$/i.test(css)) return null;
|
|
433
|
+
g.fillRect(0, 0, 1, 1);
|
|
434
|
+
var d = g.getImageData(0, 0, 1, 1).data;
|
|
435
|
+
return [d[0], d[1], d[2]];
|
|
436
|
+
} catch (e) { return null; }
|
|
437
|
+
}
|
|
438
|
+
function luma(c){ return 0.2126 * c[0] + 0.7152 * c[1] + 0.0722 * c[2]; }
|
|
439
|
+
// 上から見た天体:暗い円盤と、太陽の側の明るい半分
|
|
440
|
+
function body(g, cx, cy, r, sun, litFill, F){
|
|
441
|
+
base.el("circle", {cx: cx.toFixed(2), cy: cy.toFixed(2), r: r.toFixed(2), fill: F.dark}, g);
|
|
442
|
+
var a = Math.atan2(-sun[1], sun[0]), p = [];
|
|
443
|
+
for (var i = 0; i <= 24; i++){ var u = a - Math.PI / 2 + Math.PI * i / 24; p.push([cx + r * Math.cos(u), cy + r * Math.sin(u)]); }
|
|
444
|
+
base.el("path", {d: "M" + p.map(function(q){ return q[0].toFixed(2) + "," + q[1].toFixed(2); }).join("L") + "Z", fill: litFill || F.lit}, g);
|
|
445
|
+
base.el("circle", {cx: cx.toFixed(2), cy: cy.toFixed(2), r: r.toFixed(2), fill: "none", stroke: "var(--muted)", "stroke-width": 1.5}, g);
|
|
446
|
+
}
|
|
447
|
+
// 地球から見た明るい部分:光っている側の縁(半円)と、明暗の境(横の半径が r·|cos 位相角| の半楕円)
|
|
448
|
+
function litPath(cx, cy, r, cosP, side){
|
|
449
|
+
if ((1 + cosP) / 2 < 1e-4) return "";
|
|
450
|
+
var pts = [], M = 48, i, u;
|
|
451
|
+
for (i = 0; i <= M; i++){ u = -Math.PI / 2 + Math.PI * i / M; pts.push([cx + side * r * Math.cos(u), cy + r * Math.sin(u)]); }
|
|
452
|
+
for (i = M; i >= 0; i--){ u = -Math.PI / 2 + Math.PI * i / M; pts.push([cx - side * cosP * r * Math.cos(u), cy + r * Math.sin(u)]); }
|
|
453
|
+
return "M" + pts.map(function(q){ return q[0].toFixed(2) + "," + q[1].toFixed(2); }).join("L") + "Z";
|
|
454
|
+
}
|
|
455
|
+
function poly(pts, X, Y){ return "M" + pts.map(function(q){ return X(q[0]).toFixed(2) + "," + Y(q[1]).toFixed(2); }).join("L") + "Z"; }
|
|
456
|
+
// 見る線:出発点から天体の縁の手前まで、先に小さな矢じり
|
|
457
|
+
function sightLine(el, x0, y0, x1, y1, stop){
|
|
458
|
+
var dx = x1 - x0, dy = y1 - y0, d = Math.hypot(dx, dy);
|
|
459
|
+
if (d <= stop + 4){ setIf(el, "d", ""); return; }
|
|
460
|
+
var ux = dx / d, uy = dy / d, ex = x1 - ux * stop, ey = y1 - uy * stop, px = -uy, py = ux;
|
|
461
|
+
setIf(el, "d", "M" + x0.toFixed(2) + "," + y0.toFixed(2) + "L" + ex.toFixed(2) + "," + ey.toFixed(2) +
|
|
462
|
+
"M" + (ex - ux * 9 + px * 5).toFixed(2) + "," + (ey - uy * 9 + py * 5).toFixed(2) + "L" + ex.toFixed(2) + "," + ey.toFixed(2) + "L" + (ex - ux * 9 - px * 5).toFixed(2) + "," + (ey - uy * 9 - py * 5).toFixed(2));
|
|
463
|
+
}
|
|
464
|
+
return Part;
|
|
465
|
+
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: Icon cards in a row or 2 rows, by step; arrows for order
|
|
3
|
+
steps: largest card step (default 1 card = 1 step)
|
|
4
|
+
props:
|
|
5
|
+
layout: row, or grid (2×2; 3×2 for 5–6)
|
|
6
|
+
arrows: order arrows (grid: Z order)
|
|
7
|
+
nums: number circles
|
|
8
|
+
hilite: last or a number (from 1)
|
|
9
|
+
per-step: cards per step (0 = all)
|
|
10
|
+
stagger: card offset (s)
|
|
11
|
+
dur: appear seconds
|
|
12
|
+
example: {"cards": [{"icon": "user", "title": "Listen", "text": "Hear the problem"}, {"icon": "bulb", "title": "Think", "text": "Find 3 ideas"}, {"icon": "rocket", "title": "Try", "text": "Build small, show"}]}
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
3–4 short equal points or a 2×2: try cards over bullets; short steps: cards with arrows. Long or unequal items: bullets.
|
|
16
|
+
|
|
17
|
+
Child JSON: `{"cards": [{"n", "icon", "title", "text", "step", "tone"}, …]}` (2–6 cards).
|
|
18
|
+
|
|
19
|
+
- `title`: required, ≤ 2 lines. `text`: wraps; overflow cut with …, reported
|
|
20
|
+
- `icon`: Tabler name (below); unknown = dashed box, reported
|
|
21
|
+
- `n`: circle text (`"A"`, `"1"`); `nums` numbers the rest 1, 2, 3 …
|
|
22
|
+
- `tone`: circle and icon colour (`term`, `emph`, `accent2`, `series-1..4`)
|
|
23
|
+
- `arrows`; `hilite="last"` or `"3"`: `--emph` frame and fill
|
|
24
|
+
- `variant`: `rise` (default), `fade`, `draw`
|
|
25
|
+
|
|
26
|
+
Icons:
|
|
27
|
+
|
|
28
|
+
- People: user users user-check user-plus user-circle friends mood-smile man woman id-badge
|
|
29
|
+
- Data: chart-bar chart-line chart-pie chart-dots trending-up trending-down table database filter adjustments percentage sum
|
|
30
|
+
- Money: coin cash credit-card wallet receipt pig-money building-bank report-money shopping-cart tag
|
|
31
|
+
- Time: clock calendar calendar-event calendar-time hourglass history alarm stopwatch
|
|
32
|
+
- Place: map-pin map world home building building-factory building-store route truck
|
|
33
|
+
- Flow: arrow-right arrows-right-left refresh repeat circle-check checklist list-numbers git-branch target flag rocket hand-click
|
|
34
|
+
- Talk: message messages mail phone bell speakerphone share world-www microphone presentation
|
|
35
|
+
- Docs: file file-text files notebook book clipboard-list folder news certificate award
|
|
36
|
+
- Tools: tool settings hammer bulb puzzle cpu device-laptop device-mobile robot code scale
|
|
37
|
+
- Nature: leaf tree plant sun moon cloud cloud-rain droplet flame snowflake
|
|
38
|
+
- Safety: shield shield-check lock key alert-triangle first-aid-kit heart heart-rate-monitor eye
|
|
39
|
+
- Learning: school pencil ruler math-function atom flask microscope palette music language
|
|
40
|
+
|
|
41
|
+
The demo is `demo.html`. Companies and numbers are fictional.
|
|
42
|
+
|
|
43
|
+
<!-- llm: omit -->
|
|
44
|
+
Notes for authors of parts
|
|
45
|
+
|
|
46
|
+
- Icons come by name from the library part `icons` (Tabler outline, MIT); a build keeps only the names a lesson uses. Colour: `currentColor`
|
|
47
|
+
- Sizes: icon 32–64 px, title 26–34 px, text 24 px
|
|
48
|
+
- Overflow is cut with … and reported once (`layout`)
|
|
49
|
+
- Screen readers: svg `role="list"`, cards `role="listitem"` with number, title and text; icons and arrows `aria-hidden`
|
|
50
|
+
- Show later steps faintly: later cards at `--preview-opacity`; print and video show the last step
|
|
51
|
+
<!-- llm: end -->
|