@jjlmoya/utils-science 1.23.0 → 1.25.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 (37) hide show
  1. package/package.json +1 -1
  2. package/src/category/index.ts +2 -1
  3. package/src/entries.ts +3 -1
  4. package/src/index.ts +1 -0
  5. package/src/tests/locale_completeness.test.ts +2 -2
  6. package/src/tests/tool_validation.test.ts +2 -2
  7. package/src/tool/cosmic-inflation/component.astro +6 -4
  8. package/src/tool/lorenz-attractor/i18n/es.ts +12 -4
  9. package/src/tool/lorenz-attractor/lorenz-attractor.css +56 -25
  10. package/src/tool/stellar-habitability-zone/bibliography.astro +14 -0
  11. package/src/tool/stellar-habitability-zone/bibliography.ts +12 -0
  12. package/src/tool/stellar-habitability-zone/component.astro +123 -0
  13. package/src/tool/stellar-habitability-zone/dom-updater.ts +94 -0
  14. package/src/tool/stellar-habitability-zone/entry.ts +26 -0
  15. package/src/tool/stellar-habitability-zone/i18n/de.ts +189 -0
  16. package/src/tool/stellar-habitability-zone/i18n/en.ts +189 -0
  17. package/src/tool/stellar-habitability-zone/i18n/es.ts +189 -0
  18. package/src/tool/stellar-habitability-zone/i18n/fr.ts +189 -0
  19. package/src/tool/stellar-habitability-zone/i18n/id.ts +189 -0
  20. package/src/tool/stellar-habitability-zone/i18n/it.ts +189 -0
  21. package/src/tool/stellar-habitability-zone/i18n/ja.ts +189 -0
  22. package/src/tool/stellar-habitability-zone/i18n/ko.ts +189 -0
  23. package/src/tool/stellar-habitability-zone/i18n/nl.ts +189 -0
  24. package/src/tool/stellar-habitability-zone/i18n/pl.ts +189 -0
  25. package/src/tool/stellar-habitability-zone/i18n/pt.ts +189 -0
  26. package/src/tool/stellar-habitability-zone/i18n/ru.ts +189 -0
  27. package/src/tool/stellar-habitability-zone/i18n/sv.ts +189 -0
  28. package/src/tool/stellar-habitability-zone/i18n/tr.ts +189 -0
  29. package/src/tool/stellar-habitability-zone/i18n/zh.ts +189 -0
  30. package/src/tool/stellar-habitability-zone/index.ts +11 -0
  31. package/src/tool/stellar-habitability-zone/interaction.ts +45 -0
  32. package/src/tool/stellar-habitability-zone/logic/StellarHabitabilityEngine.ts +158 -0
  33. package/src/tool/stellar-habitability-zone/renderer.ts +241 -0
  34. package/src/tool/stellar-habitability-zone/script.ts +273 -0
  35. package/src/tool/stellar-habitability-zone/seo.astro +15 -0
  36. package/src/tool/stellar-habitability-zone/stellar-habitability-zone.css +375 -0
  37. package/src/tools.ts +2 -0
