@jjlmoya/utils-diy 1.11.0 → 1.13.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 +1 -1
- package/src/category/index.ts +2 -1
- package/src/entries.ts +3 -1
- package/src/index.ts +2 -0
- package/src/pages/[locale]/[slug].astro +28 -12
- package/src/tests/locale_completeness.test.ts +7 -9
- package/src/tests/shared-test-helpers.ts +56 -0
- package/src/tests/tool_exports.test.ts +34 -0
- package/src/tests/tool_validation.test.ts +2 -2
- package/src/tool/balusterCalculator/bibliography.astro +2 -10
- package/src/tool/balusterCalculator/bibliography.ts +16 -0
- package/src/tool/balusterCalculator/i18n/de.ts +2 -15
- package/src/tool/balusterCalculator/i18n/en.ts +2 -15
- package/src/tool/balusterCalculator/i18n/es.ts +2 -15
- package/src/tool/balusterCalculator/i18n/fr.ts +2 -15
- package/src/tool/balusterCalculator/i18n/id.ts +2 -15
- package/src/tool/balusterCalculator/i18n/it.ts +2 -15
- package/src/tool/balusterCalculator/i18n/ja.ts +2 -15
- package/src/tool/balusterCalculator/i18n/ko.ts +2 -15
- package/src/tool/balusterCalculator/i18n/nl.ts +2 -15
- package/src/tool/balusterCalculator/i18n/pl.ts +2 -15
- package/src/tool/balusterCalculator/i18n/pt.ts +2 -15
- package/src/tool/balusterCalculator/i18n/ru.ts +2 -15
- package/src/tool/balusterCalculator/i18n/sv.ts +2 -15
- package/src/tool/balusterCalculator/i18n/tr.ts +2 -15
- package/src/tool/balusterCalculator/i18n/zh.ts +2 -15
- package/src/tool/balusterCalculator/seo.astro +1 -1
- package/src/tool/clayCalculator/bibliography.astro +2 -10
- package/src/tool/clayCalculator/bibliography.ts +12 -0
- package/src/tool/clayCalculator/i18n/de.ts +2 -11
- package/src/tool/clayCalculator/i18n/en.ts +2 -11
- package/src/tool/clayCalculator/i18n/es.ts +2 -11
- package/src/tool/clayCalculator/i18n/fr.ts +2 -11
- package/src/tool/clayCalculator/i18n/id.ts +2 -11
- package/src/tool/clayCalculator/i18n/it.ts +2 -11
- package/src/tool/clayCalculator/i18n/ja.ts +2 -11
- package/src/tool/clayCalculator/i18n/ko.ts +2 -11
- package/src/tool/clayCalculator/i18n/nl.ts +2 -11
- package/src/tool/clayCalculator/i18n/pl.ts +2 -11
- package/src/tool/clayCalculator/i18n/pt.ts +2 -11
- package/src/tool/clayCalculator/i18n/ru.ts +2 -11
- package/src/tool/clayCalculator/i18n/sv.ts +2 -11
- package/src/tool/clayCalculator/i18n/tr.ts +2 -11
- package/src/tool/clayCalculator/i18n/zh.ts +2 -11
- package/src/tool/clayCalculator/seo.astro +1 -1
- package/src/tool/concreteCalculator/bibliography.astro +2 -9
- package/src/tool/concreteCalculator/bibliography.ts +7 -0
- package/src/tool/concreteCalculator/i18n/de.ts +2 -15
- package/src/tool/concreteCalculator/i18n/en.ts +2 -15
- package/src/tool/concreteCalculator/i18n/es.ts +2 -15
- package/src/tool/concreteCalculator/i18n/fr.ts +2 -15
- package/src/tool/concreteCalculator/i18n/id.ts +2 -15
- package/src/tool/concreteCalculator/i18n/it.ts +2 -15
- package/src/tool/concreteCalculator/i18n/ja.ts +2 -15
- package/src/tool/concreteCalculator/i18n/ko.ts +2 -15
- package/src/tool/concreteCalculator/i18n/nl.ts +2 -15
- package/src/tool/concreteCalculator/i18n/pl.ts +2 -15
- package/src/tool/concreteCalculator/i18n/pt.ts +2 -15
- package/src/tool/concreteCalculator/i18n/ru.ts +2 -15
- package/src/tool/concreteCalculator/i18n/sv.ts +2 -15
- package/src/tool/concreteCalculator/i18n/tr.ts +2 -15
- package/src/tool/concreteCalculator/i18n/zh.ts +2 -15
- package/src/tool/concreteCalculator/seo.astro +2 -1
- package/src/tool/cutOptimizer/bibliography.astro +2 -9
- package/src/tool/cutOptimizer/bibliography.ts +12 -0
- package/src/tool/cutOptimizer/i18n/de.ts +2 -11
- package/src/tool/cutOptimizer/i18n/en.ts +2 -11
- package/src/tool/cutOptimizer/i18n/es.ts +2 -11
- package/src/tool/cutOptimizer/i18n/fr.ts +2 -11
- package/src/tool/cutOptimizer/i18n/id.ts +2 -11
- package/src/tool/cutOptimizer/i18n/it.ts +2 -11
- package/src/tool/cutOptimizer/i18n/ja.ts +2 -11
- package/src/tool/cutOptimizer/i18n/ko.ts +2 -11
- package/src/tool/cutOptimizer/i18n/nl.ts +2 -11
- package/src/tool/cutOptimizer/i18n/pl.ts +2 -11
- package/src/tool/cutOptimizer/i18n/pt.ts +2 -11
- package/src/tool/cutOptimizer/i18n/ru.ts +2 -11
- package/src/tool/cutOptimizer/i18n/sv.ts +2 -11
- package/src/tool/cutOptimizer/i18n/tr.ts +2 -11
- package/src/tool/cutOptimizer/i18n/zh.ts +2 -11
- package/src/tool/cutOptimizer/seo.astro +2 -1
- package/src/tool/drillCalculator/bibliography.astro +2 -9
- package/src/tool/drillCalculator/bibliography.ts +12 -0
- package/src/tool/drillCalculator/i18n/de.ts +2 -5
- package/src/tool/drillCalculator/i18n/en.ts +2 -5
- package/src/tool/drillCalculator/i18n/es.ts +2 -5
- package/src/tool/drillCalculator/i18n/fr.ts +2 -5
- package/src/tool/drillCalculator/i18n/id.ts +2 -5
- package/src/tool/drillCalculator/i18n/it.ts +2 -5
- package/src/tool/drillCalculator/i18n/ja.ts +2 -5
- package/src/tool/drillCalculator/i18n/ko.ts +2 -5
- package/src/tool/drillCalculator/i18n/nl.ts +2 -5
- package/src/tool/drillCalculator/i18n/pl.ts +2 -5
- package/src/tool/drillCalculator/i18n/pt.ts +2 -5
- package/src/tool/drillCalculator/i18n/ru.ts +2 -5
- package/src/tool/drillCalculator/i18n/sv.ts +2 -5
- package/src/tool/drillCalculator/i18n/tr.ts +2 -5
- package/src/tool/drillCalculator/i18n/zh.ts +2 -5
- package/src/tool/drillCalculator/seo.astro +2 -1
- package/src/tool/drillSharpener/bibliography.astro +2 -9
- package/src/tool/drillSharpener/bibliography.ts +16 -0
- package/src/tool/drillSharpener/i18n/de.ts +2 -5
- package/src/tool/drillSharpener/i18n/en.ts +2 -6
- package/src/tool/drillSharpener/i18n/es.ts +2 -6
- package/src/tool/drillSharpener/i18n/fr.ts +2 -6
- package/src/tool/drillSharpener/i18n/id.ts +2 -5
- package/src/tool/drillSharpener/i18n/it.ts +2 -5
- package/src/tool/drillSharpener/i18n/ja.ts +2 -5
- package/src/tool/drillSharpener/i18n/ko.ts +2 -5
- package/src/tool/drillSharpener/i18n/nl.ts +2 -5
- package/src/tool/drillSharpener/i18n/pl.ts +2 -5
- package/src/tool/drillSharpener/i18n/pt.ts +2 -5
- package/src/tool/drillSharpener/i18n/ru.ts +2 -5
- package/src/tool/drillSharpener/i18n/sv.ts +2 -5
- package/src/tool/drillSharpener/i18n/tr.ts +2 -5
- package/src/tool/drillSharpener/i18n/zh.ts +2 -5
- package/src/tool/drillSharpener/seo.astro +2 -1
- package/src/tool/epoxyCalculator/bibliography.astro +2 -10
- package/src/tool/epoxyCalculator/bibliography.ts +20 -0
- package/src/tool/epoxyCalculator/i18n/de.ts +2 -5
- package/src/tool/epoxyCalculator/i18n/en.ts +2 -19
- package/src/tool/epoxyCalculator/i18n/es.ts +2 -19
- package/src/tool/epoxyCalculator/i18n/fr.ts +2 -19
- package/src/tool/epoxyCalculator/i18n/id.ts +2 -5
- package/src/tool/epoxyCalculator/i18n/it.ts +2 -5
- package/src/tool/epoxyCalculator/i18n/ja.ts +2 -5
- package/src/tool/epoxyCalculator/i18n/ko.ts +2 -5
- package/src/tool/epoxyCalculator/i18n/nl.ts +2 -5
- package/src/tool/epoxyCalculator/i18n/pl.ts +2 -5
- package/src/tool/epoxyCalculator/i18n/pt.ts +2 -5
- package/src/tool/epoxyCalculator/i18n/ru.ts +2 -5
- package/src/tool/epoxyCalculator/i18n/sv.ts +2 -5
- package/src/tool/epoxyCalculator/i18n/tr.ts +2 -5
- package/src/tool/epoxyCalculator/i18n/zh.ts +2 -5
- package/src/tool/epoxyCalculator/seo.astro +1 -1
- package/src/tool/furnitureFit/bibliography.astro +2 -9
- package/src/tool/furnitureFit/bibliography.ts +12 -0
- package/src/tool/furnitureFit/i18n/de.ts +2 -5
- package/src/tool/furnitureFit/i18n/en.ts +2 -5
- package/src/tool/furnitureFit/i18n/es.ts +2 -5
- package/src/tool/furnitureFit/i18n/fr.ts +2 -5
- package/src/tool/furnitureFit/i18n/id.ts +2 -5
- package/src/tool/furnitureFit/i18n/it.ts +2 -5
- package/src/tool/furnitureFit/i18n/ja.ts +2 -5
- package/src/tool/furnitureFit/i18n/ko.ts +2 -5
- package/src/tool/furnitureFit/i18n/nl.ts +2 -5
- package/src/tool/furnitureFit/i18n/pl.ts +2 -5
- package/src/tool/furnitureFit/i18n/pt.ts +2 -5
- package/src/tool/furnitureFit/i18n/ru.ts +2 -5
- package/src/tool/furnitureFit/i18n/sv.ts +2 -5
- package/src/tool/furnitureFit/i18n/tr.ts +2 -5
- package/src/tool/furnitureFit/i18n/zh.ts +2 -5
- package/src/tool/furnitureFit/seo.astro +2 -1
- package/src/tool/mortarCalculator/bibliography.astro +2 -9
- package/src/tool/mortarCalculator/bibliography.ts +20 -0
- package/src/tool/mortarCalculator/i18n/de.ts +2 -5
- package/src/tool/mortarCalculator/i18n/en.ts +2 -19
- package/src/tool/mortarCalculator/i18n/es.ts +2 -19
- package/src/tool/mortarCalculator/i18n/fr.ts +2 -19
- package/src/tool/mortarCalculator/i18n/id.ts +2 -5
- package/src/tool/mortarCalculator/i18n/it.ts +2 -5
- package/src/tool/mortarCalculator/i18n/ja.ts +2 -5
- package/src/tool/mortarCalculator/i18n/ko.ts +2 -5
- package/src/tool/mortarCalculator/i18n/nl.ts +2 -5
- package/src/tool/mortarCalculator/i18n/pl.ts +2 -5
- package/src/tool/mortarCalculator/i18n/pt.ts +2 -5
- package/src/tool/mortarCalculator/i18n/ru.ts +2 -5
- package/src/tool/mortarCalculator/i18n/sv.ts +2 -5
- package/src/tool/mortarCalculator/i18n/tr.ts +2 -5
- package/src/tool/mortarCalculator/i18n/zh.ts +2 -5
- package/src/tool/mortarCalculator/seo.astro +2 -1
- package/src/tool/passepartoutCalculator/bibliography.astro +2 -9
- package/src/tool/passepartoutCalculator/bibliography.ts +16 -0
- package/src/tool/passepartoutCalculator/i18n/de.ts +2 -6
- package/src/tool/passepartoutCalculator/i18n/en.ts +2 -15
- package/src/tool/passepartoutCalculator/i18n/es.ts +2 -15
- package/src/tool/passepartoutCalculator/i18n/fr.ts +2 -15
- package/src/tool/passepartoutCalculator/i18n/id.ts +2 -6
- package/src/tool/passepartoutCalculator/i18n/it.ts +2 -6
- package/src/tool/passepartoutCalculator/i18n/ja.ts +2 -6
- package/src/tool/passepartoutCalculator/i18n/ko.ts +2 -6
- package/src/tool/passepartoutCalculator/i18n/nl.ts +2 -6
- package/src/tool/passepartoutCalculator/i18n/pl.ts +2 -6
- package/src/tool/passepartoutCalculator/i18n/pt.ts +2 -6
- package/src/tool/passepartoutCalculator/i18n/ru.ts +2 -6
- package/src/tool/passepartoutCalculator/i18n/sv.ts +2 -6
- package/src/tool/passepartoutCalculator/i18n/tr.ts +2 -6
- package/src/tool/passepartoutCalculator/i18n/zh.ts +2 -6
- package/src/tool/passepartoutCalculator/seo.astro +2 -1
- package/src/tool/stairCalculator/bibliography.astro +2 -9
- package/src/tool/stairCalculator/bibliography.ts +16 -0
- package/src/tool/stairCalculator/i18n/de.ts +2 -5
- package/src/tool/stairCalculator/i18n/en.ts +2 -6
- package/src/tool/stairCalculator/i18n/es.ts +2 -6
- package/src/tool/stairCalculator/i18n/fr.ts +2 -6
- package/src/tool/stairCalculator/i18n/id.ts +2 -5
- package/src/tool/stairCalculator/i18n/it.ts +2 -5
- package/src/tool/stairCalculator/i18n/ja.ts +2 -5
- package/src/tool/stairCalculator/i18n/ko.ts +2 -5
- package/src/tool/stairCalculator/i18n/nl.ts +2 -5
- package/src/tool/stairCalculator/i18n/pl.ts +2 -5
- package/src/tool/stairCalculator/i18n/pt.ts +2 -5
- package/src/tool/stairCalculator/i18n/ru.ts +2 -5
- package/src/tool/stairCalculator/i18n/sv.ts +2 -5
- package/src/tool/stairCalculator/i18n/tr.ts +2 -5
- package/src/tool/stairCalculator/i18n/zh.ts +2 -5
- package/src/tool/stairCalculator/seo.astro +2 -1
- package/src/tool/thermalExpansionCalculator/bibliography.astro +2 -9
- package/src/tool/thermalExpansionCalculator/bibliography.ts +16 -0
- package/src/tool/thermalExpansionCalculator/i18n/de.ts +2 -6
- package/src/tool/thermalExpansionCalculator/i18n/en.ts +2 -6
- package/src/tool/thermalExpansionCalculator/i18n/es.ts +2 -6
- package/src/tool/thermalExpansionCalculator/i18n/fr.ts +2 -6
- package/src/tool/thermalExpansionCalculator/i18n/id.ts +2 -6
- package/src/tool/thermalExpansionCalculator/i18n/it.ts +2 -6
- package/src/tool/thermalExpansionCalculator/i18n/ja.ts +2 -6
- package/src/tool/thermalExpansionCalculator/i18n/ko.ts +2 -6
- package/src/tool/thermalExpansionCalculator/i18n/nl.ts +2 -6
- package/src/tool/thermalExpansionCalculator/i18n/pl.ts +2 -6
- package/src/tool/thermalExpansionCalculator/i18n/pt.ts +2 -6
- package/src/tool/thermalExpansionCalculator/i18n/ru.ts +2 -6
- package/src/tool/thermalExpansionCalculator/i18n/sv.ts +2 -6
- package/src/tool/thermalExpansionCalculator/i18n/tr.ts +2 -6
- package/src/tool/thermalExpansionCalculator/i18n/zh.ts +2 -6
- package/src/tool/thermalExpansionCalculator/seo.astro +2 -1
- package/src/tool/voltageDropCalculator/bibliography.astro +2 -9
- package/src/tool/voltageDropCalculator/bibliography.ts +16 -0
- package/src/tool/voltageDropCalculator/i18n/de.ts +2 -5
- package/src/tool/voltageDropCalculator/i18n/en.ts +2 -6
- package/src/tool/voltageDropCalculator/i18n/es.ts +2 -6
- package/src/tool/voltageDropCalculator/i18n/fr.ts +2 -6
- package/src/tool/voltageDropCalculator/i18n/id.ts +2 -5
- package/src/tool/voltageDropCalculator/i18n/it.ts +2 -5
- package/src/tool/voltageDropCalculator/i18n/ja.ts +2 -5
- package/src/tool/voltageDropCalculator/i18n/ko.ts +2 -5
- package/src/tool/voltageDropCalculator/i18n/nl.ts +2 -5
- package/src/tool/voltageDropCalculator/i18n/pl.ts +2 -5
- package/src/tool/voltageDropCalculator/i18n/pt.ts +2 -5
- package/src/tool/voltageDropCalculator/i18n/ru.ts +2 -5
- package/src/tool/voltageDropCalculator/i18n/sv.ts +2 -5
- package/src/tool/voltageDropCalculator/i18n/tr.ts +2 -5
- package/src/tool/voltageDropCalculator/i18n/zh.ts +2 -5
- package/src/tool/voltageDropCalculator/seo.astro +2 -1
- package/src/tool/workshopFractionConverter/bibliography.astro +6 -0
- package/src/tool/workshopFractionConverter/bibliography.ts +12 -0
- package/src/tool/workshopFractionConverter/client.ts +183 -0
- package/src/tool/workshopFractionConverter/component.astro +226 -0
- package/src/tool/workshopFractionConverter/converter.ts +110 -0
- package/src/tool/workshopFractionConverter/engine.ts +223 -0
- package/src/tool/workshopFractionConverter/entry.ts +24 -0
- package/src/tool/workshopFractionConverter/i18n/de.ts +147 -0
- package/src/tool/workshopFractionConverter/i18n/en.ts +147 -0
- package/src/tool/workshopFractionConverter/i18n/es.ts +147 -0
- package/src/tool/workshopFractionConverter/i18n/fr.ts +147 -0
- package/src/tool/workshopFractionConverter/i18n/id.ts +147 -0
- package/src/tool/workshopFractionConverter/i18n/it.ts +147 -0
- package/src/tool/workshopFractionConverter/i18n/ja.ts +147 -0
- package/src/tool/workshopFractionConverter/i18n/ko.ts +147 -0
- package/src/tool/workshopFractionConverter/i18n/nl.ts +147 -0
- package/src/tool/workshopFractionConverter/i18n/pl.ts +147 -0
- package/src/tool/workshopFractionConverter/i18n/pt.ts +147 -0
- package/src/tool/workshopFractionConverter/i18n/ru.ts +147 -0
- package/src/tool/workshopFractionConverter/i18n/sv.ts +147 -0
- package/src/tool/workshopFractionConverter/i18n/tr.ts +147 -0
- package/src/tool/workshopFractionConverter/i18n/zh.ts +147 -0
- package/src/tool/workshopFractionConverter/index.ts +11 -0
- package/src/tool/workshopFractionConverter/seo.astro +15 -0
- package/src/tool/workshopFractionConverter/types-client.ts +89 -0
- package/src/tool/workshopFractionConverter/ui-updater.ts +94 -0
- package/src/tool/workshopFractionConverter/ui.ts +38 -0
- package/src/tool/workshopFractionConverter/workshop-fraction-converter.css +563 -0
- package/src/tools.ts +2 -1
- package/src/types.ts +1 -1
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import type { WithContext, FAQPage, HowToThing, SoftwareApplication } from 'schema-dts';
|
|
2
|
+
import type { ToolLocaleContent } from '../../../types';
|
|
3
|
+
import type { WorkshopFractionConverterUI } from '../ui';
|
|
4
|
+
import { bibliography } from '../bibliography';
|
|
5
|
+
|
|
6
|
+
const slug = 'workshop-fraction-converter';
|
|
7
|
+
const title = '车间分数转公制转换器';
|
|
8
|
+
const description = '瞬间将分数英寸转换为毫米。为您的车间寻找最接近的标准螺栓、螺钉和套筒。专为沾满油污的手和戴手套的手指设计。';
|
|
9
|
+
|
|
10
|
+
const faqData = [
|
|
11
|
+
{
|
|
12
|
+
question: '为什么我需要将分数转换为毫米?',
|
|
13
|
+
answer: '大多数现代工具和紧固件使用公制,但许多老式工具和规格仍在使用分数英寸。此转换器弥合了这一差距,帮助您找到精确的公制对应值或最接近的标准紧固件尺寸。',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
question: '1/2 英寸和 12.7 毫米有什么区别?',
|
|
17
|
+
answer: '1/2 英寸正好等于 12.7 毫米 (0.5 × 25.4 = 12.7)。在标准尺寸下,由于制造商在两个系统中统一了常见的紧固件尺寸,公制和英制工具通常可以互换使用。',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
question: '为什么工具显示“最接近的紧固件”?',
|
|
21
|
+
answer: '因为精确转换的结果通常介于标准紧固件尺寸之间。该工具会找到与您的测量值最接近的市售螺栓或套筒,以便您可以使用车间中的现有材料。',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
question: '木工精度和金属精度有什么区别?',
|
|
25
|
+
answer: '在木工中,0.5 毫米的差异通常可以忽略不计。在金属加工和机械加工中,0.1 毫米至关重要。精度模式会提示适合您材料的容差范围。',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
question: '我可以离线使用这个工具吗?',
|
|
29
|
+
answer: '可以。所有计算都在您的浏览器中进行。初次加载后,该工具可完全离线运行,非常适合在没有 WiFi 的车间使用。',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
question: '为什么工具包含历史记录?',
|
|
33
|
+
answer: '在拆卸或处理包含多个零件的项目时,历史记录让您可以查阅测量值而无需重新输入,并帮助您在工作时建立零件清单。',
|
|
34
|
+
},
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
const howToData = [
|
|
38
|
+
{
|
|
39
|
+
name: '选择测量类型',
|
|
40
|
+
text: '选择“正向”将分数转换为毫米,或选择“反向”为您用卡尺测得的数值寻找分数。',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: '输入数值',
|
|
44
|
+
text: '使用三列输入(整数、分子、分母)或点击快速预设按钮。步进按钮让您无需键入即可进行调整。',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: '查看结果',
|
|
48
|
+
text: '结果显示精确转换值以及最接近的标准螺栓和套筒尺寸。视觉比例尺让您对比例有直观感受。',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: '保存到历史记录',
|
|
52
|
+
text: '点击“保存到历史记录”以保留测量值供以后参考。历史记录会保存在您的浏览器中,即使关闭后也是如此。',
|
|
53
|
+
},
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
const faqSchema: WithContext<FAQPage> = {
|
|
57
|
+
'@context': 'https://schema.org',
|
|
58
|
+
'@type': 'FAQPage',
|
|
59
|
+
mainEntity: faqData.map((item) => ({
|
|
60
|
+
'@type': 'Question',
|
|
61
|
+
name: item.question,
|
|
62
|
+
acceptedAnswer: { '@type': 'Answer', text: item.answer },
|
|
63
|
+
})),
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const howToSchema: WithContext<HowToThing> = {
|
|
67
|
+
'@context': 'https://schema.org',
|
|
68
|
+
'@type': 'HowTo',
|
|
69
|
+
name: title,
|
|
70
|
+
description,
|
|
71
|
+
step: howToData.map((step, i) => ({
|
|
72
|
+
'@type': 'HowToStep',
|
|
73
|
+
position: i + 1,
|
|
74
|
+
name: step.name,
|
|
75
|
+
text: step.text,
|
|
76
|
+
})),
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const appSchema: WithContext<SoftwareApplication> = {
|
|
80
|
+
'@context': 'https://schema.org',
|
|
81
|
+
'@type': 'SoftwareApplication',
|
|
82
|
+
name: title,
|
|
83
|
+
description,
|
|
84
|
+
applicationCategory: 'UtilityApplication',
|
|
85
|
+
operatingSystem: 'All',
|
|
86
|
+
offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
|
|
87
|
+
inLanguage: 'zh',
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export const content: ToolLocaleContent<WorkshopFractionConverterUI> = {
|
|
91
|
+
slug,
|
|
92
|
+
title,
|
|
93
|
+
description,
|
|
94
|
+
faqTitle: '常见问题',
|
|
95
|
+
faq: faqData,
|
|
96
|
+
bibliography,
|
|
97
|
+
howTo: howToData,
|
|
98
|
+
schemas: [faqSchema, howToSchema, appSchema],
|
|
99
|
+
seo: [
|
|
100
|
+
{ type: 'title', text: '为什么车间中的精密分数转换至关重要', level: 2 },
|
|
101
|
+
{ type: 'paragraph', html: '在专业或高要求的 DIY 车间中,“大约”的测量值往往会导致螺栓滑丝、接头松动或组装失败。本工具旨在弥补传统英制测量与公制系统精度之间的差距,确保您的车间项目保持专业级标准。' },
|
|
102
|
+
{ type: 'title', text: '标准转换:1/2" 与 12.7mm 的对比', level: 3 },
|
|
103
|
+
{ type: 'card', icon: 'mdi:ruler-square', title: '公制和英制系统可以互换吗?', html: '<p>许多人认为可以。虽然 1/2" 恰好是 12.7mm,但最接近的标准公制套筒是 13mm。使用错误的工具可能会磨圆螺栓头。我们的转换器会识别<strong>最接近的标准工具匹配</strong>,确保您永远不会损坏硬件。</p>' },
|
|
104
|
+
{ type: 'title', text: '木工与金属加工的公差', level: 3 },
|
|
105
|
+
{ type: 'paragraph', html: '公差要求因行业而异。在<strong>木工</strong>中,1/64" (0.4mm) 的公差通常是可以接受的。在<strong>金属加工和机械加工</strong>中,0.1mm 甚至 0.01mm 都至关重要。我们的工具包含精度模式,帮助您决定哪种标准紧固件最适合您的特定材料。' },
|
|
106
|
+
{ type: 'title', text: '准确测量的 3 个基本技巧', level: 3 },
|
|
107
|
+
{ type: 'paragraph', html: '<strong>1. 使用卡尺:</strong> 进行反向查询时,务必使用数显卡尺以获得最准确的毫米输入。<strong>2. 检查磨损:</strong> 旧套筒和螺栓的边缘可能已经磨损,这使得“最接近匹配”变得更加关键。<strong>3. 核对螺距:</strong> 请记住,即使头部尺寸匹配,螺距(公制与英制)也总是不同的。' },
|
|
108
|
+
],
|
|
109
|
+
ui: {
|
|
110
|
+
labelFraction: '测量类型',
|
|
111
|
+
labelWhole: '整数',
|
|
112
|
+
labelNumerator: '分子',
|
|
113
|
+
labelDenominator: '分母',
|
|
114
|
+
labelInches: '英寸',
|
|
115
|
+
labelMillimeters: '毫米',
|
|
116
|
+
resultTitle: '转换结果',
|
|
117
|
+
resultFraction: '分数',
|
|
118
|
+
resultInches: '英寸',
|
|
119
|
+
resultMillimeters: '毫米',
|
|
120
|
+
matchTitle: '最接近的标准规格',
|
|
121
|
+
matchClosestFastener: '标准螺栓或紧固件尺寸',
|
|
122
|
+
matchClosestSocket: '标准套筒或扳手尺寸',
|
|
123
|
+
matchDifference: '与测量值的差异',
|
|
124
|
+
matchRecommendation: '如果有,请使用此尺寸',
|
|
125
|
+
reverseSearchTitle: '反向搜索',
|
|
126
|
+
reverseSearchLabel: '测量尺寸 (毫米)',
|
|
127
|
+
reverseSearchButton: '寻找分数',
|
|
128
|
+
reverseSearchHint: '用卡尺测量并输入数值',
|
|
129
|
+
unitMm: '毫米',
|
|
130
|
+
unitInch: '英寸',
|
|
131
|
+
modeForward: '分数 → 公制',
|
|
132
|
+
modeReverse: '公制 → 分数',
|
|
133
|
+
precisionLabel: '精度模式',
|
|
134
|
+
precisionCarpentry: '木工',
|
|
135
|
+
precisionMetal: '金属加工',
|
|
136
|
+
buttonConvert: '转换',
|
|
137
|
+
buttonClear: '清除',
|
|
138
|
+
buttonCopyResult: '复制结果',
|
|
139
|
+
buttonSaveToHistory: '保存到历史记录',
|
|
140
|
+
historyTitle: '历史记录',
|
|
141
|
+
historyEmpty: '尚无测量记录',
|
|
142
|
+
historyRemove: '移除',
|
|
143
|
+
helpText: '选择测量值或输入分数以开始。',
|
|
144
|
+
toolOverline: '车间工具',
|
|
145
|
+
labelVisualReference: '视觉参考 (1 英寸 = 96 像素)',
|
|
146
|
+
},
|
|
147
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ToolDefinition } from '../../types';
|
|
2
|
+
import { workshopFractionConverter } from './entry';
|
|
3
|
+
export * from './entry';
|
|
4
|
+
export const WORKSHOP_FRACTION_CONVERTER_TOOL: ToolDefinition = {
|
|
5
|
+
entry: workshopFractionConverter,
|
|
6
|
+
Component: () => import('./component.astro'),
|
|
7
|
+
SEOComponent: () => import('./seo.astro'),
|
|
8
|
+
BibliographyComponent: () => import('./bibliography.astro'),
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export type { WorkshopFractionConverterUI } from './ui';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { SEORenderer } from '@jjlmoya/utils-shared';
|
|
3
|
+
import { workshopFractionConverter } from './index';
|
|
4
|
+
import type { KnownLocale } from '../../types';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
locale?: KnownLocale;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const { locale = 'es' } = Astro.props;
|
|
11
|
+
const content = await workshopFractionConverter.i18n[locale]?.();
|
|
12
|
+
if (!content) return null;
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
{content.seo?.length > 0 && <SEORenderer content={{ locale, sections: content.seo }} />}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
export interface Fraction {
|
|
2
|
+
whole: number;
|
|
3
|
+
numerator: number;
|
|
4
|
+
denominator: number;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface ConversionResult {
|
|
8
|
+
fraction: Fraction;
|
|
9
|
+
inches: number;
|
|
10
|
+
millimeters: number;
|
|
11
|
+
closestFastener: Match | null;
|
|
12
|
+
closestSocket: Match | null;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface Match {
|
|
16
|
+
name: string;
|
|
17
|
+
size_mm: number;
|
|
18
|
+
size_inch: string;
|
|
19
|
+
difference_mm: number;
|
|
20
|
+
difference_pct: number;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface ReverseSearchResult {
|
|
24
|
+
input_mm: number;
|
|
25
|
+
closest_fraction: Fraction;
|
|
26
|
+
inches: number;
|
|
27
|
+
closestFastener: Match | null;
|
|
28
|
+
closestSocket: Match | null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface HistoryEntry {
|
|
32
|
+
fraction: string;
|
|
33
|
+
mm: string;
|
|
34
|
+
time: number;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const STANDARD_FASTENERS = [
|
|
38
|
+
{ name: '#0', inch: '1/80', mm: 0.318 },
|
|
39
|
+
{ name: '#1', inch: '1/73', mm: 0.346 },
|
|
40
|
+
{ name: '#2', inch: '3/32', mm: 2.362 },
|
|
41
|
+
{ name: '#3', inch: '7/64', mm: 2.778 },
|
|
42
|
+
{ name: '#4', inch: '7/64', mm: 2.819 },
|
|
43
|
+
{ name: '#5', inch: '1/8', mm: 3.175 },
|
|
44
|
+
{ name: '#6', inch: '9/64', mm: 3.556 },
|
|
45
|
+
{ name: '#8', inch: '5/32', mm: 4.191 },
|
|
46
|
+
{ name: '#10', inch: '3/16', mm: 4.826 },
|
|
47
|
+
{ name: '#12', inch: '7/32', mm: 5.461 },
|
|
48
|
+
{ name: '1/4"', inch: '1/4', mm: 6.35 },
|
|
49
|
+
{ name: '5/16"', inch: '5/16', mm: 7.938 },
|
|
50
|
+
{ name: '3/8"', inch: '3/8', mm: 9.525 },
|
|
51
|
+
{ name: '7/16"', inch: '7/16', mm: 11.113 },
|
|
52
|
+
{ name: '1/2"', inch: '1/2', mm: 12.7 },
|
|
53
|
+
{ name: '9/16"', inch: '9/16', mm: 14.288 },
|
|
54
|
+
{ name: '5/8"', inch: '5/8', mm: 15.875 },
|
|
55
|
+
{ name: '3/4"', inch: '3/4', mm: 19.05 },
|
|
56
|
+
{ name: '7/8"', inch: '7/8', mm: 22.225 },
|
|
57
|
+
{ name: '1"', inch: '1', mm: 25.4 },
|
|
58
|
+
];
|
|
59
|
+
|
|
60
|
+
export const STANDARD_SOCKETS = [
|
|
61
|
+
{ name: '4mm', mm: 4.0, inch: '5/32' },
|
|
62
|
+
{ name: '4.5mm', mm: 4.5, inch: '3/16' },
|
|
63
|
+
{ name: '5mm', mm: 5.0, inch: '13/64' },
|
|
64
|
+
{ name: '5.5mm', mm: 5.5, inch: '7/32' },
|
|
65
|
+
{ name: '6mm', mm: 6.0, inch: '15/64' },
|
|
66
|
+
{ name: '7mm', mm: 7.0, inch: '9/32' },
|
|
67
|
+
{ name: '8mm', mm: 8.0, inch: '5/16' },
|
|
68
|
+
{ name: '9mm', mm: 9.0, inch: '23/64' },
|
|
69
|
+
{ name: '10mm', mm: 10.0, inch: '3/8' },
|
|
70
|
+
{ name: '11mm', mm: 11.0, inch: '7/16' },
|
|
71
|
+
{ name: '12mm', mm: 12.0, inch: '15/32' },
|
|
72
|
+
{ name: '13mm', mm: 13.0, inch: '1/2' },
|
|
73
|
+
{ name: '14mm', mm: 14.0, inch: '9/16' },
|
|
74
|
+
{ name: '15mm', mm: 15.0, inch: '19/32' },
|
|
75
|
+
{ name: '16mm', mm: 16.0, inch: '5/8' },
|
|
76
|
+
{ name: '17mm', mm: 17.0, inch: '11/16' },
|
|
77
|
+
{ name: '18mm', mm: 18.0, inch: '23/32' },
|
|
78
|
+
{ name: '19mm', mm: 19.0, inch: '3/4' },
|
|
79
|
+
{ name: '20mm', mm: 20.0, inch: '13/16' },
|
|
80
|
+
{ name: '1/4" socket', mm: 6.35, inch: '1/4' },
|
|
81
|
+
{ name: '5/16" socket', mm: 7.938, inch: '5/16' },
|
|
82
|
+
{ name: '3/8" socket', mm: 9.525, inch: '3/8' },
|
|
83
|
+
{ name: '7/16" socket', mm: 11.113, inch: '7/16' },
|
|
84
|
+
{ name: '1/2" socket', mm: 12.7, inch: '1/2' },
|
|
85
|
+
{ name: '9/16" socket', mm: 14.288, inch: '9/16' },
|
|
86
|
+
{ name: '5/8" socket', mm: 15.875, inch: '5/8' },
|
|
87
|
+
{ name: '11/16" socket', mm: 17.463, inch: '11/16' },
|
|
88
|
+
{ name: '3/4" socket', mm: 19.05, inch: '3/4' },
|
|
89
|
+
];
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { ConversionResult, Match, ReverseSearchResult } from './types-client';
|
|
2
|
+
import { formatFraction } from './converter';
|
|
3
|
+
|
|
4
|
+
function getDecimals(precision: string) {
|
|
5
|
+
return precision === 'metal' ? 3 : 1;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
function updateResultDisplay(fractionStr: string, inchesStr: string, mmStr: string) {
|
|
9
|
+
const fractionEl = document.getElementById('wfc-result-fraction');
|
|
10
|
+
if (fractionEl) fractionEl.textContent = fractionStr;
|
|
11
|
+
const inchesEl = document.getElementById('wfc-result-inches');
|
|
12
|
+
if (inchesEl) inchesEl.textContent = inchesStr;
|
|
13
|
+
const mmEl = document.getElementById('wfc-result-mm');
|
|
14
|
+
if (mmEl) mmEl.textContent = mmStr;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function displayResult(result: ConversionResult, precision = 'carpentry', ui: Record<string, string> = {}) {
|
|
18
|
+
document.getElementById('wfc-no-result')?.classList.add('wfc-hidden');
|
|
19
|
+
document.getElementById('wfc-result-content')?.classList.remove('wfc-hidden');
|
|
20
|
+
const decimals = getDecimals(precision);
|
|
21
|
+
const fractionStr = formatFraction(result.fraction);
|
|
22
|
+
const inchesStr = result.inches.toFixed(decimals) + '"';
|
|
23
|
+
const mmStr = result.millimeters.toFixed(decimals) + ' mm';
|
|
24
|
+
updateResultDisplay(fractionStr, inchesStr, mmStr);
|
|
25
|
+
updateVisualScale(result.millimeters);
|
|
26
|
+
if (result.closestFastener) updateFastenerMatch(result.closestFastener, ui);
|
|
27
|
+
if (result.closestSocket) updateSocketMatch(result.closestSocket, ui);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function displayReverseResult(result: ReverseSearchResult, precision = 'carpentry', ui: Record<string, string> = {}) {
|
|
31
|
+
document.getElementById('wfc-no-result')?.classList.add('wfc-hidden');
|
|
32
|
+
document.getElementById('wfc-result-content')?.classList.remove('wfc-hidden');
|
|
33
|
+
const decimals = getDecimals(precision);
|
|
34
|
+
const fractionStr = formatFraction(result.closest_fraction);
|
|
35
|
+
const inchesStr = result.inches.toFixed(decimals) + '"';
|
|
36
|
+
const mmStr = result.input_mm.toFixed(decimals) + ' mm';
|
|
37
|
+
updateResultDisplay(fractionStr, inchesStr, mmStr);
|
|
38
|
+
updateVisualScale(result.input_mm);
|
|
39
|
+
if (result.closestFastener) updateFastenerMatch(result.closestFastener, ui);
|
|
40
|
+
if (result.closestSocket) updateSocketMatch(result.closestSocket, ui);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function updateVisualScale(mm: number) {
|
|
44
|
+
const inchPx = 96;
|
|
45
|
+
const inches = mm / 25.4;
|
|
46
|
+
const width = inches * inchPx;
|
|
47
|
+
const indicator = document.getElementById('wfc-scale-indicator');
|
|
48
|
+
if (indicator) {
|
|
49
|
+
indicator.style.width = Math.min(width, 240) + 'px';
|
|
50
|
+
}
|
|
51
|
+
const scaleText = document.getElementById('wfc-scale-text');
|
|
52
|
+
if (scaleText) {
|
|
53
|
+
scaleText.textContent = mm.toFixed(2) + ' mm (' + inches.toFixed(2) + '")';
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function updateFastenerMatch(match: Match, ui: Record<string, string>) {
|
|
58
|
+
const pct = Math.abs(match.difference_pct).toFixed(1);
|
|
59
|
+
const badge = document.getElementById('wfc-fastener-badge');
|
|
60
|
+
const badgeClass = getBadgeClass(pct);
|
|
61
|
+
if (badge) {
|
|
62
|
+
badge.className = 'wfc-match-badge ' + badgeClass;
|
|
63
|
+
badge.textContent = pct + '%';
|
|
64
|
+
}
|
|
65
|
+
const nameEl = document.getElementById('wfc-fastener-name');
|
|
66
|
+
if (nameEl) nameEl.textContent = match.name;
|
|
67
|
+
const detailsEl = document.getElementById('wfc-fastener-details');
|
|
68
|
+
if (detailsEl) {
|
|
69
|
+
detailsEl.innerHTML = `<strong>${match.size_mm.toFixed(2)} mm</strong> (${match.size_inch})<br/>${ui.matchDifference || 'Difference'}: ${match.difference_mm.toFixed(2)} mm`;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function updateSocketMatch(match: Match, ui: Record<string, string>) {
|
|
74
|
+
const pct = Math.abs(match.difference_pct).toFixed(1);
|
|
75
|
+
const badge = document.getElementById('wfc-socket-badge');
|
|
76
|
+
const badgeClass = getBadgeClass(pct);
|
|
77
|
+
if (badge) {
|
|
78
|
+
badge.className = 'wfc-match-badge ' + badgeClass;
|
|
79
|
+
badge.textContent = pct + '%';
|
|
80
|
+
}
|
|
81
|
+
const nameEl = document.getElementById('wfc-socket-name');
|
|
82
|
+
if (nameEl) nameEl.textContent = match.name;
|
|
83
|
+
const detailsEl = document.getElementById('wfc-socket-details');
|
|
84
|
+
if (detailsEl) {
|
|
85
|
+
detailsEl.innerHTML = `<strong>${match.size_mm.toFixed(2)} mm</strong> (${match.size_inch})<br/>${ui.matchDifference || 'Difference'}: ${match.difference_mm.toFixed(2)} mm`;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function getBadgeClass(pct: string) {
|
|
90
|
+
const numPct = parseFloat(pct);
|
|
91
|
+
if (numPct < 2) return 'tight';
|
|
92
|
+
if (numPct < 5) return '';
|
|
93
|
+
return 'loose';
|
|
94
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export interface WorkshopFractionConverterUI extends Record<string, string> {
|
|
2
|
+
labelFraction: string;
|
|
3
|
+
labelWhole: string;
|
|
4
|
+
labelNumerator: string;
|
|
5
|
+
labelDenominator: string;
|
|
6
|
+
labelInches: string;
|
|
7
|
+
labelMillimeters: string;
|
|
8
|
+
resultTitle: string;
|
|
9
|
+
resultFraction: string;
|
|
10
|
+
resultInches: string;
|
|
11
|
+
resultMillimeters: string;
|
|
12
|
+
matchTitle: string;
|
|
13
|
+
matchClosestFastener: string;
|
|
14
|
+
matchClosestSocket: string;
|
|
15
|
+
matchDifference: string;
|
|
16
|
+
matchRecommendation: string;
|
|
17
|
+
reverseSearchTitle: string;
|
|
18
|
+
reverseSearchLabel: string;
|
|
19
|
+
reverseSearchButton: string;
|
|
20
|
+
reverseSearchHint: string;
|
|
21
|
+
unitMm: string;
|
|
22
|
+
unitInch: string;
|
|
23
|
+
modeForward: string;
|
|
24
|
+
modeReverse: string;
|
|
25
|
+
precisionLabel: string;
|
|
26
|
+
precisionCarpentry: string;
|
|
27
|
+
precisionMetal: string;
|
|
28
|
+
buttonConvert: string;
|
|
29
|
+
buttonClear: string;
|
|
30
|
+
buttonCopyResult: string;
|
|
31
|
+
buttonSaveToHistory: string;
|
|
32
|
+
historyTitle: string;
|
|
33
|
+
historyEmpty: string;
|
|
34
|
+
historyRemove: string;
|
|
35
|
+
helpText: string;
|
|
36
|
+
toolOverline: string;
|
|
37
|
+
labelVisualReference: string;
|
|
38
|
+
}
|