@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,468 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { KnownLocale } from '../../types';
|
|
3
|
+
import type { AspectRatioUI } from './ui';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
locale?: KnownLocale;
|
|
7
|
+
ui?: Record<string, unknown>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const { ui } = Astro.props;
|
|
11
|
+
const t = (ui ?? {}) as AspectRatioUI;
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
<div class="arc-container">
|
|
15
|
+
<div class="arc-layout">
|
|
16
|
+
<div class="arc-panel">
|
|
17
|
+
<div class="arc-title-group">
|
|
18
|
+
<div class="arc-icon-box">
|
|
19
|
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
20
|
+
<rect width="18" height="18" x="3" y="3" rx="2"></rect>
|
|
21
|
+
<path d="M21 15V9"></path>
|
|
22
|
+
<path d="M9 21h6"></path>
|
|
23
|
+
</svg>
|
|
24
|
+
</div>
|
|
25
|
+
<h2 class="arc-panel-title">{t.labelConfig}</h2>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<div class="arc-section">
|
|
29
|
+
<span class="arc-section-header">{t.labelRatio}</span>
|
|
30
|
+
<div class="arc-input-grid">
|
|
31
|
+
<div class="arc-field">
|
|
32
|
+
<label class="arc-label" for="arc-ratio-w">{t.labelWidth}</label>
|
|
33
|
+
<input type="number" id="arc-ratio-w" class="arc-input" value="16" min="1" step="0.1" />
|
|
34
|
+
</div>
|
|
35
|
+
<div class="arc-separator">:</div>
|
|
36
|
+
<div class="arc-field">
|
|
37
|
+
<label class="arc-label" for="arc-ratio-h">{t.labelHeight}</label>
|
|
38
|
+
<input type="number" id="arc-ratio-h" class="arc-input" value="9" min="1" step="0.1" />
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<div class="arc-presets">
|
|
43
|
+
<button class="arc-preset-btn" data-w="16" data-h="9">16:9</button>
|
|
44
|
+
<button class="arc-preset-btn" data-w="4" data-h="3">4:3</button>
|
|
45
|
+
<button class="arc-preset-btn" data-w="1" data-h="1">1:1</button>
|
|
46
|
+
<button class="arc-preset-btn" data-w="21" data-h="9">21:9</button>
|
|
47
|
+
<button class="arc-preset-btn" data-w="9" data-h="16">9:16</button>
|
|
48
|
+
<button class="arc-preset-btn" data-w="3" data-h="2">3:2</button>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
<div class="arc-section">
|
|
53
|
+
<span class="arc-section-header">{t.labelScale}</span>
|
|
54
|
+
<div class="arc-input-grid">
|
|
55
|
+
<div class="arc-field">
|
|
56
|
+
<label class="arc-label" for="arc-res-w">{t.labelPixelWidth}</label>
|
|
57
|
+
<input type="number" id="arc-res-w" class="arc-input" value="1920" min="1" />
|
|
58
|
+
</div>
|
|
59
|
+
<div class="arc-separator">×</div>
|
|
60
|
+
<div class="arc-field">
|
|
61
|
+
<label class="arc-label" for="arc-res-h">{t.labelPixelHeight}</label>
|
|
62
|
+
<input type="number" id="arc-res-h" class="arc-input" value="1080" min="1" />
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
<div class="arc-preview-panel">
|
|
69
|
+
<header class="arc-preview-header">
|
|
70
|
+
<div class="arc-preview-title">
|
|
71
|
+
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" style="color: var(--arc-primary)" aria-hidden="true">
|
|
72
|
+
<path d="M15 3h6v6"></path>
|
|
73
|
+
<path d="M9 21H3v-6"></path>
|
|
74
|
+
<path d="M21 3l-7 7"></path>
|
|
75
|
+
<path d="M3 21l7-7"></path>
|
|
76
|
+
</svg>
|
|
77
|
+
{t.labelPreview}
|
|
78
|
+
</div>
|
|
79
|
+
<div id="arc-badge" class="arc-badge">16:9</div>
|
|
80
|
+
</header>
|
|
81
|
+
|
|
82
|
+
<main class="arc-viewport" id="arc-viewport">
|
|
83
|
+
<div id="arc-box" class="arc-box">
|
|
84
|
+
<span id="arc-box-ratio" class="arc-box-ratio">16:9</span>
|
|
85
|
+
<span id="arc-box-res" class="arc-box-res">1920 × 1080px</span>
|
|
86
|
+
</div>
|
|
87
|
+
</main>
|
|
88
|
+
|
|
89
|
+
<footer class="arc-status">
|
|
90
|
+
<div class="arc-status-item">
|
|
91
|
+
<div class="arc-dot"></div>
|
|
92
|
+
<span>{t.labelStatus}</span>
|
|
93
|
+
</div>
|
|
94
|
+
<div class="arc-status-item">
|
|
95
|
+
<span>{t.labelOffline}</span>
|
|
96
|
+
</div>
|
|
97
|
+
</footer>
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
<style>
|
|
103
|
+
.arc-container {
|
|
104
|
+
--arc-primary: #0ea5e9;
|
|
105
|
+
--arc-secondary: #8b5cf6;
|
|
106
|
+
--arc-bg: #f8fafc;
|
|
107
|
+
--arc-card-bg: #fff;
|
|
108
|
+
--arc-text: #0f172a;
|
|
109
|
+
--arc-text-muted: #64748b;
|
|
110
|
+
--arc-border: #e2e8f0;
|
|
111
|
+
--arc-input-bg: #f1f5f9;
|
|
112
|
+
--arc-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
|
|
113
|
+
--arc-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
|
|
114
|
+
--arc-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
|
|
115
|
+
|
|
116
|
+
max-width: 1100px;
|
|
117
|
+
margin: 4rem auto;
|
|
118
|
+
color: var(--arc-text);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
:global(.theme-dark) .arc-container {
|
|
122
|
+
--arc-bg: #0f172a;
|
|
123
|
+
--arc-card-bg: #1e293b;
|
|
124
|
+
--arc-text: #f8fafc;
|
|
125
|
+
--arc-text-muted: #94a3b8;
|
|
126
|
+
--arc-border: #334155;
|
|
127
|
+
--arc-input-bg: #0f172a;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.arc-layout {
|
|
131
|
+
display: grid;
|
|
132
|
+
grid-template-columns: 1fr;
|
|
133
|
+
gap: 2rem;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
@media (min-width: 992px) {
|
|
137
|
+
.arc-layout {
|
|
138
|
+
grid-template-columns: 420px 1fr;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.arc-panel {
|
|
143
|
+
background: var(--arc-card-bg);
|
|
144
|
+
border: 1px solid var(--arc-border);
|
|
145
|
+
border-radius: 1.5rem;
|
|
146
|
+
padding: 2.5rem;
|
|
147
|
+
box-shadow: var(--arc-shadow-lg);
|
|
148
|
+
display: flex;
|
|
149
|
+
flex-direction: column;
|
|
150
|
+
gap: 2.5rem;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.arc-title-group {
|
|
154
|
+
display: flex;
|
|
155
|
+
align-items: center;
|
|
156
|
+
gap: 0.75rem;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.arc-icon-box {
|
|
160
|
+
width: 40px;
|
|
161
|
+
height: 40px;
|
|
162
|
+
background: linear-gradient(135deg, var(--arc-primary), var(--arc-secondary));
|
|
163
|
+
border-radius: 0.75rem;
|
|
164
|
+
display: flex;
|
|
165
|
+
align-items: center;
|
|
166
|
+
justify-content: center;
|
|
167
|
+
color: white;
|
|
168
|
+
box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.arc-panel-title {
|
|
172
|
+
font-size: 1.5rem;
|
|
173
|
+
font-weight: 800;
|
|
174
|
+
margin: 0;
|
|
175
|
+
letter-spacing: -0.025em;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.arc-section {
|
|
179
|
+
display: flex;
|
|
180
|
+
flex-direction: column;
|
|
181
|
+
gap: 1.5rem;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.arc-section-header {
|
|
185
|
+
font-size: 0.875rem;
|
|
186
|
+
font-weight: 700;
|
|
187
|
+
color: var(--arc-primary);
|
|
188
|
+
text-transform: uppercase;
|
|
189
|
+
letter-spacing: 0.1em;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.arc-input-grid {
|
|
193
|
+
display: grid;
|
|
194
|
+
grid-template-columns: 1fr auto 1fr;
|
|
195
|
+
align-items: center;
|
|
196
|
+
gap: 1rem;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.arc-field {
|
|
200
|
+
display: flex;
|
|
201
|
+
flex-direction: column;
|
|
202
|
+
gap: 0.5rem;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.arc-label {
|
|
206
|
+
font-size: 0.75rem;
|
|
207
|
+
font-weight: 600;
|
|
208
|
+
color: var(--arc-text-muted);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.arc-input {
|
|
212
|
+
width: 100%;
|
|
213
|
+
background: var(--arc-input-bg);
|
|
214
|
+
border: 2px solid var(--arc-border);
|
|
215
|
+
border-radius: 1rem;
|
|
216
|
+
padding: 1rem;
|
|
217
|
+
font-size: 1.25rem;
|
|
218
|
+
font-weight: 700;
|
|
219
|
+
color: var(--arc-text);
|
|
220
|
+
text-align: center;
|
|
221
|
+
outline: none;
|
|
222
|
+
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.arc-input:focus {
|
|
226
|
+
border-color: var(--arc-primary);
|
|
227
|
+
background: var(--arc-card-bg);
|
|
228
|
+
box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.arc-separator {
|
|
232
|
+
font-size: 1.5rem;
|
|
233
|
+
font-weight: 900;
|
|
234
|
+
opacity: 0.3;
|
|
235
|
+
padding-top: 1.5rem;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.arc-presets {
|
|
239
|
+
display: grid;
|
|
240
|
+
grid-template-columns: repeat(3, 1fr);
|
|
241
|
+
gap: 0.5rem;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.arc-preset-btn {
|
|
245
|
+
background: var(--arc-input-bg);
|
|
246
|
+
border: 1px solid var(--arc-border);
|
|
247
|
+
border-radius: 0.75rem;
|
|
248
|
+
padding: 0.6rem;
|
|
249
|
+
font-size: 0.75rem;
|
|
250
|
+
font-weight: 700;
|
|
251
|
+
color: var(--arc-text);
|
|
252
|
+
cursor: pointer;
|
|
253
|
+
transition: all 0.2s;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.arc-preset-btn:hover {
|
|
257
|
+
background: var(--arc-primary);
|
|
258
|
+
color: white;
|
|
259
|
+
border-color: var(--arc-primary);
|
|
260
|
+
transform: translateY(-2px);
|
|
261
|
+
box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.arc-preview-panel {
|
|
265
|
+
background: var(--arc-input-bg);
|
|
266
|
+
border: 1px solid var(--arc-border);
|
|
267
|
+
border-radius: 1.5rem;
|
|
268
|
+
display: flex;
|
|
269
|
+
flex-direction: column;
|
|
270
|
+
overflow: hidden;
|
|
271
|
+
position: relative;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.arc-preview-header {
|
|
275
|
+
padding: 1.5rem 2rem;
|
|
276
|
+
background: var(--arc-card-bg);
|
|
277
|
+
border-bottom: 1px solid var(--arc-border);
|
|
278
|
+
display: flex;
|
|
279
|
+
justify-content: space-between;
|
|
280
|
+
align-items: center;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.arc-preview-title {
|
|
284
|
+
font-size: 1rem;
|
|
285
|
+
font-weight: 700;
|
|
286
|
+
display: flex;
|
|
287
|
+
align-items: center;
|
|
288
|
+
gap: 0.5rem;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.arc-badge {
|
|
292
|
+
background: rgba(14, 165, 233, 0.1);
|
|
293
|
+
color: var(--arc-primary);
|
|
294
|
+
padding: 0.25rem 0.75rem;
|
|
295
|
+
border-radius: 2rem;
|
|
296
|
+
font-size: 0.75rem;
|
|
297
|
+
font-weight: 800;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.arc-viewport {
|
|
301
|
+
flex: 1;
|
|
302
|
+
display: flex;
|
|
303
|
+
align-items: center;
|
|
304
|
+
justify-content: center;
|
|
305
|
+
padding: 3rem;
|
|
306
|
+
min-height: 500px;
|
|
307
|
+
background-image: radial-gradient(var(--arc-border) 1px, transparent 1px);
|
|
308
|
+
background-size: 30px 30px;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.arc-box {
|
|
312
|
+
background: linear-gradient(45deg, var(--arc-primary), var(--arc-secondary));
|
|
313
|
+
border-radius: 1rem;
|
|
314
|
+
box-shadow: var(--arc-shadow-lg);
|
|
315
|
+
display: flex;
|
|
316
|
+
flex-direction: column;
|
|
317
|
+
align-items: center;
|
|
318
|
+
justify-content: center;
|
|
319
|
+
color: white;
|
|
320
|
+
transition:
|
|
321
|
+
width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
|
|
322
|
+
height 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
323
|
+
position: relative;
|
|
324
|
+
border: 1px solid rgba(255, 255, 255, 0.2);
|
|
325
|
+
overflow: hidden;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.arc-box::before {
|
|
329
|
+
content: "";
|
|
330
|
+
position: absolute;
|
|
331
|
+
inset: 0;
|
|
332
|
+
background: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.1' fill-rule='evenodd'%3E%3Ccircle cx='3' cy='3' r='3'/%3E%3Ccircle cx='13' cy='13' r='3'/%3E%3C/g%3E%3C/svg%3E");
|
|
333
|
+
opacity: 0.2;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.arc-box-ratio {
|
|
337
|
+
font-size: 2.5rem;
|
|
338
|
+
font-weight: 900;
|
|
339
|
+
text-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
|
|
340
|
+
z-index: 1;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
.arc-box-res {
|
|
344
|
+
font-size: 0.875rem;
|
|
345
|
+
font-weight: 600;
|
|
346
|
+
opacity: 0.9;
|
|
347
|
+
background: rgba(0, 0, 0, 0.2);
|
|
348
|
+
padding: 0.4rem 1rem;
|
|
349
|
+
border-radius: 2rem;
|
|
350
|
+
margin-top: 1rem;
|
|
351
|
+
z-index: 1;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.arc-status {
|
|
355
|
+
position: absolute;
|
|
356
|
+
bottom: 1.5rem;
|
|
357
|
+
left: 1.5rem;
|
|
358
|
+
right: 1.5rem;
|
|
359
|
+
display: flex;
|
|
360
|
+
justify-content: space-between;
|
|
361
|
+
font-size: 0.75rem;
|
|
362
|
+
font-weight: 600;
|
|
363
|
+
color: var(--arc-text-muted);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
.arc-status-item {
|
|
367
|
+
display: flex;
|
|
368
|
+
align-items: center;
|
|
369
|
+
gap: 0.5rem;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
.arc-dot {
|
|
373
|
+
width: 6px;
|
|
374
|
+
height: 6px;
|
|
375
|
+
border-radius: 50%;
|
|
376
|
+
background: var(--arc-primary);
|
|
377
|
+
box-shadow: 0 0 8px var(--arc-primary);
|
|
378
|
+
}
|
|
379
|
+
</style>
|
|
380
|
+
|
|
381
|
+
<script>
|
|
382
|
+
const rwInput = document.getElementById('arc-ratio-w') as HTMLInputElement;
|
|
383
|
+
const rhInput = document.getElementById('arc-ratio-h') as HTMLInputElement;
|
|
384
|
+
const cwInput = document.getElementById('arc-res-w') as HTMLInputElement;
|
|
385
|
+
const chInput = document.getElementById('arc-res-h') as HTMLInputElement;
|
|
386
|
+
const arcBox = document.getElementById('arc-box');
|
|
387
|
+
const arcBoxRatio = document.getElementById('arc-box-ratio');
|
|
388
|
+
const arcBoxRes = document.getElementById('arc-box-res');
|
|
389
|
+
const arcBadge = document.getElementById('arc-badge');
|
|
390
|
+
const viewport = document.getElementById('arc-viewport');
|
|
391
|
+
const presetsBtn = document.querySelectorAll('.arc-preset-btn');
|
|
392
|
+
|
|
393
|
+
const calculateGcd = (a: number, b: number): number => {
|
|
394
|
+
return b === 0 ? a : calculateGcd(b, a % b);
|
|
395
|
+
};
|
|
396
|
+
|
|
397
|
+
const getInputValues = () => ({
|
|
398
|
+
rw: parseFloat(rwInput.value) || 1,
|
|
399
|
+
rh: parseFloat(rhInput.value) || 1,
|
|
400
|
+
cw: parseFloat(cwInput.value) || 0,
|
|
401
|
+
ch: parseFloat(chInput.value) || 0,
|
|
402
|
+
});
|
|
403
|
+
|
|
404
|
+
const computeBoxDimensions = (rw: number, rh: number, viewW: number, viewH: number) => {
|
|
405
|
+
const targetRatio = rw / rh;
|
|
406
|
+
if (targetRatio > viewW / viewH) {
|
|
407
|
+
return { w: viewW, h: viewW / targetRatio };
|
|
408
|
+
}
|
|
409
|
+
return { w: viewH * targetRatio, h: viewH };
|
|
410
|
+
};
|
|
411
|
+
|
|
412
|
+
const renderBox = () => {
|
|
413
|
+
if (!arcBox || !viewport || !arcBoxRatio || !arcBoxRes || !arcBadge) return;
|
|
414
|
+
|
|
415
|
+
const { rw, rh, cw, ch } = getInputValues();
|
|
416
|
+
const divisor = calculateGcd(Math.round(rw * 100), Math.round(rh * 100)) / 100;
|
|
417
|
+
const ratioText = `${Math.round(rw / divisor)}:${Math.round(rh / divisor)}`;
|
|
418
|
+
|
|
419
|
+
arcBoxRatio.textContent = ratioText;
|
|
420
|
+
arcBoxRes.innerHTML = `${cw} × ${ch}px`;
|
|
421
|
+
arcBadge.textContent = ratioText;
|
|
422
|
+
|
|
423
|
+
const { w, h } = computeBoxDimensions(rw, rh, viewport.clientWidth - 80, viewport.clientHeight - 80);
|
|
424
|
+
arcBox.style.width = w + 'px';
|
|
425
|
+
arcBox.style.height = h + 'px';
|
|
426
|
+
};
|
|
427
|
+
|
|
428
|
+
const recalcFromWidth = () => {
|
|
429
|
+
const { rw, rh, cw } = getInputValues();
|
|
430
|
+
chInput.value = Math.round((cw / rw) * rh).toString();
|
|
431
|
+
};
|
|
432
|
+
|
|
433
|
+
const recalcFromHeight = () => {
|
|
434
|
+
const { rw, rh, ch } = getInputValues();
|
|
435
|
+
cwInput.value = Math.round((ch / rh) * rw).toString();
|
|
436
|
+
};
|
|
437
|
+
|
|
438
|
+
const updateAll = (source: string) => {
|
|
439
|
+
if (source === 'height') {
|
|
440
|
+
recalcFromHeight();
|
|
441
|
+
} else {
|
|
442
|
+
recalcFromWidth();
|
|
443
|
+
}
|
|
444
|
+
renderBox();
|
|
445
|
+
};
|
|
446
|
+
|
|
447
|
+
rwInput?.addEventListener('input', () => updateAll('ratio'));
|
|
448
|
+
rhInput?.addEventListener('input', () => updateAll('ratio'));
|
|
449
|
+
cwInput?.addEventListener('input', () => updateAll('width'));
|
|
450
|
+
chInput?.addEventListener('input', () => updateAll('height'));
|
|
451
|
+
|
|
452
|
+
presetsBtn.forEach((btn) => {
|
|
453
|
+
btn.addEventListener('click', (e) => {
|
|
454
|
+
const el = e.currentTarget as HTMLButtonElement;
|
|
455
|
+
const w = el.dataset.w;
|
|
456
|
+
const h = el.dataset.h;
|
|
457
|
+
if (w && h) {
|
|
458
|
+
rwInput.value = w;
|
|
459
|
+
rhInput.value = h;
|
|
460
|
+
updateAll('ratio');
|
|
461
|
+
}
|
|
462
|
+
});
|
|
463
|
+
});
|
|
464
|
+
|
|
465
|
+
window.addEventListener('resize', renderBox);
|
|
466
|
+
|
|
467
|
+
setTimeout(renderBox, 10);
|
|
468
|
+
</script>
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import type { WithContext, FAQPage, HowToThing, SoftwareApplication } from 'schema-dts';
|
|
2
|
+
import type { ToolLocaleContent } from '../../../types';
|
|
3
|
+
import type { AspectRatioUI } from '../ui';
|
|
4
|
+
|
|
5
|
+
const slug = 'aspect-ratio-calculator';
|
|
6
|
+
const title = 'Aspect Ratio Calculator in Pixels. Online Proportions';
|
|
7
|
+
const description =
|
|
8
|
+
'Calculate new image, video and web design resolutions and maintain the exact proportion to avoid distorting graphics. Supports 16:9, 4:3, 21:9 and custom formats.';
|
|
9
|
+
|
|
10
|
+
const faqData = [
|
|
11
|
+
{
|
|
12
|
+
question: 'What is the Aspect Ratio?',
|
|
13
|
+
answer:
|
|
14
|
+
'The Aspect Ratio describes the geometric relationship between the width and height of an image or screen. It is represented with two numbers separated by a colon (e.g. 16:9), indicating how the height changes proportionally in relation to the width.',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
question: 'Why is it important to maintain correct proportions?',
|
|
18
|
+
answer:
|
|
19
|
+
'Ignoring the Aspect Ratio causes squashed or stretched images, unexpected letterboxing in videos and web components that break their layout at different screen sizes. Maintaining correct proportions is key to professional display.',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
question: 'How do I calculate the height from the width with a given ratio?',
|
|
23
|
+
answer:
|
|
24
|
+
'The formula is: Height = Width × (Ratio Height / Ratio Width). For example, for a width of 1280px with a 16:9 ratio, the height would be: 1280 × (9/16) = 720px.',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
question: 'What is the standard Aspect Ratio for YouTube videos?',
|
|
28
|
+
answer:
|
|
29
|
+
'16:9 is the standard ratio for YouTube and most modern video platforms. It corresponds to resolutions such as 1280×720 (HD), 1920×1080 (Full HD) or 3840×2160 (4K UHD).',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
question: 'What Aspect Ratio do vertical social media videos use?',
|
|
33
|
+
answer:
|
|
34
|
+
'9:16, which is exactly the inverse of widescreen format. It is the native ratio of TikTok, Instagram Reels and YouTube Shorts, originating from consuming content on a mobile phone held vertically.',
|
|
35
|
+
},
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
const howToData = [
|
|
39
|
+
{
|
|
40
|
+
name: 'Enter the original ratio',
|
|
41
|
+
text: 'Enter the width and height values of the ratio you want to maintain (e.g. 16 and 9 for widescreen) or select one of the presets.',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: 'Adjust the scale',
|
|
45
|
+
text: 'Change the width or height value in the "Real Scale" section. The tool will automatically calculate the opposite value to maintain the proportion.',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: 'Check the preview',
|
|
49
|
+
text: 'The preview panel shows the resulting shape at proportional scale, with the simplified ratio and calculated resolution.',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'Apply in your project',
|
|
53
|
+
text: 'Copy the calculated values to use in your CSS (aspect-ratio: 16 / 9), in video export or in the settings of your design tool.',
|
|
54
|
+
},
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
const faqSchema: WithContext<FAQPage> = {
|
|
58
|
+
'@context': 'https://schema.org',
|
|
59
|
+
'@type': 'FAQPage',
|
|
60
|
+
mainEntity: faqData.map((item) => ({
|
|
61
|
+
'@type': 'Question',
|
|
62
|
+
name: item.question,
|
|
63
|
+
acceptedAnswer: { '@type': 'Answer', text: item.answer },
|
|
64
|
+
})),
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const howToSchema: WithContext<HowToThing> = {
|
|
68
|
+
'@context': 'https://schema.org',
|
|
69
|
+
'@type': 'HowTo',
|
|
70
|
+
name: title,
|
|
71
|
+
description,
|
|
72
|
+
step: howToData.map((step, i) => ({
|
|
73
|
+
'@type': 'HowToStep',
|
|
74
|
+
position: i + 1,
|
|
75
|
+
name: step.name,
|
|
76
|
+
text: step.text,
|
|
77
|
+
})),
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
const appSchema: WithContext<SoftwareApplication> = {
|
|
81
|
+
'@context': 'https://schema.org',
|
|
82
|
+
'@type': 'SoftwareApplication',
|
|
83
|
+
name: title,
|
|
84
|
+
description,
|
|
85
|
+
applicationCategory: 'UtilityApplication',
|
|
86
|
+
operatingSystem: 'All',
|
|
87
|
+
offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
|
|
88
|
+
inLanguage: 'en',
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const ui: AspectRatioUI = {
|
|
92
|
+
labelConfig: 'Configuration',
|
|
93
|
+
labelRatio: 'Original Ratio',
|
|
94
|
+
labelWidth: 'Width',
|
|
95
|
+
labelHeight: 'Height',
|
|
96
|
+
labelScale: 'Real Scale',
|
|
97
|
+
labelPixelWidth: 'Pixels (Width)',
|
|
98
|
+
labelPixelHeight: 'Pixels (Height)',
|
|
99
|
+
labelPreview: 'Proportional Preview',
|
|
100
|
+
labelStatus: 'Perfect Ratio',
|
|
101
|
+
labelOffline: '100% Offline Tool',
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export const content: ToolLocaleContent<AspectRatioUI> = {
|
|
105
|
+
slug,
|
|
106
|
+
title,
|
|
107
|
+
description,
|
|
108
|
+
ui,
|
|
109
|
+
faqTitle: 'Frequently Asked Questions',
|
|
110
|
+
faq: faqData,
|
|
111
|
+
bibliographyTitle: 'References and Documentation',
|
|
112
|
+
bibliography: [
|
|
113
|
+
{
|
|
114
|
+
name: 'MDN Web Docs: aspect-ratio (CSS)',
|
|
115
|
+
url: 'https://developer.mozilla.org/en-US/docs/Web/CSS/aspect-ratio',
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: 'Wikipedia: Aspect ratio',
|
|
119
|
+
url: 'https://en.wikipedia.org/wiki/Aspect_ratio',
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
name: 'W3C: CSS Box Sizing Level 4',
|
|
123
|
+
url: 'https://www.w3.org/TR/css-sizing-4/#aspect-ratio',
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
howTo: howToData,
|
|
127
|
+
schemas: [faqSchema, howToSchema, appSchema],
|
|
128
|
+
seo: [
|
|
129
|
+
{
|
|
130
|
+
type: 'title',
|
|
131
|
+
text: 'What is the Aspect Ratio?',
|
|
132
|
+
level: 2,
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
type: 'paragraph',
|
|
136
|
+
html: 'In graphic design, photography and frontend development, the <strong>Aspect Ratio</strong> describes the geometric relationship between the width and height of an image, screen or container. It is typically represented with two numbers separated by a colon (e.g. <code>16:9</code>), indicating how the height increases proportionally in response to its width.',
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
type: 'paragraph',
|
|
140
|
+
html: 'Mishandling aspect ratios is a common cause of squashed photographs, videos with unexpected cropping (letterboxing) or web components that break their layout when viewed progressively from mobile to ultra-wide monitors.',
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
type: 'title',
|
|
144
|
+
text: 'Common Industry Ratios',
|
|
145
|
+
level: 3,
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
type: 'paragraph',
|
|
149
|
+
html: 'Depending on your discipline, you will constantly deal with a limited number of global standard proportions:',
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
type: 'list',
|
|
153
|
+
items: [
|
|
154
|
+
'<strong>16:9 (Widescreen):</strong> The absolute dominant format for modern monitors, TVs, YouTube recordings or standard high-definition resolutions (such as 1920×1080 or 4K).',
|
|
155
|
+
'<strong>9:16 (Vertical):</strong> Originated from native mobile content consumption (TikTok, Instagram Reels, YouTube Shorts). Exactly the same ratio as widescreen videos, but with the physical rotation of the device applied.',
|
|
156
|
+
'<strong>4:3 (Classic / Vintage):</strong> Present in old televisions and monitors or in analogue and specialised digital camera models. Its slightly square appearance draws direct attention to the central compositional axis.',
|
|
157
|
+
],
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
type: 'title',
|
|
161
|
+
text: 'Web Development and the CSS aspect-ratio property',
|
|
162
|
+
level: 3,
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
type: 'paragraph',
|
|
166
|
+
html: 'Formerly in CSS, complex mathematical systems using a <strong>Padding Hack</strong> (such as injecting a <code>padding-top: 56.25%</code>) were used to reserve dynamic spaces in YouTube iframes or cover images, to avoid terrible Cumulative Layout Shift (CLS) on page load.',
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
type: 'paragraph',
|
|
170
|
+
html: 'Nowadays all modern layouts directly apply properties such as <code>aspect-ratio: 16 / 9;</code>, achieving semantic code and allowing the browser to automatically derive the missing dimension from the original width defined via Grid or Flexbox.',
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
type: 'paragraph',
|
|
174
|
+
html: 'This local pixel calculator transfers design power to an instant scaling calculation that will protect your renders from catastrophic misconfigurations.',
|
|
175
|
+
},
|
|
176
|
+
],
|
|
177
|
+
};
|