@@ -0,0 +1,375 @@
1
+ :root {
2
+ --hz-card-bg: #fafaf9;
3
+ --hz-border: rgba(0, 0, 0, 0.08);
4
+ --hz-text: #1c1917;
5
+ --hz-text-muted: #78716c;
6
+ --hz-input-border: rgba(0, 0, 0, 0.1);
7
+ --hz-canvas-bg: #fafaf9;
8
+ --hz-highlight: #10b981;
9
+ --hz-number-color: #0c0a09;
10
+ --hz-slider-active: rgba(28, 25, 23, 0.3);
11
+ --hz-slider-track: rgba(28, 25, 23, 0.08);
12
+ }
13
+
14
+ .theme-dark {
15
+ --hz-card-bg: #0c0c0e;
16
+ --hz-border: rgba(255, 255, 255, 0.08);
17
+ --hz-text: #f4f4f5;
18
+ --hz-text-muted: #a1a1aa;
19
+ --hz-input-border: rgba(255, 255, 255, 0.1);
20
+ --hz-canvas-bg: #0c0c0e;
21
+ --hz-highlight: #34d399;
22
+ --hz-number-color: #fafafa;
23
+ --hz-slider-active: rgba(244, 244, 245, 0.35);
24
+ --hz-slider-track: rgba(244, 244, 245, 0.1);
25
+ }
26
+
27
+ .hz-calculator-root {
28
+ display: flex;
29
+ flex-direction: column;
30
+ gap: 2.5rem;
31
+ padding: 1.5rem;
32
+ background: var(--hz-card-bg);
33
+ color: var(--hz-text);
34
+ border: 1px solid var(--hz-border);
35
+ border-radius: 12px;
36
+ max-width: 1000px;
37
+ margin: 2rem auto;
38
+ }
39
+
40
+ @media (min-width: 769px) {
41
+ .hz-calculator-root {
42
+ display: grid;
43
+ grid-template-columns: 1fr;
44
+ grid-template-areas:
45
+ "presets"
46
+ "controls"
47
+ "viewport";
48
+ gap: 3rem;
49
+ padding: 3rem;
50
+ }
51
+ }
52
+
53
+ .hz-presets-container {
54
+ grid-area: presets;
55
+ width: 100%;
56
+ }
57
+
58
+ .hz-presets {
59
+ display: flex;
60
+ flex-wrap: wrap;
61
+ gap: 0.75rem 1.75rem;
62
+ border-bottom: 1px solid var(--hz-border);
63
+ padding-bottom: 0.75rem;
64
+ }
65
+
66
+ .hz-preset-btn {
67
+ background: transparent;
68
+ border: none;
69
+ border-bottom: 1px solid transparent;
70
+ color: var(--hz-text);
71
+ font-weight: 600;
72
+ font-size: 13px;
73
+ text-transform: uppercase;
74
+ letter-spacing: 0.1em;
75
+ cursor: pointer;
76
+ transition: opacity 0.2s, border-color 0.2s;
77
+ padding: 6px 0;
78
+ opacity: 0.45;
79
+ white-space: nowrap;
80
+ }
81
+
82
+ .hz-preset-btn:hover {
83
+ opacity: 0.8;
84
+ }
85
+
86
+ .hz-preset-btn.active {
87
+ opacity: 1;
88
+ border-bottom-color: var(--hz-text);
89
+ border-bottom-width: 1.5px;
90
+ padding-bottom: 5.5px;
91
+ }
92
+
93
+ .hz-controls-section {
94
+ grid-area: controls;
95
+ display: flex;
96
+ flex-direction: column;
97
+ gap: 1.5rem;
98
+ }
99
+
100
+ @media (min-width: 769px) {
101
+ .hz-controls-section {
102
+ display: grid;
103
+ grid-template-columns: 1fr 1fr;
104
+ gap: 1.75rem 3.5rem;
105
+ }
106
+ }
107
+
108
+ .hz-input-group {
109
+ display: grid;
110
+ grid-template-columns: 200px 1fr 90px;
111
+ align-items: center;
112
+ gap: 1.5rem;
113
+ }
114
+
115
+ @media (max-width: 600px) {
116
+ .hz-input-group {
117
+ grid-template-columns: 1fr;
118
+ gap: 0.5rem;
119
+ }
120
+ }
121
+
122
+ .hz-input-group label {
123
+ font-weight: 600;
124
+ font-size: 13px;
125
+ text-transform: uppercase;
126
+ letter-spacing: 0.1em;
127
+ color: var(--hz-text-muted);
128
+ white-space: nowrap;
129
+ }
130
+
131
+ .hz-input-val {
132
+ font-weight: 600;
133
+ font-size: 13px;
134
+ color: var(--hz-text);
135
+ text-align: right;
136
+ opacity: 0.8;
137
+ white-space: nowrap;
138
+ width: 90px;
139
+ }
140
+
141
+ .hz-slider {
142
+ -webkit-appearance: none;
143
+ appearance: none;
144
+ width: 100%;
145
+ height: 2px;
146
+ background: var(--hz-slider-track);
147
+ outline: none;
148
+ cursor: pointer;
149
+ margin: 0;
150
+ padding: 12px 0;
151
+ background-clip: content-box;
152
+ }
153
+
154
+ .hz-slider::-webkit-slider-thumb {
155
+ -webkit-appearance: none;
156
+ appearance: none;
157
+ width: 10px;
158
+ height: 10px;
159
+ border-radius: 50%;
160
+ border: 1px solid var(--hz-text);
161
+ background: var(--hz-card-bg);
162
+ cursor: pointer;
163
+ margin-top: -4px;
164
+ }
165
+
166
+ .hz-slider::-moz-range-thumb {
167
+ width: 8px;
168
+ height: 8px;
169
+ border-radius: 50%;
170
+ border: 1px solid var(--hz-text);
171
+ background: var(--hz-card-bg);
172
+ cursor: pointer;
173
+ }
174
+
175
+ .hz-slider::-webkit-slider-runnable-track {
176
+ width: 100%;
177
+ height: 2px;
178
+ }
179
+
180
+ .hz-viewport-container {
181
+ grid-area: viewport;
182
+ background: #050507;
183
+ border: 1px solid rgba(255, 255, 255, 0.08);
184
+ border-radius: 12px;
185
+ padding: 1.5rem;
186
+ display: flex;
187
+ flex-direction: column;
188
+ gap: 2rem;
189
+ position: relative;
190
+ overflow: hidden;
191
+ }
192
+
193
+ @media (min-width: 769px) {
194
+ .hz-viewport-container {
195
+ display: grid;
196
+ grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
197
+ gap: 3.5rem;
198
+ padding: 3rem;
199
+ }
200
+ }
201
+
202
+ #hz-orbit-canvas {
203
+ position: absolute;
204
+ top: 0;
205
+ left: 0;
206
+ width: 100%;
207
+ height: 100%;
208
+ z-index: 0;
209
+ pointer-events: none;
210
+ }
211
+
212
+ .hz-canvas-section {
213
+ display: flex;
214
+ flex-direction: column;
215
+ gap: 1.5rem;
216
+ position: relative;
217
+ z-index: 1;
218
+ pointer-events: none;
219
+ }
220
+
221
+ .hz-results-section {
222
+ display: flex;
223
+ flex-direction: column;
224
+ gap: 2rem;
225
+ position: relative;
226
+ z-index: 1;
227
+ background: rgba(255, 255, 255, 0.9);
228
+ backdrop-filter: blur(10px);
229
+ -webkit-backdrop-filter: blur(10px);
230
+ border: 1px solid rgba(0, 0, 0, 0.06);
231
+ border-radius: 12px;
232
+ padding: 2rem;
233
+ }
234
+
235
+ .theme-dark .hz-results-section {
236
+ background: rgba(255, 255, 255, 0.03);
237
+ border: 1px solid rgba(255, 255, 255, 0.08);
238
+ }
239
+
240
+ @media (min-width: 769px) {
241
+ .hz-results-section {
242
+ padding: 2.5rem;
243
+ }
244
+ }
245
+
246
+ .hz-result-grid {
247
+ display: flex;
248
+ flex-direction: column;
249
+ gap: 1.5rem;
250
+ }
251
+
252
+ .hz-result-block {
253
+ display: flex;
254
+ flex-direction: column;
255
+ }
256
+
257
+ .hz-result-label {
258
+ font-weight: 600;
259
+ font-size: 11px;
260
+ text-transform: uppercase;
261
+ letter-spacing: 0.1em;
262
+ color: var(--hz-text-muted);
263
+ margin-bottom: 0.15rem;
264
+ }
265
+
266
+ .hz-result-number {
267
+ font-weight: 300;
268
+ font-size: 2.2rem;
269
+ line-height: 1.0;
270
+ color: var(--hz-number-color);
271
+ letter-spacing: -0.02em;
272
+ white-space: nowrap;
273
+ }
274
+
275
+ .hz-result-number.flash-cold {
276
+ animation: flashColdAnim 0.8s cubic-bezier(0.25, 1, 0.5, 1);
277
+ }
278
+
279
+ .hz-result-number.flash-hot {
280
+ animation: flashHotAnim 0.8s cubic-bezier(0.25, 1, 0.5, 1);
281
+ }
282
+
283
+ @keyframes flashColdAnim {
284
+ 0% {
285
+ color: #3b82f6;
286
+ }
287
+
288
+ 100% {
289
+ color: var(--hz-number-color);
290
+ }
291
+ }
292
+
293
+ @keyframes flashHotAnim {
294
+ 0% {
295
+ color: #ef4444;
296
+ }
297
+
298
+ 100% {
299
+ color: var(--hz-number-color);
300
+ }
301
+ }
302
+
303
+ .hz-status-box {
304
+ margin-top: 0.75rem;
305
+ border-left: 2px solid transparent;
306
+ padding: 0.5rem 0 0.5rem 1.25rem;
307
+ background: rgba(0, 0, 0, 0.02);
308
+ backdrop-filter: blur(8px);
309
+ -webkit-backdrop-filter: blur(8px);
310
+ transition: border-color 0.3s;
311
+ }
312
+
313
+ .theme-dark .hz-status-box {
314
+ background: rgba(255, 255, 255, 0.02);
315
+ }
316
+
317
+ .hz-status-box.too-hot {
318
+ border-left-color: #ef4444;
319
+ }
320
+
321
+ .hz-status-box.too-cold {
322
+ border-left-color: #3b82f6;
323
+ }
324
+
325
+ .hz-status-box.habitable {
326
+ border-left-color: #10b981;
327
+ }
328
+
329
+ .hz-status-title {
330
+ font-weight: 400;
331
+ font-size: 1.25rem;
332
+ margin-bottom: 0.25rem;
333
+ }
334
+
335
+ .hz-status-box.too-hot .hz-status-title {
336
+ color: #ef4444;
337
+ }
338
+
339
+ .hz-status-box.too-cold .hz-status-title {
340
+ color: #3b82f6;
341
+ }
342
+
343
+ .hz-status-box.habitable .hz-status-title {
344
+ color: #10b981;
345
+ }
346
+
347
+ .hz-status-desc {
348
+ font-size: 12px;
349
+ color: var(--hz-text-muted);
350
+ line-height: 1.5;
351
+ }
352
+
353
+ .hz-canvas-section h3 {
354
+ font-weight: 600;
355
+ font-size: 11px;
356
+ text-transform: uppercase;
357
+ letter-spacing: 0.1em;
358
+ color: var(--hz-text-muted);
359
+ margin: 0;
360
+ }
361
+
362
+ .hz-canvas-container {
363
+ position: relative;
364
+ width: 100%;
365
+ height: 380px;
366
+ background: transparent;
367
+ border-radius: 8px;
368
+ pointer-events: auto;
369
+ }
370
+
371
+ @media (min-width: 769px) {
372
+ .hz-canvas-container {
373
+ height: 540px;
374
+ }
375
+ }
package/src/tools.ts CHANGED
@@ -8,6 +8,7 @@ import { CELLULAR_RENEWAL_TOOL } from './tool/cellular-renewal/index';
8
8
  import { COSMIC_INFLATION_TOOL } from './tool/cosmic-inflation/index';
9
9
  import { TEMPERATURE_TIMELINE_TOOL } from './tool/temperature-timeline/index';
10
10
  import { LORENZ_ATTRACTOR_TOOL } from './tool/lorenz-attractor/index';
11
+ import { STELLAR_HABITABILITY_ZONE_TOOL } from './tool/stellar-habitability-zone/index';
11
12
 
12
13
  export const ALL_TOOLS: ToolDefinition[] = [
13
14
  COLONY_COUNTER_TOOL,
@@ -18,6 +19,7 @@ export const ALL_TOOLS: ToolDefinition[] = [
18
19
  COSMIC_INFLATION_TOOL,
19
20
  TEMPERATURE_TIMELINE_TOOL,
20
21
  LORENZ_ATTRACTOR_TOOL,
22
+ STELLAR_HABITABILITY_ZONE_TOOL,
21
23
  ];
22
24
 
23
25