Download tasks/lowes/solution/site/implementation/clone/ui/icons.py from TIGER-Lab/WebsiteBench: direct link, hf CLI and curl.
- Browser
- Download file 3.86 kB
-
https://huggingface.co/datasets/TIGER-Lab/WebsiteBench/resolve/main/tasks/lowes/solution/site/implementation/clone/ui/icons.py
- Command line
-
hf download hf://datasets/TIGER-Lab/WebsiteBench/tasks/lowes/solution/site/implementation/clone/ui/icons.py
-
curl -L -o icons.py https://huggingface.co/datasets/TIGER-Lab/WebsiteBench/resolve/main/tasks/lowes/solution/site/implementation/clone/ui/icons.py
3.86 kB
| """Inline SVG glyphs drawn locally for the Lowe's offline clone. | |
| Every glyph is authored here as simple geometry so the clone ships no | |
| third-party icon font, sprite sheet or CDN reference. Shapes approximate the | |
| affordances visible in the captured header and category nav (store, delivery | |
| truck, search, camera, sparkle, account, cart, grid, tools, tag, bulb) and the | |
| account drawer list (package, tools, heart, medal, asterisk). | |
| """ | |
| from __future__ import annotations | |
| _OPEN = ( | |
| '<svg class="glyph" width="{size}" height="{size}" viewBox="0 0 24 24" ' | |
| 'fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" ' | |
| 'stroke-linejoin="round" aria-hidden="true" focusable="false">' | |
| ) | |
| _PATHS: dict[str, str] = { | |
| "store": '<path d="M3 9l1.6-4.2h14.8L21 9"/><path d="M4 9v10h16V9"/>' | |
| '<path d="M9 19v-5h6v5"/>', | |
| "truck": '<path d="M2 7h11v9H2z"/><path d="M13 10h4l4 3v3h-8z"/>' | |
| '<circle cx="7" cy="18.5" r="1.6"/><circle cx="17" cy="18.5" r="1.6"/>', | |
| "search": '<circle cx="10.5" cy="10.5" r="6"/><path d="M15 15l4.5 4.5"/>', | |
| "camera": '<path d="M3 8h4l1.5-2h7L17 8h4v11H3z"/><circle cx="12" cy="13" r="3.4"/>', | |
| "sparkle": '<path d="M12 3l1.9 5.1L19 10l-5.1 1.9L12 17l-1.9-5.1L5 10l5.1-1.9z"/>' | |
| '<path d="M18 15.5l.8 2.1 2.2.8-2.2.8-.8 2.1-.8-2.1-2.2-.8 2.2-.8z"/>', | |
| "account": '<circle cx="12" cy="12" r="9"/><circle cx="12" cy="10" r="3.1"/>' | |
| '<path d="M5.8 19a6.6 6.6 0 0 1 12.4 0"/>', | |
| "cart": '<path d="M4 5h2.2l2.3 9.4h9l2.2-6.7H7"/>' | |
| '<circle cx="10" cy="19" r="1.5"/><circle cx="17.5" cy="19" r="1.5"/>', | |
| "grid": '<rect x="4" y="4" width="6" height="6"/><rect x="14" y="4" width="6" height="6"/>' | |
| '<rect x="4" y="14" width="6" height="6"/><rect x="14" y="14" width="6" height="6"/>', | |
| "tools": '<path d="M4 20l7-7"/><path d="M14.5 3.5a4 4 0 0 0 5 5L14 14l-4-4z"/>' | |
| '<path d="M3.5 6.5l3-3 3.5 3.5-3 3z"/>', | |
| "tag": '<path d="M4 4h7.4L20 12.6 12.6 20 4 11.4z"/><circle cx="8.3" cy="8.3" r="1.4"/>', | |
| "bulb": '<path d="M9 17h6"/><path d="M10 20h4"/>' | |
| '<path d="M12 3a6 6 0 0 0-3.6 10.8V17h7.2v-3.2A6 6 0 0 0 12 3z"/>', | |
| "wrench": '<path d="M20 6.5a4.5 4.5 0 0 1-6 5.9L6.6 19.8a2 2 0 0 1-2.8-2.8l7.4-7.4A4.5 4.5 0 0 1 17.5 4z"/>', | |
| "package": '<path d="M12 3l8.5 4.5v9L12 21l-8.5-4.5v-9z"/><path d="M3.5 7.5L12 12l8.5-4.5"/>' | |
| '<path d="M12 12v9"/>', | |
| "heart": '<path d="M12 20s-7-4.4-7-9.2A3.8 3.8 0 0 1 12 8a3.8 3.8 0 0 1 7 2.8C19 15.6 12 20 12 20z"/>', | |
| "medal": '<circle cx="12" cy="14.5" r="5"/><path d="M8.5 9.6L6 3h12l-2.5 6.6"/>', | |
| "asterisk": '<path d="M12 4v16"/><path d="M5 8l14 8"/><path d="M19 8L5 16"/>', | |
| "close": '<path d="M6 6l12 12"/><path d="M18 6L6 18"/>', | |
| "chevron": '<path d="M9 5l7 7-7 7"/>', | |
| "caret": '<path d="M6 9l6 6 6-6"/>', | |
| "dollar": '<circle cx="12" cy="12" r="9"/><path d="M12 6.5v11"/>' | |
| '<path d="M14.8 9.3A2.8 2.8 0 0 0 12 8c-1.7 0-2.8.9-2.8 2.1 0 2.9 5.6 1.5 5.6 4.2 0 1.2-1.1 2.2-2.8 2.2a2.9 2.9 0 0 1-2.9-1.5"/>', | |
| "points": '<circle cx="12" cy="12" r="9"/><path d="M9.4 16.5V7.5h3.2a2.7 2.7 0 0 1 0 5.4H9.4"/>', | |
| "gift": '<path d="M3.5 9h17v3.5h-17z"/><path d="M5 12.5h14V20H5z"/><path d="M12 9v11"/>' | |
| '<path d="M12 9C10.5 5.8 6 5.5 6 7.6 6 9 8.7 9.2 12 9z"/>' | |
| '<path d="M12 9c1.5-3.2 6-3.5 6-1.4 0 1.4-2.7 1.6-6 1.4z"/>', | |
| "check": '<path d="M5 12.8l4.4 4.4L19 7.6"/>', | |
| "info": '<circle cx="12" cy="12" r="9"/><path d="M12 11v6"/><path d="M12 7.6h.01"/>', | |
| "shield": '<path d="M12 3l7.5 3v5.5C19.5 16 16.3 19.6 12 21c-4.3-1.4-7.5-5-7.5-9.5V6z"/>', | |
| "leaf": '<path d="M5 19C4 12 8.5 5.5 19 5c.5 9.5-5 14.5-11.5 13.5"/><path d="M5 19c3-4.6 6.6-7.3 11-9"/>', | |
| } | |
| def icon(name: str, size: int = 20) -> str: | |
| body = _PATHS.get(name) | |
| if body is None: | |
| raise KeyError(f"unknown icon: {name}") | |
| return _OPEN.format(size=size) + body + "</svg>" | |