-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathicons.js
More file actions
31 lines (28 loc) · 6.66 KB
/
icons.js
File metadata and controls
31 lines (28 loc) · 6.66 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
/**
* Icon utility providing inline SVG icons as self-contained alternatives to FontAwesome
* All icons are base64 data URIs for complete offline/local functionality
*/
// SVG icon collection - base64 encoded for convenience
const ICONS = {
'fas fa-times': '<svg width="14" height="14" viewBox="0 0 352 512"><path fill="currentColor" d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.19 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"/></svg>',
'fas fa-home': '<svg width="16" height="16" viewBox="0 0 576 512"><path fill="currentColor" d="M280.37 148.26L96 300.11V464a16 16 0 0 0 16 16l112.06-.29a16 16 0 0 0 15.92-16V368a16 16 0 0 1 16-16h64a16 16 0 0 1 16 16v95.64a16 16 0 0 0 16 16.05L464 480a16 16 0 0 0 16-16V300L295.67 148.26a12.19 12.19 0 0 0-15.3 0zM571.6 251.47L488 182.56V44.05a12 12 0 0 0-12-12h-56a12 12 0 0 0-12 12v72.61L318.47 43.57c-17.39-16.42-46.81-16.42-64.22 0L4.4 251.47a12 12 0 0 0-3.07 8.07v9.94c0 2.12.81 4.14 2.28 5.71l11.95 11.95a12 12 0 0 0 16.95 0L288 86.53L556.76 286.2a12 12 0 0 0 16.95 0l11.95-11.95A12 12 0 0 0 587.27 260v-9.94a12 12 0 0 0-3.07-8.07z"/></svg>',
'fas fa-search': '<svg width="16" height="16" viewBox="0 0 512 512"><path fill="currentColor" d="M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.3-128 128-128 70.7 0 128 57.3 128 128 0 70.7-57.3 128-128 128z"/></svg>',
'fas fa-filter': '<svg width="16" height="16" viewBox="0 0 512 512"><path fill="currentColor" d="M487.976 0H24.028C2.71 0-8.047 25.866 7.058 40.971L192 225.941V432c0 7.831 3.821 15.17 10.237 19.662l80 55.98C298.02 518.69 320 507.493 320 487.98V225.941l184.947-184.97C520.057 25.814 509.292 0 487.976 0z"/></svg>',
'fas fa-cog': '<svg width="16" height="16" viewBox="0 0 512 512"><path fill="currentColor" d="M497.9 142.1l-46.1 46.1c-4.7 4.7-12.3 4.7-17 0l-111-111c-4.7-4.7-4.7-12.3 0-17l46.1-46.1c18.7-18.7 49.1-18.7 67.9 0l50.8 50.8c18.7 18.7 18.7 49.1 0 67.9zM284.2 99.8L21.6 362.4L.4 483.9c-2.9 16.4 11.4 30.6 27.8 27.8l121.5-21.3 262.6-262.6c4.7-4.7 12.3-4.7 17-4.7l36.5-36.5c9.4-9.4 9.4-24.6 0-33.9L296 .9c-9.4-9.4-24.6-9.4-33.9 0l-36.5 36.5c4.7 4.7 4.7 12.3-4.7 17zM124.1 339.9c-5.5-5.5-5.5-14.3 0-19.8l154-154c5.5-5.5 14.3-5.5 19.8 0s5.5 14.3 0 19.8l-154 154c-5.5 5.5-14.3 5.5-19.8 0zM88 424h48v36.3l-64.5 11.3-11.3-64.5V424z"/></svg>',
'fas fa-file-text': '<svg width="12" height="16" viewBox="0 0 384 512"><path fill="currentColor" d="M369.9 97.9L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM332.1 128H256V51.9l76.1 76.1zM48 464V48h160v104c0 13.3 10.7 24 24 24h104v288H48zm53.2-86.4l45.1-45.1c6.2-6.2 14.4-6.2 20.6 0L246.4 372c3.1 3.1 3.1 8.2 0 11.3l-11.3 11.3c-3.1 3.1-8.2 3.1-11.3 0L212.9 364 119.2 257.3c-6.2-6.2-6.2-16.4 0-22.6l11.3-11.3c6.2-6.2 16.4-6.2 22.6 0L232.4 341.5l120.1-120.1c6.2-6.2 16.4-6.2 22.6 0l11.3 11.3c6.2 6.2 6.2 16.4 0 22.6L264.1 387.1c-6.2 6.2-16.4 6.2-22.6 0l-84.3-84.3z"/></svg>',
'fas fa-ellipsis-v': '<svg width="2" height="16" viewBox="0 0 192 512"><path fill="currentColor" d="M96 184c-39.75 0-72 32.25-72 72s32.25 72 72 72 72-32.25 72-72-32.25-72-72-72zM24 80c0 39.75 32.25 72 72 72s72-32.25 72-72S135.75 8 96 8 24 40.25 24 80zm0 352c0 39.75 32.25 72 72 72s72-32.25 72-72-32.25-72-72-72-32.25 72-72 72z"/></svg>',
'fas fa-edit': '<svg width="16" height="16" viewBox="0 0 512 512"><path fill="currentColor" d="M493.255 56.236l-37.49-37.49c-10.506-10.506-27.662-10.506-38.168 0L294.8 166.409l76.168 76.168L493.256 94.405c10.506-10.506 10.506-27.662 0-38.168zM294.8 293.566L3.515 584.85c-5.251 5.251-7.331 12.858-5.419 20.265l14.285 71.428c2.154 10.783 11.834 19.169 22.617 21.323l71.428 14.285c7.407 1.912 14.904-.168 20.155-5.419L293.568 294.8l.098-.098c10.506-10.506 10.506-27.662 0-38.168L294.8 293.566z"/></svg>',
'fas fa-trash': '<svg width="14" height="16" viewBox="0 0 448 512"><path fill="currentColor" d="M432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16zM53.2 467a48 48 0 0 0 47.9 45h245.8a48 48 0 0 0 47.9-45L416 128H32z"/></svg>',
'fas fa-tag': '<svg width="14" height="16" viewBox="0 0 448 512"><path fill="currentColor" d="M0 80V229.5c0 17 6.7 33.3 18.7 45.3l176 176c25 25 65.5 25 90.5 0L418.7 317.3c25-25 25-65.5 0-90.5l-176-176c-12-12-28.3-18.7-45.3-18.7H48C21.5 32 0 53.5 0 80zm112 32h160c8.8 0 16 7.2 16 16s-7.2 16-16 16H112c-8.8 0-16-7.2-16-16s7.2-16 16-16z"/></svg>',
'fas fa-undo': '<svg width="16" height="16" viewBox="0 0 512 512"><path fill="currentColor" d="M255.545 8c-66.269.119-126.438 26.233-170.86 68.685L48.971 40.971C33.851 25.851 8 36.559 8 57.941V192c0 13.255 10.745 24 24 24h134.059c21.382 0 32.09-25.851 16.971-40.971l-41.75-41.75c27.649-21.807 63.291-35.262 102.771-35.262 56.138 0 107.273 25.987 140.796 68.063 5.73 7.172 15.549 8.29 22.71 2.516 7.187-5.742 8.299-15.524 2.547-22.699C366.077 35.513 315.469 8.134 255.545 8zM496 472c0-13.255-10.745-24-24-24H337.941c-21.382 0-32.09 25.851-16.971 40.971l41.75 41.75c-27.649 21.807-63.291 35.262-102.771 35.262-56.138 0-107.273-25.987-140.796-68.063-5.73-7.172-15.549-8.29-22.71-2.516-7.187 5.742-8.299 15.524-2.547 22.699C145.923 488.476 196.531 515.865 256.455 515.865c66.269-.119 126.438-26.233 170.86-68.685L463.029 471.029C478.149 486.149 504 475.441 504 454.059V320c0-13.255 10.745-24 24-24h134.059c21.382 0 32.09-25.851 16.971-40.971L496 472z"/></svg>'
};
/**
* Get inline SVG HTML for a FontAwesome icon
* @param {string} faClass - The FontAwesome class (e.g., "fas fa-home")
* @returns {string} HTML string containing inline SVG icon
*/
function getIcon(faClass) {
return ICONS[faClass] || '<svg width="16" height="16" viewBox="0 0 512 512"><path fill="currentColor" d="M504 256c0 137-111 248-248 248S8 393 8 256 119 8 256 8s248 111 248 248zm-248 54.1c23.9 0 37-29.6 23.7-67.8-10.5-30.7-25.2-45.5-35.9-43.6-24.6 4.3-23.8 40 3.4 47.8-23.9 0-37 29.6-23.7 67.8 10.5 30.7 25.2 45.5 35.9 43.6 24.6-4.3 23.8-40-3.4-47.8zm-61.7-86.5c23.9 0 37-29.6 23.7-67.8-10.5-30.7-25.2-45.5-35.9-43.6-24.6 4.3-23.8 40 3.4 47.8-23.9 0-37 29.6-23.7 67.8 10.5 30.7 25.2 45.5 35.9 43.6 24.6-4.3 23.8-40-3.4-47.8z"/></svg>';
}
// Export for use in other files
window.getIcon = getIcon;