-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
389 lines (342 loc) · 22.5 KB
/
index.html
File metadata and controls
389 lines (342 loc) · 22.5 KB
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
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>xsukax Github Logo Embed Code Generator</title>
<script src="https://cdn.tailwindcss.com"></script>
<style>
.logo-option { transition: all 0.3s ease; cursor: pointer; }
.logo-option:hover { transform: scale(1.05); }
.logo-option.selected { border-color: #2563eb; background-color: #eff6ff; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2); }
#previewContainer { transition: background-color 0.3s ease; }
.modal { display: none; position: fixed; z-index: 50; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); animation: fadeIn 0.2s; }
.modal.active { display: flex; }
.modal-content { animation: slideDown 0.3s; }
.toast { position: fixed; top: 20px; right: 20px; z-index: 60; animation: slideInRight 0.3s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideDown { from { transform: translateY(-50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideInRight { from { transform: translateX(400px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOutRight { from { transform: translateX(0); opacity: 1; } to { transform: translateX(400px); opacity: 0; } }
.toast.hiding { animation: slideOutRight 0.3s; }
code { font-family: 'Courier New', monospace; }
</style>
</head>
<body class="bg-gray-50 min-h-screen">
<!-- Toast Container -->
<div id="toastContainer"></div>
<!-- Modal -->
<div id="modal" class="modal items-center justify-center">
<div class="modal-content bg-white rounded-lg shadow-2xl max-w-md w-full mx-4 p-6">
<div class="flex items-center justify-between mb-4">
<h3 id="modalTitle" class="text-xl font-bold text-gray-800"></h3>
<button onclick="closeModal()" class="text-gray-400 hover:text-gray-600 text-2xl leading-none">×</button>
</div>
<p id="modalMessage" class="text-gray-600 mb-6"></p>
<div class="flex justify-end gap-3">
<button onclick="closeModal()" class="px-4 py-2 bg-gray-200 hover:bg-gray-300 text-gray-800 rounded-lg font-medium transition">Close</button>
</div>
</div>
</div>
<!-- Header -->
<header class="bg-gradient-to-r from-gray-900 to-gray-800 text-white py-8 shadow-lg">
<div class="container mx-auto px-4">
<h1 class="text-3xl md:text-4xl font-bold mb-2">xsukax Github Logo Embed Code Generator</h1>
<p class="text-gray-300 text-sm md:text-base">Effortlessly embed customizable GitHub SVG logos into your projects</p>
</div>
</header>
<!-- Main Content -->
<main class="container mx-auto px-4 py-8 max-w-6xl">
<!-- Repository URL Input -->
<section class="bg-white rounded-lg shadow-md p-6 mb-6">
<label for="repoUrl" class="block text-lg font-semibold text-gray-800 mb-3">GitHub Repository URL</label>
<div class="flex flex-col md:flex-row gap-3">
<input type="text" id="repoUrl" placeholder="https://github.com/username/repository" class="flex-1 px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent outline-none transition">
<button onclick="validateUrl()" class="px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white font-semibold rounded-lg transition shadow-md">Validate URL</button>
</div>
<p class="text-sm text-gray-500 mt-2">Enter a valid GitHub repository URL to proceed</p>
</section>
<!-- Logo Selection -->
<section class="bg-white rounded-lg shadow-md p-6 mb-6">
<h2 class="text-lg font-semibold text-gray-800 mb-4">Select a GitHub Logo Design</h2>
<div class="grid grid-cols-2 md:grid-cols-4 gap-4" id="logoGrid"></div>
</section>
<!-- Size Customization -->
<section class="bg-white rounded-lg shadow-md p-6 mb-6">
<div class="flex items-center justify-between mb-4">
<h2 class="text-lg font-semibold text-gray-800">Customize Logo Size</h2>
<span id="previewLinkBadge" class="hidden px-3 py-1 bg-blue-100 text-blue-700 text-xs font-semibold rounded-full">🔗 Linked</span>
</div>
<div class="flex items-center gap-4 mb-4">
<label for="sizeSlider" class="text-gray-700 font-medium min-w-fit">Height:</label>
<input type="range" id="sizeSlider" min="16" max="256" value="64" class="flex-1" oninput="updateSize(this.value)">
<span id="sizeValue" class="text-gray-800 font-bold min-w-fit">64px</span>
</div>
<div class="bg-gray-100 rounded-lg p-8 flex items-center justify-center min-h-[200px]">
<div id="previewContainer" class="bg-white rounded-lg shadow-md p-6"></div>
</div>
</section>
<!-- Generated Code -->
<section class="bg-white rounded-lg shadow-md p-6 mb-6">
<div class="flex items-center justify-between mb-4">
<div>
<h2 class="text-lg font-semibold text-gray-800">Generated Embed Code</h2>
<p id="linkStatus" class="text-sm text-gray-500 mt-1"></p>
</div>
<button onclick="copyCode()" class="px-4 py-2 bg-green-600 hover:bg-green-700 text-white font-semibold rounded-lg transition shadow-md">Copy Code</button>
</div>
<div class="bg-gray-900 rounded-lg p-4 overflow-x-auto">
<code id="generatedCode" class="text-green-400 text-sm block whitespace-pre"></code>
</div>
</section>
<!-- Integration Instructions -->
<section class="bg-white rounded-lg shadow-md p-6">
<h2 class="text-lg font-semibold text-gray-800 mb-4">Integration Instructions</h2>
<div class="space-y-4 text-gray-700">
<div class="flex items-start gap-3">
<span class="bg-blue-600 text-white rounded-full w-6 h-6 flex items-center justify-center font-bold text-sm flex-shrink-0">1</span>
<p><strong>Validate repository URL (optional):</strong> Enter and validate your GitHub repository URL to make the logo clickable and link directly to your repository.</p>
</div>
<div class="flex items-start gap-3">
<span class="bg-blue-600 text-white rounded-full w-6 h-6 flex items-center justify-center font-bold text-sm flex-shrink-0">2</span>
<p><strong>Copy the code:</strong> Click the "Copy Code" button above to copy the generated HTML snippet to your clipboard.</p>
</div>
<div class="flex items-start gap-3">
<span class="bg-blue-600 text-white rounded-full w-6 h-6 flex items-center justify-center font-bold text-sm flex-shrink-0">3</span>
<p><strong>Paste into your project:</strong> Insert the code snippet into your HTML file where you want the logo to appear (e.g., in a header, footer, or sidebar).</p>
</div>
<div class="flex items-start gap-3">
<span class="bg-blue-600 text-white rounded-full w-6 h-6 flex items-center justify-center font-bold text-sm flex-shrink-0">4</span>
<p><strong>README.md integration:</strong> For GitHub README files, you can use the same HTML code directly. GitHub supports inline SVG in markdown files.</p>
</div>
<div class="flex items-start gap-3">
<span class="bg-blue-600 text-white rounded-full w-6 h-6 flex items-center justify-center font-bold text-sm flex-shrink-0">5</span>
<p><strong>Customize further:</strong> You can modify the SVG attributes (like fill color, stroke, etc.) directly in the code for additional customization.</p>
</div>
</div>
</section>
</main>
<!-- Footer -->
<footer class="bg-gray-900 text-gray-400 py-6 mt-12">
<div class="container mx-auto px-4 text-center">
<p>© 2025 xsukax. Crafted with precision for developers.</p>
</div>
</footer>
<script>
const logos = [
{
name: 'GitHub Mark (White)',
aspectRatio: 1.02, // 98/96
svg: `<svg viewBox="0 0 98 96" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z" fill="#fff"/></svg>`
},
{
name: 'GitHub Mark (Black)',
aspectRatio: 1.02, // 98/96
svg: `<svg viewBox="0 0 98 96" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z" fill="#24292f"/></svg>`
},
{
name: 'GitHub Text Logo (Black)',
aspectRatio: 3.5, // 1020/291
svg: `<svg viewBox="0 0 1020 291" xmlns="http://www.w3.org/2000/svg" fill="#111"><path d="m118 125c-2 0-4 2-4 4v41c0 2 2 4 4 4h33v51s-7 3-28 3c-24 0-57-9-57-83 0-74 35-83 68-83 29 0 41 5 49 7 2 1 5-2 5-4l9-40c0-1 0-2-2-3-3-2-22-13-71-13-57 0-113 23-113 139 0 115 66 132 121 132 46 0 74-19 74-19 1-1 1-2 1-3v-129c0-2-2-4-4-4"/><path d="m635 23c0-2-2-4-4-4h-47c-2 0-4 2-4 4 0 0 0 91 0 91h-74v-91c0-2-2-4-4-4h-47c-2 0-4 2-4 4v247c0 2 2 4 4 4h47c2 0 4-2 4-4v-106h74l0 106c0 2 2 4 4 4h47c2 0 4-2 4-4v-247"/><circle cx="261" cy="56" r="31"/><path d="m288 104c0-2-2-4-4-4h-47c-2 0-4 2-4 4v164c0 5 3 6 7 6h43c5 0 6-2 6-6"/><path d="m768 101c-2 0-4 2-4 4v121s-12 9-29 9c-17 0-21-8-21-24v-106c0-2-2-4-4-4h-47c-2 0-4 2-4 4v114c0 49 27 61 65 61 31 0 56-17 56-17s1 9 2 10c1 1 2 2 3 2l30 0c2 0 4-2 4-4l0-166c0-2-2-4-4-4"/><path d="m926 236c-20 0-29-9-29-9v-79s11-7 24-8c17-2 33 4 33 44 0 43-5 52-29 52zm-27-129v-84c0-2-2-4-4-4h-47c-2 0-4 2-4 4v247c0 2 2 4 4 4h33c1 0 3-1 3-2 1-1 2-11 2-11s19 19 56 19c43 0 68-22 68-98s-39-86-66-86c-27 0-45 12-45 12z"/><path d="m389 100 0-47c0-2-1-3-3-3h-49c-2 0-3 1-3 4v49s-24 6-26 6c-2 1-3 2-3 4v31c0 2 2 4 4 4h25v73c0 55 38 60 64 60 12 0 26-4 28-5 1-1 2-2 2-4l0-33c0-2-2-4-4-4-2 0-7 1-13 1-17 0-23-8-23-19 0-11 0-69 0-69h35c2 0 4-2 4-4v-40c0-2-2-4-4-4"/></svg>`
},
{
name: 'GitHub Text Logo (White)',
aspectRatio: 3.5, // 1020/291
svg: `<svg viewBox="0 0 1020 291" xmlns="http://www.w3.org/2000/svg" fill="#fff"><path d="m118 125c-2 0-4 2-4 4v41c0 2 2 4 4 4h33v51s-7 3-28 3c-24 0-57-9-57-83 0-74 35-83 68-83 29 0 41 5 49 7 2 1 5-2 5-4l9-40c0-1 0-2-2-3-3-2-22-13-71-13-57 0-113 23-113 139 0 115 66 132 121 132 46 0 74-19 74-19 1-1 1-2 1-3v-129c0-2-2-4-4-4"/><path d="m635 23c0-2-2-4-4-4h-47c-2 0-4 2-4 4 0 0 0 91 0 91h-74v-91c0-2-2-4-4-4h-47c-2 0-4 2-4 4v247c0 2 2 4 4 4h47c2 0 4-2 4-4v-106h74l0 106c0 2 2 4 4 4h47c2 0 4-2 4-4v-247"/><circle cx="261" cy="56" r="31"/><path d="m288 104c0-2-2-4-4-4h-47c-2 0-4 2-4 4v164c0 5 3 6 7 6h43c5 0 6-2 6-6"/><path d="m768 101c-2 0-4 2-4 4v121s-12 9-29 9c-17 0-21-8-21-24v-106c0-2-2-4-4-4h-47c-2 0-4 2-4 4v114c0 49 27 61 65 61 31 0 56-17 56-17s1 9 2 10c1 1 2 2 3 2l30 0c2 0 4-2 4-4l0-166c0-2-2-4-4-4"/><path d="m926 236c-20 0-29-9-29-9v-79s11-7 24-8c17-2 33 4 33 44 0 43-5 52-29 52zm-27-129v-84c0-2-2-4-4-4h-47c-2 0-4 2-4 4v247c0 2 2 4 4 4h33c1 0 3-1 3-2 1-1 2-11 2-11s19 19 56 19c43 0 68-22 68-98s-39-86-66-86c-27 0-45 12-45 12z"/><path d="m389 100 0-47c0-2-1-3-3-3h-49c-2 0-3 1-3 4v49s-24 6-26 6c-2 1-3 2-3 4v31c0 2 2 4 4 4h25v73c0 55 38 60 64 60 12 0 26-4 28-5 1-1 2-2 2-4l0-33c0-2-2-4-4-4-2 0-7 1-13 1-17 0-23-8-23-19 0-11 0-69 0-69h35c2 0 4-2 4-4v-40c0-2-2-4-4-4"/></svg>`
}
];
let selectedLogo = null;
let currentSize = 64;
let repoUrl = '';
// Initialize the application
document.addEventListener('DOMContentLoaded', () => {
renderLogos();
generateCode();
});
// Render logo grid
function renderLogos() {
const grid = document.getElementById('logoGrid');
grid.innerHTML = logos.map((logo, index) => {
// Create a preview with proper aspect ratio
const previewHeight = 64;
const previewWidth = Math.round(previewHeight * logo.aspectRatio);
let previewSvg = logo.svg;
// Add dimensions to SVG for grid preview
if (previewSvg.includes('width="')) {
previewSvg = previewSvg.replace(/width="[^"]*"/, `width="${previewWidth}"`);
} else {
previewSvg = previewSvg.replace('<svg', `<svg width="${previewWidth}"`);
}
if (previewSvg.includes('height="')) {
previewSvg = previewSvg.replace(/height="[^"]*"/, `height="${previewHeight}"`);
} else {
previewSvg = previewSvg.replace('<svg', `<svg height="${previewHeight}"`);
}
const bgColor = logo.name.includes('White') ? 'style="background-color: #1a1a1a;"' : '';
return `
<div class="logo-option border-2 border-gray-200 rounded-lg p-4 flex flex-col items-center gap-2 hover:shadow-lg" onclick="selectLogo(${index})">
<div class="w-full h-16 flex items-center justify-center" ${bgColor}>${previewSvg}</div>
<span class="text-xs text-gray-600 text-center font-medium">${logo.name}</span>
</div>
`;
}).join('');
}
// Select a logo
function selectLogo(index) {
selectedLogo = index;
document.querySelectorAll('.logo-option').forEach((el, i) => {
el.classList.toggle('selected', i === index);
});
updatePreview();
generateCode();
showToast('Logo selected: ' + logos[index].name, 'success');
}
// Update size
function updateSize(value) {
currentSize = parseInt(value);
document.getElementById('sizeValue').textContent = value + 'px';
updatePreview();
generateCode();
}
// Update preview
function updatePreview() {
const preview = document.getElementById('previewContainer');
if (selectedLogo !== null) {
const logo = logos[selectedLogo];
let svg = logo.svg;
// Calculate dimensions based on aspect ratio
const height = currentSize;
const width = Math.round(currentSize * logo.aspectRatio);
// Add or update width and height in the SVG
if (svg.includes('width="')) {
svg = svg.replace(/width="[^"]*"/, `width="${width}"`);
} else {
svg = svg.replace('<svg', `<svg width="${width}"`);
}
if (svg.includes('height="')) {
svg = svg.replace(/height="[^"]*"/, `height="${height}"`);
} else {
svg = svg.replace('<svg', `<svg height="${height}"`);
}
// Add black background for white logos
const isWhiteLogo = logo.name.includes('White');
preview.style.backgroundColor = isWhiteLogo ? '#1a1a1a' : '#ffffff';
preview.innerHTML = svg;
} else {
preview.style.backgroundColor = '#ffffff';
preview.innerHTML = '<p class="text-gray-400 text-sm">Select a logo to preview</p>';
}
}
// Generate embed code
function generateCode() {
const codeEl = document.getElementById('generatedCode');
const linkStatus = document.getElementById('linkStatus');
if (selectedLogo === null) {
codeEl.textContent = '<!-- Select a logo to generate code -->';
linkStatus.textContent = '';
return;
}
const logo = logos[selectedLogo];
let svg = logo.svg.trim();
// Calculate dimensions based on aspect ratio
const height = currentSize;
const width = Math.round(currentSize * logo.aspectRatio);
// Add or update width and height attributes
if (svg.includes('width="')) {
svg = svg.replace(/width="[^"]*"/, `width="${width}"`);
} else {
svg = svg.replace('<svg', `<svg width="${width}"`);
}
if (svg.includes('height="')) {
svg = svg.replace(/height="[^"]*"/, `height="${height}"`);
} else {
svg = svg.replace('<svg', `<svg height="${height}"`);
}
// Generate code with or without repo URL link
let code;
if (repoUrl) {
code = `<!-- xsukax Github Logo Embed Code Generator - ${logo.name} - Linked to Repository -->
<a href="${repoUrl}" target="_blank" rel="noopener noreferrer">
${svg}
</a>`;
linkStatus.textContent = `✓ Logo will link to: ${repoUrl}`;
linkStatus.className = 'text-sm text-green-600 mt-1 font-medium';
} else {
code = `<!-- xsukax Github Logo Embed Code Generator - ${logo.name} -->
${svg}`;
linkStatus.textContent = 'Add a repository URL to make the logo clickable';
linkStatus.className = 'text-sm text-gray-500 mt-1';
}
codeEl.textContent = code;
}
// Copy code to clipboard
async function copyCode() {
const code = document.getElementById('generatedCode').textContent;
try {
await navigator.clipboard.writeText(code);
showToast('Code copied to clipboard!', 'success');
} catch (err) {
showToast('Failed to copy code', 'error');
}
}
// Validate GitHub URL
function validateUrl() {
const input = document.getElementById('repoUrl');
const url = input.value.trim();
const githubPattern = /^https?:\/\/(www\.)?github\.com\/[\w-]+\/[\w.-]+\/?$/;
if (!url) {
showModal('Invalid Input', 'Please enter a GitHub repository URL.');
return;
}
if (!githubPattern.test(url)) {
showModal('Invalid URL', 'Please enter a valid GitHub repository URL in the format: https://github.com/username/repository');
return;
}
repoUrl = url;
document.getElementById('previewLinkBadge').classList.remove('hidden');
generateCode(); // Regenerate code with the new URL
showToast('Valid GitHub repository URL! Logo will now link to your repo.', 'success');
}
// Show modal
function showModal(title, message) {
document.getElementById('modalTitle').textContent = title;
document.getElementById('modalMessage').textContent = message;
document.getElementById('modal').classList.add('active');
}
// Close modal
function closeModal() {
document.getElementById('modal').classList.remove('active');
}
// Show toast notification
function showToast(message, type = 'info') {
const container = document.getElementById('toastContainer');
const toast = document.createElement('div');
const bgColor = type === 'success' ? 'bg-green-500' : type === 'error' ? 'bg-red-500' : 'bg-blue-500';
toast.className = `toast ${bgColor} text-white px-6 py-3 rounded-lg shadow-lg mb-2 max-w-sm`;
toast.innerHTML = `
<div class="flex items-center gap-2">
<span>${message}</span>
<button onclick="removeToast(this)" class="ml-2 text-white hover:text-gray-200 font-bold">×</button>
</div>
`;
container.appendChild(toast);
setTimeout(() => {
toast.classList.add('hiding');
setTimeout(() => toast.remove(), 300);
}, 3000);
}
// Remove toast
function removeToast(button) {
const toast = button.closest('.toast');
toast.classList.add('hiding');
setTimeout(() => toast.remove(), 300);
}
// Close modal when clicking outside
document.getElementById('modal').addEventListener('click', (e) => {
if (e.target.id === 'modal') closeModal();
});
// Auto-select first logo
selectLogo(0);
</script>
</body>
</html>