@jjlmoya/utils-astronomy 1.26.0 → 1.28.0

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.
Files changed (38) hide show
  1. package/package.json +1 -1
  2. package/src/category/index.ts +3 -2
  3. package/src/data.ts +2 -1
  4. package/src/entries.ts +4 -1
  5. package/src/tests/locale_completeness.test.ts +2 -3
  6. package/src/tests/seo_translation_completeness.test.ts +1 -1
  7. package/src/tests/tool_validation.test.ts +7 -6
  8. package/src/tool/telescopeExitPupilPlanner/bibliography.astro +14 -0
  9. package/src/tool/telescopeExitPupilPlanner/bibliography.ts +12 -0
  10. package/src/tool/telescopeExitPupilPlanner/component.astro +93 -0
  11. package/src/tool/telescopeExitPupilPlanner/controller.ts +102 -0
  12. package/src/tool/telescopeExitPupilPlanner/dom-views.ts +64 -0
  13. package/src/tool/telescopeExitPupilPlanner/entry.ts +31 -0
  14. package/src/tool/telescopeExitPupilPlanner/evaluator.ts +17 -0
  15. package/src/tool/telescopeExitPupilPlanner/i18n/de.ts +2 -0
  16. package/src/tool/telescopeExitPupilPlanner/i18n/en.ts +177 -0
  17. package/src/tool/telescopeExitPupilPlanner/i18n/es.ts +2 -0
  18. package/src/tool/telescopeExitPupilPlanner/i18n/fr.ts +2 -0
  19. package/src/tool/telescopeExitPupilPlanner/i18n/id.ts +2 -0
  20. package/src/tool/telescopeExitPupilPlanner/i18n/it.ts +2 -0
  21. package/src/tool/telescopeExitPupilPlanner/i18n/ja.ts +2 -0
  22. package/src/tool/telescopeExitPupilPlanner/i18n/ko.ts +2 -0
  23. package/src/tool/telescopeExitPupilPlanner/i18n/nl.ts +2 -0
  24. package/src/tool/telescopeExitPupilPlanner/i18n/pl.ts +2 -0
  25. package/src/tool/telescopeExitPupilPlanner/i18n/pt.ts +2 -0
  26. package/src/tool/telescopeExitPupilPlanner/i18n/ru.ts +2 -0
  27. package/src/tool/telescopeExitPupilPlanner/i18n/sv.ts +2 -0
  28. package/src/tool/telescopeExitPupilPlanner/i18n/tr.ts +2 -0
  29. package/src/tool/telescopeExitPupilPlanner/i18n/translated.ts +140 -0
  30. package/src/tool/telescopeExitPupilPlanner/i18n/zh.ts +2 -0
  31. package/src/tool/telescopeExitPupilPlanner/index.ts +10 -0
  32. package/src/tool/telescopeExitPupilPlanner/logic.test.ts +39 -0
  33. package/src/tool/telescopeExitPupilPlanner/logic.ts +57 -0
  34. package/src/tool/telescopeExitPupilPlanner/seo.astro +15 -0
  35. package/src/tool/telescopeExitPupilPlanner/storage.ts +24 -0
  36. package/src/tool/telescopeExitPupilPlanner/telescope-exit-pupil-magnification-planner.css +454 -0
  37. package/src/tool/telescopeExitPupilPlanner/ui.ts +40 -0
  38. package/src/tools.ts +3 -1
