@jjlmoya/utils-developer 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +64 -0
- package/src/category/i18n/en.ts +34 -0
- package/src/category/i18n/es.ts +34 -0
- package/src/category/i18n/fr.ts +34 -0
- package/src/category/index.ts +31 -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 +11 -0
- package/src/env.d.ts +5 -0
- package/src/index.ts +78 -0
- package/src/layouts/PreviewLayout.astro +117 -0
- package/src/pages/[locale]/[slug].astro +146 -0
- package/src/pages/[locale].astro +251 -0
- package/src/pages/index.astro +4 -0
- package/src/tests/css_specificity_logic.test.ts +39 -0
- package/src/tests/faq_count.test.ts +19 -0
- package/src/tests/locale_completeness.test.ts +42 -0
- package/src/tests/mocks/astro_mock.js +2 -0
- package/src/tests/no_h1_in_components.test.ts +48 -0
- package/src/tests/schemas_fulfillment.test.ts +23 -0
- package/src/tests/seo_length.test.ts +22 -0
- package/src/tests/title_quality.test.ts +55 -0
- package/src/tests/tool_validation.test.ts +17 -0
- package/src/tool/aspectRatio/bibliography.astro +14 -0
- package/src/tool/aspectRatio/component.astro +468 -0
- package/src/tool/aspectRatio/i18n/en.ts +177 -0
- package/src/tool/aspectRatio/i18n/es.ts +177 -0
- package/src/tool/aspectRatio/i18n/fr.ts +177 -0
- package/src/tool/aspectRatio/index.ts +34 -0
- package/src/tool/aspectRatio/seo.astro +14 -0
- package/src/tool/aspectRatio/ui.ts +12 -0
- package/src/tool/calculadoraTiempoDatos/bibliography.astro +14 -0
- package/src/tool/calculadoraTiempoDatos/component.astro +829 -0
- package/src/tool/calculadoraTiempoDatos/i18n/en.ts +150 -0
- package/src/tool/calculadoraTiempoDatos/i18n/es.ts +163 -0
- package/src/tool/calculadoraTiempoDatos/i18n/fr.ts +150 -0
- package/src/tool/calculadoraTiempoDatos/index.ts +33 -0
- package/src/tool/calculadoraTiempoDatos/seo.astro +14 -0
- package/src/tool/calculadoraTiempoDatos/ui.ts +24 -0
- package/src/tool/colorConverter/bibliography.astro +14 -0
- package/src/tool/colorConverter/component.astro +504 -0
- package/src/tool/colorConverter/i18n/en.ts +126 -0
- package/src/tool/colorConverter/i18n/es.ts +126 -0
- package/src/tool/colorConverter/i18n/fr.ts +126 -0
- package/src/tool/colorConverter/index.ts +33 -0
- package/src/tool/colorConverter/seo.astro +14 -0
- package/src/tool/colorConverter/ui.ts +16 -0
- package/src/tool/conversorExcelCsvHtml/bibliography.astro +14 -0
- package/src/tool/conversorExcelCsvHtml/component.astro +595 -0
- package/src/tool/conversorExcelCsvHtml/i18n/en.ts +129 -0
- package/src/tool/conversorExcelCsvHtml/i18n/es.ts +129 -0
- package/src/tool/conversorExcelCsvHtml/i18n/fr.ts +129 -0
- package/src/tool/conversorExcelCsvHtml/index.ts +33 -0
- package/src/tool/conversorExcelCsvHtml/seo.astro +14 -0
- package/src/tool/conversorExcelCsvHtml/ui.ts +14 -0
- package/src/tool/cronGenerator/bibliography.astro +14 -0
- package/src/tool/cronGenerator/component.astro +667 -0
- package/src/tool/cronGenerator/i18n/en.ts +191 -0
- package/src/tool/cronGenerator/i18n/es.ts +191 -0
- package/src/tool/cronGenerator/i18n/fr.ts +191 -0
- package/src/tool/cronGenerator/index.ts +34 -0
- package/src/tool/cronGenerator/seo.astro +14 -0
- package/src/tool/cronGenerator/ui.ts +45 -0
- package/src/tool/cssSpecificityCalculator/bibliography.astro +14 -0
- package/src/tool/cssSpecificityCalculator/component.astro +292 -0
- package/src/tool/cssSpecificityCalculator/i18n/en.ts +168 -0
- package/src/tool/cssSpecificityCalculator/i18n/es.ts +168 -0
- package/src/tool/cssSpecificityCalculator/i18n/fr.ts +168 -0
- package/src/tool/cssSpecificityCalculator/index.ts +34 -0
- package/src/tool/cssSpecificityCalculator/logic.ts +100 -0
- package/src/tool/cssSpecificityCalculator/seo.astro +14 -0
- package/src/tool/cssSpecificityCalculator/ui-controller.ts +57 -0
- package/src/tool/cssSpecificityCalculator/ui.ts +11 -0
- package/src/tool/cssToInlineConverter/bibliography.astro +14 -0
- package/src/tool/cssToInlineConverter/component.astro +308 -0
- package/src/tool/cssToInlineConverter/i18n/en.ts +160 -0
- package/src/tool/cssToInlineConverter/i18n/es.ts +160 -0
- package/src/tool/cssToInlineConverter/i18n/fr.ts +160 -0
- package/src/tool/cssToInlineConverter/index.ts +34 -0
- package/src/tool/cssToInlineConverter/seo.astro +14 -0
- package/src/tool/cssToInlineConverter/ui.ts +12 -0
- package/src/tool/duplicateCssRemover/bibliography.astro +14 -0
- package/src/tool/duplicateCssRemover/component.astro +353 -0
- package/src/tool/duplicateCssRemover/i18n/en.ts +167 -0
- package/src/tool/duplicateCssRemover/i18n/es.ts +167 -0
- package/src/tool/duplicateCssRemover/i18n/fr.ts +167 -0
- package/src/tool/duplicateCssRemover/index.ts +34 -0
- package/src/tool/duplicateCssRemover/seo.astro +14 -0
- package/src/tool/duplicateCssRemover/ui.ts +12 -0
- package/src/tool/generadorSecurityTxt/bibliography.astro +14 -0
- package/src/tool/generadorSecurityTxt/component.astro +473 -0
- package/src/tool/generadorSecurityTxt/i18n/en.ts +173 -0
- package/src/tool/generadorSecurityTxt/i18n/es.ts +173 -0
- package/src/tool/generadorSecurityTxt/i18n/fr.ts +173 -0
- package/src/tool/generadorSecurityTxt/index.ts +33 -0
- package/src/tool/generadorSecurityTxt/seo.astro +14 -0
- package/src/tool/generadorSecurityTxt/ui.ts +27 -0
- package/src/tool/hashGenerator/bibliography.astro +14 -0
- package/src/tool/hashGenerator/component.astro +367 -0
- package/src/tool/hashGenerator/i18n/en.ts +118 -0
- package/src/tool/hashGenerator/i18n/es.ts +118 -0
- package/src/tool/hashGenerator/i18n/fr.ts +118 -0
- package/src/tool/hashGenerator/index.ts +33 -0
- package/src/tool/hashGenerator/md5.ts +138 -0
- package/src/tool/hashGenerator/seo.astro +14 -0
- package/src/tool/hashGenerator/ui.ts +11 -0
- package/src/tool/inspectorCertificadosSsl/bibliography.astro +14 -0
- package/src/tool/inspectorCertificadosSsl/component.astro +580 -0
- package/src/tool/inspectorCertificadosSsl/i18n/en.ts +214 -0
- package/src/tool/inspectorCertificadosSsl/i18n/es.ts +214 -0
- package/src/tool/inspectorCertificadosSsl/i18n/fr.ts +214 -0
- package/src/tool/inspectorCertificadosSsl/index.ts +33 -0
- package/src/tool/inspectorCertificadosSsl/seo.astro +14 -0
- package/src/tool/inspectorCertificadosSsl/ui.ts +29 -0
- package/src/tool/jsonFormatter/bibliography.astro +14 -0
- package/src/tool/jsonFormatter/component.astro +590 -0
- package/src/tool/jsonFormatter/i18n/en.ts +156 -0
- package/src/tool/jsonFormatter/i18n/es.ts +156 -0
- package/src/tool/jsonFormatter/i18n/fr.ts +156 -0
- package/src/tool/jsonFormatter/index.ts +34 -0
- package/src/tool/jsonFormatter/seo.astro +14 -0
- package/src/tool/jsonFormatter/ui.ts +15 -0
- package/src/tool/keycode/bibliography.astro +14 -0
- package/src/tool/keycode/component.astro +540 -0
- package/src/tool/keycode/i18n/en.ts +160 -0
- package/src/tool/keycode/i18n/es.ts +160 -0
- package/src/tool/keycode/i18n/fr.ts +160 -0
- package/src/tool/keycode/index.ts +34 -0
- package/src/tool/keycode/seo.astro +14 -0
- package/src/tool/keycode/ui.ts +10 -0
- package/src/tool/llmCostCalculator/bibliography.astro +14 -0
- package/src/tool/llmCostCalculator/component.astro +488 -0
- package/src/tool/llmCostCalculator/data.ts +99 -0
- package/src/tool/llmCostCalculator/i18n/en.ts +165 -0
- package/src/tool/llmCostCalculator/i18n/es.ts +165 -0
- package/src/tool/llmCostCalculator/i18n/fr.ts +165 -0
- package/src/tool/llmCostCalculator/index.ts +34 -0
- package/src/tool/llmCostCalculator/seo.astro +14 -0
- package/src/tool/llmCostCalculator/ui.ts +11 -0
- package/src/tool/mobileMockupGenerator/app.ts +614 -0
- package/src/tool/mobileMockupGenerator/bibliography.astro +14 -0
- package/src/tool/mobileMockupGenerator/component.astro +1044 -0
- package/src/tool/mobileMockupGenerator/constants.ts +48 -0
- package/src/tool/mobileMockupGenerator/i18n/en.ts +121 -0
- package/src/tool/mobileMockupGenerator/i18n/es.ts +121 -0
- package/src/tool/mobileMockupGenerator/i18n/fr.ts +121 -0
- package/src/tool/mobileMockupGenerator/index.ts +33 -0
- package/src/tool/mobileMockupGenerator/rendering.ts +189 -0
- package/src/tool/mobileMockupGenerator/seo.astro +14 -0
- package/src/tool/mobileMockupGenerator/store.ts +145 -0
- package/src/tool/mobileMockupGenerator/types.ts +41 -0
- package/src/tool/mobileMockupGenerator/ui.ts +48 -0
- package/src/tool/musicalTypography/bibliography.astro +14 -0
- package/src/tool/musicalTypography/component.astro +480 -0
- package/src/tool/musicalTypography/i18n/en.ts +179 -0
- package/src/tool/musicalTypography/i18n/es.ts +179 -0
- package/src/tool/musicalTypography/i18n/fr.ts +179 -0
- package/src/tool/musicalTypography/index.ts +33 -0
- package/src/tool/musicalTypography/seo.astro +14 -0
- package/src/tool/musicalTypography/ui.ts +25 -0
- package/src/tool/placeholderGenerator/bibliography.astro +14 -0
- package/src/tool/placeholderGenerator/component.astro +499 -0
- package/src/tool/placeholderGenerator/i18n/en.ts +176 -0
- package/src/tool/placeholderGenerator/i18n/es.ts +176 -0
- package/src/tool/placeholderGenerator/i18n/fr.ts +176 -0
- package/src/tool/placeholderGenerator/index.ts +34 -0
- package/src/tool/placeholderGenerator/seo.astro +14 -0
- package/src/tool/placeholderGenerator/ui.ts +14 -0
- package/src/tool/promptLibrary/bibliography.astro +14 -0
- package/src/tool/promptLibrary/component.astro +1131 -0
- package/src/tool/promptLibrary/controller.ts +49 -0
- package/src/tool/promptLibrary/i18n/en.ts +131 -0
- package/src/tool/promptLibrary/i18n/es.ts +131 -0
- package/src/tool/promptLibrary/i18n/fr.ts +126 -0
- package/src/tool/promptLibrary/index.ts +33 -0
- package/src/tool/promptLibrary/seo.astro +14 -0
- package/src/tool/promptLibrary/ui.ts +29 -0
- package/src/tool/readabilityCalculator/bibliography.astro +14 -0
- package/src/tool/readabilityCalculator/component.astro +534 -0
- package/src/tool/readabilityCalculator/i18n/en.ts +133 -0
- package/src/tool/readabilityCalculator/i18n/es.ts +133 -0
- package/src/tool/readabilityCalculator/i18n/fr.ts +133 -0
- package/src/tool/readabilityCalculator/index.ts +33 -0
- package/src/tool/readabilityCalculator/seo.astro +14 -0
- package/src/tool/readabilityCalculator/ui.ts +27 -0
- package/src/tool/svgSanitizer/bibliography.astro +14 -0
- package/src/tool/svgSanitizer/component.astro +554 -0
- package/src/tool/svgSanitizer/i18n/en.ts +125 -0
- package/src/tool/svgSanitizer/i18n/es.ts +125 -0
- package/src/tool/svgSanitizer/i18n/fr.ts +125 -0
- package/src/tool/svgSanitizer/index.ts +33 -0
- package/src/tool/svgSanitizer/seo.astro +14 -0
- package/src/tool/svgSanitizer/ui.ts +18 -0
- package/src/tool/svgToCss/bibliography.astro +14 -0
- package/src/tool/svgToCss/component.astro +381 -0
- package/src/tool/svgToCss/i18n/en.ts +174 -0
- package/src/tool/svgToCss/i18n/es.ts +174 -0
- package/src/tool/svgToCss/i18n/fr.ts +174 -0
- package/src/tool/svgToCss/index.ts +34 -0
- package/src/tool/svgToCss/seo.astro +14 -0
- package/src/tool/svgToCss/ui.ts +13 -0
- package/src/tool/urlCleaner/bibliography.astro +14 -0
- package/src/tool/urlCleaner/component.astro +458 -0
- package/src/tool/urlCleaner/i18n/en.ts +116 -0
- package/src/tool/urlCleaner/i18n/es.ts +116 -0
- package/src/tool/urlCleaner/i18n/fr.ts +116 -0
- package/src/tool/urlCleaner/index.ts +33 -0
- package/src/tool/urlCleaner/seo.astro +14 -0
- package/src/tool/urlCleaner/ui.ts +12 -0
- package/src/tool/urlEncoderDecoder/bibliography.astro +14 -0
- package/src/tool/urlEncoderDecoder/component.astro +291 -0
- package/src/tool/urlEncoderDecoder/i18n/en.ts +162 -0
- package/src/tool/urlEncoderDecoder/i18n/es.ts +162 -0
- package/src/tool/urlEncoderDecoder/i18n/fr.ts +162 -0
- package/src/tool/urlEncoderDecoder/index.ts +34 -0
- package/src/tool/urlEncoderDecoder/seo.astro +14 -0
- package/src/tool/urlEncoderDecoder/ui.ts +11 -0
- package/src/tool/utmGenerator/bibliography.astro +14 -0
- package/src/tool/utmGenerator/component.astro +270 -0
- package/src/tool/utmGenerator/i18n/en.ts +117 -0
- package/src/tool/utmGenerator/i18n/es.ts +117 -0
- package/src/tool/utmGenerator/i18n/fr.ts +117 -0
- package/src/tool/utmGenerator/index.ts +33 -0
- package/src/tool/utmGenerator/seo.astro +14 -0
- package/src/tool/utmGenerator/ui.ts +13 -0
- package/src/tools.ts +27 -0
- package/src/types.ts +72 -0
|
@@ -0,0 +1,504 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ColorConverterUI } from './ui';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
ui?: Record<string, unknown>;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const { ui } = Astro.props;
|
|
9
|
+
const t = (ui ?? {}) as ColorConverterUI;
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<div id="cc-root" class="cc-root" data-i18n={JSON.stringify(t)}>
|
|
13
|
+
<div class="cc-container">
|
|
14
|
+
<div class="cc-card cc-left">
|
|
15
|
+
<div class="cc-input-grid">
|
|
16
|
+
<div class="cc-input-group">
|
|
17
|
+
<div class="cc-label-row">
|
|
18
|
+
<label for="cc-hex" class="cc-label">HEX</label>
|
|
19
|
+
<button class="cc-copy-badge" data-target="cc-hex">
|
|
20
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>
|
|
21
|
+
{t.btnCopy}
|
|
22
|
+
</button>
|
|
23
|
+
</div>
|
|
24
|
+
<input type="text" id="cc-hex" class="cc-text-input" placeholder="#FFFFFF" spellcheck="false" />
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<div class="cc-input-group">
|
|
28
|
+
<div class="cc-label-row">
|
|
29
|
+
<label for="cc-rgb" class="cc-label">RGB</label>
|
|
30
|
+
<button class="cc-copy-badge" data-target="cc-rgb">
|
|
31
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>
|
|
32
|
+
{t.btnCopy}
|
|
33
|
+
</button>
|
|
34
|
+
</div>
|
|
35
|
+
<input type="text" id="cc-rgb" class="cc-text-input" placeholder="rgb(255, 255, 255)" spellcheck="false" />
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<div class="cc-input-group">
|
|
39
|
+
<div class="cc-label-row">
|
|
40
|
+
<label for="cc-hsl" class="cc-label">HSL</label>
|
|
41
|
+
<button class="cc-copy-badge" data-target="cc-hsl">
|
|
42
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>
|
|
43
|
+
{t.btnCopy}
|
|
44
|
+
</button>
|
|
45
|
+
</div>
|
|
46
|
+
<input type="text" id="cc-hsl" class="cc-text-input" placeholder="hsl(0, 0%, 100%)" spellcheck="false" />
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
<div class="cc-sliders">
|
|
51
|
+
<div class="cc-slider-group">
|
|
52
|
+
<div class="cc-slider-header">
|
|
53
|
+
<span>{t.labelR}</span>
|
|
54
|
+
<span id="cc-r-val">255</span>
|
|
55
|
+
</div>
|
|
56
|
+
<input type="range" id="cc-r-slider" class="cc-range" min="0" max="255" value="255" />
|
|
57
|
+
</div>
|
|
58
|
+
<div class="cc-slider-group">
|
|
59
|
+
<div class="cc-slider-header">
|
|
60
|
+
<span>{t.labelG}</span>
|
|
61
|
+
<span id="cc-g-val">255</span>
|
|
62
|
+
</div>
|
|
63
|
+
<input type="range" id="cc-g-slider" class="cc-range" min="0" max="255" value="255" />
|
|
64
|
+
</div>
|
|
65
|
+
<div class="cc-slider-group">
|
|
66
|
+
<div class="cc-slider-header">
|
|
67
|
+
<span>{t.labelB}</span>
|
|
68
|
+
<span id="cc-b-val">255</span>
|
|
69
|
+
</div>
|
|
70
|
+
<input type="range" id="cc-b-slider" class="cc-range" min="0" max="255" value="255" />
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
|
|
75
|
+
<div class="cc-card cc-right">
|
|
76
|
+
<div class="cc-preview-section">
|
|
77
|
+
<label class="cc-label">{t.labelPreview}</label>
|
|
78
|
+
<div id="cc-preview" class="cc-main-preview" style="background-color: rgb(99, 102, 241);" title={t.labelPreview}>
|
|
79
|
+
<div class="cc-info-overlay">
|
|
80
|
+
<span id="cc-preview-hex">#6366F1</span>
|
|
81
|
+
<span id="cc-preview-contrast">{t.contrastLabel}: 4.6</span>
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
|
|
86
|
+
<div class="cc-harmony-section">
|
|
87
|
+
<label class="cc-label">{t.labelHarmonies}</label>
|
|
88
|
+
<div class="cc-harmony-grid">
|
|
89
|
+
<div class="cc-harmony-item">
|
|
90
|
+
<div id="cc-comp" class="cc-harmony-color" title={t.clickToCopy}></div>
|
|
91
|
+
<span class="cc-harmony-label">{t.labelComp}</span>
|
|
92
|
+
</div>
|
|
93
|
+
<div class="cc-harmony-item">
|
|
94
|
+
<div id="cc-ana1" class="cc-harmony-color" title={t.clickToCopy}></div>
|
|
95
|
+
<span class="cc-harmony-label">{t.labelAna1}</span>
|
|
96
|
+
</div>
|
|
97
|
+
<div class="cc-harmony-item">
|
|
98
|
+
<div id="cc-ana2" class="cc-harmony-color" title={t.clickToCopy}></div>
|
|
99
|
+
<span class="cc-harmony-label">{t.labelAna2}</span>
|
|
100
|
+
</div>
|
|
101
|
+
<div class="cc-harmony-item">
|
|
102
|
+
<div id="cc-tri1" class="cc-harmony-color" title={t.clickToCopy}></div>
|
|
103
|
+
<span class="cc-harmony-label">{t.labelTri1}</span>
|
|
104
|
+
</div>
|
|
105
|
+
<div class="cc-harmony-item">
|
|
106
|
+
<div id="cc-tri2" class="cc-harmony-color" title={t.clickToCopy}></div>
|
|
107
|
+
<span class="cc-harmony-label">{t.labelTri2}</span>
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
|
|
115
|
+
<style>
|
|
116
|
+
.cc-root {
|
|
117
|
+
width: 100%;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.cc-container {
|
|
121
|
+
display: grid;
|
|
122
|
+
grid-template-columns: 1fr;
|
|
123
|
+
gap: 2rem;
|
|
124
|
+
max-width: 1000px;
|
|
125
|
+
margin: 0 auto;
|
|
126
|
+
padding: 1rem;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
@media (min-width: 1024px) {
|
|
130
|
+
.cc-container {
|
|
131
|
+
grid-template-columns: 1.2fr 0.8fr;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.cc-card {
|
|
136
|
+
background: rgba(255, 255, 255, 0.7);
|
|
137
|
+
backdrop-filter: blur(12px);
|
|
138
|
+
-webkit-backdrop-filter: blur(12px);
|
|
139
|
+
border: 1px solid rgba(255, 255, 255, 0.3);
|
|
140
|
+
border-radius: 1.5rem;
|
|
141
|
+
padding: 2rem;
|
|
142
|
+
display: flex;
|
|
143
|
+
flex-direction: column;
|
|
144
|
+
gap: 1.5rem;
|
|
145
|
+
box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
:global(.theme-dark) .cc-card {
|
|
149
|
+
background: rgba(30, 41, 59, 0.7);
|
|
150
|
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
151
|
+
box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.cc-input-grid {
|
|
155
|
+
display: grid;
|
|
156
|
+
grid-template-columns: 1fr;
|
|
157
|
+
gap: 1.5rem;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.cc-input-group {
|
|
161
|
+
display: flex;
|
|
162
|
+
flex-direction: column;
|
|
163
|
+
gap: 0.75rem;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.cc-label-row {
|
|
167
|
+
display: flex;
|
|
168
|
+
justify-content: space-between;
|
|
169
|
+
align-items: center;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.cc-label {
|
|
173
|
+
font-size: 0.875rem;
|
|
174
|
+
font-weight: 700;
|
|
175
|
+
color: rgb(100, 116, 139);
|
|
176
|
+
text-transform: uppercase;
|
|
177
|
+
letter-spacing: 0.05em;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
:global(.theme-dark) .cc-label {
|
|
181
|
+
color: rgb(148, 163, 184);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.cc-text-input {
|
|
185
|
+
width: 100%;
|
|
186
|
+
background: rgba(248, 250, 252, 0.8);
|
|
187
|
+
border: 1px solid rgb(203, 213, 225);
|
|
188
|
+
border-radius: 0.75rem;
|
|
189
|
+
color: rgb(30, 41, 59);
|
|
190
|
+
padding: 0.75rem 1rem;
|
|
191
|
+
font-size: 1.125rem;
|
|
192
|
+
outline: none;
|
|
193
|
+
transition: all 0.2s ease;
|
|
194
|
+
box-sizing: border-box;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
:global(.theme-dark) .cc-text-input {
|
|
198
|
+
background: rgba(15, 23, 42, 0.5);
|
|
199
|
+
border-color: rgb(51, 65, 85);
|
|
200
|
+
color: rgb(241, 245, 249);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.cc-text-input:focus {
|
|
204
|
+
border-color: rgb(99, 102, 241);
|
|
205
|
+
box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.cc-copy-badge {
|
|
209
|
+
background: rgb(241, 245, 249);
|
|
210
|
+
border: 1px solid rgb(226, 232, 240);
|
|
211
|
+
color: rgb(100, 116, 139);
|
|
212
|
+
padding: 0.25rem 0.75rem;
|
|
213
|
+
border-radius: 2rem;
|
|
214
|
+
font-size: 0.75rem;
|
|
215
|
+
font-weight: 700;
|
|
216
|
+
cursor: pointer;
|
|
217
|
+
display: flex;
|
|
218
|
+
align-items: center;
|
|
219
|
+
gap: 0.375rem;
|
|
220
|
+
transition: all 0.2s ease;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
:global(.theme-dark) .cc-copy-badge {
|
|
224
|
+
background: rgba(255, 255, 255, 0.05);
|
|
225
|
+
border-color: rgba(255, 255, 255, 0.1);
|
|
226
|
+
color: rgb(148, 163, 184);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.cc-copy-badge:hover {
|
|
230
|
+
background: rgb(238, 242, 255);
|
|
231
|
+
border-color: rgb(99, 102, 241);
|
|
232
|
+
color: rgb(79, 70, 229);
|
|
233
|
+
transform: translateY(-1px);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
:global(.theme-dark) .cc-copy-badge:hover {
|
|
237
|
+
background: rgba(99, 102, 241, 0.1);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.cc-copy-badge.cc-copied,
|
|
241
|
+
.cc-copy-badge.cc-copied:hover {
|
|
242
|
+
background: rgb(240, 253, 244);
|
|
243
|
+
border-color: rgb(34, 197, 94);
|
|
244
|
+
color: rgb(22, 163, 74);
|
|
245
|
+
transform: none;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
:global(.theme-dark) .cc-copy-badge.cc-copied,
|
|
249
|
+
:global(.theme-dark) .cc-copy-badge.cc-copied:hover {
|
|
250
|
+
background: rgba(34, 197, 94, 0.1);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.cc-sliders {
|
|
254
|
+
display: flex;
|
|
255
|
+
flex-direction: column;
|
|
256
|
+
gap: 1.25rem;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.cc-slider-group {
|
|
260
|
+
display: flex;
|
|
261
|
+
flex-direction: column;
|
|
262
|
+
gap: 0.5rem;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.cc-slider-header {
|
|
266
|
+
display: flex;
|
|
267
|
+
justify-content: space-between;
|
|
268
|
+
font-size: 0.75rem;
|
|
269
|
+
font-weight: 600;
|
|
270
|
+
color: rgb(148, 163, 184);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.cc-range {
|
|
274
|
+
-webkit-appearance: none;
|
|
275
|
+
appearance: none;
|
|
276
|
+
width: 100%;
|
|
277
|
+
height: 6px;
|
|
278
|
+
background: rgb(226, 232, 240);
|
|
279
|
+
border-radius: 3px;
|
|
280
|
+
outline: none;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
:global(.theme-dark) .cc-range {
|
|
284
|
+
background: rgb(51, 65, 85);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.cc-range::-webkit-slider-thumb {
|
|
288
|
+
-webkit-appearance: none;
|
|
289
|
+
appearance: none;
|
|
290
|
+
width: 18px;
|
|
291
|
+
height: 18px;
|
|
292
|
+
background: rgb(99, 102, 241);
|
|
293
|
+
border-radius: 50%;
|
|
294
|
+
cursor: pointer;
|
|
295
|
+
transition: transform 0.1s ease;
|
|
296
|
+
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.cc-range:active::-webkit-slider-thumb {
|
|
300
|
+
transform: scale(1.2);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.cc-preview-section {
|
|
304
|
+
display: flex;
|
|
305
|
+
flex-direction: column;
|
|
306
|
+
gap: 1rem;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.cc-main-preview {
|
|
310
|
+
width: 100%;
|
|
311
|
+
aspect-ratio: 16/9;
|
|
312
|
+
border-radius: 1.25rem;
|
|
313
|
+
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
|
|
314
|
+
position: relative;
|
|
315
|
+
overflow: hidden;
|
|
316
|
+
transition: background-color 0.2s ease;
|
|
317
|
+
cursor: pointer;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
:global(.theme-dark) .cc-main-preview {
|
|
321
|
+
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.cc-info-overlay {
|
|
325
|
+
position: absolute;
|
|
326
|
+
bottom: 0;
|
|
327
|
+
left: 0;
|
|
328
|
+
right: 0;
|
|
329
|
+
background: rgba(0, 0, 0, 0.3);
|
|
330
|
+
backdrop-filter: blur(8px);
|
|
331
|
+
padding: 1rem;
|
|
332
|
+
color: rgb(255, 255, 255);
|
|
333
|
+
font-weight: 700;
|
|
334
|
+
display: flex;
|
|
335
|
+
justify-content: space-between;
|
|
336
|
+
align-items: center;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
.cc-harmony-section {
|
|
340
|
+
display: flex;
|
|
341
|
+
flex-direction: column;
|
|
342
|
+
gap: 1rem;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
.cc-harmony-grid {
|
|
346
|
+
display: grid;
|
|
347
|
+
grid-template-columns: repeat(5, 1fr);
|
|
348
|
+
gap: 0.75rem;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
.cc-harmony-item {
|
|
352
|
+
display: flex;
|
|
353
|
+
flex-direction: column;
|
|
354
|
+
gap: 0.5rem;
|
|
355
|
+
align-items: center;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.cc-harmony-color {
|
|
359
|
+
width: 100%;
|
|
360
|
+
aspect-ratio: 1;
|
|
361
|
+
border-radius: 0.75rem;
|
|
362
|
+
cursor: pointer;
|
|
363
|
+
transition: transform 0.2s ease;
|
|
364
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
.cc-harmony-color:hover {
|
|
368
|
+
transform: scale(1.08);
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
.cc-harmony-label {
|
|
372
|
+
font-size: 0.6rem;
|
|
373
|
+
font-weight: 700;
|
|
374
|
+
color: rgb(148, 163, 184);
|
|
375
|
+
text-transform: uppercase;
|
|
376
|
+
text-align: center;
|
|
377
|
+
}
|
|
378
|
+
</style>
|
|
379
|
+
|
|
380
|
+
<script>
|
|
381
|
+
import type { ColorConverterUI } from './ui';
|
|
382
|
+
|
|
383
|
+
const root = document.getElementById('cc-root')!;
|
|
384
|
+
const t = JSON.parse(root.dataset.i18n ?? '{}') as ColorConverterUI;
|
|
385
|
+
|
|
386
|
+
const hexInput = document.getElementById('cc-hex') as HTMLInputElement;
|
|
387
|
+
const rgbInput = document.getElementById('cc-rgb') as HTMLInputElement;
|
|
388
|
+
const hslInput = document.getElementById('cc-hsl') as HTMLInputElement;
|
|
389
|
+
const rSlider = document.getElementById('cc-r-slider') as HTMLInputElement;
|
|
390
|
+
const gSlider = document.getElementById('cc-g-slider') as HTMLInputElement;
|
|
391
|
+
const bSlider = document.getElementById('cc-b-slider') as HTMLInputElement;
|
|
392
|
+
const rVal = document.getElementById('cc-r-val') as HTMLElement;
|
|
393
|
+
const gVal = document.getElementById('cc-g-val') as HTMLElement;
|
|
394
|
+
const bVal = document.getElementById('cc-b-val') as HTMLElement;
|
|
395
|
+
const mainPreview = document.getElementById('cc-preview') as HTMLElement;
|
|
396
|
+
const previewHex = document.getElementById('cc-preview-hex') as HTMLElement;
|
|
397
|
+
const previewContrast = document.getElementById('cc-preview-contrast') as HTMLElement;
|
|
398
|
+
|
|
399
|
+
const harmonyEls = {
|
|
400
|
+
comp: document.getElementById('cc-comp') as HTMLElement,
|
|
401
|
+
ana1: document.getElementById('cc-ana1') as HTMLElement,
|
|
402
|
+
ana2: document.getElementById('cc-ana2') as HTMLElement,
|
|
403
|
+
tri1: document.getElementById('cc-tri1') as HTMLElement,
|
|
404
|
+
tri2: document.getElementById('cc-tri2') as HTMLElement,
|
|
405
|
+
};
|
|
406
|
+
|
|
407
|
+
const svgCheck = '<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="rgb(16,185,129)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>';
|
|
408
|
+
|
|
409
|
+
function rgbToHex(r: number, g: number, b: number): string {
|
|
410
|
+
return '#' + [r, g, b].map((x) => x.toString(16).padStart(2, '0')).join('').toUpperCase();
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
function hexToRgb(hex: string): { r: number; g: number; b: number } | null {
|
|
414
|
+
const res = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
415
|
+
return res ? { r: parseInt(res[1], 16), g: parseInt(res[2], 16), b: parseInt(res[3], 16) } : null;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
function getHslParts(r: number, g: number, b: number): { h: number; s: number; l: number } {
|
|
419
|
+
const rn = r / 255; const gn = g / 255; const bn = b / 255;
|
|
420
|
+
const max = Math.max(rn, gn, bn); const min = Math.min(rn, gn, bn);
|
|
421
|
+
let h = 0; let s = 0;
|
|
422
|
+
const l = (max + min) / 2;
|
|
423
|
+
if (max !== min) {
|
|
424
|
+
const d = max - min;
|
|
425
|
+
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
|
426
|
+
if (max === rn) h = (gn - bn) / d + (gn < bn ? 6 : 0);
|
|
427
|
+
else if (max === gn) h = (bn - rn) / d + 2;
|
|
428
|
+
else h = (rn - gn) / d + 4;
|
|
429
|
+
h /= 6;
|
|
430
|
+
}
|
|
431
|
+
return { h: Math.round(h * 360), s: Math.round(s * 100), l: Math.round(l * 100) };
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
function getLuminance(r: number, g: number, b: number): number {
|
|
435
|
+
const lin = (v: number) => { const n = v / 255; return n <= 0.03928 ? n / 12.92 : Math.pow((n + 0.055) / 1.055, 2.4); };
|
|
436
|
+
return lin(r) * 0.2126 + lin(g) * 0.7152 + lin(b) * 0.0722;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
function updateHarmonies(h: number, s: number, l: number): void {
|
|
440
|
+
const pairs: [keyof typeof harmonyEls, number][] = [
|
|
441
|
+
['comp', h + 180], ['ana1', h + 30], ['ana2', h + 330], ['tri1', h + 120], ['tri2', h + 240],
|
|
442
|
+
];
|
|
443
|
+
pairs.forEach(([key, deg]) => {
|
|
444
|
+
const el = harmonyEls[key];
|
|
445
|
+
const color = `hsl(${deg % 360}, ${s}%, ${l}%)`;
|
|
446
|
+
el.style.backgroundColor = color;
|
|
447
|
+
el.dataset.color = color;
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
function updateAll(r: number, g: number, b: number): void {
|
|
452
|
+
const hex = rgbToHex(r, g, b);
|
|
453
|
+
const { h, s, l } = getHslParts(r, g, b);
|
|
454
|
+
hexInput.value = hex;
|
|
455
|
+
rgbInput.value = `rgb(${r}, ${g}, ${b})`;
|
|
456
|
+
hslInput.value = `hsl(${h}, ${s}%, ${l}%)`;
|
|
457
|
+
rSlider.value = r.toString(); gSlider.value = g.toString(); bSlider.value = b.toString();
|
|
458
|
+
rVal.textContent = r.toString(); gVal.textContent = g.toString(); bVal.textContent = b.toString();
|
|
459
|
+
mainPreview.style.backgroundColor = hex;
|
|
460
|
+
previewHex.textContent = hex;
|
|
461
|
+
const contrast = (getLuminance(r, g, b) + 0.05) / 0.05;
|
|
462
|
+
previewContrast.textContent = `${t.contrastLabel}: ${contrast.toFixed(1)}`;
|
|
463
|
+
updateHarmonies(h, s, l);
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
function applyCopy(btn: HTMLElement, text: string): void {
|
|
467
|
+
navigator.clipboard.writeText(text).then(() => {
|
|
468
|
+
const orig = btn.innerHTML;
|
|
469
|
+
btn.innerHTML = `${svgCheck} ${t.btnCopied}`;
|
|
470
|
+
btn.classList.add('cc-copied');
|
|
471
|
+
setTimeout(() => { btn.innerHTML = orig; btn.classList.remove('cc-copied'); }, 2000);
|
|
472
|
+
}).catch(() => { });
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
document.querySelectorAll<HTMLElement>('.cc-copy-badge').forEach((btn) => {
|
|
476
|
+
btn.addEventListener('click', () => {
|
|
477
|
+
const targetId = btn.dataset.target;
|
|
478
|
+
if (!targetId) return;
|
|
479
|
+
const target = document.getElementById(targetId) as HTMLInputElement;
|
|
480
|
+
if (!target) return;
|
|
481
|
+
applyCopy(btn, target.value);
|
|
482
|
+
});
|
|
483
|
+
});
|
|
484
|
+
|
|
485
|
+
mainPreview.addEventListener('click', () => applyCopy(mainPreview, hexInput.value));
|
|
486
|
+
|
|
487
|
+
Object.values(harmonyEls).forEach((el) => {
|
|
488
|
+
el.addEventListener('click', () => {
|
|
489
|
+
const color = el.dataset.color;
|
|
490
|
+
if (color) navigator.clipboard.writeText(color).catch(() => { });
|
|
491
|
+
});
|
|
492
|
+
});
|
|
493
|
+
|
|
494
|
+
hexInput.addEventListener('input', () => {
|
|
495
|
+
const rgb = hexToRgb(hexInput.value);
|
|
496
|
+
if (rgb) updateAll(rgb.r, rgb.g, rgb.b);
|
|
497
|
+
});
|
|
498
|
+
|
|
499
|
+
[rSlider, gSlider, bSlider].forEach((slider) => {
|
|
500
|
+
slider.addEventListener('input', () => updateAll(parseInt(rSlider.value), parseInt(gSlider.value), parseInt(bSlider.value)));
|
|
501
|
+
});
|
|
502
|
+
|
|
503
|
+
updateAll(99, 102, 241);
|
|
504
|
+
</script>
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import type { WithContext, FAQPage, HowToThing, SoftwareApplication } from 'schema-dts';
|
|
2
|
+
import type { ToolLocaleContent } from '../../../types';
|
|
3
|
+
import type { ColorConverterUI } from '../ui';
|
|
4
|
+
|
|
5
|
+
const slug = 'color-converter-rgb-hex-hsl';
|
|
6
|
+
const title = 'Online Color Converter RGB HEX and HSL';
|
|
7
|
+
const description = 'Convert colors between RGB, HEX and HSL instantly. Generate complementary color harmonies and analyze WCAG contrast. 100% client-side and private.';
|
|
8
|
+
|
|
9
|
+
const faqData = [
|
|
10
|
+
{
|
|
11
|
+
question: 'How does the RGB to HEX and HSL color converter work?',
|
|
12
|
+
answer: 'The tool takes Red, Green and Blue (RGB) values and uses mathematical algorithms to convert them to their hexadecimal (HEX) equivalent or Hue, Saturation, Lightness (HSL) values. It also works in reverse.',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
question: 'Why should I use HSL instead of HEX in my designs?',
|
|
16
|
+
answer: 'The HSL format is much more intuitive. It lets you adjust saturation or lightness without changing the hue, making it far easier to create harmonic palettes or button states (hover, disabled).',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
question: 'What is the relative contrast value?',
|
|
20
|
+
answer: 'It is a metric that indicates the readability of text against a background based on its luminance. High contrast ensures people with visual impairments can read the content, following WCAG accessibility guidelines.',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
question: 'Is it safe to use this online color converter?',
|
|
24
|
+
answer: 'Absolutely. Being 100% client-side, your color data never leaves your computer. All processing happens directly in your browser, guaranteeing privacy and instant performance.',
|
|
25
|
+
},
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
const howToData = [
|
|
29
|
+
{ name: 'Select a Color', text: 'Use the Red, Green and Blue sliders or type a HEX code directly into the text field.' },
|
|
30
|
+
{ name: 'Adjust RGB Channels', text: 'Move the sliders to change the intensity of each channel and see the real-time update.' },
|
|
31
|
+
{ name: 'Copy the Format', text: 'Click the Copy button next to the HEX, RGB or HSL format you need.' },
|
|
32
|
+
{ name: 'Explore Harmonies', text: 'Click on the harmony colors (complementary, analogous, triadic) to copy them to the clipboard.' },
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
const faqSchema: WithContext<FAQPage> = {
|
|
36
|
+
'@context': 'https://schema.org',
|
|
37
|
+
'@type': 'FAQPage',
|
|
38
|
+
mainEntity: faqData.map((item) => ({
|
|
39
|
+
'@type': 'Question',
|
|
40
|
+
name: item.question,
|
|
41
|
+
acceptedAnswer: { '@type': 'Answer', text: item.answer },
|
|
42
|
+
})),
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const howToSchema: WithContext<HowToThing> = {
|
|
46
|
+
'@context': 'https://schema.org',
|
|
47
|
+
'@type': 'HowTo',
|
|
48
|
+
name: title,
|
|
49
|
+
description,
|
|
50
|
+
step: howToData.map((s, i) => ({ '@type': 'HowToStep', position: i + 1, name: s.name, text: s.text })),
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const appSchema: WithContext<SoftwareApplication> = {
|
|
54
|
+
'@context': 'https://schema.org',
|
|
55
|
+
'@type': 'SoftwareApplication',
|
|
56
|
+
name: title,
|
|
57
|
+
description,
|
|
58
|
+
applicationCategory: 'UtilityApplication',
|
|
59
|
+
operatingSystem: 'All',
|
|
60
|
+
offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
|
|
61
|
+
inLanguage: 'en',
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const ui: ColorConverterUI = {
|
|
65
|
+
labelPreview: 'Preview (click to copy HEX)',
|
|
66
|
+
labelHarmonies: 'Color Harmonies',
|
|
67
|
+
labelR: 'Red',
|
|
68
|
+
labelG: 'Green',
|
|
69
|
+
labelB: 'Blue',
|
|
70
|
+
labelComp: 'Comp.',
|
|
71
|
+
labelAna1: 'Analog 1',
|
|
72
|
+
labelAna2: 'Analog 2',
|
|
73
|
+
labelTri1: 'Triad 1',
|
|
74
|
+
labelTri2: 'Triad 2',
|
|
75
|
+
btnCopy: 'Copy',
|
|
76
|
+
btnCopied: 'Copied',
|
|
77
|
+
contrastLabel: 'Contrast',
|
|
78
|
+
clickToCopy: 'Click to copy',
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export const content: ToolLocaleContent<ColorConverterUI> = {
|
|
82
|
+
slug,
|
|
83
|
+
title,
|
|
84
|
+
description,
|
|
85
|
+
ui,
|
|
86
|
+
faqTitle: 'Frequently Asked Questions',
|
|
87
|
+
faq: faqData,
|
|
88
|
+
bibliographyTitle: 'Color and Web Design Resources',
|
|
89
|
+
bibliography: [
|
|
90
|
+
{ name: 'W3C: CSS Color Documentation', url: 'https://www.w3.org/TR/css-color-4/' },
|
|
91
|
+
{ name: 'MDN: HSL Color Model Guide', url: 'https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/hsl' },
|
|
92
|
+
{ name: 'WebAIM: Contrast and Accessibility Guide', url: 'https://webaim.org/resources/contrastchecker/' },
|
|
93
|
+
],
|
|
94
|
+
howTo: howToData,
|
|
95
|
+
schemas: [faqSchema, howToSchema, appSchema],
|
|
96
|
+
seo: [
|
|
97
|
+
{ type: 'title', text: 'RGB to HEX and HSL Color Converter for Developers', level: 2 },
|
|
98
|
+
{
|
|
99
|
+
type: 'paragraph',
|
|
100
|
+
html: 'In the world of <strong>frontend development</strong> and <strong>UI/UX design</strong>, color management is a constant task. Our <strong>online color converter</strong> lets you transform values between <strong>HEX, RGB and HSL</strong> instantly and with mathematical precision.',
|
|
101
|
+
},
|
|
102
|
+
{ type: 'title', text: 'Color Formats: HEX, RGB and HSL', level: 3 },
|
|
103
|
+
{
|
|
104
|
+
type: 'list',
|
|
105
|
+
items: [
|
|
106
|
+
'<strong>HEX (Hexadecimal):</strong> The de facto standard for CSS. Compact and easy to share in code.',
|
|
107
|
+
'<strong>RGB (Red, Green, Blue):</strong> Based on the additive light system. Ideal for manipulating channels directly or applying transparency with RGBA.',
|
|
108
|
+
'<strong>HSL (Hue, Saturation, Lightness):</strong> The most intuitive format. Adjust hue, saturation and lightness to create harmonic palettes.',
|
|
109
|
+
],
|
|
110
|
+
},
|
|
111
|
+
{ type: 'title', text: 'Contrast and WCAG Accessibility', level: 3 },
|
|
112
|
+
{
|
|
113
|
+
type: 'paragraph',
|
|
114
|
+
html: 'The calculator includes a <strong>relative contrast</strong> measurement based on luminance. This helps you meet <strong>WCAG</strong> guidelines, ensuring your text is readable against selected backgrounds.',
|
|
115
|
+
},
|
|
116
|
+
{ type: 'title', text: 'Automatic Color Harmonies', level: 3 },
|
|
117
|
+
{
|
|
118
|
+
type: 'list',
|
|
119
|
+
items: [
|
|
120
|
+
'<strong>Complementary:</strong> The opposite color on the color wheel, ideal for maximum contrast.',
|
|
121
|
+
'<strong>Analogous:</strong> Adjacent colors that create smooth, harmonic transitions.',
|
|
122
|
+
'<strong>Triadic:</strong> Three equidistant colors for vibrant, balanced compositions.',
|
|
123
|
+
],
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
};
|