@jjlmoya/utils-forensic-science 1.1.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 +69 -0
- package/scripts/crystal-lattice-catalog-translations.mjs +459 -0
- package/scripts/postinstall.mjs +27 -0
- package/scripts/sync-crystal-lattice-i18n.mjs +50 -0
- package/src/category/i18n/de.ts +55 -0
- package/src/category/i18n/en.ts +55 -0
- package/src/category/i18n/es.ts +55 -0
- package/src/category/i18n/fr.ts +55 -0
- package/src/category/i18n/id.ts +55 -0
- package/src/category/i18n/it.ts +55 -0
- package/src/category/i18n/ja.ts +56 -0
- package/src/category/i18n/ko.ts +56 -0
- package/src/category/i18n/nl.ts +55 -0
- package/src/category/i18n/pl.ts +55 -0
- package/src/category/i18n/pt.ts +55 -0
- package/src/category/i18n/ru.ts +55 -0
- package/src/category/i18n/sv.ts +55 -0
- package/src/category/i18n/tr.ts +55 -0
- package/src/category/i18n/zh.ts +56 -0
- package/src/category/index.ts +48 -0
- package/src/category/seo.astro +15 -0
- package/src/components/PreviewNavSidebar.astro +116 -0
- package/src/components/PreviewToolbar.astro +143 -0
- package/src/data.ts +10 -0
- package/src/entries.ts +48 -0
- package/src/env.d.ts +5 -0
- package/src/index.ts +29 -0
- package/src/layouts/PreviewLayout.astro +117 -0
- package/src/pages/[locale]/[slug].astro +162 -0
- package/src/pages/[locale].astro +261 -0
- package/src/pages/index.astro +3 -0
- package/src/tests/diacritics_density.test.ts +140 -0
- package/src/tests/faq_count.test.ts +19 -0
- package/src/tests/i18n_coverage.test.ts +36 -0
- package/src/tests/inverted_punctuation.test.ts +84 -0
- package/src/tests/locale_completeness.test.ts +24 -0
- package/src/tests/mocks/astro_mock.js +2 -0
- package/src/tests/no_en_dash.test.ts +70 -0
- package/src/tests/no_h1_in_components.test.ts +48 -0
- package/src/tests/schemas_fulfillment.test.ts +23 -0
- package/src/tests/script_density.test.ts +94 -0
- package/src/tests/seo_length.test.ts +46 -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 +16 -0
- package/src/tests/widmark.test.ts +28 -0
- package/src/tool/forensic-age-estimator/bibliography.astro +14 -0
- package/src/tool/forensic-age-estimator/bibliography.ts +16 -0
- package/src/tool/forensic-age-estimator/component.astro +321 -0
- package/src/tool/forensic-age-estimator/dental-skeletal-third-molar-age-estimator.css +634 -0
- package/src/tool/forensic-age-estimator/entry.ts +32 -0
- package/src/tool/forensic-age-estimator/i18n/de.ts +245 -0
- package/src/tool/forensic-age-estimator/i18n/en.ts +245 -0
- package/src/tool/forensic-age-estimator/i18n/es.ts +245 -0
- package/src/tool/forensic-age-estimator/i18n/fr.ts +245 -0
- package/src/tool/forensic-age-estimator/i18n/id.ts +245 -0
- package/src/tool/forensic-age-estimator/i18n/it.ts +245 -0
- package/src/tool/forensic-age-estimator/i18n/ja.ts +245 -0
- package/src/tool/forensic-age-estimator/i18n/ko.ts +245 -0
- package/src/tool/forensic-age-estimator/i18n/nl.ts +245 -0
- package/src/tool/forensic-age-estimator/i18n/pl.ts +245 -0
- package/src/tool/forensic-age-estimator/i18n/pt.ts +245 -0
- package/src/tool/forensic-age-estimator/i18n/ru.ts +245 -0
- package/src/tool/forensic-age-estimator/i18n/sv.ts +245 -0
- package/src/tool/forensic-age-estimator/i18n/tr.ts +245 -0
- package/src/tool/forensic-age-estimator/i18n/zh.ts +246 -0
- package/src/tool/forensic-age-estimator/index.ts +11 -0
- package/src/tool/forensic-age-estimator/logic.ts +81 -0
- package/src/tool/forensic-age-estimator/seo.astro +15 -0
- package/src/tool/forensic-blood-test-simulator/bibliography.astro +6 -0
- package/src/tool/forensic-blood-test-simulator/bibliography.ts +12 -0
- package/src/tool/forensic-blood-test-simulator/component.astro +168 -0
- package/src/tool/forensic-blood-test-simulator/dom-utils.ts +40 -0
- package/src/tool/forensic-blood-test-simulator/entry.ts +32 -0
- package/src/tool/forensic-blood-test-simulator/forensic-presumptive-blood-testing-luminol-kastle-meyer-simulator.css +532 -0
- package/src/tool/forensic-blood-test-simulator/helpers.ts +16 -0
- package/src/tool/forensic-blood-test-simulator/i18n/de.ts +185 -0
- package/src/tool/forensic-blood-test-simulator/i18n/en.ts +185 -0
- package/src/tool/forensic-blood-test-simulator/i18n/es.ts +185 -0
- package/src/tool/forensic-blood-test-simulator/i18n/fr.ts +220 -0
- package/src/tool/forensic-blood-test-simulator/i18n/id.ts +220 -0
- package/src/tool/forensic-blood-test-simulator/i18n/it.ts +220 -0
- package/src/tool/forensic-blood-test-simulator/i18n/ja.ts +220 -0
- package/src/tool/forensic-blood-test-simulator/i18n/ko.ts +220 -0
- package/src/tool/forensic-blood-test-simulator/i18n/nl.ts +220 -0
- package/src/tool/forensic-blood-test-simulator/i18n/pl.ts +220 -0
- package/src/tool/forensic-blood-test-simulator/i18n/pt.ts +220 -0
- package/src/tool/forensic-blood-test-simulator/i18n/ru.ts +220 -0
- package/src/tool/forensic-blood-test-simulator/i18n/sv.ts +220 -0
- package/src/tool/forensic-blood-test-simulator/i18n/tr.ts +220 -0
- package/src/tool/forensic-blood-test-simulator/i18n/zh.ts +220 -0
- package/src/tool/forensic-blood-test-simulator/index.ts +11 -0
- package/src/tool/forensic-blood-test-simulator/logic.ts +174 -0
- package/src/tool/forensic-blood-test-simulator/script.ts +192 -0
- package/src/tool/forensic-blood-test-simulator/seo.astro +15 -0
- package/src/tool/forensic-fiber-comparison-microscope/bibliography.astro +6 -0
- package/src/tool/forensic-fiber-comparison-microscope/bibliography.ts +16 -0
- package/src/tool/forensic-fiber-comparison-microscope/component.astro +146 -0
- package/src/tool/forensic-fiber-comparison-microscope/entry.ts +32 -0
- package/src/tool/forensic-fiber-comparison-microscope/forensic-fiber-comparison-microscope.css +629 -0
- package/src/tool/forensic-fiber-comparison-microscope/i18n/de.ts +250 -0
- package/src/tool/forensic-fiber-comparison-microscope/i18n/en.ts +246 -0
- package/src/tool/forensic-fiber-comparison-microscope/i18n/es.ts +246 -0
- package/src/tool/forensic-fiber-comparison-microscope/i18n/fr.ts +246 -0
- package/src/tool/forensic-fiber-comparison-microscope/i18n/id.ts +250 -0
- package/src/tool/forensic-fiber-comparison-microscope/i18n/it.ts +246 -0
- package/src/tool/forensic-fiber-comparison-microscope/i18n/ja.ts +250 -0
- package/src/tool/forensic-fiber-comparison-microscope/i18n/ko.ts +246 -0
- package/src/tool/forensic-fiber-comparison-microscope/i18n/nl.ts +246 -0
- package/src/tool/forensic-fiber-comparison-microscope/i18n/pl.ts +250 -0
- package/src/tool/forensic-fiber-comparison-microscope/i18n/pt.ts +250 -0
- package/src/tool/forensic-fiber-comparison-microscope/i18n/ru.ts +250 -0
- package/src/tool/forensic-fiber-comparison-microscope/i18n/sv.ts +250 -0
- package/src/tool/forensic-fiber-comparison-microscope/i18n/tr.ts +246 -0
- package/src/tool/forensic-fiber-comparison-microscope/i18n/zh.ts +250 -0
- package/src/tool/forensic-fiber-comparison-microscope/index.ts +11 -0
- package/src/tool/forensic-fiber-comparison-microscope/logic.ts +244 -0
- package/src/tool/forensic-fiber-comparison-microscope/render.ts +265 -0
- package/src/tool/forensic-fiber-comparison-microscope/seo.astro +15 -0
- package/src/tool/forensic-fiber-comparison-microscope/view.ts +267 -0
- package/src/tool/forensic-glass-becke-line-simulator/bibliography.astro +6 -0
- package/src/tool/forensic-glass-becke-line-simulator/bibliography.ts +16 -0
- package/src/tool/forensic-glass-becke-line-simulator/component.astro +81 -0
- package/src/tool/forensic-glass-becke-line-simulator/entry.ts +32 -0
- package/src/tool/forensic-glass-becke-line-simulator/forensic-glass-becke-line-simulator.css +392 -0
- package/src/tool/forensic-glass-becke-line-simulator/i18n/de.ts +231 -0
- package/src/tool/forensic-glass-becke-line-simulator/i18n/en.ts +231 -0
- package/src/tool/forensic-glass-becke-line-simulator/i18n/es.ts +231 -0
- package/src/tool/forensic-glass-becke-line-simulator/i18n/fr.ts +231 -0
- package/src/tool/forensic-glass-becke-line-simulator/i18n/id.ts +231 -0
- package/src/tool/forensic-glass-becke-line-simulator/i18n/it.ts +231 -0
- package/src/tool/forensic-glass-becke-line-simulator/i18n/ja.ts +231 -0
- package/src/tool/forensic-glass-becke-line-simulator/i18n/ko.ts +231 -0
- package/src/tool/forensic-glass-becke-line-simulator/i18n/nl.ts +231 -0
- package/src/tool/forensic-glass-becke-line-simulator/i18n/pl.ts +231 -0
- package/src/tool/forensic-glass-becke-line-simulator/i18n/pt.ts +231 -0
- package/src/tool/forensic-glass-becke-line-simulator/i18n/ru.ts +231 -0
- package/src/tool/forensic-glass-becke-line-simulator/i18n/sv.ts +231 -0
- package/src/tool/forensic-glass-becke-line-simulator/i18n/tr.ts +231 -0
- package/src/tool/forensic-glass-becke-line-simulator/i18n/zh.ts +231 -0
- package/src/tool/forensic-glass-becke-line-simulator/index.ts +11 -0
- package/src/tool/forensic-glass-becke-line-simulator/logic.ts +100 -0
- package/src/tool/forensic-glass-becke-line-simulator/seo.astro +15 -0
- package/src/tool/forensic-glass-becke-line-simulator/view.ts +281 -0
- package/src/tool/forensic-image-authenticity-analyzer/bibliography.astro +9 -0
- package/src/tool/forensic-image-authenticity-analyzer/bibliography.ts +7 -0
- package/src/tool/forensic-image-authenticity-analyzer/component.astro +250 -0
- package/src/tool/forensic-image-authenticity-analyzer/entry.ts +29 -0
- package/src/tool/forensic-image-authenticity-analyzer/forensic-image-metadata-authenticity-analyzer.css +679 -0
- package/src/tool/forensic-image-authenticity-analyzer/i18n/de.ts +105 -0
- package/src/tool/forensic-image-authenticity-analyzer/i18n/en.ts +105 -0
- package/src/tool/forensic-image-authenticity-analyzer/i18n/es.ts +105 -0
- package/src/tool/forensic-image-authenticity-analyzer/i18n/fr.ts +105 -0
- package/src/tool/forensic-image-authenticity-analyzer/i18n/id.ts +76 -0
- package/src/tool/forensic-image-authenticity-analyzer/i18n/it.ts +105 -0
- package/src/tool/forensic-image-authenticity-analyzer/i18n/ja.ts +72 -0
- package/src/tool/forensic-image-authenticity-analyzer/i18n/ko.ts +72 -0
- package/src/tool/forensic-image-authenticity-analyzer/i18n/nl.ts +75 -0
- package/src/tool/forensic-image-authenticity-analyzer/i18n/pl.ts +75 -0
- package/src/tool/forensic-image-authenticity-analyzer/i18n/pt.ts +105 -0
- package/src/tool/forensic-image-authenticity-analyzer/i18n/ru.ts +75 -0
- package/src/tool/forensic-image-authenticity-analyzer/i18n/sv.ts +76 -0
- package/src/tool/forensic-image-authenticity-analyzer/i18n/tr.ts +76 -0
- package/src/tool/forensic-image-authenticity-analyzer/i18n/zh.ts +71 -0
- package/src/tool/forensic-image-authenticity-analyzer/index.ts +11 -0
- package/src/tool/forensic-image-authenticity-analyzer/logic.ts +283 -0
- package/src/tool/forensic-image-authenticity-analyzer/seo.astro +10 -0
- package/src/tool/forensic-microcrystal-drug-simulator/bibliography.astro +6 -0
- package/src/tool/forensic-microcrystal-drug-simulator/bibliography.ts +12 -0
- package/src/tool/forensic-microcrystal-drug-simulator/component.astro +240 -0
- package/src/tool/forensic-microcrystal-drug-simulator/entry.ts +32 -0
- package/src/tool/forensic-microcrystal-drug-simulator/forensic-microcrystal-drug-simulator.css +430 -0
- package/src/tool/forensic-microcrystal-drug-simulator/i18n/de.ts +244 -0
- package/src/tool/forensic-microcrystal-drug-simulator/i18n/en.ts +244 -0
- package/src/tool/forensic-microcrystal-drug-simulator/i18n/es.ts +244 -0
- package/src/tool/forensic-microcrystal-drug-simulator/i18n/fr.ts +244 -0
- package/src/tool/forensic-microcrystal-drug-simulator/i18n/id.ts +244 -0
- package/src/tool/forensic-microcrystal-drug-simulator/i18n/it.ts +244 -0
- package/src/tool/forensic-microcrystal-drug-simulator/i18n/ja.ts +244 -0
- package/src/tool/forensic-microcrystal-drug-simulator/i18n/ko.ts +244 -0
- package/src/tool/forensic-microcrystal-drug-simulator/i18n/nl.ts +244 -0
- package/src/tool/forensic-microcrystal-drug-simulator/i18n/pl.ts +244 -0
- package/src/tool/forensic-microcrystal-drug-simulator/i18n/pt.ts +244 -0
- package/src/tool/forensic-microcrystal-drug-simulator/i18n/ru.ts +244 -0
- package/src/tool/forensic-microcrystal-drug-simulator/i18n/sv.ts +244 -0
- package/src/tool/forensic-microcrystal-drug-simulator/i18n/tr.ts +244 -0
- package/src/tool/forensic-microcrystal-drug-simulator/i18n/zh.ts +244 -0
- package/src/tool/forensic-microcrystal-drug-simulator/index.ts +11 -0
- package/src/tool/forensic-microcrystal-drug-simulator/logic.ts +189 -0
- package/src/tool/forensic-microcrystal-drug-simulator/seo.astro +15 -0
- package/src/tool/forensic-sex-determinator/bibliography.astro +14 -0
- package/src/tool/forensic-sex-determinator/bibliography.ts +12 -0
- package/src/tool/forensic-sex-determinator/component.astro +463 -0
- package/src/tool/forensic-sex-determinator/entry.ts +32 -0
- package/src/tool/forensic-sex-determinator/forensic-sex-determinator.css +413 -0
- package/src/tool/forensic-sex-determinator/i18n/de.ts +211 -0
- package/src/tool/forensic-sex-determinator/i18n/en.ts +211 -0
- package/src/tool/forensic-sex-determinator/i18n/es.ts +211 -0
- package/src/tool/forensic-sex-determinator/i18n/fr.ts +211 -0
- package/src/tool/forensic-sex-determinator/i18n/id.ts +211 -0
- package/src/tool/forensic-sex-determinator/i18n/it.ts +211 -0
- package/src/tool/forensic-sex-determinator/i18n/ja.ts +211 -0
- package/src/tool/forensic-sex-determinator/i18n/ko.ts +211 -0
- package/src/tool/forensic-sex-determinator/i18n/nl.ts +211 -0
- package/src/tool/forensic-sex-determinator/i18n/pl.ts +211 -0
- package/src/tool/forensic-sex-determinator/i18n/pt.ts +211 -0
- package/src/tool/forensic-sex-determinator/i18n/ru.ts +211 -0
- package/src/tool/forensic-sex-determinator/i18n/sv.ts +211 -0
- package/src/tool/forensic-sex-determinator/i18n/tr.ts +211 -0
- package/src/tool/forensic-sex-determinator/i18n/zh.ts +211 -0
- package/src/tool/forensic-sex-determinator/index.ts +11 -0
- package/src/tool/forensic-sex-determinator/logic.ts +89 -0
- package/src/tool/forensic-sex-determinator/seo.astro +15 -0
- package/src/tool/forensic-stature-estimator/bibliography.astro +14 -0
- package/src/tool/forensic-stature-estimator/bibliography.ts +12 -0
- package/src/tool/forensic-stature-estimator/component.astro +49 -0
- package/src/tool/forensic-stature-estimator/components/EstimationPanel.astro +65 -0
- package/src/tool/forensic-stature-estimator/components/OsteometricBoard.astro +39 -0
- package/src/tool/forensic-stature-estimator/components/OsteometricSelector.astro +109 -0
- package/src/tool/forensic-stature-estimator/dom-utils.ts +71 -0
- package/src/tool/forensic-stature-estimator/entry.ts +32 -0
- package/src/tool/forensic-stature-estimator/forensic-stature-estimator.css +689 -0
- package/src/tool/forensic-stature-estimator/helpers.ts +51 -0
- package/src/tool/forensic-stature-estimator/i18n/de.ts +196 -0
- package/src/tool/forensic-stature-estimator/i18n/en.ts +196 -0
- package/src/tool/forensic-stature-estimator/i18n/es.ts +196 -0
- package/src/tool/forensic-stature-estimator/i18n/fr.ts +196 -0
- package/src/tool/forensic-stature-estimator/i18n/id.ts +196 -0
- package/src/tool/forensic-stature-estimator/i18n/it.ts +196 -0
- package/src/tool/forensic-stature-estimator/i18n/ja.ts +196 -0
- package/src/tool/forensic-stature-estimator/i18n/ko.ts +196 -0
- package/src/tool/forensic-stature-estimator/i18n/nl.ts +196 -0
- package/src/tool/forensic-stature-estimator/i18n/pl.ts +196 -0
- package/src/tool/forensic-stature-estimator/i18n/pt.ts +196 -0
- package/src/tool/forensic-stature-estimator/i18n/ru.ts +196 -0
- package/src/tool/forensic-stature-estimator/i18n/sv.ts +196 -0
- package/src/tool/forensic-stature-estimator/i18n/tr.ts +196 -0
- package/src/tool/forensic-stature-estimator/i18n/zh.ts +196 -0
- package/src/tool/forensic-stature-estimator/index.ts +11 -0
- package/src/tool/forensic-stature-estimator/logic.ts +119 -0
- package/src/tool/forensic-stature-estimator/script.ts +288 -0
- package/src/tool/forensic-stature-estimator/seo.astro +15 -0
- package/src/tool/forensic-tlc-ink-simulator/bibliography.astro +6 -0
- package/src/tool/forensic-tlc-ink-simulator/bibliography.ts +16 -0
- package/src/tool/forensic-tlc-ink-simulator/component.astro +245 -0
- package/src/tool/forensic-tlc-ink-simulator/entry.ts +32 -0
- package/src/tool/forensic-tlc-ink-simulator/forensic-tlc-ink-simulator.css +462 -0
- package/src/tool/forensic-tlc-ink-simulator/i18n/de.ts +243 -0
- package/src/tool/forensic-tlc-ink-simulator/i18n/en.ts +243 -0
- package/src/tool/forensic-tlc-ink-simulator/i18n/es.ts +243 -0
- package/src/tool/forensic-tlc-ink-simulator/i18n/fr.ts +243 -0
- package/src/tool/forensic-tlc-ink-simulator/i18n/id.ts +243 -0
- package/src/tool/forensic-tlc-ink-simulator/i18n/it.ts +243 -0
- package/src/tool/forensic-tlc-ink-simulator/i18n/ja.ts +235 -0
- package/src/tool/forensic-tlc-ink-simulator/i18n/ko.ts +235 -0
- package/src/tool/forensic-tlc-ink-simulator/i18n/nl.ts +243 -0
- package/src/tool/forensic-tlc-ink-simulator/i18n/pl.ts +243 -0
- package/src/tool/forensic-tlc-ink-simulator/i18n/pt.ts +243 -0
- package/src/tool/forensic-tlc-ink-simulator/i18n/ru.ts +243 -0
- package/src/tool/forensic-tlc-ink-simulator/i18n/sv.ts +243 -0
- package/src/tool/forensic-tlc-ink-simulator/i18n/tr.ts +243 -0
- package/src/tool/forensic-tlc-ink-simulator/i18n/zh.ts +235 -0
- package/src/tool/forensic-tlc-ink-simulator/index.ts +11 -0
- package/src/tool/forensic-tlc-ink-simulator/logic.ts +152 -0
- package/src/tool/forensic-tlc-ink-simulator/seo.astro +15 -0
- package/src/tool/gsr-dispersion-calculator/bibliography.astro +6 -0
- package/src/tool/gsr-dispersion-calculator/bibliography.ts +16 -0
- package/src/tool/gsr-dispersion-calculator/component.astro +294 -0
- package/src/tool/gsr-dispersion-calculator/entry.ts +32 -0
- package/src/tool/gsr-dispersion-calculator/gsr-dispersion-calculator.css +305 -0
- package/src/tool/gsr-dispersion-calculator/i18n/de.ts +272 -0
- package/src/tool/gsr-dispersion-calculator/i18n/en.ts +272 -0
- package/src/tool/gsr-dispersion-calculator/i18n/es.ts +272 -0
- package/src/tool/gsr-dispersion-calculator/i18n/fr.ts +272 -0
- package/src/tool/gsr-dispersion-calculator/i18n/id.ts +272 -0
- package/src/tool/gsr-dispersion-calculator/i18n/it.ts +272 -0
- package/src/tool/gsr-dispersion-calculator/i18n/ja.ts +272 -0
- package/src/tool/gsr-dispersion-calculator/i18n/ko.ts +272 -0
- package/src/tool/gsr-dispersion-calculator/i18n/nl.ts +272 -0
- package/src/tool/gsr-dispersion-calculator/i18n/pl.ts +272 -0
- package/src/tool/gsr-dispersion-calculator/i18n/pt.ts +272 -0
- package/src/tool/gsr-dispersion-calculator/i18n/ru.ts +272 -0
- package/src/tool/gsr-dispersion-calculator/i18n/sv.ts +272 -0
- package/src/tool/gsr-dispersion-calculator/i18n/tr.ts +272 -0
- package/src/tool/gsr-dispersion-calculator/i18n/zh.ts +272 -0
- package/src/tool/gsr-dispersion-calculator/index.ts +11 -0
- package/src/tool/gsr-dispersion-calculator/logic.ts +148 -0
- package/src/tool/gsr-dispersion-calculator/seo.astro +15 -0
- package/src/tool/widmark-alcohol-simulator/bibliography.astro +14 -0
- package/src/tool/widmark-alcohol-simulator/bibliography.ts +12 -0
- package/src/tool/widmark-alcohol-simulator/component.astro +453 -0
- package/src/tool/widmark-alcohol-simulator/entry.ts +32 -0
- package/src/tool/widmark-alcohol-simulator/i18n/de.ts +193 -0
- package/src/tool/widmark-alcohol-simulator/i18n/en.ts +206 -0
- package/src/tool/widmark-alcohol-simulator/i18n/es.ts +193 -0
- package/src/tool/widmark-alcohol-simulator/i18n/fr.ts +193 -0
- package/src/tool/widmark-alcohol-simulator/i18n/id.ts +193 -0
- package/src/tool/widmark-alcohol-simulator/i18n/it.ts +193 -0
- package/src/tool/widmark-alcohol-simulator/i18n/ja.ts +193 -0
- package/src/tool/widmark-alcohol-simulator/i18n/ko.ts +193 -0
- package/src/tool/widmark-alcohol-simulator/i18n/nl.ts +193 -0
- package/src/tool/widmark-alcohol-simulator/i18n/pl.ts +193 -0
- package/src/tool/widmark-alcohol-simulator/i18n/pt.ts +193 -0
- package/src/tool/widmark-alcohol-simulator/i18n/ru.ts +193 -0
- package/src/tool/widmark-alcohol-simulator/i18n/sv.ts +193 -0
- package/src/tool/widmark-alcohol-simulator/i18n/tr.ts +193 -0
- package/src/tool/widmark-alcohol-simulator/i18n/zh.ts +193 -0
- package/src/tool/widmark-alcohol-simulator/index.ts +11 -0
- package/src/tool/widmark-alcohol-simulator/logic.ts +97 -0
- package/src/tool/widmark-alcohol-simulator/seo.astro +15 -0
- package/src/tool/widmark-alcohol-simulator/widmark-alcohol-simulator.css +386 -0
- package/src/tools.ts +27 -0
- package/src/types.ts +70 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
export interface SexDeterminatorInput {
|
|
2
|
+
subpubicAngle: number;
|
|
3
|
+
sciaticNotch: number;
|
|
4
|
+
ventralArc: number;
|
|
5
|
+
preauricularSulcus: number;
|
|
6
|
+
mastoidProcess: number;
|
|
7
|
+
supraorbitalRidge: number;
|
|
8
|
+
mentalEminence: number;
|
|
9
|
+
nuchalCrest: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface SexDeterminatorResult {
|
|
13
|
+
femaleProbability: number;
|
|
14
|
+
maleProbability: number;
|
|
15
|
+
predominantSex: 'female' | 'male' | 'indeterminate';
|
|
16
|
+
confidence: 'weak' | 'moderate' | 'strong';
|
|
17
|
+
scoredIndicatorsCount: number;
|
|
18
|
+
notes: string[];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const femaleLikelihoods = [0.45, 0.35, 0.12, 0.06, 0.02];
|
|
22
|
+
const maleLikelihoods = [0.02, 0.06, 0.12, 0.35, 0.45];
|
|
23
|
+
|
|
24
|
+
function getConfidence(count: number): 'weak' | 'moderate' | 'strong' {
|
|
25
|
+
if (count >= 6) {
|
|
26
|
+
return 'strong';
|
|
27
|
+
}
|
|
28
|
+
if (count >= 3) {
|
|
29
|
+
return 'moderate';
|
|
30
|
+
}
|
|
31
|
+
return 'weak';
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function getPredominantSex(femaleProb: number, maleProb: number): 'female' | 'male' | 'indeterminate' {
|
|
35
|
+
if (Math.abs(femaleProb - maleProb) < 10) {
|
|
36
|
+
return 'indeterminate';
|
|
37
|
+
}
|
|
38
|
+
return femaleProb > maleProb ? 'female' : 'male';
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function calculateProducts(scores: number[]) {
|
|
42
|
+
let female = 1.0;
|
|
43
|
+
let male = 1.0;
|
|
44
|
+
let count = 0;
|
|
45
|
+
|
|
46
|
+
for (const score of scores) {
|
|
47
|
+
if (score >= 1 && score <= 5) {
|
|
48
|
+
const idx = score - 1;
|
|
49
|
+
female *= (femaleLikelihoods[idx] ?? 0.2);
|
|
50
|
+
male *= (maleLikelihoods[idx] ?? 0.2);
|
|
51
|
+
count++;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return { female, male, count };
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function determineSex(input: SexDeterminatorInput): SexDeterminatorResult {
|
|
59
|
+
const scores = [
|
|
60
|
+
input.subpubicAngle,
|
|
61
|
+
input.sciaticNotch,
|
|
62
|
+
input.ventralArc,
|
|
63
|
+
input.preauricularSulcus,
|
|
64
|
+
input.mastoidProcess,
|
|
65
|
+
input.supraorbitalRidge,
|
|
66
|
+
input.mentalEminence,
|
|
67
|
+
input.nuchalCrest,
|
|
68
|
+
];
|
|
69
|
+
|
|
70
|
+
const { female: femaleProduct, male: maleProduct, count: scoredCount } = calculateProducts(scores);
|
|
71
|
+
|
|
72
|
+
const femaleNumerator = femaleProduct * 0.5;
|
|
73
|
+
const maleNumerator = maleProduct * 0.5;
|
|
74
|
+
const total = femaleNumerator + maleNumerator;
|
|
75
|
+
|
|
76
|
+
const femaleProb = total > 0 ? (femaleNumerator / total) * 100 : 50;
|
|
77
|
+
const maleProb = total > 0 ? (maleNumerator / total) * 100 : 50;
|
|
78
|
+
|
|
79
|
+
const notes = scoredCount === 0 ? ['noteNoData'] : ['noteTriageOnly', 'noteBayesianEst'];
|
|
80
|
+
|
|
81
|
+
return {
|
|
82
|
+
femaleProbability: Math.round(femaleProb),
|
|
83
|
+
maleProbability: Math.round(maleProb),
|
|
84
|
+
predominantSex: getPredominantSex(femaleProb, maleProb),
|
|
85
|
+
confidence: getConfidence(scoredCount),
|
|
86
|
+
scoredIndicatorsCount: scoredCount,
|
|
87
|
+
notes,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { SEORenderer } from '@jjlmoya/utils-shared';
|
|
3
|
+
import { forensicSexDeterminator } from './index';
|
|
4
|
+
import type { KnownLocale } from '../../types';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
locale?: KnownLocale;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const { locale = 'en' } = Astro.props;
|
|
11
|
+
const content = await forensicSexDeterminator.i18n[locale]?.();
|
|
12
|
+
if (!content) return null;
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
{content.seo && content.seo.length > 0 && <SEORenderer content={{ locale, sections: content.seo }} />}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { Bibliography as SharedBibliography } from '@jjlmoya/utils-shared';
|
|
3
|
+
import { forensicStatureEstimator } from './index';
|
|
4
|
+
import type { KnownLocale } from '../../types';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
locale?: KnownLocale;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const { locale = 'en' } = Astro.props;
|
|
11
|
+
const content = await forensicStatureEstimator.i18n[locale]?.();
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
{content && <SharedBibliography links={content.bibliography} />}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { BibliographyEntry } from '../../types';
|
|
2
|
+
|
|
3
|
+
export const bibliography: BibliographyEntry[] = [
|
|
4
|
+
{
|
|
5
|
+
name: 'Estimation of stature from long bones of American Whites and Negroes',
|
|
6
|
+
url: 'https://pubmed.ncbi.nlm.nih.gov/13007782/'
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
name: 'A re-evaluation of estimation of stature based on measurements of stature taken during life and of long bones after death',
|
|
10
|
+
url: 'https://onlinelibrary.wiley.com/doi/10.1002/ajpa.1330160106'
|
|
11
|
+
}
|
|
12
|
+
];
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
import './forensic-stature-estimator.css';
|
|
3
|
+
import { forensicStatureEstimator } from './index';
|
|
4
|
+
import type { KnownLocale } from '../../types';
|
|
5
|
+
import OsteometricBoard from './components/OsteometricBoard.astro';
|
|
6
|
+
import OsteometricSelector from './components/OsteometricSelector.astro';
|
|
7
|
+
import EstimationPanel from './components/EstimationPanel.astro';
|
|
8
|
+
|
|
9
|
+
interface Props {
|
|
10
|
+
locale?: KnownLocale;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const { locale = 'en' } = Astro.props;
|
|
14
|
+
const content = await forensicStatureEstimator.i18n[locale]?.();
|
|
15
|
+
if (!content) return null;
|
|
16
|
+
const { ui } = content;
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
<div class="forensic-stature-card">
|
|
20
|
+
<div class="forensic-stature-header">
|
|
21
|
+
<div class="unit-toggle-group-global">
|
|
22
|
+
<label class="unit-toggle-label">
|
|
23
|
+
<input type="radio" name="system-unit" value="metric" checked />
|
|
24
|
+
<span class="unit-toggle-button">{ui.metricOption}</span>
|
|
25
|
+
</label>
|
|
26
|
+
<label class="unit-toggle-label">
|
|
27
|
+
<input type="radio" name="system-unit" value="imperial" />
|
|
28
|
+
<span class="unit-toggle-button">{ui.imperialOption}</span>
|
|
29
|
+
</label>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<div class="forensic-stature-grid">
|
|
34
|
+
<div class="forensic-stature-left">
|
|
35
|
+
<OsteometricBoard ui={ui} />
|
|
36
|
+
<OsteometricSelector ui={ui} />
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<div class="forensic-stature-right">
|
|
40
|
+
<EstimationPanel ui={ui} />
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
<script id="stature-ui-data" type="application/json" set:html={JSON.stringify(ui)}></script>
|
|
46
|
+
|
|
47
|
+
<script>
|
|
48
|
+
import './script';
|
|
49
|
+
</script>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
interface Props {
|
|
3
|
+
ui: Record<string, string>;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
const { ui } = Astro.props;
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
<div class="estimation-panel">
|
|
10
|
+
<h3 class="panel-title">{ui.resultsTitle}</h3>
|
|
11
|
+
|
|
12
|
+
<div id="fallback-alert" class="alert-box hidden">
|
|
13
|
+
{ui.fallbackAlert}
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<div class="stature-hero">
|
|
17
|
+
<div class="stature-value-box">
|
|
18
|
+
<span class="stature-value-title">{ui.estimateLabel}</span>
|
|
19
|
+
<div class="stature-display">
|
|
20
|
+
<span id="stature-cm-value" class="stature-number">--</span>
|
|
21
|
+
<span class="stature-unit">{ui.unitsCm}</span>
|
|
22
|
+
</div>
|
|
23
|
+
<div class="stature-display-secondary">
|
|
24
|
+
<span id="stature-inch-value">--</span>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<div class="metrics-grid">
|
|
30
|
+
<div class="metric-card">
|
|
31
|
+
<span class="metric-title">{ui.errorLabel}</span>
|
|
32
|
+
<span id="see-value" class="metric-value">--</span>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<div class="metric-card span-2">
|
|
36
|
+
<span class="metric-title">{ui.rangeLabel}</span>
|
|
37
|
+
<span id="range-value" class="metric-value">--</span>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<div class="formula-card">
|
|
42
|
+
<span class="formula-title">{ui.formulaLabel}</span>
|
|
43
|
+
<div class="formula-visual-container">
|
|
44
|
+
<div class="formula-part highlight-bone">
|
|
45
|
+
<span class="formula-part-label">{ui.formulaBoneFactor}</span>
|
|
46
|
+
<span class="formula-part-math" id="part-bone">--</span>
|
|
47
|
+
</div>
|
|
48
|
+
<div class="formula-operator">+</div>
|
|
49
|
+
<div class="formula-part highlight-const">
|
|
50
|
+
<span class="formula-part-label">{ui.formulaConstant}</span>
|
|
51
|
+
<span class="formula-part-math" id="part-const">--</span>
|
|
52
|
+
</div>
|
|
53
|
+
<div class="formula-operator" id="operator-age-sign" style="display: none;">-</div>
|
|
54
|
+
<div class="formula-part highlight-age" id="container-part-age" style="display: none;">
|
|
55
|
+
<span class="formula-part-label">{ui.formulaAgeCorrection}</span>
|
|
56
|
+
<span class="formula-part-math" id="part-age">--</span>
|
|
57
|
+
</div>
|
|
58
|
+
<div class="formula-operator">±</div>
|
|
59
|
+
<div class="formula-part highlight-error">
|
|
60
|
+
<span class="formula-part-label">{ui.formulaStdError}</span>
|
|
61
|
+
<span class="formula-part-math" id="part-error">--</span>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
interface Props {
|
|
3
|
+
ui: Record<string, string>;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
const { ui } = Astro.props;
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
<div class="osteometric-board-container">
|
|
10
|
+
<div class="osteometric-board-header">
|
|
11
|
+
<span class="osteometric-board-title">{ui.rulerLabelMetric}</span>
|
|
12
|
+
<span class="osteometric-board-instructions">{ui.boardInstructions}</span>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="osteometric-board">
|
|
15
|
+
<div class="osteometric-ruler">
|
|
16
|
+
<div class="ruler-ticks"></div>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<div class="osteometric-base">
|
|
20
|
+
<div class="fixed-block"></div>
|
|
21
|
+
|
|
22
|
+
<div class="bone-stage">
|
|
23
|
+
<svg viewBox="0 0 100 20" class="bone-svg" preserveAspectRatio="none">
|
|
24
|
+
<path id="bone-shape-femur" class="bone-shape hidden" d="M 5 10 C 5 6, 8 6, 10 9 C 20 8, 40 8, 90 9 C 92 6, 95 6, 95 10 C 95 14, 92 14, 90 11 C 40 12, 20 12, 10 11 C 8 14, 5 14, 5 10 Z" fill="rgba(240, 235, 215, 0.95)" stroke="rgb(180, 170, 140)" stroke-width="0.5" />
|
|
25
|
+
<path id="bone-shape-tibia" class="bone-shape hidden" d="M 5 10 C 5 5, 10 5, 12 8 C 25 8, 55 8, 90 9 C 91 7, 93 7, 95 10 C 95 13, 91 13, 90 11 C 55 12, 25 12, 12 12 C 10 15, 5 15, 5 10 Z" fill="rgba(240, 235, 215, 0.95)" stroke="rgb(180, 170, 140)" stroke-width="0.5" />
|
|
26
|
+
<path id="bone-shape-humerus" class="bone-shape hidden" d="M 6 10 C 6 7, 9 7, 11 9 C 20 9, 60 9, 89 9 C 91 7, 94 7, 94 10 C 94 13, 91 13, 89 11 C 60 11, 20 11, 11 11 C 9 13, 6 13, 6 10 Z" fill="rgba(240, 235, 215, 0.95)" stroke="rgb(180, 170, 140)" stroke-width="0.5" />
|
|
27
|
+
<path id="bone-shape-fibula" class="bone-shape hidden" d="M 5 10 C 5 8, 7 8, 8 9.5 L 92 9.5 C 93 8, 95 8, 95 10 C 95 12, 93 12, 92 10.5 L 8 10.5 C 7 12, 5 12, 5 10 Z" fill="rgba(240, 235, 215, 0.95)" stroke="rgb(180, 170, 140)" stroke-width="0.5" />
|
|
28
|
+
<path id="bone-shape-radius" class="bone-shape hidden" d="M 5 10 C 5 7, 8 7, 10 9 Q 50 8, 90 9 C 92 7, 95 7, 95 10 C 95 13, 92 13, 90 11 Q 50 12, 10 11 C 8 13, 5 13, 5 10 Z" fill="rgba(240, 235, 215, 0.95)" stroke="rgb(180, 170, 140)" stroke-width="0.5" />
|
|
29
|
+
<path id="bone-shape-ulna" class="bone-shape hidden" d="M 5 10 C 5 6, 9 6, 11 8.5 L 90 9.5 C 91 8.5, 94 8.5, 94 10 C 94 11.5, 91 11.5, 90 10.5 L 11 11.5 C 9 14, 5 14, 5 10 Z" fill="rgba(240, 235, 215, 0.95)" stroke="rgb(180, 170, 140)" stroke-width="0.5" />
|
|
30
|
+
</svg>
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<div class="sliding-caliper" id="caliper-slider">
|
|
34
|
+
<div class="caliper-arm"></div>
|
|
35
|
+
<div class="caliper-handle"></div>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
---
|
|
2
|
+
interface Props {
|
|
3
|
+
ui: Record<string, string>;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
const { ui } = Astro.props;
|
|
7
|
+
|
|
8
|
+
const bones = [
|
|
9
|
+
{ value: 'femur', label: ui.femurName, min: 30, max: 60, default: 45 },
|
|
10
|
+
{ value: 'tibia', label: ui.tibiaName, min: 25, max: 50, default: 38 },
|
|
11
|
+
{ value: 'humerus', label: ui.humerusName, min: 20, max: 45, default: 32 },
|
|
12
|
+
{ value: 'fibula', label: ui.fibulaName, min: 25, max: 50, default: 37 },
|
|
13
|
+
{ value: 'radius', label: ui.radiusName, min: 15, max: 35, default: 24 },
|
|
14
|
+
{ value: 'ulna', label: ui.ulnaName, min: 18, max: 38, default: 26 }
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
const sexes = [
|
|
18
|
+
{ value: 'male', label: ui.maleOption },
|
|
19
|
+
{ value: 'female', label: ui.femaleOption }
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
const ancestries = [
|
|
23
|
+
{ value: 'white', label: ui.whiteOption },
|
|
24
|
+
{ value: 'black', label: ui.blackOption },
|
|
25
|
+
{ value: 'asian', label: ui.asianOption }
|
|
26
|
+
];
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
<div class="osteometric-selector">
|
|
30
|
+
<h3 class="selector-title">{ui.configTitle}</h3>
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
<div class="form-group">
|
|
34
|
+
<label>{ui.boneLabel}</label>
|
|
35
|
+
<div class="custom-select" id="dropdown-bone">
|
|
36
|
+
<input type="hidden" id="input-bone" value="femur" />
|
|
37
|
+
<button type="button" class="custom-select-trigger" aria-haspopup="listbox" aria-expanded="false">
|
|
38
|
+
<span class="custom-select-trigger-text">{ui.femurName}</span>
|
|
39
|
+
<svg class="custom-select-arrow" viewBox="0 0 24 24" width="18" height="18">
|
|
40
|
+
<path d="M7 10l5 5 5-5H7z" fill="currentColor" />
|
|
41
|
+
</svg>
|
|
42
|
+
</button>
|
|
43
|
+
<div class="custom-select-options hidden" role="listbox">
|
|
44
|
+
{bones.map((bone) => (
|
|
45
|
+
<div
|
|
46
|
+
class="custom-select-option"
|
|
47
|
+
role="option"
|
|
48
|
+
data-value={bone.value}
|
|
49
|
+
data-min={bone.min}
|
|
50
|
+
data-max={bone.max}
|
|
51
|
+
data-default={bone.default}
|
|
52
|
+
>
|
|
53
|
+
{bone.label}
|
|
54
|
+
</div>
|
|
55
|
+
))}
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
<div class="form-group">
|
|
61
|
+
<label for="input-length-val" id="length-label-text">{ui.lengthLabel} ({ui.unitsCm})</label>
|
|
62
|
+
<div class="length-input-container">
|
|
63
|
+
<input type="number" id="input-length-val" class="selector-number" step="0.1" />
|
|
64
|
+
<input type="range" id="input-length" class="selector-range" step="0.1" />
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
<div class="form-group">
|
|
69
|
+
<label>{ui.sexLabel}</label>
|
|
70
|
+
<div class="radio-group">
|
|
71
|
+
{sexes.map((sex) => (
|
|
72
|
+
<label class="radio-label">
|
|
73
|
+
<input type="radio" name="sex" value={sex.value} checked={sex.value === 'male'} />
|
|
74
|
+
<span class="custom-radio"></span>
|
|
75
|
+
<span>{sex.label}</span>
|
|
76
|
+
</label>
|
|
77
|
+
))}
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
|
|
81
|
+
<div class="form-group">
|
|
82
|
+
<label>{ui.ancestryLabel}</label>
|
|
83
|
+
<div class="custom-select" id="dropdown-ancestry">
|
|
84
|
+
<input type="hidden" id="input-ancestry" value="white" />
|
|
85
|
+
<button type="button" class="custom-select-trigger" aria-haspopup="listbox" aria-expanded="false">
|
|
86
|
+
<span class="custom-select-trigger-text">{ui.whiteOption}</span>
|
|
87
|
+
<svg class="custom-select-arrow" viewBox="0 0 24 24" width="18" height="18">
|
|
88
|
+
<path d="M7 10l5 5 5-5H7z" fill="currentColor" />
|
|
89
|
+
</svg>
|
|
90
|
+
</button>
|
|
91
|
+
<div class="custom-select-options hidden" role="listbox">
|
|
92
|
+
{ancestries.map((ancestry) => (
|
|
93
|
+
<div
|
|
94
|
+
class="custom-select-option"
|
|
95
|
+
role="option"
|
|
96
|
+
data-value={ancestry.value}
|
|
97
|
+
>
|
|
98
|
+
{ancestry.label}
|
|
99
|
+
</div>
|
|
100
|
+
))}
|
|
101
|
+
</div>
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
|
|
105
|
+
<div class="form-group">
|
|
106
|
+
<label for="input-age">{ui.ageLabel}</label>
|
|
107
|
+
<input type="number" id="input-age" class="selector-number" min="18" max="100" value="25" />
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export function toggleDropdownExpanded(trigger: HTMLButtonElement, container: Element) {
|
|
2
|
+
const isOpen = trigger.getAttribute('aria-expanded') === 'true';
|
|
3
|
+
closeAllDropdowns();
|
|
4
|
+
if (!isOpen) {
|
|
5
|
+
trigger.setAttribute('aria-expanded', 'true');
|
|
6
|
+
container.classList.remove('hidden');
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function setupCustomDropdown(dropdownId: string, onSelect: (val: string) => void) {
|
|
11
|
+
const dropdown = document.getElementById(dropdownId);
|
|
12
|
+
if (!dropdown) return;
|
|
13
|
+
const trigger = dropdown.querySelector('.custom-select-trigger') as HTMLButtonElement | null;
|
|
14
|
+
const container = dropdown.querySelector('.custom-select-options');
|
|
15
|
+
const input = dropdown.querySelector('input[type="hidden"]') as HTMLInputElement | null;
|
|
16
|
+
const triggerText = dropdown.querySelector('.custom-select-trigger-text');
|
|
17
|
+
|
|
18
|
+
if (!trigger || !container || !input) return;
|
|
19
|
+
|
|
20
|
+
trigger.addEventListener('click', (e) => {
|
|
21
|
+
e.stopPropagation();
|
|
22
|
+
toggleDropdownExpanded(trigger, container);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const options = container.querySelectorAll('.custom-select-option');
|
|
26
|
+
options.forEach(option => {
|
|
27
|
+
option.addEventListener('click', (e) => {
|
|
28
|
+
e.stopPropagation();
|
|
29
|
+
const val = option.getAttribute('data-value') || '';
|
|
30
|
+
input.value = val;
|
|
31
|
+
if (triggerText) triggerText.textContent = option.textContent;
|
|
32
|
+
trigger.setAttribute('aria-expanded', 'false');
|
|
33
|
+
container.classList.add('hidden');
|
|
34
|
+
onSelect(val);
|
|
35
|
+
options.forEach(o => o.classList.remove('selected'));
|
|
36
|
+
option.classList.add('selected');
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function closeAllDropdowns() {
|
|
42
|
+
document.querySelectorAll('.custom-select-trigger').forEach(trig => {
|
|
43
|
+
trig.setAttribute('aria-expanded', 'false');
|
|
44
|
+
});
|
|
45
|
+
document.querySelectorAll('.custom-select-options').forEach(opts => {
|
|
46
|
+
opts.classList.add('hidden');
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function syncDropdown(id: string, val: string) {
|
|
51
|
+
const opt = document.querySelector(`#${id} .custom-select-option[data-value="${val}"]`);
|
|
52
|
+
const triggerText = document.querySelector(`#${id} .custom-select-trigger-text`);
|
|
53
|
+
if (opt && triggerText) {
|
|
54
|
+
triggerText.textContent = opt.textContent;
|
|
55
|
+
document.querySelectorAll(`#${id} .custom-select-option`).forEach(o => o.classList.remove('selected'));
|
|
56
|
+
opt.classList.add('selected');
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function restoreValue(input: HTMLInputElement | null, val: unknown) {
|
|
61
|
+
if (input && val !== undefined && val !== null) {
|
|
62
|
+
input.value = String(val);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function restoreSelectable(input: HTMLInputElement | null, val: unknown, dropdownId: string) {
|
|
67
|
+
if (input && val) {
|
|
68
|
+
input.value = String(val);
|
|
69
|
+
syncDropdown(dropdownId, String(val));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ScienceToolEntry, ToolLocaleContent } from '../../types';
|
|
2
|
+
|
|
3
|
+
export interface StatureEstimatorUI {
|
|
4
|
+
[key: string]: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export type StatureEstimatorLocaleContent = ToolLocaleContent<StatureEstimatorUI>;
|
|
8
|
+
|
|
9
|
+
export const forensicStatureEstimator: ScienceToolEntry<StatureEstimatorUI> = {
|
|
10
|
+
id: 'forensic-stature-estimator',
|
|
11
|
+
icons: {
|
|
12
|
+
bg: 'mdi:ruler-square',
|
|
13
|
+
fg: 'mdi:human-male-height'
|
|
14
|
+
},
|
|
15
|
+
i18n: {
|
|
16
|
+
de: () => import('./i18n/de').then((m) => m.content),
|
|
17
|
+
en: () => import('./i18n/en').then((m) => m.content),
|
|
18
|
+
es: () => import('./i18n/es').then((m) => m.content),
|
|
19
|
+
fr: () => import('./i18n/fr').then((m) => m.content),
|
|
20
|
+
id: () => import('./i18n/id').then((m) => m.content),
|
|
21
|
+
it: () => import('./i18n/it').then((m) => m.content),
|
|
22
|
+
ja: () => import('./i18n/ja').then((m) => m.content),
|
|
23
|
+
ko: () => import('./i18n/ko').then((m) => m.content),
|
|
24
|
+
nl: () => import('./i18n/nl').then((m) => m.content),
|
|
25
|
+
pl: () => import('./i18n/pl').then((m) => m.content),
|
|
26
|
+
pt: () => import('./i18n/pt').then((m) => m.content),
|
|
27
|
+
ru: () => import('./i18n/ru').then((m) => m.content),
|
|
28
|
+
sv: () => import('./i18n/sv').then((m) => m.content),
|
|
29
|
+
tr: () => import('./i18n/tr').then((m) => m.content),
|
|
30
|
+
zh: () => import('./i18n/zh').then((m) => m.content)
|
|
31
|
+
}
|
|
32
|
+
};
|