@@ -0,0 +1,454 @@
1
+ .tep-root {
2
+ --n-bg: #f4f0e8;
3
+ --n-surface: #fffdf7;
4
+ --n-surface-strong: #f6ead6;
5
+ --n-ink: #1c2530;
6
+ --n-muted: #59636d;
7
+ --n-line: #d8cfc0;
8
+ --n-accent: #1d6d72;
9
+ --n-accent-soft: #cde3de;
10
+ --n-warm: #d8794a;
11
+ --n-scene: #182b34;
12
+ --n-scene-line: #6ec7c0;
13
+ --n-scene-light: #f5ca7c;
14
+ --n-shadow: #c3b6a2;
15
+
16
+ box-sizing: border-box;
17
+ width: 100%;
18
+ max-width: calc(100vw - 4rem);
19
+ margin-inline: auto;
20
+ color: var(--n-ink);
21
+ background: var(--n-bg);
22
+ border: 1px solid var(--n-line);
23
+ border-radius: 1.35rem;
24
+ overflow: visible;
25
+ }
26
+
27
+ .theme-dark .tep-root {
28
+ --n-bg: #151b21;
29
+ --n-surface: #202a31;
30
+ --n-surface-strong: #2d373b;
31
+ --n-ink: #f3efe6;
32
+ --n-muted: #c3c9c7;
33
+ --n-line: #4b5758;
34
+ --n-accent: #8bd1c7;
35
+ --n-accent-soft: #294744;
36
+ --n-warm: #f0a56d;
37
+ --n-scene: #0d171d;
38
+ --n-scene-line: #8bd1c7;
39
+ --n-scene-light: #ffd58a;
40
+ --n-shadow: #0b1116;
41
+ }
42
+
43
+ .tep-root * {
44
+ box-sizing: border-box;
45
+ }
46
+
47
+ .tep-layout {
48
+ display: grid;
49
+ grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
50
+ }
51
+
52
+ .tep-inputs,
53
+ .tep-output {
54
+ padding: 1.5rem;
55
+ }
56
+
57
+ .tep-inputs {
58
+ border-right: 1px solid var(--n-line);
59
+ background: var(--n-surface);
60
+ border-radius: 1.35rem 0 0 1.35rem;
61
+ }
62
+
63
+ .tep-input-grid {
64
+ display: grid;
65
+ grid-template-columns: repeat(2, minmax(0, 1fr));
66
+ gap: 1rem;
67
+ }
68
+
69
+ .tep-field {
70
+ position: relative;
71
+ display: flex;
72
+ flex-direction: column;
73
+ gap: 0.45rem;
74
+ min-width: 0;
75
+ }
76
+
77
+ .tep-field > span,
78
+ .tep-primary-result > span,
79
+ .tep-metrics span,
80
+ .tep-scene-heading > span,
81
+ .tep-footnotes span {
82
+ color: var(--n-muted);
83
+ font-size: 0.74rem;
84
+ font-weight: 750;
85
+ letter-spacing: 0.045em;
86
+ line-height: 1.25;
87
+ text-transform: uppercase;
88
+ }
89
+
90
+ .tep-number-wrap,
91
+ .tep-select-trigger {
92
+ min-height: 3.25rem;
93
+ border: 1px solid var(--n-line);
94
+ border-radius: 0.7rem;
95
+ background: var(--n-surface-strong);
96
+ }
97
+
98
+ .tep-number-wrap {
99
+ display: flex;
100
+ align-items: center;
101
+ padding: 0 0.75rem;
102
+ }
103
+
104
+ .tep-number-wrap:focus-within,
105
+ .tep-select-trigger:focus-visible,
106
+ .tep-select-menu button:focus-visible,
107
+ .tep-reset:focus-visible {
108
+ outline: 3px solid var(--n-warm);
109
+ outline-offset: 2px;
110
+ }
111
+
112
+ .tep-number-wrap input {
113
+ width: 100%;
114
+ min-width: 0;
115
+ border: 0;
116
+ outline: 0;
117
+ background: transparent;
118
+ color: var(--n-ink);
119
+ font: inherit;
120
+ font-size: 1.12rem;
121
+ font-weight: 700;
122
+ }
123
+
124
+ .tep-number-wrap b {
125
+ flex: 0 0 auto;
126
+ color: var(--n-muted);
127
+ font-size: 0.82rem;
128
+ }
129
+
130
+ .tep-select-trigger {
131
+ width: 100%;
132
+ padding: 0.8rem 2.5rem 0.8rem 0.8rem;
133
+ color: var(--n-ink);
134
+ cursor: pointer;
135
+ font: inherit;
136
+ font-size: 0.9rem;
137
+ font-weight: 650;
138
+ text-align: left;
139
+ position: relative;
140
+ }
141
+
142
+ .tep-select-trigger::after {
143
+ content: '';
144
+ position: absolute;
145
+ right: 0.85rem;
146
+ top: 1.18rem;
147
+ width: 0.55rem;
148
+ height: 0.55rem;
149
+ border-right: 2px solid var(--n-accent);
150
+ border-bottom: 2px solid var(--n-accent);
151
+ transform: rotate(45deg);
152
+ }
153
+
154
+ .tep-select-menu {
155
+ position: absolute;
156
+ z-index: 5;
157
+ top: calc(100% + 0.4rem);
158
+ right: 0;
159
+ left: 0;
160
+ padding: 0.35rem;
161
+ border: 1px solid var(--n-line);
162
+ border-radius: 0.7rem;
163
+ background: var(--n-surface);
164
+ box-shadow: 0 0.8rem 1.8rem var(--n-shadow);
165
+ }
166
+
167
+ .tep-select-menu[hidden] {
168
+ display: none;
169
+ }
170
+
171
+ .tep-select-menu button {
172
+ display: block;
173
+ width: 100%;
174
+ border: 0;
175
+ border-radius: 0.45rem;
176
+ padding: 0.7rem;
177
+ background: transparent;
178
+ color: var(--n-ink);
179
+ cursor: pointer;
180
+ font: inherit;
181
+ text-align: left;
182
+ }
183
+
184
+ .tep-select-menu button:hover,
185
+ .tep-select-menu button[aria-selected='true'] {
186
+ background: var(--n-accent-soft);
187
+ }
188
+
189
+ .tep-hint,
190
+ .tep-scene-copy,
191
+ .tep-footnotes p {
192
+ color: var(--n-muted);
193
+ font-size: 0.82rem;
194
+ line-height: 1.5;
195
+ }
196
+
197
+ .tep-hint {
198
+ margin: 1.25rem 0 0;
199
+ }
200
+
201
+ .tep-reset {
202
+ margin-top: 1.35rem;
203
+ border: 0;
204
+ border-bottom: 1px solid var(--n-accent);
205
+ padding: 0.15rem 0;
206
+ background: transparent;
207
+ color: var(--n-accent);
208
+ cursor: pointer;
209
+ font: inherit;
210
+ font-size: 0.83rem;
211
+ font-weight: 750;
212
+ }
213
+
214
+ .tep-output {
215
+ background: var(--n-bg);
216
+ border-radius: 0 1.35rem 1.35rem 0;
217
+ }
218
+
219
+ .tep-primary-result {
220
+ display: grid;
221
+ grid-template-columns: auto 1fr auto;
222
+ align-items: baseline;
223
+ gap: 0.35rem 0.5rem;
224
+ padding-bottom: 1.05rem;
225
+ border-bottom: 1px solid var(--n-line);
226
+ }
227
+
228
+ .tep-primary-result strong {
229
+ color: var(--n-accent);
230
+ font-size: clamp(3.4rem, 8vw, 5.6rem);
231
+ font-weight: 800;
232
+ letter-spacing: -0.07em;
233
+ line-height: 0.9;
234
+ text-align: right;
235
+ }
236
+
237
+ .tep-primary-result > b {
238
+ color: var(--n-warm);
239
+ font-size: 1.3rem;
240
+ }
241
+
242
+ .tep-primary-result small {
243
+ grid-column: 1 / -1;
244
+ color: var(--n-muted);
245
+ font-size: 0.78rem;
246
+ }
247
+
248
+ .tep-metrics {
249
+ display: grid;
250
+ grid-template-columns: repeat(3, minmax(0, 1fr));
251
+ gap: 0.8rem;
252
+ padding: 1.15rem 0;
253
+ border-bottom: 1px solid var(--n-line);
254
+ }
255
+
256
+ .tep-metrics div {
257
+ min-width: 0;
258
+ }
259
+
260
+ .tep-metrics > div > span {
261
+ display: block;
262
+ }
263
+
264
+ .tep-metrics strong {
265
+ display: inline-block;
266
+ margin-top: 0.35rem;
267
+ color: var(--n-ink);
268
+ font-size: 1.55rem;
269
+ line-height: 1;
270
+ }
271
+
272
+ .tep-metric-value {
273
+ white-space: nowrap;
274
+ }
275
+
276
+ .tep-metrics b {
277
+ margin-left: 0.22rem;
278
+ color: var(--n-muted);
279
+ font-size: 0.75rem;
280
+ }
281
+
282
+ .tep-scene-wrap {
283
+ padding-top: 1.15rem;
284
+ }
285
+
286
+ .tep-scene-heading {
287
+ display: flex;
288
+ align-items: baseline;
289
+ justify-content: space-between;
290
+ gap: 1rem;
291
+ }
292
+
293
+ .tep-scene-heading strong {
294
+ color: var(--n-warm);
295
+ font-size: 0.84rem;
296
+ text-align: right;
297
+ }
298
+
299
+ .tep-scene {
300
+ margin-top: 0.7rem;
301
+ border-radius: 0.85rem;
302
+ overflow: hidden;
303
+ }
304
+
305
+ .tep-optical-scene {
306
+ display: block;
307
+ width: 100%;
308
+ height: auto;
309
+ }
310
+
311
+ .tep-scene-ground {
312
+ fill: var(--n-scene);
313
+ }
314
+
315
+ .tep-light-cone {
316
+ fill: var(--n-scene-light);
317
+ opacity: 0.7;
318
+ }
319
+
320
+ .tep-light-cone-secondary {
321
+ opacity: 0.28;
322
+ }
323
+
324
+ .tep-tube,
325
+ .tep-eyepiece {
326
+ fill: var(--n-accent);
327
+ }
328
+
329
+ .tep-aperture,
330
+ .tep-exit-ring {
331
+ fill: none;
332
+ stroke: var(--n-scene-line);
333
+ stroke-width: 3;
334
+ }
335
+
336
+ .tep-aperture-core,
337
+ .tep-exit-pupil {
338
+ fill: var(--n-scene-light);
339
+ }
340
+
341
+ .tep-eye {
342
+ fill: none;
343
+ stroke: var(--n-scene-line);
344
+ stroke-width: 4;
345
+ }
346
+
347
+ .tep-eye-iris {
348
+ fill: var(--n-warm);
349
+ }
350
+
351
+ .tep-eye-glint {
352
+ fill: var(--n-surface);
353
+ }
354
+
355
+ .tep-guide,
356
+ .tep-field-orbit {
357
+ fill: none;
358
+ stroke: var(--n-scene-line);
359
+ stroke-width: 2;
360
+ stroke-dasharray: 5 7;
361
+ }
362
+
363
+ .tep-field-orbit {
364
+ opacity: 0.65;
365
+ }
366
+
367
+ .tep-scene-label,
368
+ .tep-scene-value {
369
+ fill: var(--n-surface);
370
+ font-size: 13px;
371
+ font-weight: 700;
372
+ }
373
+
374
+ .tep-scene-copy {
375
+ margin: 0.7rem 0 0;
376
+ }
377
+
378
+ .tep-footnotes {
379
+ display: grid;
380
+ gap: 0.6rem;
381
+ margin-top: 1rem;
382
+ padding-top: 1rem;
383
+ border-top: 1px solid var(--n-line);
384
+ }
385
+
386
+ .tep-footnotes p {
387
+ margin: 0;
388
+ }
389
+
390
+ .tep-footnotes p:first-child {
391
+ display: flex;
392
+ justify-content: space-between;
393
+ gap: 1rem;
394
+ }
395
+
396
+ .tep-footnotes strong {
397
+ color: var(--n-ink);
398
+ }
399
+
400
+ @media (max-width: 760px) {
401
+ .tep-layout {
402
+ grid-template-columns: 1fr;
403
+ }
404
+
405
+ .tep-inputs {
406
+ border-right: 0;
407
+ border-bottom: 1px solid var(--n-line);
408
+ border-radius: 1.35rem 1.35rem 0 0;
409
+ }
410
+
411
+ .tep-output {
412
+ border-radius: 0 0 1.35rem 1.35rem;
413
+ }
414
+ }
415
+
416
+ @media (max-width: 520px) {
417
+ .tep-inputs,
418
+ .tep-output {
419
+ padding: 1rem;
420
+ }
421
+
422
+ .tep-input-grid,
423
+ .tep-metrics {
424
+ grid-template-columns: 1fr;
425
+ }
426
+
427
+ .tep-primary-result strong {
428
+ font-size: 4rem;
429
+ }
430
+
431
+ .tep-metrics > div {
432
+ display: grid;
433
+ grid-template-columns: 1fr auto;
434
+ align-items: baseline;
435
+ gap: 0.35rem;
436
+ }
437
+
438
+ .tep-metric-value {
439
+ display: grid;
440
+ grid-template-columns: auto auto;
441
+ justify-content: end;
442
+ }
443
+
444
+ .tep-metrics strong {
445
+ margin-top: 0;
446
+ text-align: right;
447
+ }
448
+
449
+ .tep-metrics b {
450
+ grid-column: 2;
451
+ margin-left: 0;
452
+ text-align: right;
453
+ }
454
+ }
@@ -0,0 +1,40 @@
1
+ export interface SelectOption {
2
+ value: string;
3
+ label: string;
4
+ }
5
+
6
+ export interface TelescopeExitPupilPlannerUI {
7
+ apertureLabel: string;
8
+ scopeFocalLengthLabel: string;
9
+ eyepieceFocalLengthLabel: string;
10
+ barlowLabel: string;
11
+ apparentFieldLabel: string;
12
+ millimetreUnit: string;
13
+ presetHint: string;
14
+ barlowOptions: SelectOption[];
15
+ apparentFieldOptions: SelectOption[];
16
+ magnificationLabel: string;
17
+ exitPupilLabel: string;
18
+ trueFieldLabel: string;
19
+ focalRatioLabel: string;
20
+ effectiveEyepieceLabel: string;
21
+ magnificationUnit: string;
22
+ exitPupilUnit: string;
23
+ fieldUnit: string;
24
+ focalRatioUnit: string;
25
+ opticalPathLabel: string;
26
+ opticalPathDescription: string;
27
+ pupilTooSmall: string;
28
+ pupilDetail: string;
29
+ pupilWorking: string;
30
+ pupilWide: string;
31
+ pupilTooSmallDetail: string;
32
+ pupilDetailDetail: string;
33
+ pupilWorkingDetail: string;
34
+ pupilWideDetail: string;
35
+ assumptionLabel: string;
36
+ assumptionText: string;
37
+ magnificationHint: string;
38
+ trueFieldHint: string;
39
+ resetLabel: string;
40
+ }
package/src/tools.ts CHANGED
@@ -4,6 +4,7 @@ import { DEEP_SPACE_SCOPE_TOOL } from './tool/deepSpaceScope';
4
4
  import { STAR_EXPOSURE_CALCULATOR_TOOL } from './tool/starExposureCalculator';
