-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
309 lines (274 loc) · 8.47 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, user-scalable=no"
/>
<title>HEIC to JPG Converter | Free Online Tool | CHITA.DEV</title>
<meta
name="description"
content="Convert HEIC images to JPG format instantly and securely in your browser. Developed by CHITA.DEV. Free, private, and easy-to-use HEIC to JPG converter."
/>
<meta
name="keywords"
content="HEIC to JPG, convert HEIC to JPG, online HEIC to JPG converter, free image converter, CHITA.DEV, no upload image conversion"
/>
<meta name="author" content="CHITA.DEV" />
<meta name="robots" content="index, follow" />
<!-- Open Graph Tags -->
<meta
property="og:title"
content="HEIC to JPG Converter - Free & Secure | CHITA.DEV"
/>
<meta
property="og:description"
content="Convert HEIC images to JPG format instantly in your browser. No uploads, no data transfer. 100% privacy guaranteed."
/>
<meta
property="og:image"
content="https://chita.dev/images/heic-to-jpg-thumbnail.jpg"
/>
<meta property="og:url" content="https://chita.dev/heic-to-jpg-converter" />
<meta property="og:type" content="website" />
<!-- Structured Data -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "SoftwareApplication",
"name": "HEIC to JPG Converter",
"operatingSystem": "Browser",
"applicationCategory": "UtilitiesApplication",
"description": "Convert HEIC images to JPG format directly in your browser with this free and secure tool by CHITA.DEV.",
"offers": {
"@type": "Offer",
"price": "0.00",
"priceCurrency": "USD"
},
"creator": {
"@type": "Person",
"name": "CHITA.DEV",
"url": "https://chita.dev"
}
}
</script>
<!-- Bootstrap CSS -->
<link
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
rel="stylesheet"
/>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.css"
/>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/heic2any/dist/heic2any.min.js"></script>
<style>
body {
font-family: Arial, sans-serif;
background-image: linear-gradient(
to right bottom,
#eeffef,
#c4f4c7,
#98e7a0,
#65da78,
#00cc4f
);
margin: 0;
padding: 10px;
min-height: 100vh;
}
a {
color: black;
}
h1 {
font-size: 2rem;
text-align: center;
margin-bottom: 1rem;
color: #212529;
}
.container {
max-width: 900px;
margin: auto;
padding: 15px;
}
.card {
padding: 20px;
border-radius: 10px;
background-color: white;
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
}
.image-container {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
margin-bottom: 1.5rem;
background-color: #ffffff;
border: 1px solid #ddd;
border-radius: 10px;
padding: 15px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
width: 256px;
height: fit-content;
}
.image-container img {
max-width: 100%;
height: auto;
border-radius: 5px;
margin-bottom: 10px;
}
.progress-bar {
width: 100%;
height: 10px;
background-color: #ddd;
border-radius: 5px;
margin: 10px 0;
}
#output {
display: flex;
flex-wrap: wrap;
gap: 10px;
justify-content: center;
}
.progress-bar-fill {
height: 100%;
width: 0;
background: #28a745;
border-radius: 5px;
transition: width 0.4s;
}
.download-link {
color: #28a745;
text-decoration: none;
font-weight: bold;
}
.privacy-info {
font-size: 0.9rem;
color: #6c757d;
text-align: center;
margin-top: 10px;
}
/* Responsive Styling */
@media (max-width: 768px) {
body {
padding: 5px;
padding-top: 20px;
}
h1 {
font-size: 1.75rem;
}
.card {
padding: 15px;
}
.image-container {
padding: 10px;
}
}
@media (max-width: 576px) {
.container {
padding: 10px;
}
h1 {
font-size: 1.5rem;
}
.btn {
width: 100%;
}
}
</style>
</head>
<body>
<div class="container">
<h1>
<i class="bi bi-arrow-repeat"></i> <b>HEIC</b> to <b>JPG</b> Converter
</h1>
<p class="text-center">Convert directly in your browser.</p>
<div class="text-center">
<span style="color: forestgreen">☑</span> No cookies
<span style="color: forestgreen">☑</span> No uploads
<span style="color: forestgreen">☑</span> No data transfer
</div>
<p class="text-center text-muted">Your privacy is 100% secure!</p>
<p class="text-center">
Developed by <a href="https://chita.dev" target="_blank">CHITA.DEV</a>
</p>
<div class="card">
<input
type="file"
id="fileInput"
class="form-control mb-3"
multiple
accept=".heic"
/>
<button class="btn btn-success w-100" onclick="convertImages()">
<i class="bi bi-arrow-repeat"></i> Convert to JPG
</button>
<p class="privacy-info">
This tool is free and works entirely in your browser. No strings
attached!
</p>
</div>
<div id="output" class="mt-4"></div>
</div>
<script>
async function convertImages() {
const fileInput = document.getElementById("fileInput");
const output = document.getElementById("output");
output.innerHTML = ""; // Clear previous results
if (!fileInput.files.length) {
alert("Please select one or more HEIC images.");
return;
}
for (const file of fileInput.files) {
const container = document.createElement("div");
container.classList.add("image-container");
const progressBar = document.createElement("div");
progressBar.classList.add("progress-bar");
const progressBarFill = document.createElement("div");
progressBarFill.classList.add("progress-bar-fill");
progressBar.appendChild(progressBarFill);
container.appendChild(progressBar);
output.appendChild(container);
const estimatedTime = Math.max(2000, file.size / 350); // Minimum 2 seconds
const updateInterval = 100;
const steps = Math.ceil(estimatedTime / updateInterval);
let currentStep = 0;
const updateProgress = () => {
if (currentStep <= steps) {
const percentage = (currentStep / steps) * 100;
progressBarFill.style.width = `${percentage}%`;
currentStep++;
setTimeout(updateProgress, updateInterval);
}
};
try {
updateProgress();
const blob = await heic2any({
blob: file,
toType: "image/jpeg",
});
progressBarFill.style.width = "100%";
const img = document.createElement("img");
img.src = URL.createObjectURL(blob);
container.appendChild(img);
const downloadLink = document.createElement("a");
downloadLink.href = img.src;
downloadLink.download = file.name.replace(/\.heic$/i, ".jpg");
downloadLink.innerText = `Download ${downloadLink.download}`;
downloadLink.classList.add("download-link");
container.appendChild(downloadLink);
} catch (error) {
console.error("Conversion error:", error);
alert(`Error converting ${file.name}: ${error.message}`);
} finally {
setTimeout(() => {
progressBar.remove();
}, 500);
}
}
}
</script>
</body>
</html>