@jjlmoya/utils-astronomy 1.11.0 → 1.13.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.
- package/package.json +7 -4
- package/scripts/postinstall.mjs +27 -0
- package/src/category/index.ts +4 -4
- package/src/entries.ts +14 -0
- package/src/tool/bortleVisualizer/component.astro +0 -342
- package/src/tool/bortleVisualizer/dark-sky-simulator.css +340 -0
- package/src/tool/bortleVisualizer/entry.ts +53 -0
- package/src/tool/bortleVisualizer/index.ts +2 -55
- package/src/tool/deepSpaceScope/component.astro +0 -478
- package/src/tool/deepSpaceScope/entry.ts +60 -0
- package/src/tool/deepSpaceScope/index.ts +2 -62
- package/src/tool/deepSpaceScope/telescope-reach.css +476 -0
- package/src/tool/starExposureCalculator/500-rule-calculator.css +317 -0
- package/src/tool/starExposureCalculator/component.astro +0 -319
- package/src/tool/starExposureCalculator/entry.ts +49 -0
- package/src/tool/starExposureCalculator/index.ts +2 -51
- package/src/tool/telescopeResolution/component.astro +0 -334
- package/src/tool/telescopeResolution/entry.ts +49 -0
- package/src/tool/telescopeResolution/index.ts +2 -51
- package/src/tool/telescopeResolution/telescope-resolution-calculator.css +332 -0
- package/src/tools.ts +1 -1
package/package.json
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jjlmoya/utils-astronomy",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": "./src/index.ts",
|
|
9
|
-
"./data": "./src/data.ts"
|
|
9
|
+
"./data": "./src/data.ts",
|
|
10
|
+
"./entries": "./src/entries.ts"
|
|
10
11
|
},
|
|
11
12
|
"files": [
|
|
12
|
-
"src"
|
|
13
|
+
"src",
|
|
14
|
+
"scripts"
|
|
13
15
|
],
|
|
14
16
|
"publishConfig": {
|
|
15
17
|
"access": "public"
|
|
@@ -28,7 +30,8 @@
|
|
|
28
30
|
"postversion": "git push && git push --tags",
|
|
29
31
|
"patch": "npm version patch",
|
|
30
32
|
"minor": "npm version minor",
|
|
31
|
-
"major": "npm version major"
|
|
33
|
+
"major": "npm version major",
|
|
34
|
+
"postinstall": "node scripts/postinstall.mjs"
|
|
32
35
|
},
|
|
33
36
|
"lint-staged": {
|
|
34
37
|
"*.{ts,tsx,astro}": [
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { readFileSync, writeFileSync, mkdirSync, readdirSync } from 'fs';
|
|
2
|
+
import { join, dirname } from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
|
|
5
|
+
const libDir = dirname(fileURLToPath(import.meta.url));
|
|
6
|
+
const toolsDir = join(libDir, '../src/tool');
|
|
7
|
+
|
|
8
|
+
const inNodeModules = libDir.includes('node_modules');
|
|
9
|
+
if (!inNodeModules) process.exit(0);
|
|
10
|
+
|
|
11
|
+
const projectRoot = join(libDir, '../../../..');
|
|
12
|
+
const categoryKey = JSON.parse(readFileSync(join(libDir, '../package.json'), 'utf8')).name.replace('@jjlmoya/utils-', '');
|
|
13
|
+
const destDir = join(projectRoot, `public/styles/lib/${categoryKey}`);
|
|
14
|
+
|
|
15
|
+
mkdirSync(destDir, { recursive: true });
|
|
16
|
+
|
|
17
|
+
const tools = readdirSync(toolsDir, { withFileTypes: true }).filter(d => d.isDirectory());
|
|
18
|
+
for (const tool of tools) {
|
|
19
|
+
const toolDir = join(toolsDir, tool.name);
|
|
20
|
+
let files;
|
|
21
|
+
try { files = readdirSync(toolDir).filter(f => f.endsWith('.css')); }
|
|
22
|
+
catch { continue; }
|
|
23
|
+
for (const file of files) {
|
|
24
|
+
writeFileSync(join(destDir, file), readFileSync(join(toolDir, file)));
|
|
25
|
+
console.log(`[@jjlmoya/utils-${categoryKey}] copied ${file}`);
|
|
26
|
+
}
|
|
27
|
+
}
|
package/src/category/index.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { AstronomyCategoryEntry } from '../types';
|
|
2
|
-
import { bortleVisualizer } from '../tool/bortleVisualizer';
|
|
3
|
-
import { deepSpaceScope } from '../tool/deepSpaceScope';
|
|
4
|
-
import { starExposureCalculator } from '../tool/starExposureCalculator';
|
|
5
|
-
import { telescopeResolution } from '../tool/telescopeResolution';
|
|
2
|
+
import { bortleVisualizer } from '../tool/bortleVisualizer/entry';
|
|
3
|
+
import { deepSpaceScope } from '../tool/deepSpaceScope/entry';
|
|
4
|
+
import { starExposureCalculator } from '../tool/starExposureCalculator/entry';
|
|
5
|
+
import { telescopeResolution } from '../tool/telescopeResolution/entry';
|
|
6
6
|
|
|
7
7
|
export const toolsCategory: AstronomyCategoryEntry = {
|
|
8
8
|
icon: 'mdi:telescope',
|
package/src/entries.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { bortleVisualizer } from './tool/bortleVisualizer/entry';
|
|
2
|
+
export type { BortleVisualizerUI, BortleLevel, BortleVisualizerLocaleContent } from './tool/bortleVisualizer/entry';
|
|
3
|
+
export { deepSpaceScope } from './tool/deepSpaceScope/entry';
|
|
4
|
+
export type { DeepSpaceObject, DeepSpaceScopeUI, DeepSpaceScopeLocaleContent } from './tool/deepSpaceScope/entry';
|
|
5
|
+
export { starExposureCalculator } from './tool/starExposureCalculator/entry';
|
|
6
|
+
export type { StarExposureCalculatorUI, StarExposureCalculatorLocaleContent } from './tool/starExposureCalculator/entry';
|
|
7
|
+
export { telescopeResolution } from './tool/telescopeResolution/entry';
|
|
8
|
+
export type { TelescopeResolutionUI, TelescopeResolutionLocaleContent } from './tool/telescopeResolution/entry';
|
|
9
|
+
export { toolsCategory, astronomyCategory } from './category';
|
|
10
|
+
import { bortleVisualizer } from './tool/bortleVisualizer/entry';
|
|
11
|
+
import { deepSpaceScope } from './tool/deepSpaceScope/entry';
|
|
12
|
+
import { starExposureCalculator } from './tool/starExposureCalculator/entry';
|
|
13
|
+
import { telescopeResolution } from './tool/telescopeResolution/entry';
|
|
14
|
+
export const ALL_ENTRIES = [bortleVisualizer, deepSpaceScope, starExposureCalculator, telescopeResolution];
|
|
@@ -216,345 +216,3 @@ const bortleData = ui.bortleData;
|
|
|
216
216
|
}
|
|
217
217
|
</script>
|
|
218
218
|
|
|
219
|
-
<style>
|
|
220
|
-
.bortle-wrapper {
|
|
221
|
-
width: 100%;
|
|
222
|
-
max-width: 80rem;
|
|
223
|
-
margin: 0 auto;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
.bortle-scene {
|
|
227
|
-
--on-dark: #fff;
|
|
228
|
-
|
|
229
|
-
position: relative;
|
|
230
|
-
width: 100%;
|
|
231
|
-
aspect-ratio: 9 / 16;
|
|
232
|
-
border-radius: 2rem;
|
|
233
|
-
overflow: hidden;
|
|
234
|
-
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
|
|
235
|
-
background: var(--color-bg-deep, #050b14);
|
|
236
|
-
border: 1px solid rgba(255, 255, 255, 0.05);
|
|
237
|
-
user-select: none;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
@media (min-width: 768px) {
|
|
241
|
-
.bortle-scene {
|
|
242
|
-
aspect-ratio: 16 / 9;
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
.bortle-bg-gradient {
|
|
247
|
-
position: absolute;
|
|
248
|
-
inset: 0;
|
|
249
|
-
background: linear-gradient(to bottom, #02040a, #0b1026, #1e293b);
|
|
250
|
-
z-index: 0;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
.bortle-layer {
|
|
254
|
-
position: absolute;
|
|
255
|
-
inset: 0;
|
|
256
|
-
transition: opacity 1s ease-in-out;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
.layer-stars {
|
|
260
|
-
z-index: 10;
|
|
261
|
-
opacity: 1;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
.stars-canvas {
|
|
265
|
-
position: absolute;
|
|
266
|
-
inset: 0;
|
|
267
|
-
width: 100%;
|
|
268
|
-
height: 100%;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
.layer-milkyway {
|
|
272
|
-
z-index: 20;
|
|
273
|
-
mix-blend-mode: screen;
|
|
274
|
-
opacity: 1;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
.milkyway-image {
|
|
278
|
-
position: absolute;
|
|
279
|
-
inset: 0;
|
|
280
|
-
background-image: url('/images/utilities/dark-sky/milky-way.webp');
|
|
281
|
-
background-size: contain;
|
|
282
|
-
background-position: center;
|
|
283
|
-
background-repeat: no-repeat;
|
|
284
|
-
opacity: 0.8;
|
|
285
|
-
scale: 1.25;
|
|
286
|
-
mask-image: radial-gradient(closest-side, black 40%, transparent 100%);
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
.layer-pollution {
|
|
290
|
-
position: absolute;
|
|
291
|
-
inset-inline: 0;
|
|
292
|
-
bottom: 0;
|
|
293
|
-
top: 25%;
|
|
294
|
-
z-index: 30;
|
|
295
|
-
opacity: 0;
|
|
296
|
-
transition: opacity 1s ease-in-out;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
.pollution-gradient {
|
|
300
|
-
position: absolute;
|
|
301
|
-
inset: 0;
|
|
302
|
-
background: linear-gradient(to top, var(--color-pollution-warm, #f97316), rgba(251, 191, 36, 0.4), transparent);
|
|
303
|
-
mix-blend-mode: hard-light;
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
.layer-glow {
|
|
307
|
-
z-index: 40;
|
|
308
|
-
background: rgba(219, 234, 254, 0.1);
|
|
309
|
-
opacity: 0;
|
|
310
|
-
pointer-events: none;
|
|
311
|
-
mix-blend-mode: overlay;
|
|
312
|
-
transition: opacity 1s ease-in-out;
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
.landscape-layer {
|
|
316
|
-
position: absolute;
|
|
317
|
-
inset-inline: 0;
|
|
318
|
-
bottom: 0;
|
|
319
|
-
height: 50%;
|
|
320
|
-
z-index: 50;
|
|
321
|
-
pointer-events: none;
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
.landscape-image {
|
|
325
|
-
position: absolute;
|
|
326
|
-
inset: 0;
|
|
327
|
-
background-image: url('/images/utilities/dark-sky/landscape-silhouette.webp');
|
|
328
|
-
background-size: cover;
|
|
329
|
-
background-position: bottom;
|
|
330
|
-
background-repeat: no-repeat;
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
.landscape-fade {
|
|
334
|
-
position: absolute;
|
|
335
|
-
inset-inline: 0;
|
|
336
|
-
bottom: 0;
|
|
337
|
-
height: 50%;
|
|
338
|
-
background: linear-gradient(to top, black, rgba(0, 0, 0, 0.8), transparent);
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
.bortle-info-overlay {
|
|
342
|
-
position: absolute;
|
|
343
|
-
top: 1.5rem;
|
|
344
|
-
inset-inline: 1rem;
|
|
345
|
-
z-index: 60;
|
|
346
|
-
display: flex;
|
|
347
|
-
flex-direction: column;
|
|
348
|
-
align-items: center;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
@media (min-width: 768px) {
|
|
352
|
-
.bortle-info-overlay {
|
|
353
|
-
top: 2.5rem;
|
|
354
|
-
inset-inline: auto;
|
|
355
|
-
left: 2.5rem;
|
|
356
|
-
align-items: flex-start;
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
.bortle-info-content {
|
|
361
|
-
display: flex;
|
|
362
|
-
flex-direction: column;
|
|
363
|
-
gap: 0.5rem;
|
|
364
|
-
text-align: center;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
@media (min-width: 768px) {
|
|
368
|
-
.bortle-info-content {
|
|
369
|
-
text-align: left;
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
.bortle-title {
|
|
374
|
-
font-size: clamp(1.5rem, 5vw, 3rem);
|
|
375
|
-
font-weight: 900;
|
|
376
|
-
color: var(--on-dark);
|
|
377
|
-
letter-spacing: -0.02em;
|
|
378
|
-
text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
|
|
379
|
-
transition: all 0.3s ease;
|
|
380
|
-
margin: 0;
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
.bortle-badges {
|
|
384
|
-
display: inline-flex;
|
|
385
|
-
align-items: center;
|
|
386
|
-
gap: 1rem;
|
|
387
|
-
background: rgba(0, 0, 0, 0.4);
|
|
388
|
-
backdrop-filter: blur(12px);
|
|
389
|
-
padding: 0.5rem 1rem;
|
|
390
|
-
border-radius: 9999px;
|
|
391
|
-
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
392
|
-
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
.bortle-class-badge {
|
|
396
|
-
font-size: 0.7rem;
|
|
397
|
-
font-weight: 700;
|
|
398
|
-
color: var(--on-dark);
|
|
399
|
-
border-right: 1px solid rgba(255, 255, 255, 0.2);
|
|
400
|
-
padding-right: 1rem;
|
|
401
|
-
text-transform: uppercase;
|
|
402
|
-
letter-spacing: 0.1em;
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
.bortle-nelm-badge {
|
|
406
|
-
color: var(--color-emerald, #34d399);
|
|
407
|
-
font-weight: 700;
|
|
408
|
-
font-size: 0.875rem;
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
.bortle-description {
|
|
412
|
-
display: none;
|
|
413
|
-
max-width: 24rem;
|
|
414
|
-
font-size: 0.875rem;
|
|
415
|
-
color: rgba(255, 255, 255, 0.8);
|
|
416
|
-
font-weight: 500;
|
|
417
|
-
line-height: 1.6;
|
|
418
|
-
margin: 0;
|
|
419
|
-
text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
@media (min-width: 768px) {
|
|
423
|
-
.bortle-description {
|
|
424
|
-
display: block;
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
.bortle-description-mobile {
|
|
429
|
-
position: absolute;
|
|
430
|
-
bottom: 7rem;
|
|
431
|
-
inset-inline: 1rem;
|
|
432
|
-
z-index: 70;
|
|
433
|
-
text-align: center;
|
|
434
|
-
font-size: 0.875rem;
|
|
435
|
-
color: rgba(255, 255, 255, 0.9);
|
|
436
|
-
font-weight: 500;
|
|
437
|
-
line-height: 1.6;
|
|
438
|
-
text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
|
|
439
|
-
min-height: 3em;
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
@media (min-width: 768px) {
|
|
443
|
-
.bortle-description-mobile {
|
|
444
|
-
display: none;
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
.bortle-controls {
|
|
449
|
-
position: absolute;
|
|
450
|
-
bottom: 2rem;
|
|
451
|
-
inset-inline: 1rem;
|
|
452
|
-
z-index: 70;
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
@media (min-width: 768px) {
|
|
456
|
-
.bortle-controls {
|
|
457
|
-
inset-inline: 3rem;
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
.bortle-slider-track {
|
|
462
|
-
position: relative;
|
|
463
|
-
height: 4rem;
|
|
464
|
-
display: flex;
|
|
465
|
-
align-items: center;
|
|
466
|
-
background: rgba(0, 0, 0, 0.5);
|
|
467
|
-
backdrop-filter: blur(20px);
|
|
468
|
-
border-radius: 9999px;
|
|
469
|
-
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
470
|
-
padding: 0 0.5rem;
|
|
471
|
-
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
.slider-gradient-bar {
|
|
475
|
-
position: absolute;
|
|
476
|
-
inset-inline: 1rem;
|
|
477
|
-
height: 0.5rem;
|
|
478
|
-
border-radius: 9999px;
|
|
479
|
-
background: linear-gradient(to right, var(--color-emerald, #34d399), var(--color-amber, #f59e0b), var(--color-red, #ef4444));
|
|
480
|
-
opacity: 0.8;
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
.bortle-slider-input {
|
|
484
|
-
position: absolute;
|
|
485
|
-
inset: 0;
|
|
486
|
-
width: 100%;
|
|
487
|
-
height: 100%;
|
|
488
|
-
opacity: 0;
|
|
489
|
-
cursor: pointer;
|
|
490
|
-
z-index: 20;
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
.bortle-thumb {
|
|
494
|
-
position: absolute;
|
|
495
|
-
height: 2.5rem;
|
|
496
|
-
width: 2.5rem;
|
|
497
|
-
background: white;
|
|
498
|
-
border: 4px solid var(--color-indigo, #6366f1);
|
|
499
|
-
border-radius: 50%;
|
|
500
|
-
box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
|
|
501
|
-
pointer-events: none;
|
|
502
|
-
transition: left 0.15s ease-out;
|
|
503
|
-
display: flex;
|
|
504
|
-
align-items: center;
|
|
505
|
-
justify-content: center;
|
|
506
|
-
z-index: 10;
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
.bortle-thumb-dot {
|
|
510
|
-
width: 0.5rem;
|
|
511
|
-
height: 0.5rem;
|
|
512
|
-
background: var(--color-indigo, #6366f1);
|
|
513
|
-
border-radius: 50%;
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
.bortle-tick-marks {
|
|
517
|
-
position: absolute;
|
|
518
|
-
inset-inline: 1rem;
|
|
519
|
-
bottom: 0.5rem;
|
|
520
|
-
top: 0.5rem;
|
|
521
|
-
display: flex;
|
|
522
|
-
justify-content: space-between;
|
|
523
|
-
pointer-events: none;
|
|
524
|
-
z-index: 0;
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
.bortle-tick {
|
|
528
|
-
display: flex;
|
|
529
|
-
flex-direction: column;
|
|
530
|
-
align-items: center;
|
|
531
|
-
justify-content: center;
|
|
532
|
-
height: 100%;
|
|
533
|
-
width: 1rem;
|
|
534
|
-
position: relative;
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
.tick-line {
|
|
538
|
-
width: 1px;
|
|
539
|
-
height: 100%;
|
|
540
|
-
background: rgba(255, 255, 255, 0.1);
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
.tick-label {
|
|
544
|
-
position: absolute;
|
|
545
|
-
font-size: 0.625rem;
|
|
546
|
-
font-weight: 700;
|
|
547
|
-
color: rgba(255, 255, 255, 0.6);
|
|
548
|
-
top: calc(100% + 0.25rem);
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
.bortle-slider-hint {
|
|
552
|
-
text-align: center;
|
|
553
|
-
margin-top: 1.5rem;
|
|
554
|
-
font-size: 0.625rem;
|
|
555
|
-
text-transform: uppercase;
|
|
556
|
-
letter-spacing: 0.2em;
|
|
557
|
-
color: rgba(255, 255, 255, 0.4);
|
|
558
|
-
font-weight: 700;
|
|
559
|
-
}
|
|
560
|
-
</style>
|