5
5
  import { TELESCOPE_RESOLUTION_TOOL } from './tool/telescopeResolution';
6
6
  import { EYEPIECE_CALCULATOR_TOOL } from './tool/smartEyepieceCalculator';
7
+ import { TELESCOPE_EXIT_PUPIL_PLANNER_TOOL } from './tool/telescopeExitPupilPlanner';
7
8
  import type { ToolDefinition } from './types';
8
9
 
9
10
  export const ALL_TOOLS: ToolDefinition[] = [
@@ -12,6 +13,7 @@ export const ALL_TOOLS: ToolDefinition[] = [
12
13
  STAR_EXPOSURE_CALCULATOR_TOOL,
13
14
  TELESCOPE_RESOLUTION_TOOL,
14
15
  EYEPIECE_CALCULATOR_TOOL,
16
+ TELESCOPE_EXIT_PUPIL_PLANNER_TOOL,
15
17
  ];
16
18
 
17
19
  export {
@@ -20,5 +22,5 @@ export {
20
22
  STAR_EXPOSURE_CALCULATOR_TOOL,
21
23
  TELESCOPE_RESOLUTION_TOOL,
22
24
  EYEPIECE_CALCULATOR_TOOL,
25
+ TELESCOPE_EXIT_PUPIL_PLANNER_TOOL,
23
26
  };
24
-