@jjlmoya/utils-converters 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +61 -0
- package/src/category/i18n/en.ts +90 -0
- package/src/category/i18n/es.ts +90 -0
- package/src/category/i18n/fr.ts +90 -0
- package/src/category/index.ts +39 -0
- package/src/category/seo.astro +15 -0
- package/src/components/PreviewNavSidebar.astro +116 -0
- package/src/components/PreviewToolbar.astro +152 -0
- package/src/data.ts +34 -0
- package/src/env.d.ts +5 -0
- package/src/index.ts +39 -0
- package/src/layouts/PreviewLayout.astro +117 -0
- package/src/pages/[locale]/[slug].astro +148 -0
- package/src/pages/[locale].astro +271 -0
- package/src/pages/index.astro +4 -0
- package/src/shared/ImageConverter.astro +237 -0
- package/src/shared/logic/converter.ts +167 -0
- package/src/shared/style.css +258 -0
- package/src/tests/faq_count.test.ts +10 -0
- package/src/tests/mocks/astro_mock.js +2 -0
- package/src/tests/seo_length.test.ts +22 -0
- package/src/tests/tool_validation.test.ts +17 -0
- package/src/tool/avifAJpg/bibliography.astro +14 -0
- package/src/tool/avifAJpg/component.astro +8 -0
- package/src/tool/avifAJpg/i18n/en.ts +123 -0
- package/src/tool/avifAJpg/i18n/es.ts +123 -0
- package/src/tool/avifAJpg/i18n/fr.ts +118 -0
- package/src/tool/avifAJpg/index.ts +29 -0
- package/src/tool/avifAJpg/seo.astro +14 -0
- package/src/tool/avifAPng/bibliography.astro +14 -0
- package/src/tool/avifAPng/component.astro +8 -0
- package/src/tool/avifAPng/i18n/en.ts +118 -0
- package/src/tool/avifAPng/i18n/es.ts +123 -0
- package/src/tool/avifAPng/i18n/fr.ts +118 -0
- package/src/tool/avifAPng/index.ts +29 -0
- package/src/tool/avifAPng/seo.astro +14 -0
- package/src/tool/avifAWebp/bibliography.astro +14 -0
- package/src/tool/avifAWebp/component.astro +8 -0
- package/src/tool/avifAWebp/i18n/en.ts +118 -0
- package/src/tool/avifAWebp/i18n/es.ts +123 -0
- package/src/tool/avifAWebp/i18n/fr.ts +118 -0
- package/src/tool/avifAWebp/index.ts +29 -0
- package/src/tool/avifAWebp/seo.astro +14 -0
- package/src/tool/bmpAJpg/bibliography.astro +14 -0
- package/src/tool/bmpAJpg/component.astro +8 -0
- package/src/tool/bmpAJpg/i18n/en.ts +123 -0
- package/src/tool/bmpAJpg/i18n/es.ts +123 -0
- package/src/tool/bmpAJpg/i18n/fr.ts +118 -0
- package/src/tool/bmpAJpg/index.ts +29 -0
- package/src/tool/bmpAJpg/seo.astro +14 -0
- package/src/tool/bmpAPng/bibliography.astro +14 -0
- package/src/tool/bmpAPng/component.astro +8 -0
- package/src/tool/bmpAPng/i18n/en.ts +123 -0
- package/src/tool/bmpAPng/i18n/es.ts +123 -0
- package/src/tool/bmpAPng/i18n/fr.ts +118 -0
- package/src/tool/bmpAPng/index.ts +29 -0
- package/src/tool/bmpAPng/seo.astro +14 -0
- package/src/tool/bmpAWebp/bibliography.astro +14 -0
- package/src/tool/bmpAWebp/component.astro +8 -0
- package/src/tool/bmpAWebp/i18n/en.ts +118 -0
- package/src/tool/bmpAWebp/i18n/es.ts +123 -0
- package/src/tool/bmpAWebp/i18n/fr.ts +118 -0
- package/src/tool/bmpAWebp/index.ts +29 -0
- package/src/tool/bmpAWebp/seo.astro +14 -0
- package/src/tool/gifAJpg/bibliography.astro +14 -0
- package/src/tool/gifAJpg/component.astro +8 -0
- package/src/tool/gifAJpg/i18n/en.ts +123 -0
- package/src/tool/gifAJpg/i18n/es.ts +123 -0
- package/src/tool/gifAJpg/i18n/fr.ts +118 -0
- package/src/tool/gifAJpg/index.ts +29 -0
- package/src/tool/gifAJpg/seo.astro +14 -0
- package/src/tool/gifAPng/bibliography.astro +14 -0
- package/src/tool/gifAPng/component.astro +8 -0
- package/src/tool/gifAPng/i18n/en.ts +123 -0
- package/src/tool/gifAPng/i18n/es.ts +123 -0
- package/src/tool/gifAPng/i18n/fr.ts +118 -0
- package/src/tool/gifAPng/index.ts +29 -0
- package/src/tool/gifAPng/seo.astro +14 -0
- package/src/tool/gifAWebp/bibliography.astro +14 -0
- package/src/tool/gifAWebp/component.astro +8 -0
- package/src/tool/gifAWebp/i18n/en.ts +123 -0
- package/src/tool/gifAWebp/i18n/es.ts +123 -0
- package/src/tool/gifAWebp/i18n/fr.ts +118 -0
- package/src/tool/gifAWebp/index.ts +29 -0
- package/src/tool/gifAWebp/seo.astro +14 -0
- package/src/tool/imagenBase64/bibliography.astro +14 -0
- package/src/tool/imagenBase64/component.astro +159 -0
- package/src/tool/imagenBase64/i18n/en.ts +137 -0
- package/src/tool/imagenBase64/i18n/es.ts +137 -0
- package/src/tool/imagenBase64/i18n/fr.ts +132 -0
- package/src/tool/imagenBase64/index.ts +43 -0
- package/src/tool/imagenBase64/seo.astro +14 -0
- package/src/tool/imagenBase64/style.css +299 -0
- package/src/tool/jpgAIco/bibliography.astro +14 -0
- package/src/tool/jpgAIco/component.astro +8 -0
- package/src/tool/jpgAIco/i18n/en.ts +123 -0
- package/src/tool/jpgAIco/i18n/es.ts +123 -0
- package/src/tool/jpgAIco/i18n/fr.ts +118 -0
- package/src/tool/jpgAIco/index.ts +29 -0
- package/src/tool/jpgAIco/seo.astro +14 -0
- package/src/tool/jpgAPng/bibliography.astro +14 -0
- package/src/tool/jpgAPng/component.astro +8 -0
- package/src/tool/jpgAPng/i18n/en.ts +128 -0
- package/src/tool/jpgAPng/i18n/es.ts +128 -0
- package/src/tool/jpgAPng/i18n/fr.ts +123 -0
- package/src/tool/jpgAPng/index.ts +29 -0
- package/src/tool/jpgAPng/seo.astro +14 -0
- package/src/tool/jpgAWebp/bibliography.astro +14 -0
- package/src/tool/jpgAWebp/component.astro +8 -0
- package/src/tool/jpgAWebp/i18n/en.ts +118 -0
- package/src/tool/jpgAWebp/i18n/es.ts +123 -0
- package/src/tool/jpgAWebp/i18n/fr.ts +118 -0
- package/src/tool/jpgAWebp/index.ts +29 -0
- package/src/tool/jpgAWebp/seo.astro +14 -0
- package/src/tool/pngAIco/bibliography.astro +14 -0
- package/src/tool/pngAIco/component.astro +8 -0
- package/src/tool/pngAIco/i18n/en.ts +123 -0
- package/src/tool/pngAIco/i18n/es.ts +123 -0
- package/src/tool/pngAIco/i18n/fr.ts +118 -0
- package/src/tool/pngAIco/index.ts +29 -0
- package/src/tool/pngAIco/seo.astro +14 -0
- package/src/tool/pngAJpg/bibliography.astro +14 -0
- package/src/tool/pngAJpg/component.astro +8 -0
- package/src/tool/pngAJpg/i18n/en.ts +133 -0
- package/src/tool/pngAJpg/i18n/es.ts +201 -0
- package/src/tool/pngAJpg/i18n/fr.ts +128 -0
- package/src/tool/pngAJpg/index.ts +29 -0
- package/src/tool/pngAJpg/seo.astro +14 -0
- package/src/tool/pngAWebp/bibliography.astro +14 -0
- package/src/tool/pngAWebp/component.astro +8 -0
- package/src/tool/pngAWebp/i18n/en.ts +127 -0
- package/src/tool/pngAWebp/i18n/es.ts +132 -0
- package/src/tool/pngAWebp/i18n/fr.ts +122 -0
- package/src/tool/pngAWebp/index.ts +29 -0
- package/src/tool/pngAWebp/seo.astro +14 -0
- package/src/tool/svgAJpg/bibliography.astro +14 -0
- package/src/tool/svgAJpg/component.astro +8 -0
- package/src/tool/svgAJpg/i18n/en.ts +118 -0
- package/src/tool/svgAJpg/i18n/es.ts +123 -0
- package/src/tool/svgAJpg/i18n/fr.ts +118 -0
- package/src/tool/svgAJpg/index.ts +29 -0
- package/src/tool/svgAJpg/seo.astro +14 -0
- package/src/tool/svgAPng/bibliography.astro +14 -0
- package/src/tool/svgAPng/component.astro +8 -0
- package/src/tool/svgAPng/i18n/en.ts +123 -0
- package/src/tool/svgAPng/i18n/es.ts +128 -0
- package/src/tool/svgAPng/i18n/fr.ts +118 -0
- package/src/tool/svgAPng/index.ts +29 -0
- package/src/tool/svgAPng/seo.astro +14 -0
- package/src/tool/webpAIco/bibliography.astro +14 -0
- package/src/tool/webpAIco/component.astro +8 -0
- package/src/tool/webpAIco/i18n/en.ts +123 -0
- package/src/tool/webpAIco/i18n/es.ts +123 -0
- package/src/tool/webpAIco/i18n/fr.ts +118 -0
- package/src/tool/webpAIco/index.ts +29 -0
- package/src/tool/webpAIco/seo.astro +14 -0
- package/src/tool/webpAJpg/bibliography.astro +14 -0
- package/src/tool/webpAJpg/component.astro +8 -0
- package/src/tool/webpAJpg/i18n/en.ts +122 -0
- package/src/tool/webpAJpg/i18n/es.ts +127 -0
- package/src/tool/webpAJpg/i18n/fr.ts +122 -0
- package/src/tool/webpAJpg/index.ts +29 -0
- package/src/tool/webpAJpg/seo.astro +14 -0
- package/src/tool/webpAPng/bibliography.astro +14 -0
- package/src/tool/webpAPng/component.astro +8 -0
- package/src/tool/webpAPng/i18n/en.ts +127 -0
- package/src/tool/webpAPng/i18n/es.ts +132 -0
- package/src/tool/webpAPng/i18n/fr.ts +122 -0
- package/src/tool/webpAPng/index.ts +29 -0
- package/src/tool/webpAPng/seo.astro +14 -0
- package/src/tools.ts +70 -0
- package/src/types.ts +69 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ConvertersToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
|
|
2
|
+
import type { ImageConverterUI } from '../../shared/ImageConverter.astro';
|
|
3
|
+
import GifAWebpCalculator from './component.astro';
|
|
4
|
+
import GifAWebpSEO from './seo.astro';
|
|
5
|
+
import GifAWebpBibliography from './bibliography.astro';
|
|
6
|
+
|
|
7
|
+
export type GifAWebpLocaleContent = ToolLocaleContent<ImageConverterUI>;
|
|
8
|
+
|
|
9
|
+
export const gifAWebp: ConvertersToolEntry<ImageConverterUI> = {
|
|
10
|
+
id: 'gif-a-webp',
|
|
11
|
+
icons: {
|
|
12
|
+
bg: 'mdi:file-image',
|
|
13
|
+
fg: 'mdi:file-export',
|
|
14
|
+
},
|
|
15
|
+
i18n: {
|
|
16
|
+
es: () => import('./i18n/es').then((m) => m.content),
|
|
17
|
+
en: () => import('./i18n/en').then((m) => m.content),
|
|
18
|
+
fr: () => import('./i18n/fr').then((m) => m.content),
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { GifAWebpCalculator, GifAWebpSEO, GifAWebpBibliography };
|
|
23
|
+
|
|
24
|
+
export const GIF_A_WEBP_TOOL: ToolDefinition = {
|
|
25
|
+
entry: gifAWebp,
|
|
26
|
+
Component: GifAWebpCalculator,
|
|
27
|
+
SEOComponent: GifAWebpSEO,
|
|
28
|
+
BibliographyComponent: GifAWebpBibliography,
|
|
29
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { SEORenderer } from '@jjlmoya/utils-shared';
|
|
3
|
+
import { gifAWebp } 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 gifAWebp.i18n[locale]?.();
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
{content && <SEORenderer content={{ locale, sections: content.seo }} />}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { Bibliography as SharedBibliography } from '@jjlmoya/utils-shared';
|
|
3
|
+
import { imagenBase64 } 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 imagenBase64.i18n[locale]?.();
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
{content && <SharedBibliography links={content.bibliography} title={content.ui.bibliographyTitle} />}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ImageToBase64UI } from './index';
|
|
3
|
+
|
|
4
|
+
interface Props { ui: ImageToBase64UI }
|
|
5
|
+
const { ui } = Astro.props;
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<style is:global>
|
|
9
|
+
@import './style.css';
|
|
10
|
+
</style>
|
|
11
|
+
|
|
12
|
+
<div class="base64-container animate-in">
|
|
13
|
+
<div class="base64-card">
|
|
14
|
+
<div class="card-section upload-section">
|
|
15
|
+
<div class="drop-zone" id="b64-drop-zone">
|
|
16
|
+
<div class="drop-content">
|
|
17
|
+
<svg class="upload-icon" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
18
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" />
|
|
19
|
+
</svg>
|
|
20
|
+
<h3>{ui.dragTitle}</h3>
|
|
21
|
+
<p>{ui.dragSubtext}</p>
|
|
22
|
+
<input type="file" id="b64-file-input" class="file-input-native" accept="image/*" />
|
|
23
|
+
<span class="format-badge">{ui.formatBadge}</span>
|
|
24
|
+
</div>
|
|
25
|
+
<div class="preview-container hidden" id="b64-preview-container">
|
|
26
|
+
<button class="clear-btn" id="b64-clear-btn" type="button">
|
|
27
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
28
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
|
|
29
|
+
</svg>
|
|
30
|
+
</button>
|
|
31
|
+
<img id="b64-image-preview" src="" alt="preview" />
|
|
32
|
+
<div class="image-info">
|
|
33
|
+
<span class="info-pill name-pill" id="b64-file-name"></span>
|
|
34
|
+
<span class="info-pill size-pill" id="b64-file-size"></span>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<div class="card-section result-section">
|
|
41
|
+
<div class="output-group">
|
|
42
|
+
<div class="output-header">
|
|
43
|
+
<label>{ui.dataUriLabel}</label>
|
|
44
|
+
<button class="copy-btn" id="copy-data-uri">{ui.copyBtn}</button>
|
|
45
|
+
</div>
|
|
46
|
+
<div class="code-wrapper">
|
|
47
|
+
<textarea id="output-data-uri" readonly placeholder={ui.dataUriPlaceholder}></textarea>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<div class="output-group">
|
|
52
|
+
<div class="output-header">
|
|
53
|
+
<label>{ui.base64Label}</label>
|
|
54
|
+
<button class="copy-btn" id="copy-base64">{ui.copyBtn}</button>
|
|
55
|
+
</div>
|
|
56
|
+
<div class="code-wrapper">
|
|
57
|
+
<textarea id="output-base64" readonly placeholder={ui.base64Placeholder}></textarea>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
<div class="toast" id="b64-toast">
|
|
65
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
66
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M5 13l4 4L19 7" />
|
|
67
|
+
</svg>
|
|
68
|
+
<span id="b64-toast-msg">{ui.toastMessage}</span>
|
|
69
|
+
</div>
|
|
70
|
+
|
|
71
|
+
<script define:vars={{ toastMessage: ui.toastMessage, invalidImageAlert: ui.invalidImageAlert }}>
|
|
72
|
+
const dropZone = document.getElementById('b64-drop-zone');
|
|
73
|
+
const fileInput = document.getElementById('b64-file-input');
|
|
74
|
+
const previewContainer = document.getElementById('b64-preview-container');
|
|
75
|
+
const imagePreview = document.getElementById('b64-image-preview');
|
|
76
|
+
const clearBtn = document.getElementById('b64-clear-btn');
|
|
77
|
+
const fileNameEl = document.getElementById('b64-file-name');
|
|
78
|
+
const fileSizeEl = document.getElementById('b64-file-size');
|
|
79
|
+
const outputDataUri = document.getElementById('output-data-uri');
|
|
80
|
+
const outputBase64 = document.getElementById('output-base64');
|
|
81
|
+
const copyDataUriBtn = document.getElementById('copy-data-uri');
|
|
82
|
+
const copyBase64Btn = document.getElementById('copy-base64');
|
|
83
|
+
const toast = document.getElementById('b64-toast');
|
|
84
|
+
const toastMsg = document.getElementById('b64-toast-msg');
|
|
85
|
+
|
|
86
|
+
function formatBytes(bytes) {
|
|
87
|
+
if (bytes < 1024) return bytes + ' B';
|
|
88
|
+
if (bytes < 1024 * 1024) return (bytes / 1024).toFixed(1) + ' KB';
|
|
89
|
+
return (bytes / (1024 * 1024)).toFixed(2) + ' MB';
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function showToast(message) {
|
|
93
|
+
if (toastMsg) toastMsg.textContent = message;
|
|
94
|
+
toast?.classList.add('show');
|
|
95
|
+
setTimeout(() => toast?.classList.remove('show'), 2500);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function updateOutputs(dataUri, fileName, fileSize) {
|
|
99
|
+
const base64 = dataUri.split(',')[1] || '';
|
|
100
|
+
if (outputDataUri) outputDataUri.value = dataUri;
|
|
101
|
+
if (outputBase64) outputBase64.value = base64;
|
|
102
|
+
if (imagePreview) imagePreview.src = dataUri;
|
|
103
|
+
if (fileNameEl) fileNameEl.textContent = fileName;
|
|
104
|
+
if (fileSizeEl) fileSizeEl.textContent = formatBytes(fileSize);
|
|
105
|
+
previewContainer?.classList.remove('hidden');
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function handleFile(file) {
|
|
109
|
+
if (!file.type.startsWith('image/')) {
|
|
110
|
+
alert(invalidImageAlert);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
const reader = new FileReader();
|
|
114
|
+
reader.onload = (e) => {
|
|
115
|
+
const dataUri = e.target?.result;
|
|
116
|
+
if (typeof dataUri === 'string') updateOutputs(dataUri, file.name, file.size);
|
|
117
|
+
};
|
|
118
|
+
reader.readAsDataURL(file);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
dropZone?.addEventListener('click', () => fileInput?.click());
|
|
122
|
+
dropZone?.addEventListener('dragover', (e) => {
|
|
123
|
+
e.preventDefault();
|
|
124
|
+
dropZone.classList.add('dragover');
|
|
125
|
+
});
|
|
126
|
+
dropZone?.addEventListener('dragleave', () => dropZone.classList.remove('dragover'));
|
|
127
|
+
dropZone?.addEventListener('drop', (e) => {
|
|
128
|
+
e.preventDefault();
|
|
129
|
+
dropZone.classList.remove('dragover');
|
|
130
|
+
const file = e.dataTransfer?.files[0];
|
|
131
|
+
if (file) handleFile(file);
|
|
132
|
+
});
|
|
133
|
+
fileInput?.addEventListener('change', (e) => {
|
|
134
|
+
const file = e.target?.files?.[0];
|
|
135
|
+
if (file) handleFile(file);
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
clearBtn?.addEventListener('click', (e) => {
|
|
139
|
+
e.stopPropagation();
|
|
140
|
+
previewContainer?.classList.add('hidden');
|
|
141
|
+
if (outputDataUri) outputDataUri.value = '';
|
|
142
|
+
if (outputBase64) outputBase64.value = '';
|
|
143
|
+
if (fileInput) fileInput.value = '';
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
copyDataUriBtn?.addEventListener('click', () => {
|
|
147
|
+
const val = outputDataUri?.value;
|
|
148
|
+
if (val) {
|
|
149
|
+
navigator.clipboard.writeText(val).then(() => showToast(toastMessage));
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
copyBase64Btn?.addEventListener('click', () => {
|
|
154
|
+
const val = outputBase64?.value;
|
|
155
|
+
if (val) {
|
|
156
|
+
navigator.clipboard.writeText(val).then(() => showToast(toastMessage));
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
</script>
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import type { WithContext, SoftwareApplication } from 'schema-dts';
|
|
2
|
+
import type { ImagenBase64LocaleContent } from '../index';
|
|
3
|
+
import type { ImageToBase64UI } from '../index';
|
|
4
|
+
|
|
5
|
+
const slug = 'image-to-base64-converter';
|
|
6
|
+
const title = 'Image to Base64 Converter Online - Free and 100% Private';
|
|
7
|
+
const description =
|
|
8
|
+
'Convert any image to Base64 code and Data URI directly in your browser. No file uploads. Free, private and instant.';
|
|
9
|
+
|
|
10
|
+
const ui: ImageToBase64UI = {
|
|
11
|
+
dragTitle: 'Drag your image here',
|
|
12
|
+
dragSubtext: 'or click to browse your files',
|
|
13
|
+
formatBadge: 'Supports JPG, PNG, WEBP, SVG, GIF',
|
|
14
|
+
dataUriLabel: 'Data URI (Ready for CSS / HTML src="")',
|
|
15
|
+
base64Label: 'Base64 only (Plain encoded text)',
|
|
16
|
+
copyBtn: 'Copy',
|
|
17
|
+
dataUriPlaceholder: 'Upload an image to see the Data URI code...',
|
|
18
|
+
base64Placeholder: 'Upload an image to see the pure Base64 code...',
|
|
19
|
+
toastMessage: 'Code copied to clipboard!',
|
|
20
|
+
invalidImageAlert: 'Please upload a valid image file.',
|
|
21
|
+
bibliographyTitle: 'Bibliographic References',
|
|
22
|
+
faqTitle: 'Frequently Asked Questions',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const faq: ImagenBase64LocaleContent['faq'] = [
|
|
26
|
+
{
|
|
27
|
+
question: 'What is Base64 and what is it used for in web development?',
|
|
28
|
+
answer:
|
|
29
|
+
'Base64 is an encoding system that converts binary data into an ASCII text string. In web development, it is used to embed images directly within HTML or CSS files via Data URIs, reducing the number of HTTP requests to the server.',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
question: 'Is it safe to convert my images to Base64 here?',
|
|
33
|
+
answer:
|
|
34
|
+
'Absolutely safe and private. Our tool works 100% locally in your browser. Your images are never uploaded or processed on any external server.',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
question: 'What image formats does the Base64 converter support?',
|
|
38
|
+
answer:
|
|
39
|
+
'The tool is compatible with JPG, PNG, GIF, WebP, and even SVG vector files. When loading the image, it will automatically detect its MIME type to generate the exact Data URI code.',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
question: 'When should I NOT use Base64 images?',
|
|
43
|
+
answer:
|
|
44
|
+
'You should avoid using Base64 images for large photographs or high-resolution images. Base64 code takes up approximately 33% more weight than the original binary file, which can excessively inflate your CSS stylesheets or HTML documents.',
|
|
45
|
+
},
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
const howTo: ImagenBase64LocaleContent['howTo'] = [
|
|
49
|
+
{
|
|
50
|
+
name: 'Drag or Select your Image',
|
|
51
|
+
text: 'Move any image (JPG, PNG, WebP, SVG, GIF) to the upload area to start the conversion.',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'Copy the Generated Code',
|
|
55
|
+
text: 'You will see two textareas: the complete Data URI (ready to use in src="" or CSS) and the pure Base64 for other uses.',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: 'Use the Code in your Project',
|
|
59
|
+
text: 'Paste the Data URI directly into the src of an img tag or in your CSS as background-image without needing external files.',
|
|
60
|
+
},
|
|
61
|
+
];
|
|
62
|
+
|
|
63
|
+
const bibliography: ImagenBase64LocaleContent['bibliography'] = [
|
|
64
|
+
{
|
|
65
|
+
name: 'MDN Web Docs: Data URIs',
|
|
66
|
+
url: 'https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: 'Base64 Encoding RFC 4648',
|
|
70
|
+
url: 'https://datatracker.ietf.org/doc/html/rfc4648',
|
|
71
|
+
},
|
|
72
|
+
];
|
|
73
|
+
|
|
74
|
+
const seo: ImagenBase64LocaleContent['seo'] = [
|
|
75
|
+
{
|
|
76
|
+
type: 'title',
|
|
77
|
+
text: 'Online Image to Base64 Converter',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
type: 'paragraph',
|
|
81
|
+
html:
|
|
82
|
+
'Base64 encoding is a fundamental technique in modern web development. It allows representing binary data (like images) as ASCII text, making it possible to embed images directly in HTML, CSS or JavaScript code without separate files. This is done through what are called Data URIs (Data Uniform Resource Identifiers).',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
type: 'paragraph',
|
|
86
|
+
html:
|
|
87
|
+
'A Data URI for an image follows the format: data:[MIME type];base64,[encoded data]. Our tool automatically generates the correct MIME type based on the image format you upload, whether it is PNG, JPG, WebP, GIF or SVG.',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
type: 'paragraph',
|
|
91
|
+
html:
|
|
92
|
+
'Main use cases for Base64 images include: SVG icons in CSS, small logos in SPA (Single Page Application) apps, critical images for initial page load that should not cause additional network requests, and image data in JSON or REST APIs.',
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
type: 'tip',
|
|
96
|
+
html:
|
|
97
|
+
'Base64 code is approximately 33% larger than the original file. For small images (icons, logos, small sprites) it is efficient. For large photographs, it is better to use separate files and take advantage of browser caching.',
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
type: 'paragraph',
|
|
101
|
+
html:
|
|
102
|
+
'A 1KB PNG image converts to approximately 1.37KB of Base64. A 100KB image would result in about 137KB of Base64 text. This 1.33x factor is constant for any file type.',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
type: 'paragraph',
|
|
106
|
+
html:
|
|
107
|
+
'Our tool processes everything locally. The image is read via the browser\'s FileReader API, which converts it directly to Base64 without any data being sent to external servers. This guarantees complete privacy for your images, whether personal or corporate.',
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
type: 'paragraph',
|
|
111
|
+
html:
|
|
112
|
+
'Convert images to Base64 and Data URI for free and privately. Support for JPG, PNG, WebP, SVG and GIF. Immediate result in your browser without server-side processing.',
|
|
113
|
+
},
|
|
114
|
+
];
|
|
115
|
+
|
|
116
|
+
const appSchema: WithContext<SoftwareApplication> = {
|
|
117
|
+
'@context': 'https://schema.org',
|
|
118
|
+
'@type': 'SoftwareApplication',
|
|
119
|
+
name: title,
|
|
120
|
+
description,
|
|
121
|
+
applicationCategory: 'UtilitiesApplication',
|
|
122
|
+
operatingSystem: 'Web',
|
|
123
|
+
offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
|
|
124
|
+
inLanguage: 'en',
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export const content: ImagenBase64LocaleContent = {
|
|
128
|
+
slug,
|
|
129
|
+
title,
|
|
130
|
+
description,
|
|
131
|
+
ui,
|
|
132
|
+
seo,
|
|
133
|
+
faq,
|
|
134
|
+
bibliography,
|
|
135
|
+
howTo,
|
|
136
|
+
schemas: [appSchema as any],
|
|
137
|
+
};
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import type { WithContext, SoftwareApplication } from 'schema-dts';
|
|
2
|
+
import type { ImagenBase64LocaleContent } from '../index';
|
|
3
|
+
import type { ImageToBase64UI } from '../index';
|
|
4
|
+
|
|
5
|
+
const slug = 'convertidor-imagen-base64';
|
|
6
|
+
const title = 'Convertidor de Imagen a Base64 Online - Gratis y 100% Privado';
|
|
7
|
+
const description =
|
|
8
|
+
'Convierte cualquier imagen a código Base64 y Data URI directamente en tu navegador. Sin subir archivos. Gratis, privado e instantáneo.';
|
|
9
|
+
|
|
10
|
+
const ui: ImageToBase64UI = {
|
|
11
|
+
dragTitle: 'Arrastra tu imagen aquí',
|
|
12
|
+
dragSubtext: 'o haz clic para explorar tus archivos',
|
|
13
|
+
formatBadge: 'Soporta JPG, PNG, WEBP, SVG, GIF',
|
|
14
|
+
dataUriLabel: 'Data URI (Listo para CSS / HTML src="")',
|
|
15
|
+
base64Label: 'Solo Base64 (Texto plano codificado)',
|
|
16
|
+
copyBtn: 'Copiar',
|
|
17
|
+
dataUriPlaceholder: 'Sube una imagen para ver el código Data URI...',
|
|
18
|
+
base64Placeholder: 'Sube una imagen para ver el código Base64 puro...',
|
|
19
|
+
toastMessage: '¡Código copiado al portapapeles!',
|
|
20
|
+
invalidImageAlert: 'Por favor sube un archivo de imagen válido.',
|
|
21
|
+
bibliographyTitle: 'Referencias Bibliográficas',
|
|
22
|
+
faqTitle: 'Preguntas Frecuentes',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const faq: ImagenBase64LocaleContent['faq'] = [
|
|
26
|
+
{
|
|
27
|
+
question: '¿Qué es Base64 y para qué sirve en el desarrollo web?',
|
|
28
|
+
answer:
|
|
29
|
+
'Base64 es un sistema de codificación que convierte datos binarios en una cadena de texto ASCII. En desarrollo web, se utiliza para incrustar imágenes directamente dentro de los archivos HTML o CSS mediante Data URIs, reduciendo el número de peticiones HTTP al servidor.',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
question: '¿Es seguro convertir mis imágenes a Base64 aquí?',
|
|
33
|
+
answer:
|
|
34
|
+
'Absolutamente seguro y privado. Nuestra herramienta funciona 100% de manera local en tu navegador. Tus imágenes nunca se suben ni se procesan en ningún servidor externo.',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
question: '¿Qué formatos de imagen soporta el convertidor a Base64?',
|
|
38
|
+
answer:
|
|
39
|
+
'La herramienta es compatible con JPG, PNG, GIF, WebP, e incluso archivos vectoriales SVG. Al cargar la imagen, automáticamente detectará su tipo MIME para generar el código Data URI exacto.',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
question: '¿Cuándo NO debería usar imágenes en Base64?',
|
|
43
|
+
answer:
|
|
44
|
+
'Debes evitar usar imágenes en Base64 para fotografías grandes o imágenes de alta resolución. El código Base64 ocupa aproximadamente un 33% más de peso que el archivo binario original, lo que puede inflar excesivamente tus hojas de estilo CSS o documentos HTML.',
|
|
45
|
+
},
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
const howTo: ImagenBase64LocaleContent['howTo'] = [
|
|
49
|
+
{
|
|
50
|
+
name: 'Arrastra o Selecciona tu Imagen',
|
|
51
|
+
text: 'Mueve cualquier imagen (JPG, PNG, WebP, SVG, GIF) al área de carga para iniciar la conversión.',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'Copia el Código Generado',
|
|
55
|
+
text: 'Verás dos textareas: el Data URI completo (listo para usar en src="" o CSS) y el Base64 puro para otros usos.',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: 'Usa el Código en tu Proyecto',
|
|
59
|
+
text: 'Pega directamente el Data URI en el src de una etiqueta img o en tu CSS como background-image sin necesidad de archivos externos.',
|
|
60
|
+
},
|
|
61
|
+
];
|
|
62
|
+
|
|
63
|
+
const bibliography: ImagenBase64LocaleContent['bibliography'] = [
|
|
64
|
+
{
|
|
65
|
+
name: 'MDN Web Docs: Data URIs',
|
|
66
|
+
url: 'https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: 'Base64 Encoding RFC 4648',
|
|
70
|
+
url: 'https://datatracker.ietf.org/doc/html/rfc4648',
|
|
71
|
+
},
|
|
72
|
+
];
|
|
73
|
+
|
|
74
|
+
const seo: ImagenBase64LocaleContent['seo'] = [
|
|
75
|
+
{
|
|
76
|
+
type: 'title',
|
|
77
|
+
text: 'Convertidor de Imagen a Base64 Online',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
type: 'paragraph',
|
|
81
|
+
html:
|
|
82
|
+
'La codificación Base64 es una técnica fundamental en el desarrollo web moderno. Permite representar datos binarios (como imágenes) como texto ASCII, lo que hace posible incrustar imágenes directamente en código HTML, CSS o JavaScript sin necesidad de archivos separados. Esto se realiza mediante los llamados Data URIs (Uniform Resource Identifiers de datos).',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
type: 'paragraph',
|
|
86
|
+
html:
|
|
87
|
+
'Un Data URI para una imagen sigue el formato: data:[tipo MIME];base64,[datos codificados]. Por ejemplo, una imagen PNG pequeña podría representarse como data:image/png;base64,iVBORw0KGgo... Nuestra herramienta genera automáticamente el tipo MIME correcto según el formato de la imagen que subas.',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
type: 'paragraph',
|
|
91
|
+
html:
|
|
92
|
+
'Los principales casos de uso para imágenes en Base64 incluyen: iconos SVG en CSS, logotipos pequeños en aplicaciones SPA (Single Page Applications), imágenes críticas para carga inicial que no deben causar peticiones adicionales de red, y datos de imagen en JSON o APIs REST.',
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
type: 'tip',
|
|
96
|
+
html:
|
|
97
|
+
'El código Base64 es aproximadamente un 33% más grande que el archivo original. Para imágenes pequeñas (iconos, logos, pequeños sprites) es eficiente. Para fotografías grandes, es mejor usar archivos separados y aprovechar la caché del navegador.',
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
type: 'paragraph',
|
|
101
|
+
html:
|
|
102
|
+
'Una imagen PNG de 1KB se convierte en aproximadamente 1.37KB de Base64. Una imagen de 100KB resultaría en unos 137KB de texto Base64. Este factor de 1.33x es constante para cualquier tipo de archivo.',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
type: 'paragraph',
|
|
106
|
+
html:
|
|
107
|
+
'Nuestra herramienta procesa todo localmente. La imagen se lee mediante la API FileReader del navegador, que la convierte directamente a Base64 sin ningún envío de datos a servidores externos. Esto garantiza la privacidad total de tus imágenes, sean personales o corporativas.',
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
type: 'paragraph',
|
|
111
|
+
html:
|
|
112
|
+
'Convierte imágenes a Base64 y Data URI de forma gratuita y privada. Soporte para JPG, PNG, WebP, SVG y GIF. Resultado inmediato en tu navegador sin procesamiento en servidores.',
|
|
113
|
+
},
|
|
114
|
+
];
|
|
115
|
+
|
|
116
|
+
const appSchema: WithContext<SoftwareApplication> = {
|
|
117
|
+
'@context': 'https://schema.org',
|
|
118
|
+
'@type': 'SoftwareApplication',
|
|
119
|
+
name: title,
|
|
120
|
+
description,
|
|
121
|
+
applicationCategory: 'UtilitiesApplication',
|
|
122
|
+
operatingSystem: 'Web',
|
|
123
|
+
offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
|
|
124
|
+
inLanguage: 'es',
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export const content: ImagenBase64LocaleContent = {
|
|
128
|
+
slug,
|
|
129
|
+
title,
|
|
130
|
+
description,
|
|
131
|
+
ui,
|
|
132
|
+
seo,
|
|
133
|
+
faq,
|
|
134
|
+
bibliography,
|
|
135
|
+
howTo,
|
|
136
|
+
schemas: [appSchema as any],
|
|
137
|
+
};
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import type { WithContext, SoftwareApplication } from 'schema-dts';
|
|
2
|
+
import type { ImagenBase64LocaleContent } from '../index';
|
|
3
|
+
import type { ImageToBase64UI } from '../index';
|
|
4
|
+
|
|
5
|
+
const slug = 'convertisseur-image-base64';
|
|
6
|
+
const title = 'Convertisseur Image vers Base64 en Ligne - Gratuit et 100% Privé';
|
|
7
|
+
const description =
|
|
8
|
+
'Convertissez n\'importe quelle image en code Base64 et Data URI directement dans votre navigateur. Sans téléchargement. Gratuit, privé et instantané.';
|
|
9
|
+
|
|
10
|
+
const ui: ImageToBase64UI = {
|
|
11
|
+
dragTitle: 'Faites glisser votre image ici',
|
|
12
|
+
dragSubtext: 'ou cliquez pour parcourir vos fichiers',
|
|
13
|
+
formatBadge: 'Supporte JPG, PNG, WEBP, SVG, GIF',
|
|
14
|
+
dataUriLabel: 'Data URI (Prêt pour CSS / HTML src="")',
|
|
15
|
+
base64Label: 'Base64 uniquement (Texte encodé en clair)',
|
|
16
|
+
copyBtn: 'Copier',
|
|
17
|
+
dataUriPlaceholder: 'Téléchargez une image pour voir le code Data URI...',
|
|
18
|
+
base64Placeholder: 'Téléchargez une image pour voir le code Base64 pur...',
|
|
19
|
+
toastMessage: 'Code copié dans le presse-papiers !',
|
|
20
|
+
invalidImageAlert: 'Veuillez télécharger un fichier image valide.',
|
|
21
|
+
bibliographyTitle: 'Références Bibliographiques',
|
|
22
|
+
faqTitle: 'Questions Fréquentes',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const faq: ImagenBase64LocaleContent['faq'] = [
|
|
26
|
+
{
|
|
27
|
+
question: 'Qu\'est-ce que Base64 et à quoi sert-il dans le développement web ?',
|
|
28
|
+
answer:
|
|
29
|
+
'Base64 est un système d\'encodage qui convertit des données binaires en une chaîne de texte ASCII. Dans le développement web, il est utilisé pour intégrer des images directement dans les fichiers HTML ou CSS via des Data URIs, réduisant le nombre de requêtes HTTP vers le serveur.',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
question: 'Est-il sûr de convertir mes images en Base64 ici ?',
|
|
33
|
+
answer:
|
|
34
|
+
'Absolument sûr et privé. Notre outil fonctionne à 100% localement dans votre navigateur. Vos images ne sont jamais téléchargées ni traitées sur un serveur externe.',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
question: 'Quels formats d\'image le convertisseur Base64 supporte-t-il ?',
|
|
38
|
+
answer:
|
|
39
|
+
'L\'outil est compatible avec JPG, PNG, GIF, WebP et même les fichiers vectoriels SVG. Lors du chargement de l\'image, il détectera automatiquement son type MIME pour générer le code Data URI exact.',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
question: 'Quand NE devrais-je PAS utiliser des images en Base64 ?',
|
|
43
|
+
answer:
|
|
44
|
+
'Vous devriez éviter d\'utiliser des images en Base64 pour de grandes photographies ou des images haute résolution. Le code Base64 occupe environ 33% de poids en plus que le fichier binaire original, ce qui peut excessivement gonfler vos feuilles de style CSS ou documents HTML.',
|
|
45
|
+
},
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
const howTo: ImagenBase64LocaleContent['howTo'] = [
|
|
49
|
+
{
|
|
50
|
+
name: 'Faites glisser ou sélectionnez votre image',
|
|
51
|
+
text: 'Déplacez n\'importe quelle image (JPG, PNG, WebP, SVG, GIF) vers la zone de téléchargement pour démarrer la conversion.',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'Copiez le code généré',
|
|
55
|
+
text: 'Vous verrez deux zones de texte : le Data URI complet (prêt à utiliser dans src="" ou CSS) et le Base64 pur pour d\'autres utilisations.',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: 'Utilisez le code dans votre projet',
|
|
59
|
+
text: 'Collez directement le Data URI dans le src d\'une balise img ou dans votre CSS comme background-image sans avoir besoin de fichiers externes.',
|
|
60
|
+
},
|
|
61
|
+
];
|
|
62
|
+
|
|
63
|
+
const bibliography: ImagenBase64LocaleContent['bibliography'] = [
|
|
64
|
+
{
|
|
65
|
+
name: 'MDN Web Docs: Data URIs',
|
|
66
|
+
url: 'https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: 'Base64 Encoding RFC 4648',
|
|
70
|
+
url: 'https://datatracker.ietf.org/doc/html/rfc4648',
|
|
71
|
+
},
|
|
72
|
+
];
|
|
73
|
+
|
|
74
|
+
const seo: ImagenBase64LocaleContent['seo'] = [
|
|
75
|
+
{
|
|
76
|
+
type: 'title',
|
|
77
|
+
text: 'Convertisseur d\'Image vers Base64 en Ligne',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
type: 'paragraph',
|
|
81
|
+
html:
|
|
82
|
+
'L\'encodage Base64 est une technique fondamentale dans le développement web moderne. Il permet de représenter des données binaires (comme des images) sous forme de texte ASCII, rendant possible l\'intégration d\'images directement dans le code HTML, CSS ou JavaScript sans fichiers séparés. Cela se fait via ce qu\'on appelle les Data URIs (Uniform Resource Identifiers de données).',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
type: 'paragraph',
|
|
86
|
+
html:
|
|
87
|
+
'Un Data URI pour une image suit le format : data:[type MIME];base64,[données encodées]. Notre outil génère automatiquement le bon type MIME selon le format de l\'image que vous téléchargez, que ce soit PNG, JPG, WebP, GIF ou SVG.',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
type: 'paragraph',
|
|
91
|
+
html:
|
|
92
|
+
'Les principaux cas d\'utilisation pour les images Base64 incluent : les icônes SVG en CSS, les petits logos dans les applications SPA, les images critiques pour le chargement initial de page qui ne devraient pas causer de requêtes réseau supplémentaires, et les données d\'image en JSON ou APIs REST.',
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
type: 'tip',
|
|
96
|
+
html:
|
|
97
|
+
'Le code Base64 est environ 33% plus grand que le fichier original. Pour les petites images (icônes, logos, petits sprites) c\'est efficace. Pour les grandes photographies, il vaut mieux utiliser des fichiers séparés et profiter du cache du navigateur.',
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
type: 'paragraph',
|
|
101
|
+
html:
|
|
102
|
+
'Une image PNG de 1Ko se convertit en environ 1,37Ko de Base64. Une image de 100Ko donnerait environ 137Ko de texte Base64. Ce facteur de 1,33x est constant pour tout type de fichier.',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
type: 'paragraph',
|
|
106
|
+
html:
|
|
107
|
+
'Convertissez des images en Base64 et Data URI gratuitement et en toute confidentialité. Support JPG, PNG, WebP, SVG et GIF. Résultat immédiat dans votre navigateur sans traitement côté serveur.',
|
|
108
|
+
},
|
|
109
|
+
];
|
|
110
|
+
|
|
111
|
+
const appSchema: WithContext<SoftwareApplication> = {
|
|
112
|
+
'@context': 'https://schema.org',
|
|
113
|
+
'@type': 'SoftwareApplication',
|
|
114
|
+
name: title,
|
|
115
|
+
description,
|
|
116
|
+
applicationCategory: 'UtilitiesApplication',
|
|
117
|
+
operatingSystem: 'Web',
|
|
118
|
+
offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
|
|
119
|
+
inLanguage: 'fr',
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export const content: ImagenBase64LocaleContent = {
|
|
123
|
+
slug,
|
|
124
|
+
title,
|
|
125
|
+
description,
|
|
126
|
+
ui,
|
|
127
|
+
seo,
|
|
128
|
+
faq,
|
|
129
|
+
bibliography,
|
|
130
|
+
howTo,
|
|
131
|
+
schemas: [appSchema as any],
|
|
132
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ConvertersToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
|
|
2
|
+
import ImagenBase64Calculator from './component.astro';
|
|
3
|
+
import ImagenBase64SEO from './seo.astro';
|
|
4
|
+
import ImagenBase64Bibliography from './bibliography.astro';
|
|
5
|
+
|
|
6
|
+
export interface ImageToBase64UI {
|
|
7
|
+
[key: string]: string;
|
|
8
|
+
dragTitle: string;
|
|
9
|
+
dragSubtext: string;
|
|
10
|
+
formatBadge: string;
|
|
11
|
+
dataUriLabel: string;
|
|
12
|
+
base64Label: string;
|
|
13
|
+
copyBtn: string;
|
|
14
|
+
dataUriPlaceholder: string;
|
|
15
|
+
base64Placeholder: string;
|
|
16
|
+
toastMessage: string;
|
|
17
|
+
invalidImageAlert: string;
|
|
18
|
+
bibliographyTitle: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type ImagenBase64LocaleContent = ToolLocaleContent<ImageToBase64UI>;
|
|
22
|
+
|
|
23
|
+
export const imagenBase64: ConvertersToolEntry<ImageToBase64UI> = {
|
|
24
|
+
id: 'imagen-base64',
|
|
25
|
+
icons: {
|
|
26
|
+
bg: 'mdi:file-image',
|
|
27
|
+
fg: 'mdi:code-tags',
|
|
28
|
+
},
|
|
29
|
+
i18n: {
|
|
30
|
+
es: () => import('./i18n/es').then((m) => m.content),
|
|
31
|
+
en: () => import('./i18n/en').then((m) => m.content),
|
|
32
|
+
fr: () => import('./i18n/fr').then((m) => m.content),
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export { ImagenBase64Calculator, ImagenBase64SEO, ImagenBase64Bibliography };
|
|
37
|
+
|
|
38
|
+
export const IMAGEN_BASE64_TOOL: ToolDefinition = {
|
|
39
|
+
entry: imagenBase64,
|
|
40
|
+
Component: ImagenBase64Calculator,
|
|
41
|
+
SEOComponent: ImagenBase64SEO,
|
|
42
|
+
BibliographyComponent: ImagenBase64Bibliography,
|
|
43
|
+
};
|