@jjlmoya/utils-drones 1.4.0 → 1.6.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.
@@ -4,7 +4,6 @@ import BatterySpecs from "./components/BatterySpecs.astro";
4
4
  import ConsumptionStats from "./components/ConsumptionStats.astro";
5
5
  import FlightDashboard from "./components/FlightDashboard.astro";
6
6
  import AutonomyChart from "./components/AutonomyChart.astro";
7
- import "./FlightTimeCalculator.css";
8
7
  ---
9
8
 
10
9
  <div class="flight-calculator-ui">
@@ -61,8 +60,8 @@ import "./FlightTimeCalculator.css";
61
60
  datasets: [{
62
61
  label,
63
62
  data: [],
64
- borderColor: "#f97316",
65
- backgroundColor: "rgba(249, 115, 22, 0.1)",
63
+ borderColor: "#f59e0b",
64
+ backgroundColor: "rgba(245, 158, 11, 0.1)",
66
65
  borderWidth: 3,
67
66
  fill: true,
68
67
  tension: 0.4,
@@ -139,7 +138,7 @@ import "./FlightTimeCalculator.css";
139
138
  const limit = 20;
140
139
  const progress = Math.min(safeMin / limit, 1);
141
140
  const offset = 283 - (progress * 283);
142
- displays.circle.style.strokeDashoffset = offset.toString();
141
+ (displays.circle as HTMLElement).style.strokeDashoffset = offset.toString();
143
142
  }
144
143
  }
145
144
 
@@ -185,78 +184,375 @@ import "./FlightTimeCalculator.css";
185
184
  </script>
186
185
 
187
186
  <style>
