Files
awesome-copilot/extensions/draw/public/icons.js
T

45 lines
3.5 KiB
JavaScript

// 16px stroke icons. Stroke, caps and joins come from the .icon class.
const ICONS = {
select: '<path d="M4 2.5v10.2l2.8-2.6 1.9 4.2 1.7-.8-1.9-4.1h3.8z"/>',
hand: '<path d="M5.5 8.5V4a1 1 0 0 1 2 0v3.5M7.5 7V3a1 1 0 0 1 2 0v4M9.5 7.2V4.2a1 1 0 0 1 2 0v5.3c0 2.5-1.7 4.5-4.2 4.5-1.5 0-2.6-.7-3.4-1.9L2.4 9.6a1 1 0 0 1 1.5-1.3l1.6 1.6"/>',
rect: '<rect x="2.5" y="3.5" width="11" height="9" rx="1.5"/>',
ellipse: '<ellipse cx="8" cy="8" rx="5.75" ry="4.75"/>',
diamond: '<path d="M8 2l6 6-6 6-6-6z"/>',
cylinder: '<ellipse cx="8" cy="4.2" rx="5" ry="1.9"/><path d="M3 4.2v7.6c0 1.05 2.24 1.9 5 1.9s5-.85 5-1.9V4.2"/>',
arrow: '<path d="M3 13L13 3M7.5 3H13v5.5"/>',
text: '<path d="M3.5 4.5v-2h9v2M8 2.5v11M6 13.5h4"/>',
pen: '<path d="M11 2.5l2.5 2.5L6 12.5l-3.5 1 1-3.5z"/><path d="M9.5 4l2.5 2.5"/>',
undo: '<path d="M6 3.5L3 6.5l3 3"/><path d="M3 6.5h6.5a3.5 3.5 0 0 1 0 7H7"/>',
redo: '<path d="M10 3.5l3 3-3 3"/><path d="M13 6.5H6.5a3.5 3.5 0 0 0 0 7H9"/>',
minus: '<path d="M3.5 8h9"/>',
plus: '<path d="M8 3.5v9M3.5 8h9"/>',
fit: '<path d="M2.5 6V2.5H6M10 2.5h3.5V6M13.5 10v3.5H10M6 13.5H2.5V10"/>',
help: '<circle cx="8" cy="8" r="6"/><path d="M6.2 6.3a1.9 1.9 0 0 1 3.7.6c0 1.3-1.9 1.6-1.9 2.8"/><path d="M8 11.6h.01"/>',
front: '<rect x="2.5" y="2.5" width="7" height="7" rx="1"/><rect x="6.5" y="6.5" width="7" height="7" rx="1" fill="currentColor"/>',
back: '<rect x="6.5" y="6.5" width="7" height="7" rx="1" fill="currentColor"/><rect x="2.5" y="2.5" width="7" height="7" rx="1" style="fill: var(--bg)"/>',
duplicate: '<rect x="5.5" y="5.5" width="8" height="8" rx="1.5"/><path d="M10.5 5.5v-2a1 1 0 0 0-1-1h-6a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2"/>',
trash: '<path d="M3 4.5h10M6.5 4.5V3h3v1.5M4.5 4.5l.6 8.2a1 1 0 0 0 1 .8h3.8a1 1 0 0 0 1-.8l.6-8.2"/>',
"fill-none": '<rect x="3" y="3" width="10" height="10" rx="2"/>',
"fill-soft": '<rect x="3" y="3" width="10" height="10" rx="2" fill="currentColor" fill-opacity=".28"/>',
"fill-solid": '<rect x="3" y="3" width="10" height="10" rx="2" fill="currentColor"/>',
"line-solid": '<path d="M2.5 8h11"/>',
"line-dashed": '<path d="M2.5 8h11" stroke-dasharray="2.4 2.4"/>',
"head-end": '<path d="M2.5 8h10M9.5 5l3 3-3 3"/>',
"head-both": '<path d="M3.5 8h9M6.5 5l-3 3 3 3M9.5 5l3 3-3 3"/>',
"head-none": '<path d="M2.5 8h11"/><path d="M2.5 6v4M13.5 6v4" opacity=".45"/>',
"route-straight": '<path d="M3 13L13 3"/>',
"route-curve": '<path d="M3 13C3 6.5 13 9.5 13 3"/>',
"route-elbow": '<path d="M3 13V8h10V3"/>',
folder: '<path d="M2.5 4.5a1 1 0 0 1 1-1h3L8 5h4.5a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1h-9a1 1 0 0 1-1-1z"/>',
copy: '<rect x="5.5" y="5.5" width="8" height="8" rx="1.5"/><path d="M10.5 5.5v-2a1 1 0 0 0-1-1h-6a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2"/>',
download: '<path d="M8 2.5v8M4.5 7.5L8 11l3.5-3.5M3 13.5h10"/>',
edit: '<path d="M10.5 3l2.5 2.5-7 7H3.5V10z"/>',
sparkle: '<path d="M8 2.5l1.3 3.2 3.2 1.3-3.2 1.3L8 11.5 6.7 8.3 3.5 7l3.2-1.3z"/><path d="M12.5 11v3M11 12.5h3"/>',
sun: '<circle cx="8" cy="8" r="2.6"/><path d="M8 2.1v1.5M8 12.4v1.5M2.1 8h1.5M12.4 8h1.5M3.83 3.83l1.06 1.06M11.11 11.11l1.06 1.06M3.83 12.17l1.06-1.06M11.11 4.89l1.06-1.06"/>',
moon: '<path d="M13.73 8.53A5.75 5.75 0 1 1 7.47 2.27a4.6 4.6 0 0 0 6.26 6.26z"/>',
contrast: '<circle cx="8" cy="8" r="5.75"/><path d="M8 2.25a5.75 5.75 0 0 1 0 11.5z" fill="currentColor"/>',
check: '<path d="M3.5 8.5l3 3 6-7"/>',
};
export const icon = (name) => `<svg class="icon" viewBox="0 0 16 16" aria-hidden="true">${ICONS[name] || ""}</svg>`;