|
271 | 271 | } |
272 | 272 | } |
273 | 273 | </style> |
| 274 | + <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css"> |
274 | 275 | </head> |
275 | 276 | <body> |
276 | 277 | <div class="above-tabs"> |
|
331 | 332 | } |
332 | 333 | function getFileTypeIcon(fileName) { |
333 | 334 | const ext = fileName.split('.').pop().toLowerCase(); |
334 | | - if (['jpg','jpeg','png','gif','bmp','svg','webp'].includes(ext)) return '🖼️'; |
335 | | - if (['pdf'].includes(ext)) return '📄'; |
336 | | - if (['doc','docx'].includes(ext)) return '📝'; |
337 | | - if (['xls','xlsx','csv'].includes(ext)) return '📊'; |
338 | | - if (['ppt','pptx'].includes(ext)) return '📊'; |
339 | | - if (['zip','rar','7z','tar','gz'].includes(ext)) return '🗜️'; |
340 | | - if (['mp3','wav','ogg','m4a'].includes(ext)) return '🎵'; |
341 | | - if (['mp4','avi','mov','mkv'].includes(ext)) return '🎬'; |
342 | | - if (['txt','md','rtf','json','log'].includes(ext)) return '📃'; |
343 | | - return '📁'; |
| 335 | + if (['jpg','jpeg','png','gif','bmp','svg','webp'].includes(ext)) return '<i class="fa-regular fa-image"></i>'; |
| 336 | + if (['pdf'].includes(ext)) return '<i class="fa-regular fa-file-pdf"></i>'; |
| 337 | + if (['doc','docx'].includes(ext)) return '<i class="fa-regular fa-file-word"></i>'; |
| 338 | + if (['xls','xlsx','csv'].includes(ext)) return '<i class="fa-regular fa-file-excel"></i>'; |
| 339 | + if (['ppt','pptx'].includes(ext)) return '<i class="fa-regular fa-file-powerpoint"></i>'; |
| 340 | + if (['zip','rar','7z','tar','gz'].includes(ext)) return '<i class="fa-regular fa-file-zipper"></i>'; |
| 341 | + if (['mp3','wav','ogg','m4a'].includes(ext)) return '<i class="fa-regular fa-file-audio"></i>'; |
| 342 | + if (['mp4','avi','mov','mkv'].includes(ext)) return '<i class="fa-regular fa-file-video"></i>'; |
| 343 | + if (['txt','md','rtf','json','log'].includes(ext)) return '<i class="fa-regular fa-file-lines"></i>'; |
| 344 | + return '<i class="fa-regular fa-file"></i>'; |
344 | 345 | } |
345 | 346 | function fileToBase64(file) { |
346 | 347 | return new Promise((resolve, reject) => { |
|
403 | 404 | li.className = "file-pill"; |
404 | 405 | const icon = document.createElement('span'); |
405 | 406 | icon.className = "file-icon"; |
406 | | - icon.textContent = getFileTypeIcon(f.name); |
| 407 | + icon.innerHTML = getFileTypeIcon(f.name); |
407 | 408 | const title = document.createElement('span'); |
408 | 409 | title.className = "file-title"; |
409 | 410 | title.textContent = f.name; |
|
412 | 413 | const downloadBtn = document.createElement('button'); |
413 | 414 | downloadBtn.type = "button"; |
414 | 415 | downloadBtn.title = "Download"; |
415 | | - downloadBtn.innerHTML = "⬇️"; |
| 416 | + downloadBtn.innerHTML = '<i class="fa-solid fa-download"></i>'; |
416 | 417 | downloadBtn.onclick = function() { |
417 | 418 | const blob = new Blob([f.file], {type: f.file.type}); |
418 | 419 | const url = URL.createObjectURL(blob); |
|
430 | 431 | removeBtn.type = "button"; |
431 | 432 | removeBtn.title = "Remove"; |
432 | 433 | removeBtn.className = "remove-btn"; |
433 | | - removeBtn.innerHTML = "🗑️"; |
| 434 | + removeBtn.innerHTML = '<i class="fa-solid fa-xmark"></i>'; |
434 | 435 | removeBtn.onclick = function() { |
435 | 436 | attachedFiles.splice(i, 1); |
436 | 437 | attachedFileObjs.splice(i, 1); |
|
0 commit comments