188
- .flight-calculator-ui {
189
- width: 100%;
190
- max-width: 1100px;
191
- margin: 0 auto;
187
+ .flight-calculator-ui {
188
+ --dft-accent: #f59e0b;
189
+ --dft-accent-rgb: 245, 158, 11;
190
+ --dft-bg: #fff;
191
+ --dft-bg-muted: #f8fafc;
192
+ --dft-bg-surface: #f1f5f9;
193
+ --dft-bg-overlay: #fdfdfd;
194
+ --dft-text: #1e293b;
195
+ --dft-text-muted: #64748b;
196
+ --dft-text-dim: #94a3b8;
197
+ --dft-border: #e2e8f0;
198
+ --dft-border-light: #f1f5f9;
199
+ --dft-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.08);
200
+ --dft-success: #10b981;
201
+ --dft-success-bg: rgba(16, 185, 129, 0.1);
202
+ --dft-warning: #f59e0b;
203
+ --dft-warning-bg: rgba(245, 158, 11, 0.1);
204
+ --dft-danger: #ef4444;
205
+ --dft-danger-bg: rgba(239, 68, 68, 0.1);
206
+
207
+ width: 100%;
208
+ max-width: 1200px;
209
+ margin: 2rem auto;
210
+ padding: 0 1.5rem;
211
+ }
212
+
213
+ :global([data-theme="dark"]) .flight-calculator-ui,
214
+ :global(.theme-dark) .flight-calculator-ui {
215
+ --dft-bg: #0f172a;
216
+ --dft-bg-muted: #1e293b;
217
+ --dft-bg-surface: #334155;
218
+ --dft-bg-overlay: #1e293b;
219
+ --dft-text: #f1f5f9;
220
+ --dft-text-muted: #94a3b8;
221
+ --dft-text-dim: #64748b;
222
+ --dft-border: #334155;
223
+ --dft-border-light: #1e293b;
224
+ --dft-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.4);
225
+ }
226
+
227
+ .flight-calculator-ui .tech-mega-card {
228
+ background: var(--dft-bg);
229
+ backdrop-filter: blur(24px) saturate(180%);
230
+ -webkit-backdrop-filter: blur(24px) saturate(180%);
231
+ border: 1px solid var(--dft-border);
232
+ border-radius: 40px;
233
+ box-shadow: var(--dft-shadow);
234
+ overflow: hidden;
235
+ position: relative;
236
+ transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
237
+ }
238
+
239
+ .flight-calculator-ui .tech-mega-card::before {
240
+ content: '';
241
+ position: absolute;
242
+ top: 0;
243
+ left: 0;
244
+ right: 0;
245
+ height: 6px;
246
+ background: linear-gradient(90deg, #f59e0b, #fbbf24, #f59e0b);
247
+ background-size: 200% 100%;
248
+ animation: gradient-shift-dft 4s linear infinite;
249
+ z-index: 10;
250
+ }
251
+
252
+ @keyframes gradient-shift-dft {
253
+ 0% { background-position: 0% 50%; }
254
+ 100% { background-position: 200% 50%; }
255
+ }
256
+
257
+ .flight-calculator-ui .card-grid {
258
+ display: grid;
259
+ grid-template-columns: 400px 1fr;
260
+ min-height: 700px;
261
+ }
262
+
263
+ .flight-calculator-ui .config-sidebar {
264
+ padding: 3.5rem 3rem;
265
+ background: var(--dft-bg-overlay);
266
+ border-right: 1px solid var(--dft-border-light);
267
+ display: flex;
268
+ flex-direction: column;
269
+ gap: 3rem;
270
+ }
271
+
272
+ .flight-calculator-ui .main-display {
273
+ padding: 3.5rem 3rem;
274
+ display: flex;
275
+ flex-direction: column;
276
+ gap: 3rem;
277
+ background: var(--dft-bg);
278
+ }
279
+
280
+ .flight-calculator-ui .divider {
281
+ height: 1px;
282
+ width: 100%;
283
+ background: linear-gradient(90deg, transparent, var(--dft-border-light), transparent);
284
+ }
285
+
286
+ .flight-calculator-ui :global(.tech-section) {
287
+ display: flex;
288
+ flex-direction: column;
289
+ gap: 2rem;
290
+ }
291
+
292
+ .flight-calculator-ui :global(.section-title) {
293
+ font-size: 0.75rem;
294
+ font-weight: 800;
295
+ color: var(--dft-text-dim);
296
+ text-transform: uppercase;
297
+ letter-spacing: 0.15em;
298
+ margin-bottom: 0.5rem;
299
+ }
300
+
301
+ .flight-calculator-ui :global(.input-group) {
302
+ display: flex;
303
+ flex-direction: column;
304
+ gap: 1rem;
305
+ }
306
+
307
+ .flight-calculator-ui :global(.label-row) {
308
+ display: flex;
309
+ justify-content: space-between;
310
+ align-items: center;
311
+ }
312
+
313
+ .flight-calculator-ui :global(.input-group label) {
314
+ font-size: 0.8rem;
315
+ font-weight: 800;
316
+ color: var(--dft-text-muted);
317
+ }
318
+
319
+ .flight-calculator-ui :global(.value-badge) {
320
+ padding: 0.4rem 1rem;
321
+ background: var(--dft-bg-surface);
322
+ border-radius: 12px;
323
+ color: var(--dft-accent);
324
+ font-weight: 850;
325
+ font-size: 0.85rem;
326
+ box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
327
+ }
328
+
329
+ .flight-calculator-ui :global(.tech-slider) {
330
+ width: 100%;
331
+ height: 6px;
332
+ appearance: none;
333
+ -webkit-appearance: none;
334
+ background: var(--dft-border);
335
+ border-radius: 100px;
336
+ outline: none;
337
+ transition: all 0.3s ease;
338
+ }
339
+
340
+ .flight-calculator-ui :global(.tech-slider:hover) {
341
+ background: var(--dft-border-light);
342
+ }
343
+
344
+ .flight-calculator-ui :global(.tech-slider::-webkit-slider-thumb) {
345
+ appearance: none;
346
+ -webkit-appearance: none;
347
+ width: 22px;
348
+ height: 22px;
349
+ background: var(--dft-accent);
350
+ border: 4px solid var(--dft-bg);
351
+ border-radius: 50%;
352
+ cursor: pointer;
353
+ box-shadow: 0 4px 10px rgba(var(--dft-accent-rgb), 0.3);
354
+ transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
355
+ }
356
+
357
+ .flight-calculator-ui :global(.tech-select),
358
+ .flight-calculator-ui :global(.tech-input) {
359
+ width: 100%;
360
+ padding: 1rem 1.25rem;
361
+ background: var(--dft-bg-surface);
362
+ border: 1px solid var(--dft-border);
363
+ border-radius: 16px;
364
+ font-weight: 700;
365
+ color: var(--dft-text);
366
+ font-size: 1rem;
367
+ transition: all 0.3s ease;
368
+ cursor: pointer;
369
+ }
370
+
371
+ .flight-calculator-ui :global(.tech-select:focus),
372
+ .flight-calculator-ui :global(.tech-input:focus) {
373
+ outline: none;
374
+ border-color: var(--dft-accent);
375
+ background: var(--dft-bg);
376
+ box-shadow: 0 0 0 4px var(--dft-accent-glow);
377
+ }
378
+
379
+ .flight-calculator-ui :global(.presets) {
380
+ display: flex;
381
+ gap: 0.5rem;
382
+ flex-wrap: wrap;
383
+ margin-top: 0.5rem;
384
+ }
385
+
386
+ .flight-calculator-ui :global(.preset-btn) {
387
+ padding: 0.5rem 1rem;
388
+ background: var(--dft-bg-surface);
389
+ border: 1px solid transparent;
390
+ border-radius: 12px;
391
+ font-size: 0.75rem;
392
+ font-weight: 800;
393
+ color: var(--dft-text-muted);
394
+ cursor: pointer;
395
+ transition: all 0.2s;
396
+ }
397
+
398
+ .flight-calculator-ui :global(.preset-btn:hover) {
399
+ background: var(--dft-bg);
400
+ border-color: var(--dft-accent);
401
+ color: var(--dft-accent);
402
+ transform: translateY(-2px);
403
+ }
404
+
405
+ .flight-calculator-ui :global(.hint) {
406
+ font-size: 0.7rem;
407
+ color: var(--dft-text-dim);
408
+ font-style: italic;
409
+ line-height: 1.4;
410
+ }
411
+
412
+ .flight-calculator-ui :global(.dashboard-section) {
413
+ display: flex;
414
+ flex-direction: column;
415
+ align-items: center;
416
+ gap: 3.5rem;
417
+ }
418
+
419
+ .flight-calculator-ui :global(.radial-container) {
420
+ position: relative;
421
+ width: 320px;
422
+ height: 320px;
423
+ display: flex;
424
+ justify-content: center;
425
+ align-items: center;
426
+ }
427
+
428
+ .flight-calculator-ui :global(.radial-svg) {
429
+ transform: rotate(-90deg);
430
+ width: 100%;
431
+ height: 100%;
432
+ filter: drop-shadow(0 10px 30px rgba(var(--dft-accent-rgb), 0.15));
433
+ }
434
+
435
+ .flight-calculator-ui :global(.bg-circle) {
436
+ fill: none;
437
+ stroke: var(--dft-bg-surface);
438
+ stroke-width: 10;
439
+ }
440
+
441
+ .flight-calculator-ui :global(.fg-circle) {
442
+ fill: none;
443
+ stroke: url("#statGradient");
444
+ stroke-width: 10;
445
+ stroke-linecap: round;
446
+ stroke-dasharray: 283;
447
+ stroke-dashoffset: 0;
448
+ transition: stroke-dashoffset 1s cubic-bezier(0.34, 1.56, 0.64, 1);
449
+ }
450
+
451
+ .flight-calculator-ui :global(.result-text) {
452
+ position: absolute;
453
+ display: flex;
454
+ flex-direction: column;
455
+ align-items: center;
456
+ }
457
+
458
+ .flight-calculator-ui :global(.time-primary) {
459
+ font-size: 7rem;
460
+ font-weight: 950;
461
+ color: var(--dft-text);
462
+ letter-spacing: -0.08em;
463
+ line-height: 1;
464
+ }
465
+
466
+ .flight-calculator-ui :global(.time-label) {
467
+ font-size: 1rem;
468
+ font-weight: 850;
469
+ color: var(--dft-text-muted);
470
+ text-transform: uppercase;
471
+ letter-spacing: 0.2em;
472
+ margin-top: 0.5rem;
473
+ }
474
+
475
+ .flight-calculator-ui :global(.secondary-stats) {
476
+ display: grid;
477
+ grid-template-columns: repeat(3, 1fr);
478
+ gap: 2rem;
479
+ width: 100%;
480
+ }
481
+
482
+ .flight-calculator-ui :global(.stat-box) {
483
+ display: flex;
484
+ flex-direction: column;
485
+ align-items: center;
486
+ gap: 0.5rem;
487
+ padding: 2rem 1.5rem;
488
+ background: var(--dft-bg-overlay);
489
+ border: 1px solid var(--dft-border-light);
490
+ border-radius: 32px;
491
+ transition: all 0.3s ease;
492
+ }
493
+
494
+ .flight-calculator-ui :global(.stat-box:hover) {
495
+ transform: translateY(-5px);
496
+ box-shadow: 0 20px 40px rgba(0, 0, 0, 0.04);
497
+ border-color: var(--dft-accent);
498
+ }
499
+
500
+ .flight-calculator-ui :global(.stat-label) {
501
+ font-size: 0.75rem;
502
+ font-weight: 800;
503
+ color: var(--dft-text-dim);
504
+ text-transform: uppercase;
505
+ letter-spacing: 0.1em;
506
+ }
507
+
508
+ .flight-calculator-ui :global(.stat-value) {
509
+ font-size: 1.75rem;
510
+ font-weight: 950;
511
+ color: var(--dft-text);
512
+ }
513
+
514
+ .flight-calculator-ui :global(.chart-header) {
515
+ display: flex;
516
+ justify-content: space-between;
517
+ align-items: center;
518
+ margin-bottom: 2rem;
519
+ }
520
+
521
+ .flight-calculator-ui :global(.chart-subtitle) {
522
+ font-size: 0.85rem;
523
+ font-weight: 700;
524
+ color: var(--dft-text-muted);
525
+ }
526
+
527
+ .flight-calculator-ui :global(.chart-body) {
528
+ position: relative;
529
+ height: 350px;
530
+ width: 100%;
531
+ background: var(--dft-bg-surface);
532
+ border-radius: 32px;
533
+ padding: 1.5rem;
534
+ border: 1px solid var(--dft-border-light);
535
+ }
536
+
537
+ @media (max-width: 1200px) {
538
+ .flight-calculator-ui .card-grid {
539
+ grid-template-columns: 1fr;
192
540
  }
193
-
194
- .tech-mega-card {
195
- background: rgba(255, 255, 255, 0.7);
196
- backdrop-filter: blur(20px);
197
- border: 1px solid rgba(255, 255, 255, 0.4);
198
- border-radius: 32px;
199
- box-shadow: 0 30px 60px rgba(0, 0, 0, 0.08);
200
- overflow: hidden;
201
- }
202
-
203
- [data-theme="dark"] .tech-mega-card,
204
- .theme-dark .tech-mega-card {
205
- background: rgba(15, 23, 42, 0.7);
206
- border-color: rgba(255, 255, 255, 0.05);
207
- }
208
-
209
- .card-grid {
210
- display: grid;
211
- grid-template-columns: 380px 1fr;
212
- }
213
-
214
- .config-sidebar {
215
- padding: 2.5rem;
216
- background: rgba(255, 255, 255, 0.3);
217
- display: flex;
218
- flex-direction: column;
219
- gap: 2.5rem;
220
- border-right: 1px solid rgba(0, 0, 0, 0.05);
221
- }
222
-
223
- [data-theme="dark"],
224
- .theme-dark .config-sidebar {
225
- background: rgba(255, 255, 255, 0.02);
226
- border-right-color: rgba(255, 255, 255, 0.05);
227
- }
228
-
229
- .main-display {
230
- padding: 2.5rem;
231
- display: flex;
232
- flex-direction: column;
233
- gap: 2.5rem;
541
+ .flight-calculator-ui .config-sidebar {
542
+ border-right: none;
543
+ border-bottom: 1px solid var(--dft-border-light);
234
544
  }
235
-
236
- .divider {
237
- height: 1px;
238
- width: 100%;
239
- background: linear-gradient(90deg, transparent, rgba(0,0,0,0.05), transparent);
240
- }
241
-
242
- [data-theme="dark"],
243
- .theme-dark .divider {
244
- background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
245
- }
246
-
247
- @media (max-width: 992px) {
248
- .card-grid {
249
- grid-template-columns: 1fr;
250
- }
251
-
252
- .config-sidebar {
253
- border-right: none;
254
- border-bottom: 1px solid rgba(0, 0, 0, 0.05);
255
- }
256
-
257
- [data-theme="dark"],
258
- .theme-dark .config-sidebar {
259
- border-bottom-color: rgba(255, 255, 255, 0.05);
260
- }
545
+ }
546
+
547
+ @media (max-width: 600px) {
548
+ .flight-calculator-ui { padding: 0.5rem; }
549
+ .flight-calculator-ui :global(.secondary-stats) { grid-template-columns: 1fr; }
550
+ .flight-calculator-ui :global(.radial-container) {
551
+ width: 240px;
552
+ height: 240px;
261
553
  }
554
+ .flight-calculator-ui :global(.time-primary) { font-size: 4.5rem; }
555
+ .flight-calculator-ui :global(.stat-box) { padding: 1.5rem; }
556
+ }
262
557
  </style>
558
+
@@ -6,6 +6,12 @@ const { ui } = Astro.props;
6
6
  <div class="main-result">
7
7
  <div class="radial-container">
8
8
  <svg viewBox="0 0 100 100" class="radial-svg">
9
+ <defs>
10
+ <linearGradient id="statGradient" x1="0%" y1="0%" x2="100%" y2="100%">
11
+ <stop offset="0%" style="stop-color:#f59e0b;stop-opacity:1" />
12
+ <stop offset="100%" style="stop-color:#fbbf24;stop-opacity:1" />
13
+ </linearGradient>
14
+ </defs>
9
15
  <circle cx="50" cy="50" r="45" class="bg-circle"></circle>
10
16
  <circle cx="50" cy="50" r="45" class="fg-circle" id="timeCircle"></circle>
11
17
  </svg>