@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.
Files changed (277) hide show
  1. package/package.json +65 -0
  2. package/scripts/postinstall.mjs +27 -0
  3. package/src/category/ChronoCategorySEO.astro +8 -0
  4. package/src/category/i18n/de.ts +23 -0
  5. package/src/category/i18n/en.ts +23 -0
  6. package/src/category/i18n/es.ts +23 -0
  7. package/src/category/i18n/fr.ts +23 -0
  8. package/src/category/i18n/id.ts +23 -0
  9. package/src/category/i18n/it.ts +23 -0
  10. package/src/category/i18n/ja.ts +23 -0
  11. package/src/category/i18n/ko.ts +23 -0
  12. package/src/category/i18n/nl.ts +23 -0
  13. package/src/category/i18n/pl.ts +23 -0
  14. package/src/category/i18n/pt.ts +23 -0
  15. package/src/category/i18n/ru.ts +23 -0
  16. package/src/category/i18n/sv.ts +23 -0
  17. package/src/category/i18n/tr.ts +23 -0
  18. package/src/category/i18n/zh.ts +23 -0
  19. package/src/category/index.ts +42 -0
  20. package/src/components/PreviewNavSidebar.astro +116 -0
  21. package/src/components/PreviewToolbar.astro +143 -0
  22. package/src/data.ts +11 -0
  23. package/src/entries.ts +32 -0
  24. package/src/env.d.ts +5 -0
  25. package/src/index.ts +28 -0
  26. package/src/layouts/PreviewLayout.astro +117 -0
  27. package/src/pages/[locale]/[slug].astro +161 -0
  28. package/src/pages/[locale].astro +251 -0
  29. package/src/pages/index.astro +4 -0
  30. package/src/tests/faq_count.test.ts +19 -0
  31. package/src/tests/i18n_coverage.test.ts +36 -0
  32. package/src/tests/locale_completeness.test.ts +29 -0
  33. package/src/tests/mocks/astro_mock.js +2 -0
  34. package/src/tests/no_h1_in_components.test.ts +48 -0
  35. package/src/tests/schemas_fulfillment.test.ts +23 -0
  36. package/src/tests/seo_length.test.ts +22 -0
  37. package/src/tests/shared-test-helpers.ts +56 -0
  38. package/src/tests/slug_language_code_format.test.ts +23 -0
  39. package/src/tests/slug_uniqueness.test.ts +81 -0
  40. package/src/tests/title_quality.test.ts +55 -0
  41. package/src/tests/tool_exports.test.ts +34 -0
  42. package/src/tests/tool_validation.test.ts +18 -0
  43. package/src/tool/beat-rate-converter/beat-rate-converter.css +301 -0
  44. package/src/tool/beat-rate-converter/bibliography.astro +16 -0
  45. package/src/tool/beat-rate-converter/bibliography.ts +12 -0
  46. package/src/tool/beat-rate-converter/client.ts +46 -0
  47. package/src/tool/beat-rate-converter/component.astro +15 -0
  48. package/src/tool/beat-rate-converter/components/ConverterPanel.astro +87 -0
  49. package/src/tool/beat-rate-converter/entry.ts +42 -0
  50. package/src/tool/beat-rate-converter/i18n/de.ts +138 -0
  51. package/src/tool/beat-rate-converter/i18n/en.ts +138 -0
  52. package/src/tool/beat-rate-converter/i18n/es.ts +138 -0
  53. package/src/tool/beat-rate-converter/i18n/fr.ts +138 -0
  54. package/src/tool/beat-rate-converter/i18n/id.ts +138 -0
  55. package/src/tool/beat-rate-converter/i18n/it.ts +138 -0
  56. package/src/tool/beat-rate-converter/i18n/ja.ts +138 -0
  57. package/src/tool/beat-rate-converter/i18n/ko.ts +138 -0
  58. package/src/tool/beat-rate-converter/i18n/nl.ts +138 -0
  59. package/src/tool/beat-rate-converter/i18n/pl.ts +138 -0
  60. package/src/tool/beat-rate-converter/i18n/pt.ts +138 -0
  61. package/src/tool/beat-rate-converter/i18n/ru.ts +138 -0
  62. package/src/tool/beat-rate-converter/i18n/sv.ts +138 -0
  63. package/src/tool/beat-rate-converter/i18n/tr.ts +138 -0
  64. package/src/tool/beat-rate-converter/i18n/zh.ts +138 -0
  65. package/src/tool/beat-rate-converter/index.ts +11 -0
  66. package/src/tool/beat-rate-converter/seo.astro +16 -0
  67. package/src/tool/crown-reference-guide/bibliography.astro +16 -0
  68. package/src/tool/crown-reference-guide/bibliography.ts +20 -0
  69. package/src/tool/crown-reference-guide/client.ts +193 -0
  70. package/src/tool/crown-reference-guide/component.astro +69 -0
  71. package/src/tool/crown-reference-guide/components/CrownView.astro +40 -0
  72. package/src/tool/crown-reference-guide/components/MovementSelector.astro +26 -0
  73. package/src/tool/crown-reference-guide/components/PositionPanel.astro +59 -0
  74. package/src/tool/crown-reference-guide/crown-reference-guide.css +383 -0
  75. package/src/tool/crown-reference-guide/entry.ts +60 -0
  76. package/src/tool/crown-reference-guide/i18n/de.ts +207 -0
  77. package/src/tool/crown-reference-guide/i18n/en.ts +207 -0
  78. package/src/tool/crown-reference-guide/i18n/es.ts +207 -0
  79. package/src/tool/crown-reference-guide/i18n/fr.ts +207 -0
  80. package/src/tool/crown-reference-guide/i18n/id.ts +207 -0
  81. package/src/tool/crown-reference-guide/i18n/it.ts +207 -0
  82. package/src/tool/crown-reference-guide/i18n/ja.ts +207 -0
  83. package/src/tool/crown-reference-guide/i18n/ko.ts +207 -0
  84. package/src/tool/crown-reference-guide/i18n/nl.ts +207 -0
  85. package/src/tool/crown-reference-guide/i18n/pl.ts +207 -0
  86. package/src/tool/crown-reference-guide/i18n/pt.ts +207 -0
  87. package/src/tool/crown-reference-guide/i18n/ru.ts +207 -0
  88. package/src/tool/crown-reference-guide/i18n/sv.ts +207 -0
  89. package/src/tool/crown-reference-guide/i18n/tr.ts +207 -0
  90. package/src/tool/crown-reference-guide/i18n/zh.ts +207 -0
  91. package/src/tool/crown-reference-guide/index.ts +11 -0
  92. package/src/tool/crown-reference-guide/seo.astro +16 -0
  93. package/src/tool/crown-reference-guide/utils.ts +0 -0
  94. package/src/tool/demagnetizing-timer/bibliography.astro +16 -0
  95. package/src/tool/demagnetizing-timer/bibliography.ts +12 -0
  96. package/src/tool/demagnetizing-timer/client.ts +221 -0
  97. package/src/tool/demagnetizing-timer/component.astro +15 -0
  98. package/src/tool/demagnetizing-timer/components/TimerPanel.astro +92 -0
  99. package/src/tool/demagnetizing-timer/demagnetizing-timer.css +389 -0
  100. package/src/tool/demagnetizing-timer/entry.ts +50 -0
  101. package/src/tool/demagnetizing-timer/helpers/field.ts +134 -0
  102. package/src/tool/demagnetizing-timer/i18n/de.ts +143 -0
  103. package/src/tool/demagnetizing-timer/i18n/en.ts +143 -0
  104. package/src/tool/demagnetizing-timer/i18n/es.ts +143 -0
  105. package/src/tool/demagnetizing-timer/i18n/fr.ts +143 -0
  106. package/src/tool/demagnetizing-timer/i18n/id.ts +143 -0
  107. package/src/tool/demagnetizing-timer/i18n/it.ts +143 -0
  108. package/src/tool/demagnetizing-timer/i18n/ja.ts +143 -0
  109. package/src/tool/demagnetizing-timer/i18n/ko.ts +143 -0
  110. package/src/tool/demagnetizing-timer/i18n/nl.ts +143 -0
  111. package/src/tool/demagnetizing-timer/i18n/pl.ts +143 -0
  112. package/src/tool/demagnetizing-timer/i18n/pt.ts +143 -0
  113. package/src/tool/demagnetizing-timer/i18n/ru.ts +143 -0
  114. package/src/tool/demagnetizing-timer/i18n/sv.ts +143 -0
  115. package/src/tool/demagnetizing-timer/i18n/tr.ts +143 -0
  116. package/src/tool/demagnetizing-timer/i18n/zh.ts +143 -0
  117. package/src/tool/demagnetizing-timer/index.ts +11 -0
  118. package/src/tool/demagnetizing-timer/seo.astro +16 -0
  119. package/src/tool/demagnetizing-timer/utils.ts +0 -0
  120. package/src/tool/power-reserve-estimator/bibliography.astro +16 -0
  121. package/src/tool/power-reserve-estimator/bibliography.ts +16 -0
  122. package/src/tool/power-reserve-estimator/client.ts +139 -0
  123. package/src/tool/power-reserve-estimator/component.astro +15 -0
  124. package/src/tool/power-reserve-estimator/components/EstimatorPanel.astro +150 -0
  125. package/src/tool/power-reserve-estimator/entry.ts +51 -0
  126. package/src/tool/power-reserve-estimator/i18n/de.ts +158 -0
  127. package/src/tool/power-reserve-estimator/i18n/en.ts +158 -0
  128. package/src/tool/power-reserve-estimator/i18n/es.ts +158 -0
  129. package/src/tool/power-reserve-estimator/i18n/fr.ts +158 -0
  130. package/src/tool/power-reserve-estimator/i18n/id.ts +158 -0
  131. package/src/tool/power-reserve-estimator/i18n/it.ts +158 -0
  132. package/src/tool/power-reserve-estimator/i18n/ja.ts +158 -0
  133. package/src/tool/power-reserve-estimator/i18n/ko.ts +158 -0
  134. package/src/tool/power-reserve-estimator/i18n/nl.ts +158 -0
  135. package/src/tool/power-reserve-estimator/i18n/pl.ts +158 -0
  136. package/src/tool/power-reserve-estimator/i18n/pt.ts +158 -0
  137. package/src/tool/power-reserve-estimator/i18n/ru.ts +158 -0
  138. package/src/tool/power-reserve-estimator/i18n/sv.ts +158 -0
  139. package/src/tool/power-reserve-estimator/i18n/tr.ts +158 -0
  140. package/src/tool/power-reserve-estimator/i18n/zh.ts +158 -0
  141. package/src/tool/power-reserve-estimator/index.ts +11 -0
  142. package/src/tool/power-reserve-estimator/power-reserve-estimator.css +402 -0
  143. package/src/tool/power-reserve-estimator/seo.astro +16 -0
  144. package/src/tool/strap-taper-calculator/bibliography.astro +16 -0
  145. package/src/tool/strap-taper-calculator/bibliography.ts +12 -0
  146. package/src/tool/strap-taper-calculator/client.ts +129 -0
  147. package/src/tool/strap-taper-calculator/component.astro +15 -0
  148. package/src/tool/strap-taper-calculator/components/CalculatorPanel.astro +114 -0
  149. package/src/tool/strap-taper-calculator/entry.ts +56 -0
  150. package/src/tool/strap-taper-calculator/i18n/de.ts +152 -0
  151. package/src/tool/strap-taper-calculator/i18n/en.ts +152 -0
  152. package/src/tool/strap-taper-calculator/i18n/es.ts +152 -0
  153. package/src/tool/strap-taper-calculator/i18n/fr.ts +152 -0
  154. package/src/tool/strap-taper-calculator/i18n/id.ts +152 -0
  155. package/src/tool/strap-taper-calculator/i18n/it.ts +152 -0
  156. package/src/tool/strap-taper-calculator/i18n/ja.ts +152 -0
  157. package/src/tool/strap-taper-calculator/i18n/ko.ts +152 -0
  158. package/src/tool/strap-taper-calculator/i18n/nl.ts +152 -0
  159. package/src/tool/strap-taper-calculator/i18n/pl.ts +152 -0
  160. package/src/tool/strap-taper-calculator/i18n/pt.ts +152 -0
  161. package/src/tool/strap-taper-calculator/i18n/ru.ts +152 -0
  162. package/src/tool/strap-taper-calculator/i18n/sv.ts +152 -0
  163. package/src/tool/strap-taper-calculator/i18n/tr.ts +152 -0
  164. package/src/tool/strap-taper-calculator/i18n/zh.ts +152 -0
  165. package/src/tool/strap-taper-calculator/index.ts +11 -0
  166. package/src/tool/strap-taper-calculator/seo.astro +16 -0
  167. package/src/tool/strap-taper-calculator/strap-taper-calculator.css +320 -0
  168. package/src/tool/watch-accuracy-tracker/bibliography.astro +16 -0
  169. package/src/tool/watch-accuracy-tracker/bibliography.ts +12 -0
  170. package/src/tool/watch-accuracy-tracker/chart.ts +126 -0
  171. package/src/tool/watch-accuracy-tracker/client.ts +287 -0
  172. package/src/tool/watch-accuracy-tracker/component.astro +35 -0
  173. package/src/tool/watch-accuracy-tracker/components/AccuracyTracker.astro +96 -0
  174. package/src/tool/watch-accuracy-tracker/components/DriftPredictor.astro +126 -0
  175. package/src/tool/watch-accuracy-tracker/components/LogHistory.astro +66 -0
  176. package/src/tool/watch-accuracy-tracker/entry.ts +94 -0
  177. package/src/tool/watch-accuracy-tracker/i18n/de.ts +167 -0
  178. package/src/tool/watch-accuracy-tracker/i18n/en.ts +167 -0
  179. package/src/tool/watch-accuracy-tracker/i18n/es.ts +167 -0
  180. package/src/tool/watch-accuracy-tracker/i18n/fr.ts +167 -0
  181. package/src/tool/watch-accuracy-tracker/i18n/id.ts +167 -0
  182. package/src/tool/watch-accuracy-tracker/i18n/it.ts +167 -0
  183. package/src/tool/watch-accuracy-tracker/i18n/ja.ts +167 -0
  184. package/src/tool/watch-accuracy-tracker/i18n/ko.ts +167 -0
  185. package/src/tool/watch-accuracy-tracker/i18n/nl.ts +167 -0
  186. package/src/tool/watch-accuracy-tracker/i18n/pl.ts +167 -0
  187. package/src/tool/watch-accuracy-tracker/i18n/pt.ts +167 -0
  188. package/src/tool/watch-accuracy-tracker/i18n/ru.ts +167 -0
  189. package/src/tool/watch-accuracy-tracker/i18n/sv.ts +167 -0
  190. package/src/tool/watch-accuracy-tracker/i18n/tr.ts +167 -0
  191. package/src/tool/watch-accuracy-tracker/i18n/zh.ts +167 -0
  192. package/src/tool/watch-accuracy-tracker/index.ts +9 -0
  193. package/src/tool/watch-accuracy-tracker/logger.ts +105 -0
  194. package/src/tool/watch-accuracy-tracker/seo.astro +16 -0
  195. package/src/tool/watch-accuracy-tracker/utils.ts +99 -0
  196. package/src/tool/watch-accuracy-tracker/watch-accuracy-tracker.css +564 -0
  197. package/src/tool/watch-savings-planner/bibliography.astro +16 -0
  198. package/src/tool/watch-savings-planner/bibliography.ts +8 -0
  199. package/src/tool/watch-savings-planner/client.ts +271 -0
  200. package/src/tool/watch-savings-planner/component.astro +33 -0
  201. package/src/tool/watch-savings-planner/components/AddGoalForm.astro +49 -0
  202. package/src/tool/watch-savings-planner/components/GoalCard.astro +58 -0
  203. package/src/tool/watch-savings-planner/entry.ts +62 -0
  204. package/src/tool/watch-savings-planner/i18n/de.ts +153 -0
  205. package/src/tool/watch-savings-planner/i18n/en.ts +155 -0
  206. package/src/tool/watch-savings-planner/i18n/es.ts +153 -0
  207. package/src/tool/watch-savings-planner/i18n/fr.ts +153 -0
  208. package/src/tool/watch-savings-planner/i18n/id.ts +153 -0
  209. package/src/tool/watch-savings-planner/i18n/it.ts +153 -0
  210. package/src/tool/watch-savings-planner/i18n/ja.ts +153 -0
  211. package/src/tool/watch-savings-planner/i18n/ko.ts +153 -0
  212. package/src/tool/watch-savings-planner/i18n/nl.ts +153 -0
  213. package/src/tool/watch-savings-planner/i18n/pl.ts +153 -0
  214. package/src/tool/watch-savings-planner/i18n/pt.ts +153 -0
  215. package/src/tool/watch-savings-planner/i18n/ru.ts +153 -0
  216. package/src/tool/watch-savings-planner/i18n/sv.ts +153 -0
  217. package/src/tool/watch-savings-planner/i18n/tr.ts +153 -0
  218. package/src/tool/watch-savings-planner/i18n/zh.ts +153 -0
  219. package/src/tool/watch-savings-planner/index.ts +11 -0
  220. package/src/tool/watch-savings-planner/seo.astro +16 -0
  221. package/src/tool/watch-savings-planner/utils.ts +0 -0
  222. package/src/tool/watch-savings-planner/watch-savings-planner.css +460 -0
  223. package/src/tool/water-resistance-converter/bibliography.astro +16 -0
  224. package/src/tool/water-resistance-converter/bibliography.ts +16 -0
  225. package/src/tool/water-resistance-converter/client.ts +56 -0
  226. package/src/tool/water-resistance-converter/component.astro +15 -0
  227. package/src/tool/water-resistance-converter/components/ConverterPanel.astro +113 -0
  228. package/src/tool/water-resistance-converter/entry.ts +52 -0
  229. package/src/tool/water-resistance-converter/i18n/de.ts +148 -0
  230. package/src/tool/water-resistance-converter/i18n/en.ts +148 -0
  231. package/src/tool/water-resistance-converter/i18n/es.ts +148 -0
  232. package/src/tool/water-resistance-converter/i18n/fr.ts +148 -0
  233. package/src/tool/water-resistance-converter/i18n/id.ts +148 -0
  234. package/src/tool/water-resistance-converter/i18n/it.ts +148 -0
  235. package/src/tool/water-resistance-converter/i18n/ja.ts +148 -0
  236. package/src/tool/water-resistance-converter/i18n/ko.ts +148 -0
  237. package/src/tool/water-resistance-converter/i18n/nl.ts +148 -0
  238. package/src/tool/water-resistance-converter/i18n/pl.ts +148 -0
  239. package/src/tool/water-resistance-converter/i18n/pt.ts +148 -0
  240. package/src/tool/water-resistance-converter/i18n/ru.ts +148 -0
  241. package/src/tool/water-resistance-converter/i18n/sv.ts +148 -0
  242. package/src/tool/water-resistance-converter/i18n/tr.ts +148 -0
  243. package/src/tool/water-resistance-converter/i18n/zh.ts +148 -0
  244. package/src/tool/water-resistance-converter/index.ts +11 -0
  245. package/src/tool/water-resistance-converter/seo.astro +16 -0
  246. package/src/tool/water-resistance-converter/water-resistance-converter.css +254 -0
  247. package/src/tool/wrist-presence-calculator/bibliography.astro +16 -0
  248. package/src/tool/wrist-presence-calculator/bibliography.ts +12 -0
  249. package/src/tool/wrist-presence-calculator/client.ts +180 -0
  250. package/src/tool/wrist-presence-calculator/component.astro +23 -0
  251. package/src/tool/wrist-presence-calculator/components/CalculatorInputs.astro +97 -0
  252. package/src/tool/wrist-presence-calculator/components/FitResult.astro +68 -0
  253. package/src/tool/wrist-presence-calculator/components/Visualizer.astro +16 -0
  254. package/src/tool/wrist-presence-calculator/entry.ts +59 -0
  255. package/src/tool/wrist-presence-calculator/helpers/canvas.ts +189 -0
  256. package/src/tool/wrist-presence-calculator/helpers/results.ts +78 -0
  257. package/src/tool/wrist-presence-calculator/i18n/de.ts +139 -0
  258. package/src/tool/wrist-presence-calculator/i18n/en.ts +155 -0
  259. package/src/tool/wrist-presence-calculator/i18n/es.ts +139 -0
  260. package/src/tool/wrist-presence-calculator/i18n/fr.ts +139 -0
  261. package/src/tool/wrist-presence-calculator/i18n/id.ts +139 -0
  262. package/src/tool/wrist-presence-calculator/i18n/it.ts +139 -0
  263. package/src/tool/wrist-presence-calculator/i18n/ja.ts +139 -0
  264. package/src/tool/wrist-presence-calculator/i18n/ko.ts +139 -0
  265. package/src/tool/wrist-presence-calculator/i18n/nl.ts +139 -0
  266. package/src/tool/wrist-presence-calculator/i18n/pl.ts +139 -0
  267. package/src/tool/wrist-presence-calculator/i18n/pt.ts +139 -0
  268. package/src/tool/wrist-presence-calculator/i18n/ru.ts +139 -0
  269. package/src/tool/wrist-presence-calculator/i18n/sv.ts +139 -0
  270. package/src/tool/wrist-presence-calculator/i18n/tr.ts +139 -0
  271. package/src/tool/wrist-presence-calculator/i18n/zh.ts +155 -0
  272. package/src/tool/wrist-presence-calculator/index.ts +11 -0
  273. package/src/tool/wrist-presence-calculator/seo.astro +16 -0
  274. package/src/tool/wrist-presence-calculator/utils.ts +30 -0
  275. package/src/tool/wrist-presence-calculator/wrist-presence-calculator.css +372 -0
  276. package/src/tools.ts +26 -0
  277. package/src/types.ts +70 -0
