@jjlmoya/utils-chrono 1.2.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 +65 -0
- package/scripts/postinstall.mjs +27 -0
- package/src/category/ChronoCategorySEO.astro +8 -0
- package/src/category/i18n/de.ts +23 -0
- package/src/category/i18n/en.ts +23 -0
- package/src/category/i18n/es.ts +23 -0
- package/src/category/i18n/fr.ts +23 -0
- package/src/category/i18n/id.ts +23 -0
- package/src/category/i18n/it.ts +23 -0
- package/src/category/i18n/ja.ts +23 -0
- package/src/category/i18n/ko.ts +23 -0
- package/src/category/i18n/nl.ts +23 -0
- package/src/category/i18n/pl.ts +23 -0
- package/src/category/i18n/pt.ts +23 -0
- package/src/category/i18n/ru.ts +23 -0
- package/src/category/i18n/sv.ts +23 -0
- package/src/category/i18n/tr.ts +23 -0
- package/src/category/i18n/zh.ts +23 -0
- package/src/category/index.ts +42 -0
- package/src/components/PreviewNavSidebar.astro +116 -0
- package/src/components/PreviewToolbar.astro +143 -0
- package/src/data.ts +11 -0
- package/src/entries.ts +32 -0
- package/src/env.d.ts +5 -0
- package/src/index.ts +28 -0
- package/src/layouts/PreviewLayout.astro +117 -0
- package/src/pages/[locale]/[slug].astro +161 -0
- package/src/pages/[locale].astro +251 -0
- package/src/pages/index.astro +4 -0
- package/src/tests/faq_count.test.ts +19 -0
- package/src/tests/i18n_coverage.test.ts +36 -0
- package/src/tests/locale_completeness.test.ts +29 -0
- package/src/tests/mocks/astro_mock.js +2 -0
- package/src/tests/no_h1_in_components.test.ts +48 -0
- package/src/tests/schemas_fulfillment.test.ts +23 -0
- package/src/tests/seo_length.test.ts +22 -0
- package/src/tests/shared-test-helpers.ts +56 -0
- package/src/tests/slug_language_code_format.test.ts +23 -0
- package/src/tests/slug_uniqueness.test.ts +81 -0
- package/src/tests/title_quality.test.ts +55 -0
- package/src/tests/tool_exports.test.ts +34 -0
- package/src/tests/tool_validation.test.ts +18 -0
- package/src/tool/beat-rate-converter/beat-rate-converter.css +301 -0
- package/src/tool/beat-rate-converter/bibliography.astro +16 -0
- package/src/tool/beat-rate-converter/bibliography.ts +12 -0
- package/src/tool/beat-rate-converter/client.ts +46 -0
- package/src/tool/beat-rate-converter/component.astro +15 -0
- package/src/tool/beat-rate-converter/components/ConverterPanel.astro +87 -0
- package/src/tool/beat-rate-converter/entry.ts +42 -0
- package/src/tool/beat-rate-converter/i18n/de.ts +138 -0
- package/src/tool/beat-rate-converter/i18n/en.ts +138 -0
- package/src/tool/beat-rate-converter/i18n/es.ts +138 -0
- package/src/tool/beat-rate-converter/i18n/fr.ts +138 -0
- package/src/tool/beat-rate-converter/i18n/id.ts +138 -0
- package/src/tool/beat-rate-converter/i18n/it.ts +138 -0
- package/src/tool/beat-rate-converter/i18n/ja.ts +138 -0
- package/src/tool/beat-rate-converter/i18n/ko.ts +138 -0
- package/src/tool/beat-rate-converter/i18n/nl.ts +138 -0
- package/src/tool/beat-rate-converter/i18n/pl.ts +138 -0
- package/src/tool/beat-rate-converter/i18n/pt.ts +138 -0
- package/src/tool/beat-rate-converter/i18n/ru.ts +138 -0
- package/src/tool/beat-rate-converter/i18n/sv.ts +138 -0
- package/src/tool/beat-rate-converter/i18n/tr.ts +138 -0
- package/src/tool/beat-rate-converter/i18n/zh.ts +138 -0
- package/src/tool/beat-rate-converter/index.ts +11 -0
- package/src/tool/beat-rate-converter/seo.astro +16 -0
- package/src/tool/crown-reference-guide/bibliography.astro +16 -0
- package/src/tool/crown-reference-guide/bibliography.ts +20 -0
- package/src/tool/crown-reference-guide/client.ts +193 -0
- package/src/tool/crown-reference-guide/component.astro +69 -0
- package/src/tool/crown-reference-guide/components/CrownView.astro +40 -0
- package/src/tool/crown-reference-guide/components/MovementSelector.astro +26 -0
- package/src/tool/crown-reference-guide/components/PositionPanel.astro +59 -0
- package/src/tool/crown-reference-guide/crown-reference-guide.css +383 -0
- package/src/tool/crown-reference-guide/entry.ts +60 -0
- package/src/tool/crown-reference-guide/i18n/de.ts +207 -0
- package/src/tool/crown-reference-guide/i18n/en.ts +207 -0
- package/src/tool/crown-reference-guide/i18n/es.ts +207 -0
- package/src/tool/crown-reference-guide/i18n/fr.ts +207 -0
- package/src/tool/crown-reference-guide/i18n/id.ts +207 -0
- package/src/tool/crown-reference-guide/i18n/it.ts +207 -0
- package/src/tool/crown-reference-guide/i18n/ja.ts +207 -0
- package/src/tool/crown-reference-guide/i18n/ko.ts +207 -0
- package/src/tool/crown-reference-guide/i18n/nl.ts +207 -0
- package/src/tool/crown-reference-guide/i18n/pl.ts +207 -0
- package/src/tool/crown-reference-guide/i18n/pt.ts +207 -0
- package/src/tool/crown-reference-guide/i18n/ru.ts +207 -0
- package/src/tool/crown-reference-guide/i18n/sv.ts +207 -0
- package/src/tool/crown-reference-guide/i18n/tr.ts +207 -0
- package/src/tool/crown-reference-guide/i18n/zh.ts +207 -0
- package/src/tool/crown-reference-guide/index.ts +11 -0
- package/src/tool/crown-reference-guide/seo.astro +16 -0
- package/src/tool/crown-reference-guide/utils.ts +0 -0
- package/src/tool/demagnetizing-timer/bibliography.astro +16 -0
- package/src/tool/demagnetizing-timer/bibliography.ts +12 -0
- package/src/tool/demagnetizing-timer/client.ts +221 -0
- package/src/tool/demagnetizing-timer/component.astro +15 -0
- package/src/tool/demagnetizing-timer/components/TimerPanel.astro +92 -0
- package/src/tool/demagnetizing-timer/demagnetizing-timer.css +389 -0
- package/src/tool/demagnetizing-timer/entry.ts +50 -0
- package/src/tool/demagnetizing-timer/helpers/field.ts +134 -0
- package/src/tool/demagnetizing-timer/i18n/de.ts +143 -0
- package/src/tool/demagnetizing-timer/i18n/en.ts +143 -0
- package/src/tool/demagnetizing-timer/i18n/es.ts +143 -0
- package/src/tool/demagnetizing-timer/i18n/fr.ts +143 -0
- package/src/tool/demagnetizing-timer/i18n/id.ts +143 -0
- package/src/tool/demagnetizing-timer/i18n/it.ts +143 -0
- package/src/tool/demagnetizing-timer/i18n/ja.ts +143 -0
- package/src/tool/demagnetizing-timer/i18n/ko.ts +143 -0
- package/src/tool/demagnetizing-timer/i18n/nl.ts +143 -0
- package/src/tool/demagnetizing-timer/i18n/pl.ts +143 -0
- package/src/tool/demagnetizing-timer/i18n/pt.ts +143 -0
- package/src/tool/demagnetizing-timer/i18n/ru.ts +143 -0
- package/src/tool/demagnetizing-timer/i18n/sv.ts +143 -0
- package/src/tool/demagnetizing-timer/i18n/tr.ts +143 -0
- package/src/tool/demagnetizing-timer/i18n/zh.ts +143 -0
- package/src/tool/demagnetizing-timer/index.ts +11 -0
- package/src/tool/demagnetizing-timer/seo.astro +16 -0
- package/src/tool/demagnetizing-timer/utils.ts +0 -0
- package/src/tool/power-reserve-estimator/bibliography.astro +16 -0
- package/src/tool/power-reserve-estimator/bibliography.ts +16 -0
- package/src/tool/power-reserve-estimator/client.ts +139 -0
- package/src/tool/power-reserve-estimator/component.astro +15 -0
- package/src/tool/power-reserve-estimator/components/EstimatorPanel.astro +150 -0
- package/src/tool/power-reserve-estimator/entry.ts +51 -0
- package/src/tool/power-reserve-estimator/i18n/de.ts +158 -0
- package/src/tool/power-reserve-estimator/i18n/en.ts +158 -0
- package/src/tool/power-reserve-estimator/i18n/es.ts +158 -0
- package/src/tool/power-reserve-estimator/i18n/fr.ts +158 -0
- package/src/tool/power-reserve-estimator/i18n/id.ts +158 -0
- package/src/tool/power-reserve-estimator/i18n/it.ts +158 -0
- package/src/tool/power-reserve-estimator/i18n/ja.ts +158 -0
- package/src/tool/power-reserve-estimator/i18n/ko.ts +158 -0
- package/src/tool/power-reserve-estimator/i18n/nl.ts +158 -0
- package/src/tool/power-reserve-estimator/i18n/pl.ts +158 -0
- package/src/tool/power-reserve-estimator/i18n/pt.ts +158 -0
- package/src/tool/power-reserve-estimator/i18n/ru.ts +158 -0
- package/src/tool/power-reserve-estimator/i18n/sv.ts +158 -0
- package/src/tool/power-reserve-estimator/i18n/tr.ts +158 -0
- package/src/tool/power-reserve-estimator/i18n/zh.ts +158 -0
- package/src/tool/power-reserve-estimator/index.ts +11 -0
- package/src/tool/power-reserve-estimator/power-reserve-estimator.css +402 -0
- package/src/tool/power-reserve-estimator/seo.astro +16 -0
- package/src/tool/strap-taper-calculator/bibliography.astro +16 -0
- package/src/tool/strap-taper-calculator/bibliography.ts +12 -0
- package/src/tool/strap-taper-calculator/client.ts +129 -0
- package/src/tool/strap-taper-calculator/component.astro +15 -0
- package/src/tool/strap-taper-calculator/components/CalculatorPanel.astro +114 -0
- package/src/tool/strap-taper-calculator/entry.ts +56 -0
- package/src/tool/strap-taper-calculator/i18n/de.ts +152 -0
- package/src/tool/strap-taper-calculator/i18n/en.ts +152 -0
- package/src/tool/strap-taper-calculator/i18n/es.ts +152 -0
- package/src/tool/strap-taper-calculator/i18n/fr.ts +152 -0
- package/src/tool/strap-taper-calculator/i18n/id.ts +152 -0
- package/src/tool/strap-taper-calculator/i18n/it.ts +152 -0
- package/src/tool/strap-taper-calculator/i18n/ja.ts +152 -0
- package/src/tool/strap-taper-calculator/i18n/ko.ts +152 -0
- package/src/tool/strap-taper-calculator/i18n/nl.ts +152 -0
- package/src/tool/strap-taper-calculator/i18n/pl.ts +152 -0
- package/src/tool/strap-taper-calculator/i18n/pt.ts +152 -0
- package/src/tool/strap-taper-calculator/i18n/ru.ts +152 -0
- package/src/tool/strap-taper-calculator/i18n/sv.ts +152 -0
- package/src/tool/strap-taper-calculator/i18n/tr.ts +152 -0
- package/src/tool/strap-taper-calculator/i18n/zh.ts +152 -0
- package/src/tool/strap-taper-calculator/index.ts +11 -0
- package/src/tool/strap-taper-calculator/seo.astro +16 -0
- package/src/tool/strap-taper-calculator/strap-taper-calculator.css +320 -0
- package/src/tool/watch-accuracy-tracker/bibliography.astro +16 -0
- package/src/tool/watch-accuracy-tracker/bibliography.ts +12 -0
- package/src/tool/watch-accuracy-tracker/chart.ts +126 -0
- package/src/tool/watch-accuracy-tracker/client.ts +287 -0
- package/src/tool/watch-accuracy-tracker/component.astro +35 -0
- package/src/tool/watch-accuracy-tracker/components/AccuracyTracker.astro +96 -0
- package/src/tool/watch-accuracy-tracker/components/DriftPredictor.astro +126 -0
- package/src/tool/watch-accuracy-tracker/components/LogHistory.astro +66 -0
- package/src/tool/watch-accuracy-tracker/entry.ts +94 -0
- package/src/tool/watch-accuracy-tracker/i18n/de.ts +167 -0
- package/src/tool/watch-accuracy-tracker/i18n/en.ts +167 -0
- package/src/tool/watch-accuracy-tracker/i18n/es.ts +167 -0
- package/src/tool/watch-accuracy-tracker/i18n/fr.ts +167 -0
- package/src/tool/watch-accuracy-tracker/i18n/id.ts +167 -0
- package/src/tool/watch-accuracy-tracker/i18n/it.ts +167 -0
- package/src/tool/watch-accuracy-tracker/i18n/ja.ts +167 -0
- package/src/tool/watch-accuracy-tracker/i18n/ko.ts +167 -0
- package/src/tool/watch-accuracy-tracker/i18n/nl.ts +167 -0
- package/src/tool/watch-accuracy-tracker/i18n/pl.ts +167 -0
- package/src/tool/watch-accuracy-tracker/i18n/pt.ts +167 -0
- package/src/tool/watch-accuracy-tracker/i18n/ru.ts +167 -0
- package/src/tool/watch-accuracy-tracker/i18n/sv.ts +167 -0
- package/src/tool/watch-accuracy-tracker/i18n/tr.ts +167 -0
- package/src/tool/watch-accuracy-tracker/i18n/zh.ts +167 -0
- package/src/tool/watch-accuracy-tracker/index.ts +9 -0
- package/src/tool/watch-accuracy-tracker/logger.ts +105 -0
- package/src/tool/watch-accuracy-tracker/seo.astro +16 -0
- package/src/tool/watch-accuracy-tracker/utils.ts +99 -0
- package/src/tool/watch-accuracy-tracker/watch-accuracy-tracker.css +564 -0
- package/src/tool/watch-savings-planner/bibliography.astro +16 -0
- package/src/tool/watch-savings-planner/bibliography.ts +8 -0
- package/src/tool/watch-savings-planner/client.ts +271 -0
- package/src/tool/watch-savings-planner/component.astro +33 -0
- package/src/tool/watch-savings-planner/components/AddGoalForm.astro +49 -0
- package/src/tool/watch-savings-planner/components/GoalCard.astro +58 -0
- package/src/tool/watch-savings-planner/entry.ts +62 -0
- package/src/tool/watch-savings-planner/i18n/de.ts +153 -0
- package/src/tool/watch-savings-planner/i18n/en.ts +155 -0
- package/src/tool/watch-savings-planner/i18n/es.ts +153 -0
- package/src/tool/watch-savings-planner/i18n/fr.ts +153 -0
- package/src/tool/watch-savings-planner/i18n/id.ts +153 -0
- package/src/tool/watch-savings-planner/i18n/it.ts +153 -0
- package/src/tool/watch-savings-planner/i18n/ja.ts +153 -0
- package/src/tool/watch-savings-planner/i18n/ko.ts +153 -0
- package/src/tool/watch-savings-planner/i18n/nl.ts +153 -0
- package/src/tool/watch-savings-planner/i18n/pl.ts +153 -0
- package/src/tool/watch-savings-planner/i18n/pt.ts +153 -0
- package/src/tool/watch-savings-planner/i18n/ru.ts +153 -0
- package/src/tool/watch-savings-planner/i18n/sv.ts +153 -0
- package/src/tool/watch-savings-planner/i18n/tr.ts +153 -0
- package/src/tool/watch-savings-planner/i18n/zh.ts +153 -0
- package/src/tool/watch-savings-planner/index.ts +11 -0
- package/src/tool/watch-savings-planner/seo.astro +16 -0
- package/src/tool/watch-savings-planner/utils.ts +0 -0
- package/src/tool/watch-savings-planner/watch-savings-planner.css +460 -0
- package/src/tool/water-resistance-converter/bibliography.astro +16 -0
- package/src/tool/water-resistance-converter/bibliography.ts +16 -0
- package/src/tool/water-resistance-converter/client.ts +56 -0
- package/src/tool/water-resistance-converter/component.astro +15 -0
- package/src/tool/water-resistance-converter/components/ConverterPanel.astro +113 -0
- package/src/tool/water-resistance-converter/entry.ts +52 -0
- package/src/tool/water-resistance-converter/i18n/de.ts +148 -0
- package/src/tool/water-resistance-converter/i18n/en.ts +148 -0
- package/src/tool/water-resistance-converter/i18n/es.ts +148 -0
- package/src/tool/water-resistance-converter/i18n/fr.ts +148 -0
- package/src/tool/water-resistance-converter/i18n/id.ts +148 -0
- package/src/tool/water-resistance-converter/i18n/it.ts +148 -0
- package/src/tool/water-resistance-converter/i18n/ja.ts +148 -0
- package/src/tool/water-resistance-converter/i18n/ko.ts +148 -0
- package/src/tool/water-resistance-converter/i18n/nl.ts +148 -0
- package/src/tool/water-resistance-converter/i18n/pl.ts +148 -0
- package/src/tool/water-resistance-converter/i18n/pt.ts +148 -0
- package/src/tool/water-resistance-converter/i18n/ru.ts +148 -0
- package/src/tool/water-resistance-converter/i18n/sv.ts +148 -0
- package/src/tool/water-resistance-converter/i18n/tr.ts +148 -0
- package/src/tool/water-resistance-converter/i18n/zh.ts +148 -0
- package/src/tool/water-resistance-converter/index.ts +11 -0
- package/src/tool/water-resistance-converter/seo.astro +16 -0
- package/src/tool/water-resistance-converter/water-resistance-converter.css +254 -0
- package/src/tool/wrist-presence-calculator/bibliography.astro +16 -0
- package/src/tool/wrist-presence-calculator/bibliography.ts +12 -0
- package/src/tool/wrist-presence-calculator/client.ts +180 -0
- package/src/tool/wrist-presence-calculator/component.astro +23 -0
- package/src/tool/wrist-presence-calculator/components/CalculatorInputs.astro +97 -0
- package/src/tool/wrist-presence-calculator/components/FitResult.astro +68 -0
- package/src/tool/wrist-presence-calculator/components/Visualizer.astro +16 -0
- package/src/tool/wrist-presence-calculator/entry.ts +59 -0
- package/src/tool/wrist-presence-calculator/helpers/canvas.ts +189 -0
- package/src/tool/wrist-presence-calculator/helpers/results.ts +78 -0
- package/src/tool/wrist-presence-calculator/i18n/de.ts +139 -0
- package/src/tool/wrist-presence-calculator/i18n/en.ts +155 -0
- package/src/tool/wrist-presence-calculator/i18n/es.ts +139 -0
- package/src/tool/wrist-presence-calculator/i18n/fr.ts +139 -0
- package/src/tool/wrist-presence-calculator/i18n/id.ts +139 -0
- package/src/tool/wrist-presence-calculator/i18n/it.ts +139 -0
- package/src/tool/wrist-presence-calculator/i18n/ja.ts +139 -0
- package/src/tool/wrist-presence-calculator/i18n/ko.ts +139 -0
- package/src/tool/wrist-presence-calculator/i18n/nl.ts +139 -0
- package/src/tool/wrist-presence-calculator/i18n/pl.ts +139 -0
- package/src/tool/wrist-presence-calculator/i18n/pt.ts +139 -0
- package/src/tool/wrist-presence-calculator/i18n/ru.ts +139 -0
- package/src/tool/wrist-presence-calculator/i18n/sv.ts +139 -0
- package/src/tool/wrist-presence-calculator/i18n/tr.ts +139 -0
- package/src/tool/wrist-presence-calculator/i18n/zh.ts +155 -0
- package/src/tool/wrist-presence-calculator/index.ts +11 -0
- package/src/tool/wrist-presence-calculator/seo.astro +16 -0
- package/src/tool/wrist-presence-calculator/utils.ts +30 -0
- package/src/tool/wrist-presence-calculator/wrist-presence-calculator.css +372 -0
- package/src/tools.ts +26 -0
- package/src/types.ts +70 -0
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
.tool-main-card {
|
|
2
|
+
background: var(--bg-surface);
|
|
3
|
+
border: 1px solid var(--border-color);
|
|
4
|
+
border-radius: 1.25rem;
|
|
5
|
+
max-width: 400px;
|
|
6
|
+
margin: 0 auto;
|
|
7
|
+
padding: 1.75rem;
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
gap: 1.5rem;
|
|
11
|
+
box-shadow: var(--shadow-base);
|
|
12
|
+
position: relative;
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.calculator-panel {
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
gap: 1.25rem;
|
|
20
|
+
position: relative;
|
|
21
|
+
z-index: 1;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.panel-section {
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
gap: 0.5rem;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.section-label {
|
|
31
|
+
font-size: 0.75rem;
|
|
32
|
+
font-weight: 600;
|
|
33
|
+
color: var(--text-base);
|
|
34
|
+
opacity: 0.7;
|
|
35
|
+
text-transform: uppercase;
|
|
36
|
+
letter-spacing: 0.06em;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.input-row {
|
|
40
|
+
display: flex;
|
|
41
|
+
gap: 0.75rem;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.input-group {
|
|
45
|
+
flex: 1;
|
|
46
|
+
display: flex;
|
|
47
|
+
flex-direction: column;
|
|
48
|
+
gap: 0.35rem;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.input-label {
|
|
52
|
+
font-size: 0.75rem;
|
|
53
|
+
color: var(--text-base);
|
|
54
|
+
opacity: 0.6;
|
|
55
|
+
font-weight: 600;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.stepper-wrap {
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
background: var(--bg-page);
|
|
62
|
+
border: 1px solid var(--border-base);
|
|
63
|
+
border-radius: 0.75rem;
|
|
64
|
+
overflow: hidden;
|
|
65
|
+
transition: border-color 0.2s;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.stepper-wrap:focus-within {
|
|
69
|
+
border-color: var(--accent);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.stepper-input {
|
|
73
|
+
width: 100%;
|
|
74
|
+
padding: 0.6rem 0.25rem;
|
|
75
|
+
border: none;
|
|
76
|
+
background: transparent;
|
|
77
|
+
color: var(--text-base);
|
|
78
|
+
font-size: 0.875rem;
|
|
79
|
+
text-align: center;
|
|
80
|
+
font-variant-numeric: tabular-nums;
|
|
81
|
+
box-sizing: border-box;
|
|
82
|
+
-moz-appearance: textfield;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.stepper-input::-webkit-inner-spin-button,
|
|
86
|
+
.stepper-input::-webkit-outer-spin-button {
|
|
87
|
+
-webkit-appearance: none;
|
|
88
|
+
margin: 0;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.stepper-input:focus {
|
|
92
|
+
outline: none;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.stepper-btn {
|
|
96
|
+
display: flex;
|
|
97
|
+
align-items: center;
|
|
98
|
+
justify-content: center;
|
|
99
|
+
min-width: 2.2rem;
|
|
100
|
+
padding: 0.5rem;
|
|
101
|
+
border: none;
|
|
102
|
+
background: transparent;
|
|
103
|
+
color: var(--text-base);
|
|
104
|
+
opacity: 0.5;
|
|
105
|
+
font-size: 0.8125rem;
|
|
106
|
+
font-weight: 700;
|
|
107
|
+
cursor: pointer;
|
|
108
|
+
transition: all 0.15s ease;
|
|
109
|
+
user-select: none;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.stepper-btn:hover {
|
|
113
|
+
background: var(--bg-page);
|
|
114
|
+
color: var(--accent);
|
|
115
|
+
opacity: 1;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.stepper-btn:active {
|
|
119
|
+
background: var(--border-base);
|
|
120
|
+
transform: scale(0.95);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.taper-chips {
|
|
124
|
+
display: grid;
|
|
125
|
+
grid-template-columns: 1fr 1fr;
|
|
126
|
+
gap: 0.375rem;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.taper-chip {
|
|
130
|
+
display: flex;
|
|
131
|
+
flex-direction: column;
|
|
132
|
+
align-items: center;
|
|
133
|
+
gap: 0.15rem;
|
|
134
|
+
padding: 0.6rem 0.5rem;
|
|
135
|
+
border: 1px solid var(--border-base);
|
|
136
|
+
border-radius: 0.75rem;
|
|
137
|
+
background: var(--bg-page);
|
|
138
|
+
cursor: pointer;
|
|
139
|
+
transition: all 0.2s ease;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.taper-chip:hover {
|
|
143
|
+
border-color: var(--accent);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.taper-chip.active {
|
|
147
|
+
background: var(--bg-surface);
|
|
148
|
+
border-color: var(--accent);
|
|
149
|
+
box-shadow: 0 0 0 1px var(--accent);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.taper-chip-label {
|
|
153
|
+
font-size: 0.8125rem;
|
|
154
|
+
font-weight: 700;
|
|
155
|
+
color: var(--text-base);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.taper-chip-sub {
|
|
159
|
+
font-size: 0.65rem;
|
|
160
|
+
color: var(--text-base);
|
|
161
|
+
opacity: 0.5;
|
|
162
|
+
font-weight: 600;
|
|
163
|
+
font-variant-numeric: tabular-nums;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.strap-visual {
|
|
167
|
+
display: flex;
|
|
168
|
+
justify-content: center;
|
|
169
|
+
padding: 0.5rem 0;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.strap-visual svg {
|
|
173
|
+
display: block;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.strap-visual polygon {
|
|
177
|
+
transition: all 0.4s ease;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.result-card {
|
|
181
|
+
background: var(--bg-page);
|
|
182
|
+
border: 1px solid var(--border-base);
|
|
183
|
+
border-radius: 1rem;
|
|
184
|
+
padding: 1rem;
|
|
185
|
+
display: flex;
|
|
186
|
+
flex-direction: column;
|
|
187
|
+
gap: 0.75rem;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.result-header {
|
|
191
|
+
font-size: 0.7rem;
|
|
192
|
+
font-weight: 600;
|
|
193
|
+
color: var(--text-base);
|
|
194
|
+
opacity: 0.5;
|
|
195
|
+
text-transform: uppercase;
|
|
196
|
+
letter-spacing: 0.05em;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.result-grid {
|
|
200
|
+
display: grid;
|
|
201
|
+
grid-template-columns: 1fr 1fr;
|
|
202
|
+
gap: 0.5rem;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.result-item {
|
|
206
|
+
display: flex;
|
|
207
|
+
flex-direction: column;
|
|
208
|
+
align-items: center;
|
|
209
|
+
gap: 0.1rem;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.result-value {
|
|
213
|
+
font-size: 1.5rem;
|
|
214
|
+
font-weight: 800;
|
|
215
|
+
color: var(--accent);
|
|
216
|
+
letter-spacing: -0.02em;
|
|
217
|
+
line-height: 1;
|
|
218
|
+
font-variant-numeric: tabular-nums;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.result-unit {
|
|
222
|
+
font-size: 0.7rem;
|
|
223
|
+
font-weight: 600;
|
|
224
|
+
color: var(--text-base);
|
|
225
|
+
opacity: 0.5;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.result-label {
|
|
229
|
+
font-size: 0.6rem;
|
|
230
|
+
font-weight: 600;
|
|
231
|
+
color: var(--text-base);
|
|
232
|
+
opacity: 0.5;
|
|
233
|
+
text-transform: uppercase;
|
|
234
|
+
letter-spacing: 0.04em;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.score-row {
|
|
238
|
+
display: flex;
|
|
239
|
+
align-items: center;
|
|
240
|
+
justify-content: space-between;
|
|
241
|
+
padding-top: 0.5rem;
|
|
242
|
+
border-top: 1px solid var(--border-base);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.score-label {
|
|
246
|
+
font-size: 0.75rem;
|
|
247
|
+
font-weight: 600;
|
|
248
|
+
color: var(--text-base);
|
|
249
|
+
opacity: 0.6;
|
|
250
|
+
text-transform: uppercase;
|
|
251
|
+
letter-spacing: 0.05em;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.score-badge {
|
|
255
|
+
padding: 0.25rem 0.75rem;
|
|
256
|
+
border-radius: 2rem;
|
|
257
|
+
font-size: 0.75rem;
|
|
258
|
+
font-weight: 700;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.score-excellent {
|
|
262
|
+
background: color-mix(in srgb, var(--color-success, #22c55e) 15%, transparent);
|
|
263
|
+
color: var(--color-success, #22c55e);
|
|
264
|
+
border: 1px solid color-mix(in srgb, var(--color-success, #22c55e) 30%, transparent);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.score-good {
|
|
268
|
+
background: color-mix(in srgb, var(--color-warning, #f59e0b) 15%, transparent);
|
|
269
|
+
color: var(--color-warning, #f59e0b);
|
|
270
|
+
border: 1px solid color-mix(in srgb, var(--color-warning, #f59e0b) 30%, transparent);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.score-fair {
|
|
274
|
+
background: color-mix(in srgb, var(--color-danger, #ef4444) 15%, transparent);
|
|
275
|
+
color: var(--color-danger, #ef4444);
|
|
276
|
+
border: 1px solid color-mix(in srgb, var(--color-danger, #ef4444) 30%, transparent);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.score-unbalanced {
|
|
280
|
+
background: color-mix(in srgb, var(--color-warning, #f59e0b) 15%, transparent);
|
|
281
|
+
color: var(--color-warning, #f59e0b);
|
|
282
|
+
border: 1px solid color-mix(in srgb, var(--color-warning, #f59e0b) 30%, transparent);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.tip-row {
|
|
286
|
+
display: flex;
|
|
287
|
+
gap: 0.5rem;
|
|
288
|
+
padding: 0.75rem 1rem;
|
|
289
|
+
background: var(--bg-page);
|
|
290
|
+
border-radius: 0.75rem;
|
|
291
|
+
border: 1px solid var(--border-base);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.tip-icon {
|
|
295
|
+
flex-shrink: 0;
|
|
296
|
+
margin-top: 0.1rem;
|
|
297
|
+
color: var(--accent);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.tip-text {
|
|
301
|
+
font-size: 0.8rem;
|
|
302
|
+
color: var(--text-base);
|
|
303
|
+
opacity: 0.85;
|
|
304
|
+
line-height: 1.5;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
@media (max-width: 520px) {
|
|
308
|
+
.tool-main-card {
|
|
309
|
+
padding: 1rem;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.input-row {
|
|
313
|
+
flex-direction: column;
|
|
314
|
+
gap: 0.5rem;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.taper-chips {
|
|
318
|
+
grid-template-columns: 1fr 1fr;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { Bibliography as SharedBibliography } from '@jjlmoya/utils-shared';
|
|
3
|
+
import { watchAccuracyTracker } from './index';
|
|
4
|
+
import type { KnownLocale } from '../../types';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
locale?: KnownLocale;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const { locale = 'en' } = Astro.props as Props;
|
|
11
|
+
const loader = watchAccuracyTracker.i18n[locale] || watchAccuracyTracker.i18n.en;
|
|
12
|
+
const content = await loader?.();
|
|
13
|
+
if (!content) return null;
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
{content && <SharedBibliography links={content.bibliography} />}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { BibliographyEntry } from '../../types';
|
|
2
|
+
|
|
3
|
+
export const bibliography: BibliographyEntry[] = [
|
|
4
|
+
{
|
|
5
|
+
name: 'Contrôle Officiel Suisse des Chronomètres (COSC) Standards',
|
|
6
|
+
url: 'https://www.cosc.swiss/en',
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
name: 'Understanding Mechanical Watch Regulation and Accuracy',
|
|
10
|
+
url: 'https://en.wikipedia.org/wiki/Mechanical_watch',
|
|
11
|
+
},
|
|
12
|
+
];
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import type { LogEntry } from './logger';
|
|
2
|
+
|
|
3
|
+
interface Point {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
log: LogEntry;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
interface ZeroLineParams {
|
|
10
|
+
ctx: CanvasRenderingContext2D;
|
|
11
|
+
minVal: number;
|
|
12
|
+
valRange: number;
|
|
13
|
+
padding: { top: number; left: number };
|
|
14
|
+
graphWidth: number;
|
|
15
|
+
graphHeight: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function drawBackgroundAndMessage(
|
|
19
|
+
ctx: CanvasRenderingContext2D,
|
|
20
|
+
w: number,
|
|
21
|
+
h: number,
|
|
22
|
+
logs: LogEntry[]
|
|
23
|
+
): boolean {
|
|
24
|
+
ctx.fillStyle = '#0f172a';
|
|
25
|
+
ctx.fillRect(0, 0, w, h);
|
|
26
|
+
|
|
27
|
+
if (logs.length < 2) {
|
|
28
|
+
ctx.fillStyle = '#94a3b8';
|
|
29
|
+
ctx.font = '12px sans-serif';
|
|
30
|
+
ctx.textAlign = 'center';
|
|
31
|
+
ctx.fillText('Add at least 2 logs to visualize trend', w / 2, h / 2);
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function drawZeroLine(params: ZeroLineParams) {
|
|
38
|
+
const { ctx, minVal, valRange, padding, graphWidth, graphHeight } = params;
|
|
39
|
+
ctx.strokeStyle = '#334155';
|
|
40
|
+
ctx.lineWidth = 1;
|
|
41
|
+
ctx.beginPath();
|
|
42
|
+
const zeroY = padding.top + graphHeight * (1 - (0 - minVal) / valRange);
|
|
43
|
+
if (zeroY >= padding.top && zeroY <= padding.top + graphHeight) {
|
|
44
|
+
ctx.moveTo(padding.left, zeroY);
|
|
45
|
+
ctx.lineTo(padding.left + graphWidth, zeroY);
|
|
46
|
+
ctx.stroke();
|
|
47
|
+
ctx.fillStyle = '#64748b';
|
|
48
|
+
ctx.font = '10px monospace';
|
|
49
|
+
ctx.textAlign = 'right';
|
|
50
|
+
ctx.fillText('0s', padding.left - 8, zeroY + 3);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function drawLineTrend(ctx: CanvasRenderingContext2D, points: Point[]) {
|
|
55
|
+
ctx.strokeStyle = '#f43f5e';
|
|
56
|
+
ctx.lineWidth = 2.5;
|
|
57
|
+
ctx.lineJoin = 'round';
|
|
58
|
+
ctx.lineCap = 'round';
|
|
59
|
+
ctx.beginPath();
|
|
60
|
+
points.forEach((p, i) => {
|
|
61
|
+
if (i === 0) {
|
|
62
|
+
ctx.moveTo(p.x, p.y);
|
|
63
|
+
} else {
|
|
64
|
+
ctx.lineTo(p.x, p.y);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
ctx.stroke();
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function drawPoints(ctx: CanvasRenderingContext2D, points: Point[]) {
|
|
71
|
+
points.forEach(p => {
|
|
72
|
+
ctx.fillStyle = '#10b981';
|
|
73
|
+
ctx.strokeStyle = '#0f172a';
|
|
74
|
+
ctx.lineWidth = 2;
|
|
75
|
+
ctx.beginPath();
|
|
76
|
+
ctx.arc(p.x, p.y, 5, 0, Math.PI * 2);
|
|
77
|
+
ctx.fill();
|
|
78
|
+
ctx.stroke();
|
|
79
|
+
|
|
80
|
+
const entry = p.log;
|
|
81
|
+
if (entry.position) {
|
|
82
|
+
ctx.fillStyle = '#94a3b8';
|
|
83
|
+
ctx.font = '8px sans-serif';
|
|
84
|
+
ctx.textAlign = 'center';
|
|
85
|
+
ctx.fillText(entry.position, p.x, p.y - 8);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function drawTrendChart(canvas: HTMLCanvasElement, logs: LogEntry[]) {
|
|
91
|
+
const ctx = canvas.getContext('2d');
|
|
92
|
+
if (!ctx) return;
|
|
93
|
+
|
|
94
|
+
const rect = canvas.getBoundingClientRect();
|
|
95
|
+
canvas.width = rect.width * window.devicePixelRatio;
|
|
96
|
+
canvas.height = 180 * window.devicePixelRatio;
|
|
97
|
+
ctx.scale(window.devicePixelRatio, window.devicePixelRatio);
|
|
98
|
+
|
|
99
|
+
const w = rect.width;
|
|
100
|
+
const h = 180;
|
|
101
|
+
|
|
102
|
+
if (drawBackgroundAndMessage(ctx, w, h, logs)) return;
|
|
103
|
+
|
|
104
|
+
const offsets = logs.map(l => l.offset);
|
|
105
|
+
const minVal = Math.min(...offsets, -5) - 2;
|
|
106
|
+
const maxVal = Math.max(...offsets, 5) + 2;
|
|
107
|
+
const valRange = maxVal - minVal;
|
|
108
|
+
|
|
109
|
+
const times = logs.map(l => new Date(l.date).getTime());
|
|
110
|
+
const timeRange = times[times.length - 1] - times[0] || 1;
|
|
111
|
+
|
|
112
|
+
const padding = { top: 20, right: 30, bottom: 25, left: 40 };
|
|
113
|
+
const graphWidth = w - padding.left - padding.right;
|
|
114
|
+
const graphHeight = h - padding.top - padding.bottom;
|
|
115
|
+
|
|
116
|
+
drawZeroLine({ ctx, minVal, valRange, padding, graphWidth, graphHeight });
|
|
117
|
+
|
|
118
|
+
const points = logs.map((log, i) => {
|
|
119
|
+
const x = padding.left + ((times[i] - times[0]) / timeRange) * graphWidth;
|
|
120
|
+
const y = padding.top + graphHeight * (1 - (log.offset - minVal) / valRange);
|
|
121
|
+
return { x, y, log };
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
drawLineTrend(ctx, points);
|
|
125
|
+
drawPoints(ctx, points);
|
|
126
|
+
}
|