@@ -0,0 +1,254 @@
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
+ .converter-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-unit-group {
40
+ display: flex;
41
+ gap: 0.5rem;
42
+ }
43
+
44
+ .depth-input {
45
+ flex: 1;
46
+ padding: 0.65rem 0.75rem;
47
+ background: var(--bg-page);
48
+ border: 1px solid var(--border-base);
49
+ border-radius: 0.75rem;
50
+ color: var(--text-base);
51
+ font-size: 1rem;
52
+ font-weight: 700;
53
+ transition: border-color 0.2s;
54
+ box-sizing: border-box;
55
+ -moz-appearance: textfield;
56
+ }
57
+
58
+ .depth-input::-webkit-inner-spin-button,
59
+ .depth-input::-webkit-outer-spin-button {
60
+ -webkit-appearance: none;
61
+ margin: 0;
62
+ }
63
+
64
+ .depth-input:focus {
65
+ outline: none;
66
+ border-color: var(--accent);
67
+ }
68
+
69
+ .unit-select {
70
+ min-width: 8rem;
71
+ padding: 0.65rem 0.75rem;
72
+ background: var(--bg-page);
73
+ border: 1px solid var(--border-base);
74
+ border-radius: 0.75rem;
75
+ color: var(--text-base);
76
+ font-size: 0.8125rem;
77
+ cursor: pointer;
78
+ transition: border-color 0.2s;
79
+ appearance: none;
80
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%23888' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
81
+ background-repeat: no-repeat;
82
+ background-position: right 0.6rem center;
83
+ padding-right: 1.75rem;
84
+ }
85
+
86
+ .unit-select:focus {
87
+ outline: none;
88
+ border-color: var(--accent);
89
+ }
90
+
91
+ .conversions-card {
92
+ background: var(--bg-page);
93
+ border: 1px solid var(--border-base);
94
+ border-radius: 1rem;
95
+ padding: 1rem;
96
+ display: flex;
97
+ flex-direction: column;
98
+ gap: 0.75rem;
99
+ }
100
+
101
+ .conversions-header {
102
+ font-size: 0.7rem;
103
+ font-weight: 600;
104
+ color: var(--text-base);
105
+ opacity: 0.5;
106
+ text-transform: uppercase;
107
+ letter-spacing: 0.05em;
108
+ }
109
+
110
+ .conversions-grid {
111
+ display: grid;
112
+ grid-template-columns: 1fr 1fr;
113
+ gap: 0.5rem;
114
+ }
115
+
116
+ .conv-item {
117
+ display: flex;
118
+ flex-direction: column;
119
+ gap: 0.1rem;
120
+ padding: 0.4rem 0.5rem;
121
+ background: var(--bg-surface);
122
+ border-radius: 0.5rem;
123
+ }
124
+
125
+ .conv-label {
126
+ font-size: 0.65rem;
127
+ color: var(--text-base);
128
+ opacity: 0.5;
129
+ font-weight: 600;
130
+ text-transform: uppercase;
131
+ }
132
+
133
+ .conv-value {
134
+ font-size: 1rem;
135
+ font-weight: 800;
136
+ color: var(--accent);
137
+ letter-spacing: -0.01em;
138
+ font-variant-numeric: tabular-nums;
139
+ }
140
+
141
+ .rating-badge {
142
+ display: flex;
143
+ flex-direction: column;
144
+ align-items: center;
145
+ gap: 0.25rem;
146
+ padding: 0.75rem;
147
+ background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, transparent), color-mix(in srgb, var(--accent) 5%, transparent));
148
+ border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--border-base));
149
+ border-radius: 1rem;
150
+ }
151
+
152
+ .rating-label {
153
+ font-size: 0.65rem;
154
+ font-weight: 600;
155
+ color: var(--text-base);
156
+ opacity: 0.5;
157
+ text-transform: uppercase;
158
+ letter-spacing: 0.05em;
159
+ }
160
+
161
+ .rating-name {
162
+ font-size: 1.125rem;
163
+ font-weight: 800;
164
+ color: var(--accent);
165
+ text-align: center;
166
+ }
167
+
168
+ .usage-cards {
169
+ display: flex;
170
+ flex-direction: column;
171
+ gap: 0.375rem;
172
+ }
173
+
174
+ .usage-card {
175
+ display: flex;
176
+ align-items: flex-start;
177
+ gap: 0.625rem;
178
+ padding: 0.625rem 0.75rem;
179
+ background: var(--bg-page);
180
+ border: 1px solid var(--border-base);
181
+ border-radius: 0.75rem;
182
+ opacity: 0.35;
183
+ transition: all 0.3s ease;
184
+ }
185
+
186
+ .usage-card.active {
187
+ opacity: 1;
188
+ background: var(--bg-surface);
189
+ border-color: var(--accent);
190
+ box-shadow: 0 0 0 1px var(--accent);
191
+ }
192
+
193
+ .usage-icon {
194
+ flex-shrink: 0;
195
+ width: 1.5rem;
196
+ height: 1.5rem;
197
+ display: flex;
198
+ align-items: center;
199
+ justify-content: center;
200
+ background: color-mix(in srgb, var(--accent) 15%, transparent);
201
+ border-radius: 50%;
202
+ color: var(--accent);
203
+ margin-top: 0.05rem;
204
+ }
205
+
206
+ .usage-title {
207
+ font-size: 0.8125rem;
208
+ font-weight: 700;
209
+ color: var(--text-base);
210
+ margin-bottom: 0.1rem;
211
+ }
212
+
213
+ .usage-desc {
214
+ font-size: 0.7rem;
215
+ color: var(--text-base);
216
+ opacity: 0.6;
217
+ line-height: 1.35;
218
+ }
219
+
220
+ .tip-row {
221
+ display: flex;
222
+ gap: 0.5rem;
223
+ padding: 0.75rem 1rem;
224
+ background: var(--bg-page);
225
+ border-radius: 0.75rem;
226
+ border: 1px solid var(--border-base);
227
+ }
228
+
229
+ .tip-icon {
230
+ flex-shrink: 0;
231
+ margin-top: 0.1rem;
232
+ color: var(--accent);
233
+ }
234
+
235
+ .tip-text {
236
+ font-size: 0.8rem;
237
+ color: var(--text-base);
238
+ opacity: 0.85;
239
+ line-height: 1.5;
240
+ }
241
+
242
+ @media (max-width: 520px) {
243
+ .tool-main-card {
244
+ padding: 1rem;
245
+ }
246
+
247
+ .input-unit-group {
248
+ flex-direction: column;
249
+ }
250
+
251
+ .unit-select {
252
+ min-width: 100%;
253
+ }
254
+ }
@@ -0,0 +1,16 @@
1
+ ---
2
+ import { Bibliography as SharedBibliography } from '@jjlmoya/utils-shared';
3
+ import { wristPresenceCalculator } 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 = wristPresenceCalculator.i18n[locale] || wristPresenceCalculator.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: 'Horology Design and Proportions Guide',
6
+ url: 'https://en.wikipedia.org/wiki/Watch_size',
7
+ },
8
+ {
9
+ name: 'The Aesthetics of Watch Sizing',
10
+ url: 'https://www.nytimes.com/watch-aesthetics',
11
+ },
12
+ ];
@@ -0,0 +1,180 @@
1
+ import {
2
+ calculateCaseToWristRatio,
3
+ estimateWristWidth,
4
+ getIdealCaseRange,
5
+ getRatioClass,
6
+ getCoverageClass
7
+ } from './utils';
8
+ import { drawFitVisualizer } from './helpers/canvas';
9
+ import { getRatioText, getCoverageText, getVerdictHtml, formatWristValue, formatRecValue } from './helpers/results';
10
+
11
+ const mainEl = document.querySelector('.tool-main-card') as HTMLElement;
12
+ const ui = mainEl ? JSON.parse(mainEl.dataset.ui || '{}') : {};
13
+
14
+ const wristCircSlider = document.getElementById('wrist-circumference') as HTMLInputElement;
15
+ const wristCircDisplay = document.getElementById('wrist-circumference-display') as HTMLElement;
16
+ const caseDiamSlider = document.getElementById('case-diameter') as HTMLInputElement;
17
+ const caseDiamDisplay = document.getElementById('case-diameter-display') as HTMLElement;
18
+ const lugToLugSlider = document.getElementById('lug-to-lug') as HTMLInputElement;
19
+ const lugToLugDisplay = document.getElementById('lug-to-lug-display') as HTMLElement;
20
+ const autoEstimateCheckbox = document.getElementById('auto-estimate-width') as HTMLInputElement;
21
+ const customWidthGroup = document.getElementById('custom-width-group') as HTMLElement;
22
+ const wristWidthSlider = document.getElementById('wrist-width') as HTMLInputElement;
23
+ const wristWidthDisplay = document.getElementById('wrist-width-display') as HTMLElement;
24
+ const btnUnitCm = document.getElementById('btn-unit-cm') as HTMLButtonElement;
25
+ const btnUnitIn = document.getElementById('btn-unit-in') as HTMLButtonElement;
26
+ const ratioValEl = document.getElementById('ratio-value') as HTMLElement;
27
+ const ratioVerdictBadge = document.getElementById('ratio-verdict-badge') as HTMLElement;
28
+ const coverageValEl = document.getElementById('coverage-value') as HTMLElement;
29
+ const coverageVerdictBadge = document.getElementById('coverage-verdict-badge') as HTMLElement;
30
+ const verdictDescEl = document.getElementById('verdict-description') as HTMLElement;
31
+ const recClassicCase = document.getElementById('rec-classic-case') as HTMLElement;
32
+ const recClassicLug = document.getElementById('rec-classic-lug') as HTMLElement;
33
+ const recSweetCase = document.getElementById('rec-sweet-case') as HTMLElement;
34
+ const recSweetLug = document.getElementById('rec-sweet-lug') as HTMLElement;
35
+ const recBoldCase = document.getElementById('rec-bold-case') as HTMLElement;
36
+ const recBoldLug = document.getElementById('rec-bold-lug') as HTMLElement;
37
+ const fitCanvas = document.getElementById('fit-canvas') as HTMLCanvasElement;
38
+
39
+ let unit: 'cm' | 'in' = 'cm';
40
+
41
+ function getWristCircMm(): number {
42
+ const val = parseFloat(wristCircSlider.value);
43
+ return unit === 'in' ? val * 25.4 : val * 10;
44
+ }
45
+
46
+ function getWristWidthMm(): number {
47
+ if (autoEstimateCheckbox.checked) {
48
+ return estimateWristWidth(getWristCircMm());
49
+ }
50
+ return parseFloat(wristWidthSlider.value);
51
+ }
52
+
53
+ function updateInputs() {
54
+ const circ = parseFloat(wristCircSlider.value);
55
+ wristCircDisplay.textContent = `${circ.toFixed(1)} ${unit}`;
56
+
57
+ const caseD = parseFloat(caseDiamSlider.value);
58
+ caseDiamDisplay.textContent = formatRecValue(caseD, unit);
59
+
60
+ const l2l = parseFloat(lugToLugSlider.value);
61
+ lugToLugDisplay.textContent = formatRecValue(l2l, unit);
62
+
63
+ const wristWMm = getWristWidthMm();
64
+ const displayVal = formatWristValue(wristWMm, unit);
65
+
66
+ if (autoEstimateCheckbox.checked) {
67
+ customWidthGroup.style.display = 'none';
68
+ wristWidthDisplay.textContent = `${displayVal} (${ui.estimatedLabel || 'estimated'})`;
69
+ } else {
70
+ customWidthGroup.style.display = 'block';
71
+ wristWidthDisplay.textContent = displayVal;
72
+ }
73
+ }
74
+
75
+ function updateRecommendations(circMm: number) {
76
+ const ideal = getIdealCaseRange(circMm);
77
+ recClassicCase.textContent = formatRecValue(ideal.min, unit);
78
+ recClassicLug.textContent = formatRecValue(ideal.maxLugToLug, unit);
79
+ recSweetCase.textContent = formatRecValue(ideal.sweetSpot, unit);
80
+ recSweetLug.textContent = formatRecValue(ideal.maxLugToLug, unit);
81
+ recBoldCase.textContent = formatRecValue(ideal.max, unit);
82
+ recBoldLug.textContent = formatRecValue(ideal.maxLugToLug, unit);
83
+ }
84
+
85
+ function updateResults() {
86
+ const circMm = getWristCircMm();
87
+ const caseD = parseFloat(caseDiamSlider.value);
88
+ const l2l = parseFloat(lugToLugSlider.value);
89
+ const wristW = getWristWidthMm();
90
+
91
+ const ratio = calculateCaseToWristRatio(circMm, caseD);
92
+ ratioValEl.textContent = ratio.toFixed(2);
93
+ const ratioClass = getRatioClass(ratio);
94
+ ratioVerdictBadge.className = `verdict-badge ${ratioClass}`;
95
+ ratioVerdictBadge.textContent = getRatioText(ratioClass, ui);
96
+
97
+ const coverage = (l2l / wristW) * 100;
98
+ coverageValEl.textContent = `${Math.round(coverage)}%`;
99
+ const coverageClass = getCoverageClass(coverage);
100
+ coverageVerdictBadge.className = `verdict-badge ${coverageClass}`;
101
+ coverageVerdictBadge.textContent = getCoverageText(coverageClass, ui);
102
+
103
+ verdictDescEl.innerHTML = getVerdictHtml(coverage, ratio, ui);
104
+ updateRecommendations(circMm);
105
+ }
106
+
107
+ function triggerDraw() {
108
+ if (!fitCanvas) return;
109
+ drawFitVisualizer({
110
+ canvas: fitCanvas,
111
+ wristW: getWristWidthMm(),
112
+ caseD: parseFloat(caseDiamSlider.value),
113
+ l2l: parseFloat(lugToLugSlider.value),
114
+ unit,
115
+ ui
116
+ });
117
+ }
118
+
119
+ interface SliderConfig {
120
+ slider: HTMLInputElement;
121
+ min: number;
122
+ max: number;
123
+ step: number;
124
+ val: number;
125
+ }
126
+
127
+ function setupSlider(config: SliderConfig) {
128
+ config.slider.min = config.min.toString();
129
+ config.slider.max = config.max.toString();
130
+ config.slider.step = config.step.toString();
131
+ config.slider.value = config.val.toFixed(1);
132
+ }
133
+
134
+ function handleUnitChange(newUnit: 'cm' | 'in') {
135
+ if (unit === newUnit) return;
136
+ const prevCircMm = getWristCircMm();
137
+ unit = newUnit;
138
+
139
+ if (unit === 'cm') {
140
+ btnUnitCm.classList.add('active');
141
+ btnUnitIn.classList.remove('active');
142
+ setupSlider({ slider: wristCircSlider, min: 12, max: 24, step: 0.1, val: prevCircMm / 10 });
143
+ } else {
144
+ btnUnitCm.classList.remove('active');
145
+ btnUnitIn.classList.add('active');
146
+ setupSlider({ slider: wristCircSlider, min: 4.7, max: 9.5, step: 0.1, val: prevCircMm / 25.4 });
147
+ }
148
+
149
+ updateInputs();
150
+ updateResults();
151
+ triggerDraw();
152
+ }
153
+
154
+ btnUnitCm.addEventListener('click', () => handleUnitChange('cm'));
155
+ btnUnitIn.addEventListener('click', () => handleUnitChange('in'));
156
+
157
+ [wristCircSlider, caseDiamSlider, lugToLugSlider, wristWidthSlider].forEach(input => {
158
+ input.addEventListener('input', () => {
159
+ updateInputs();
160
+ updateResults();
161
+ triggerDraw();
162
+ });
163
+ });
164
+
165
+ autoEstimateCheckbox.addEventListener('change', () => {
166
+ updateInputs();
167
+ updateResults();
168
+ triggerDraw();
169
+ });
170
+
171
+ window.addEventListener('resize', triggerDraw);
172
+
173
+ updateInputs();
174
+ updateResults();
175
+ setTimeout(triggerDraw, 100);
176
+
177
+ const observer = new MutationObserver(() => {
178
+ triggerDraw();
179
+ });
180
+ observer.observe(document.documentElement, { attributes: true, attributeFilter: ['class'] });
@@ -0,0 +1,23 @@
1
+ ---
2
+ import CalculatorInputs from './components/CalculatorInputs.astro';
3
+ import Visualizer from './components/Visualizer.astro';
4
+ import FitResult from './components/FitResult.astro';
5
+
6
+ interface Props {
7
+ ui: Record<string, string>;
8
+ }
9
+
10
+ const { ui } = Astro.props;
11
+ ---
12
+
13
+ <div class="tool-main-card" data-ui={JSON.stringify(ui)}>
14
+ <div class="wrist-calculator-layout">
15
+ <div class="calc-panel">
16
+ <CalculatorInputs labels={ui} />
17
+ <Visualizer labels={ui} />
18
+ </div>
19
+ <FitResult labels={ui} />
20
+ </div>
21
+ </div>
22
+
23
+ <script src="./client.ts"></script>
@@ -0,0 +1,97 @@
1
+ ---
2
+ interface Props {
3
+ labels: Record<string, string>;
4
+ }
5
+
6
+ const { labels } = Astro.props;
7
+ ---
8
+
9
+ <div class="inputs-section">
10
+ <div class="section-header">
11
+ <h3>{labels.title || "Wrist Sizing"}</h3>
12
+ <div class="unit-selector">
13
+ <button type="button" class="unit-btn active" id="btn-unit-cm">{labels.unitCm || "CM"}</button>
14
+ <button type="button" class="unit-btn" id="btn-unit-in">{labels.unitInches || "IN"}</button>
15
+ </div>
16
+ </div>
17
+
18
+ <div class="input-row">
19
+ <div class="input-group">
20
+ <div class="input-header">
21
+ <label class="input-label" for="wrist-circumference">{labels.wristCircumferenceLabel || "Wrist Circumference"}</label>
22
+ <span class="value-display" id="wrist-circumference-display">17.0 cm</span>
23
+ </div>
24
+ <input
25
+ type="range"
26
+ id="wrist-circumference"
27
+ class="slider-control"
28
+ min="12"
29
+ max="24"
30
+ step="0.1"
31
+ value="17.0"
32
+ />
33
+ </div>
34
+
35
+ <div class="input-group">
36
+ <div class="input-header">
37
+ <label class="input-label" for="case-diameter">{labels.caseDiameterLabel || "Case Diameter"}</label>
38
+ <span class="value-display" id="case-diameter-display">40 mm</span>
39
+ </div>
40
+ <input
41
+ type="range"
42
+ id="case-diameter"
43
+ class="slider-control"
44
+ min="28"
45
+ max="52"
46
+ step="1"
47
+ value="40"
48
+ />
49
+ </div>
50
+
51
+ <div class="input-group">
52
+ <div class="input-header">
53
+ <label class="input-label" for="lug-to-lug">{labels.lugToLugLabel || "Lug-to-Lug"}</label>
54
+ <span class="value-display" id="lug-to-lug-display">47 mm</span>
55
+ </div>
56
+ <input
57
+ type="range"
58
+ id="lug-to-lug"
59
+ class="slider-control"
60
+ min="34"
61
+ max="60"
62
+ step="1"
63
+ value="47"
64
+ />
65
+ </div>
66
+
67
+ <div class="input-group">
68
+ <div class="toggle-container">
69
+ <input
70
+ type="checkbox"
71
+ id="auto-estimate-width"
72
+ class="checkbox-control"
73
+ checked
74
+ />
75
+ <label class="toggle-label" for="auto-estimate-width">
76
+ {labels.autoEstimateWidthLabel || "Auto-estimate flat wrist width (30%)"}
77
+ </label>
78
+ </div>
79
+ </div>
80
+
81
+ <div class="input-group" id="custom-width-group" style="display: none;">
82
+ <div class="input-header">
83
+ <label class="input-label" for="wrist-width">{labels.wristWidthLabel || "Flat Wrist Width"}</label>
84
+ <span class="value-display" id="wrist-width-display">51 mm</span>
85
+ </div>
86
+ <input
87
+ type="range"
88
+ id="wrist-width"
89
+ class="slider-control"
90
+ min="30"
91
+ max="80"
92
+ step="1"
93
+ value="51"
94
+ />
95
+ </div>
96
+ </div>
97
+ </div>
@@ -0,0 +1,68 @@
1
+ ---
2
+ interface Props {
3
+ labels: Record<string, string>;
4
+ }
5
+
6
+ const { labels } = Astro.props;
7
+ ---
8
+
9
+ <div class="results-wrapper">
10
+ <div class="results-section">
11
+ <div class="section-header">
12
+ <h3>{labels.fitAnalysisTitle || "Wrist Fit Assessment"}</h3>
13
+ </div>
14
+
15
+ <div class="metrics-summary-grid">
16
+ <div class="metric-box">
17
+ <span class="metric-lbl">{labels.caseWristRatioLabel || "Case-to-Wrist Ratio"}</span>
18
+ <span class="metric-val" id="ratio-value">4.25</span>
19
+ <span class="verdict-badge verdict-golden" id="ratio-verdict-badge">Golden Fit</span>
20
+ </div>
21
+
22
+ <div class="metric-box">
23
+ <span class="metric-lbl">{labels.wristCoverageLabel || "Wrist Lug Coverage"}</span>
24
+ <span class="metric-val" id="coverage-value">92%</span>
25
+ <span class="verdict-badge coverage-bold" id="coverage-verdict-badge">Bold Coverage</span>
26
+ </div>
27
+ </div>
28
+
29
+ <div class="verdict-box" id="verdict-description">
30
+ <strong>Rolex Superlative Fit:</strong> Loading recommendation...
31
+ </div>
32
+ </div>
33
+
34
+ <div class="recommendations-section">
35
+ <div class="section-header">
36
+ <h3>{labels.idealSizesTitle || "Ideal Sizing Guidelines"}</h3>
37
+ </div>
38
+
39
+ <div class="recommendations-table-wrapper">
40
+ <table class="recommendations-table">
41
+ <thead>
42
+ <tr>
43
+ <th>{labels.sweetSpotTitle || "Fit Style"}</th>
44
+ <th>{labels.caseDiameterLabel || "Case Diameter"}</th>
45
+ <th>{labels.lugToLugLabel || "Max Lug-to-Lug"}</th>
46
+ </tr>
47
+ </thead>
48
+ <tbody>
49
+ <tr>
50
+ <td class="rec-target">{labels.minClassicLabel || "Vintage / Classic Fit"}</td>
51
+ <td class="rec-value" id="rec-classic-case">34.0 mm</td>
52
+ <td class="rec-value" id="rec-classic-lug">51.0 mm</td>
53
+ </tr>
54
+ <tr>
55
+ <td class="rec-target">{labels.sweetSpotLabel || "Aesthetic Sweet Spot"}</td>
56
+ <td class="rec-value" id="rec-sweet-case">37.8 mm</td>
57
+ <td class="rec-value" id="rec-sweet-lug">51.0 mm</td>
58
+ </tr>
59
+ <tr>
60
+ <td class="rec-target">{labels.maxBoldLabel || "Modern / Bold Fit"}</td>
61
+ <td class="rec-value" id="rec-bold-case">42.5 mm</td>
62
+ <td class="rec-value" id="rec-bold-lug">51.0 mm</td>
63
+ </tr>
64
+ </tbody>
65
+ </table>
66
+ </div>
67
+ </div>
68
+ </div>
@@ -0,0 +1,16 @@
1
+ ---
2
+ interface Props {
3
+ labels: Record<string, string>;
4
+ }
5
+
6
+ const { labels } = Astro.props;
7
+ ---
8
+
9
+ <div class="visualizer-section">
10
+ <div class="section-header">
11
+ <h3>{labels.visualizerTitle || "Live Fit Simulator"}</h3>
12
+ </div>
13
+ <div class="canvas-wrapper">
14
+ <canvas id="fit-canvas" class="fit-canvas"></canvas>
15
+ </div>
16
+ </div>