Jobley / website · jobley.ai / tools / role-illustrations.py
| 1 | """Original, deterministic title art for volunteer and career cards.""" |
| 2 | from hashlib import sha256 |
| 3 | |
| 4 | # Simplified original line motifs. Drawing coordinates use a 48-unit square. |
| 5 | MOTIFS = { |
| 6 | "marine-hull": "M5 26h38l-6 9H13zm9-3 5-9h12l6 9M6 40q5-5 10 0t10 0t10 0t8-1", |
| 7 | "marine-propulsion": "M23 23a4 4 0 1 0 0 7 4 4 0 0 0 0-7zm0 0c-7-2-10-9-5-12 5-3 9 4 7 12m4 3c5-5 13-5 13 1s-7 7-13 2m-7 2c3 7-1 14-6 11s-2-10 3-13", |
| 8 | "marine-battery": "M6 12h31v21H6zm31 7h5v7h-5M17 17l-4 7h7l-3 5M26 22h5M6 40q5-5 10 0t10 0t10 0t8-1", |
| 9 | "marine-dock": "M5 24h38v5H5zm7 5v12m24-12v12M12 24V8h11v16m-7-12h3m8 3h6v5h-6zm3-4v4m3-4v4", |
| 10 | "marine-evidence": "M9 8h30v32H9zm9 0V5h12v3M14 31l6-7 5 3 8-10m-5 0h5v5M14 35h19", |
| 11 | "marine-cruise": "M5 27h38l-5 8H12zm7 0v-7h24v7m-20-7v-6h16v6m-11-6V8h6v6M5 40q5-4 10 0t10 0t10 0t8-1", |
| 12 | "hosting-platform": "M8 10h32v8H8zm0 11h32v8H8zm0 11h32v8H8zM13 14h2m-2 11h2m-2 11h2m15-22h6m-6 11h6m-6 11h6", |
| 13 | "hosting-transit": "M9 25h8m14 0h8M13 22v-7l11-7 11 7v7m-22 6v7l11 7 11-7v-7M20 21h8v8h-8zm-15 0h8v8H5zm30 0h8v8h-8z", |
| 14 | "hosting-facilities": "M6 19 24 9l18 10M9 20v21h30V20M14 24h20v14H14zm7 2-4 6h6l-3 5m9-9 2 2-2 3", |
| 15 | "hosting-cost": "M8 6v35h32M15 34v-8h5v8zm10 0V20h5v14zm10 0V13h5v21zM12 17l9-5 7 2 10-6", |
| 16 | "hosting-operations": "M24 7l13 6v11c0 8-5 13-13 17-8-4-13-9-13-17V13zm-6 16 4 4 8-9", |
| 17 | "garden-cad": "M5 21 19 9l14 12M9 18v19h20V18M16 37V26h7v11M4 41h40m-4-19v15m-4-11 4-4 4 4m-8 7 4 4 4-4", |
| 18 | "garden-catalog": "M7 8h13a4 4 0 0 1 4 4v28c0-3-2-5-5-5H7zm34 0H28a4 4 0 0 0-4 4v28c0-3 2-5 5-5h12zM12 16h7m-7 5h7m-7 5h7m14 2v-8m0 3c-5 0-5-3-5-6 4 0 5 2 5 6zm0 2c5 0 5-4 5-7-4 0-5 3-5 7z", |
| 19 | "garden-assets": "M24 41V25m0 6C10 31 9 21 9 15c7 0 15 5 15 16zm0 3c11 0 15-9 15-15-7 0-15 4-15 15zM19 21c-4-7 0-12 5-16 6 7 6 11 1 17M14 41h20", |
| 20 | "garden-layout": "M7 7h34v34H7zM7 18h11V7m12 34V29h11M12 37l24-24m-8 0h8v8M20 34a3 3 0 1 0 6 0 3 3 0 1 0-6 0Z", |
| 21 | "garden-ai": "M8 8h32v25H25l-8 7v-7H8zm11 9 3 3-3 6 7-3 5 3-2-6 3-5-6 1-4-4v5zM30 39h10m-5-5 5 5-5 5", |
| 22 | "lightwell-mechanical": "M9 9h30v7H9zm3 12h24v7H12zm3 12h18v7H15m-9-27H5m1 11H5m1 11H5", |
| 23 | "lightwell-power": "M6 16h36v20H6zm13 3-4 7h7l-3 6m11-8h7m-3-3v6M14 12h6m8 0h6", |
| 24 | "lightwell-firmware": "M15 13h18v19H15zm-5 3h5m-5 6h5m-5 6h5m18-12h5m-5 6h5m-5 6h5m-17 9h6m-9-31v7m12-7v7", |
| 25 | "lightwell-controller": "M11 7h26v34H11zm5 9h16m-16 7h16m-16 7h16m-12-12v-4m10 11v-4m-6 11v-4", |
| 26 | "lightwell-validation": "M9 8h30v33H9zm11 0V5h8v3m-13 9 3 3 5-6m3 4h7m-18 8 3 3 5-6m3 4h7M16 35h16", |
| 27 | "lightwell-parts": "M7 15h34v23H7zm0 8h34m-26-8v23m0-7h26M13 9h22m-13 10h9m-9 8h13m-13 8h6", |
| 28 | |
| 29 | "aosp-platform": "M6 12h26v24H6zM6 18h26m-21 6 4 4-4 4m8-1h6m11-12h7v20h-7z", |
| 30 | "linux-app-port": "M5 10h38v23H5zm15 23v4m8-4v4M15 39h18M12 16h9v10h-9zm13 1h11m-11 4h11m-11 4h8", |
| 31 | "glimmer-identity-sync": "M6 12h14v22H6zm22 0h14v22H28zM10 29h6m16 0h6M15 7h16l-3-3m3 3-3 3M33 40H17l3-3m-3 3 3 3", |
| 32 | |
| 33 | "preventive-vet": "M12 14a4 4 0 1 0 8 0 4 4 0 1 0-8 0zm8-4a4 4 0 1 0 8 0 4 4 0 1 0-8 0zm8 4a4 4 0 1 0 8 0 4 4 0 1 0-8 0zM12 31c0-5 6-12 12-12s12 7 12 12c0 5-6 6-12 2-6 4-12 3-12-2Z", |
| 34 | "preventive-clinical": "M10 8h28v33H10zm10 0V6h8v2M13 25h6l3-8 4 14 3-6h6M16 35h16", |
| 35 | "preventive-dental": "M10 17c0-9 9-12 14-7 5-5 14-2 14 7 0 6-4 8-4 14 0 5-3 8-5 8-4 0-1-12-5-12s-1 12-5 12c-2 0-5-3-5-8 0-6-4-8-4-14zm23-8 1-4m4 9 4-1", |
| 36 | |
| 37 | "printer-motion": "M6 10h36v28H6z M6 10l7-5h22l7 5 M12 30h24m-21-9h18m-15-4-4 4 4 4m12-8 4 4-4 4", |
| 38 | "printer-toolhead": "M8 8h32v8H8z M13 16v11l4 4 4-4V16m6 0v11l4 4 4-4V16M9 38h30m-16-3 1 4 1-4", |
| 39 | "printer-controls": "M14 14h20v20H14z M9 18h5m-5 6h5m-5 6h5m20-12h5m-5 6h5m-5 6h5m-21-1 3-6 4 4 4-6M20 9v5m8-5v5m-8 20v5m8-5v5", |
| 40 | "printer-filament": "M6 15a7 7 0 1 0 14 0 7 7 0 1 0-14 0zm4 0a3 3 0 1 0 6 0 3 3 0 1 0-6 0zm18 0a7 7 0 1 0 14 0 7 7 0 1 0-14 0zm4 0a3 3 0 1 0 6 0 3 3 0 1 0-6 0z M13 22v5l11 7 11-7v-5M18 39h12", |
| 41 | "printer-cad": "M8 33l10-6 10 6-10 6zm0 0V22l10-6 10 6v11m-10-6V16m12 1 7-4 6 4-6 4zm7 4v10m6-14v10l-6 4-7-4V17", |
| 42 | "printer-test": "M11 8h26v33H11zm8 0V6h10v2m-12 8 2 2 4-4m4 3h5m-15 8 2 2 4-4m4 3h5m-15 8 2 2 4-4m4 3h5", |
| 43 | "printer-materials": "M5 32 14 26l9 6-9 6zm10-9 9-6 9 6-9 6zm10-9 9-6 9 6-9 6z M24 37h12m-3-4 4 4-4 4", |
| 44 | "printer-liquid": "M8 15v23h32V15M8 25c6-6 10 6 16 0s10 6 16 0 M21 7v12l3 3 3-3V7m-7 23q4 5 8 0", |
| 45 | |
| 46 | "semi-route-study": "M5 17h23v15H5z M28 22h8l7 7v3H28 M10 32v4m24-4v4 M30 8h12m-4-3 4 3-4 3", |
| 47 | "aircraft-study": "M22 4h4l2 15 15 9v4l-15-3-2 13h-4l-2-13-15 3v-4l15-9z M11 24v8m26-8v8", |
| 48 | "shelter-outreach": "M7 19h26v13H18l-7 6v-6H7zm25 5h8v13h-5v4l-6-4h-4", |
| 49 | "shelter-operations": "M8 22 24 9l16 13v17H8zm11 17V26h10v13", |
| 50 | "shelter-pantry": "M8 11h32v27H8zm0 9h32M8 29h32m-25-6h6v5h-6zm14-11h5v7h-5z", |
| 51 | "shelter-access": "M8 33h6l17-16h9M8 38h9l18-16h5m-29-4h6v5h-6", |
| 52 | "shelter-housing": "M7 15h13l7 18h14m-5-5 5 5-5 5m-12-20h14l-7-7z", |
| 53 | "vision-outcomes": "M5 24s7-12 19-12 19 12 19 12-7 12-19 12S5 24 5 24zm26 0a7 7 0 1 1-14 0 7 7 0 1 1 14 0Z", |
| 54 | "vision-access": "M5 24h8m22 0h8M13 16a8 8 0 1 0 0 16m22-16a8 8 0 1 1 0 16m-14-8h6", |
| 55 | "vision-metrics": "M8 37V11m0 26h32M13 32l6-9 7 4 10-13m-2 0h4v4", |
| 56 | "browser-platform": "M7 9h34v30H7zM7 17h34M12 13h2m3 0h2m3 0h2M15 28l5-4m-5 4 5 4m13-8 5 4-5 4", |
| 57 | "browser-updates": "M7 9h34v30H7zM7 17h34m-22 9a7 7 0 0 1 12-3l3 4m0-5v5h-5m2 5a7 7 0 0 1-12 3l-3-4m0 5v-5h5", |
| 58 | "browser-access": "M7 9h34v30H7zM7 17h34m-26 8h18v8H15zm3 3h2m3 0h2m3 0h2", |
| 59 | "browser-testing": "M7 9h34v30H7zM7 17h34m-27 7 2 2 4-4m-6 11 2 2 4-4m5-7h8m-8 9h8", |
| 60 | "hardware-interconnect": "M8 8h11v10H8zm22 0h10v10H30zM8 30h11v10H8zm22 0h10v10H30z M19 13h11M13 18v12m22-12v12M19 35h11M19 24h10", |
| 61 | "hardware-thermal": "M5 9h37v30H5z M14 15a8 8 0 1 0 0 16 8 8 0 1 0 0-16m0 4v8m-4-4h8 M24 20h12m-4-4 4 4-4 4m-8 6h15", |
| 62 | "hardware-validation": "M12 7h18v5h7v29H9V12h3zm1 3h13 M13 21l3 3 5-6m3 4h9 M13 30l3 3 5-6m3 4h9", |
| 63 | "appliance-cooker": "M8 20h32l-4 18H12z M5 20h38 M13 20l5-7h12l5 7 M20 12V8h8v4M17 27h14m-10 4h6", |
| 64 | "appliance-refrigerator": "M11 7h26v34H11z M11 20h26m-21-8v4m0 9v6 M25 23v10m-4-8 8 5m-8 0 8-5", |
| 65 | "appliance-offline": "M10 7h28v34H10z M16 18q8-7 16 0m-12 4q4-3 8 0m-5 5h2m-9-13 16 16M21 36h6", |
| 66 | "appliance-resilience": "M8 10h32v28H8z M12 25h7l4-9 4 14 4-6h5 M13 6v4m10-4v4m10-4v4m-20 28v4m10-4v4m10-4v4", |
| 67 | "appliance-mechanical": "M8 9h32v30H8z M13 14h22v18H13z M24 17l7 11H17zm0 4v3m0 2v1 M14 35h4m12 0h4", |
| 68 | "home-maintainability": "M5 22 24 7l19 15M10 20v21h28V20 M18 40V25h12v15 m-9-7h5 m-3-3 3 3-3 3", |
| 69 | "home-envelope": "M7 39h34 M13 39V21L24 12v25 m5 0V10L13 24 M35 37V8L8 29 m30-14 4 2m-4 5 4 2", |
| 70 | "home-energy-storage": "M8 10h16l3 12H5z M16 10v12 M6 16h20 M12 22v6h12v7h6 M31 27h12v14H31z m4-7h4M35 31h4", |
| 71 | "home-appliance-loads": "M8 6h17v36H8z M8 16h17m-13-5h2 M30 22h11v20H30z m2-15h7m1 8a4 4 0 1 1-8 0 4 4 0 1 1 8 0", |
| 72 | "home-water-paths": "M7 9h20v6H13v13h-6zm6 18h14v-6h8v10H13 M38 30l-4 6a4 4 0 1 0 8 0z", |
| 73 | "home-duct-handoff": "M6 6h36v36H6z M11 15h22v10h7 M14 19h15v11h11m-8 4 3 3 5-5M17 19v17h-6", |
| 74 | "home-access": "M6 9h36v31H6z M17 9v10m0 11v10 M10 25h18m-6-5 6 5-6 5M36 20a5 5 0 1 0 0 10 5 5 0 1 0 0-10", |
| 75 | "home-lifecycle": "M7 39V9m0 30h35 M12 32l6-5 6 2 7-12 10-4 M32 12l9 1-3 8 M14 36h3m6 0h3m6 0h3", |
| 76 | "home-load-study": "M5 22 24 7l19 15M10 20v21h28V20 M16 28h8m0-5v10m7-5h4 M15 41v-7h17", |
| 77 | "heat-pump-study": "M7 11h34v26H7z M11 17h7l4 14 5-14 4 14h6M15 41h18", |
| 78 | "ventilation-study": "M5 30h17m-5-5 5 5-5 5M25 18h18m-5-5 5 5-5 5 M7 22V9h34v33H7v-7", |
| 79 | "hvac-commissioning-study": "M9 7h30v34H9z M14 17l2 2 4-5m4 3h11M14 27l2 2 4-5m4 3h11M14 36h21", |
| 80 | "battery-study": "M5 13h34v22H5z M39 20h4v8h-4 M12 24h6m-3-3v6m9-3h7", |
| 81 | "motor-study": "M8 11h24v26H8z M32 20h9v8h-9 M13 29h14M13 18l4 7 3-6 3 6 4-7", |
| 82 | "chassis-study": "M12 6v36m24-36v36M8 12h32M8 36h32M11 18h26v12H11z", |
| 83 | "network-study": "M6 22h36M7 12h9v8H7z M31 12h9v8h-9z M19 28h10v9H19z M11 20v2m25-2v2m-12 0v6", |
| 84 | "sensor-study": "M8 20h13v16H8z M21 24l7-4v16l-7-4 M31 19c5 4 5 11 0 15 M36 15c8 7 8 17 0 23", |
| 85 | "fusion-study": "M6 11h8v8H6z M6 29h8v8H6z M33 18h9v12h-9z M14 15h5l7 9h7m-19 9h5l7-9", |
| 86 | "map-study": "M6 12l12-4 12 4 12-4v28l-12 4-12-4-12 4z M18 8v28m12-24v28 M11 31l10-11 13 2", |
| 87 | "planning-study": "M8 38h11l6-13 10-9 7-1 M8 38h10l7-5h11l6-7 M36 10l6 5-5 4", |
| 88 | "validation-study": "M7 8h34v33H7z M7 17h34M19 17v24m12-24v24M7 28h34 M22 22l3 3 4-5", |
| 89 | "interface-study": "M6 10h36v23H6z M16 39h16m-8-6v6 M24 16l7 12H17z M24 21v2", |
| 90 | "production-study": "M5 33h38v6H5z M8 10h12v19H8z M24 16h15v13H24z M13 19h2m14 3h6", |
| 91 | "defensive-study": "M24 6l15 6v10c0 10-7 16-15 20-8-4-15-10-15-20V12z M18 23h12v9H18z M21 23v-4a3 3 0 0 1 6 0v4", |
| 92 | "autonomy-perception": "M5 31l4-11h20l4 11v6H5z M5 31h28 M9 37v4m20-4v4 M12 34h4m8 0h4 M11 14c5-5 11-5 16 0M7 10c7-7 17-7 24 0 M36 21h8v8h-8z M40 18v4m0 6v4", |
| 93 | "nanoscale-grid": "M7 35h26m-25 0v5m6-5v3m6-3v5m6-5v3m6-3v5 M10 10h2m7 0h2m7 0h2 M10 17h2m7 0h2m7 0h2 M10 24h2m7 0h2m7 0h2 M39 10a6 6 0 1 1-8.5 8.5A6 6 0 0 1 39 10zm0 8 5 5", |
| 94 | "quantum-circuit": "M4 15h10m10 0h8m8 0h4 M4 32h17m7 0h16 M14 9h10v12H14z M32 10h8v10h-8z M21 32h7m-3.5-3.5v7 M24.5 21v7.5", |
| 95 | "laptop": "M9 9h30v22H9z M9 31 4 38h40l-5-7 M19 35h10 M14 14h20v12H14z", |
| 96 | "desktop": "M4 8h29v22H4z M10 37h17m-8-7v7 M36 6h8v32h-8z M39 13h2m-2 18h2 M9 19l5-5m-5 5 5 5m5 0h8", |
| 97 | "foldable": "M5 8l17 4v30L5 38z M26 12l17-4v30l-17 4z M24 13v27 M9 16l9 2m-9 6 9 2m12-8 9-2m-9 10 9-2", |
| 98 | "hardware": "M5 12h24v26H5z M7 20h20m-17-4h2m3 0h2 M11 29a6 6 0 1 0 12 0 6 6 0 1 0-12 0 M34 20h9v16h-9z M31 28h3m3-4h3m-3 8h3", |
| 99 | "accord": "M9 5h29v36H9z M16 13h15m-15 6h15m-15 6h10 M22 33l4 4 9-9 M5 11v32h27", |
| 100 | "submersible": "M5 30l9-8h20l9 8-8 6H14z M17 22v-7h12l5 7 M21 15V8h7m-7 20h3m6 0h3 M5 41q5-4 10 0t10 0t10 0t8 0", |
| 101 | "evidence": "M8 6h30v36H8z M15 15h16m-16 6h10 M14 32h6l3-7 4 11 3-4h3 M5 11v32h28", |
| 102 | "plan": "M9 6h30v36H9z M16 16h15m-15 8h15m-15 8h9 M33 29l3 3 6-7", |
| 103 | "community": "M6 10h24v18H17l-7 6v-6H6z M21 32v5h13l6 5v-5h3V20h-8 M12 17h12m-12 5h9", |
| 104 | "code": "M17 12 6 24l11 12m14-24 11 12-11 12m-4-28-6 32", |
| 105 | "data": "M7 8v32h34 M13 33l8-9 7 3 11-15 M34 12h5v6", |
| 106 | "farm": "M24 43V24 M24 30C10 30 7 24 7 12c12 0 17 7 17 18Zm0 4c14 0 17-8 17-17-12 0-17 7-17 17Z", |
| 107 | "truck": "M4 12h24v22H4z M28 20h9l7 8v6H28 M16 39a5 5 0 1 0-10 0 5 5 0 1 0 10 0m25 0a5 5 0 1 0-10 0 5 5 0 1 0 10 0", |
| 108 | "food": "M7 22h34v14H7z M15 36v6h18v-6 M15 9c-4 4 4 5 0 9m9-13c-4 4 4 6 0 11m9-7c-4 4 4 5 0 9", |
| 109 | "film": "M6 11h36v27H6z M6 18h36 M15 11l5 7m7-7 5 7m-12 5 10 5-10 5z", |
| 110 | "chip": "M11 11h26v26H11z M17 17h14v14H17z M17 5v6m7-6v6m7-6v6m-14 26v6m7-6v6m7-6v6M5 17h6m-6 7h6m-6 7h6m26-14h6m-6 7h6m-6 7h6", |
| 111 | "power": "M29 3 9 27h14l-5 18 21-25H25z", |
| 112 | "solar": "M5 25 24 10l19 15M10 24v16h28V24 M16 27h16m-16 6h16m-11-9v15m7-15v15 M35 8v3m5 2 3-2", |
| 113 | "energy": "M6 40h36m-31 0 8-24 8 24m-10-18h5m-7 8h9m4 10 6-18 6 18m-8-11h4", |
| 114 | "health": "M17 7h14v10h10v14H31v10H17V31H7V17h10z", |
| 115 | "motor": "M8 31l5-12h22l5 12v7H8z M11 31h26M13 38v5m22-5v5M17 34h2m10 0h2", |
| 116 | "robot": "M11 16h26v21H11z M24 6v10m-3-9h6M16 26h2m12 0h2m-13 6h10M6 22v8m36-8v8", |
| 117 | "rocket": "M15 32c3-16 8-23 24-25-2 16-9 21-25 24m11-1-3 10-8-5m4-11-10 3 5 8m-5 6-3 3m32-25-5-5", |
| 118 | "tool": "M31 6l-7 7 3 8 8 3 7-7c2 10-5 15-14 14L15 43l-9-9 13-12C17 13 22 6 31 6Z", |
| 119 | "book": "M5 11c8-3 15-2 19 3 4-5 11-6 19-3v27c-8-3-15-2-19 3-4-5-11-6-19-3z M24 14v27", |
| 120 | "shield": "M24 5 41 11v13c0 8-6 15-17 20C13 39 7 32 7 24V11z M17 24l5 5 9-11", |
| 121 | "craft": "M8 37 28 17l5 5-20 20H8z M29 15l4-4a4 4 0 0 1 6 6l-4 4z M10 12h10m-5-5v10m18 18h8m-4-4v8", |
| 122 | "money": "M6 12h36v24H6z M30 24a6 6 0 1 1-12 0 6 6 0 1 1 12 0 M11 19h3m20 10h3", |
| 123 | "music": "M20 34V12l20-5v22M20 17l20-5 M20 34a5 5 0 1 1-10 0 5 5 0 1 1 10 0m20-5a5 5 0 1 1-10 0 5 5 0 1 1 10 0", |
| 124 | "cat-tree": "M6 41h36M15 40V22m17 18V13M10 22h18v5H10zM26 13h15v5H26z M12 13h12v7H12z M15 13l1-5 3 5m2 0 2-5 2 5", |
| 125 | "scratch": "M10 37h28v6H10zM19 37V10h10v27M19 15l10 4m-10 1 10 4m-10 1 10 4m-10 1 10 4M24 10V6m3 0a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z", |
| 126 | "collar": "M34 15c10 6 10 16 0 22s-22 4-28-2S2 20 10 15c5-3 12-4 18-2M10 24c-5 4-4 9 2 11m4-13 5-2m5-7h10v10H26z m10 5h8", |
| 127 | "weave": "M8 8h32v32H8zM15 8v32m9-32v32m9-32v32M8 15h32M8 24h32M8 33h32", |
| 128 | "animal": "M13 21c-5 0-6-9-2-10 4-1 7 10 2 10Zm9-3c-5 0-6-12-1-12 5 0 6 12 1 12Zm10 2c-5 0-5-11-1-11 5-1 6 11 1 11Zm9 5c-4 0-5-8-1-9 4-1 5 9 1 9Zm-17-3c6 0 14 10 14 16 0 7-9 3-14 3s-14 4-14-3c0-6 8-16 14-16Z", |
| 129 | } |
| 130 | PAL = [ |
| 131 | ("#182939", "#192126", "#e4ac68", "#82bdca"), ("#233336", "#1c2223", "#e2aa70", "#a2ccb0"), |
| 132 | ("#312737", "#211e28", "#f3a882", "#c4a9df"), ("#283337", "#1a282b", "#ffd18c", "#81c8bd"), |
| 133 | ("#392c2d", "#241e27", "#ffc69a", "#c3a8ce"), ("#2c3041", "#21232c", "#f2b274", "#a7bce5"), |
| 134 | ] |
| 135 | FAMILIES = dict(zip("11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53".split(), |
| 136 | "plan money code tool data community shield book craft health health shield food farm community money plan farm tool tool chip truck".split())) |
| 137 | TRADES = dict(zip("leadership-operations community software ai-data farming delivery-driving kitchens-food film-tv-production chips-manufacturing data-centers-trades build-solar-roof-tiles civilian-nuclear-energy health-veterinary motors robotics-space design-media".split(), |
| 138 | "plan community code data farm truck food film chip chip solar energy health motor robot craft".split())) |
| 139 | TRADES.update({'baby-products': 'health', 'sell-your-home-by-owner': 'solar', 'online-banking-research': 'money', 'clean-waterways': 'energy', 'mosquito-control-research': 'shield'}) |
| 140 | KEYWORDS = [ |
| 141 | ("solar photovoltaic roofing roof", "solar"), ("veterinary veterinarian animal", "animal"), |
| 142 | ("rocket space astronaut orbital", "rocket"), ("design artist graphic editor animation", "craft"), |
| 143 | ("film video television captions camera", "film"), ("music audio musician", "music"), |
| 144 | ("finance payroll bookkeeping banker budget", "money"), ("law legal attorney licensing safety security police", "shield"), |
| 145 | ("teacher education library librarian training professor", "book"), ("driver transit trucking dispatch transportation", "truck"), |
| 146 | ("farmer farming grounds garden landscape forestry", "farm"), ("food kitchens cook chef meals waitress", "food"), |
| 147 | ("dentist medical physician nursing nurse dental health pharmacy", "health"), |
| 148 | ("software web programmer developer coding", "code"), ("data analytics mathematics statistical", "data"), |
| 149 | ("robot robotics", "robot"), ("auto automobile motors vehicle mechanic automotive", "motor"), |
| 150 | ("power electrical energy electrician", "power"), ("machine equipment repair manufacturing construction plumbing", "tool"), |
| 151 | ] |
| 152 | def motif_for(title, fallback): |
| 153 | words = set(title.lower().replace("-", " ").split()) |
| 154 | return next((m for terms,m in KEYWORDS if words.intersection(terms.split())), fallback) |
| 155 | |
| 156 | OPEN_DESIGN_MOTIFS = { |
| 157 | "lightwell-mechanical": "M9 9h30v7H9zm3 12h24v7H12zm3 12h18v7H15m-9-27H5m1 11H5m1 11H5", |
| 158 | "lightwell-power": "M6 16h36v20H6zm13 3-4 7h7l-3 6m11-8h7m-3-3v6M14 12h6m8 0h6", |
| 159 | "lightwell-firmware": "M15 13h18v19H15zm-5 3h5m-5 6h5m-5 6h5m18-12h5m-5 6h5m-5 6h5m-17 9h6m-9-31v7m12-7v7", |
| 160 | "lightwell-controller": "M11 7h26v34H11zm5 9h16m-16 7h16m-16 7h16m-12-12v-4m10 11v-4m-6 11v-4", |
| 161 | "lightwell-validation": "M9 8h30v33H9zm11 0V5h8v3m-13 9 3 3 5-6m3 4h7m-18 8 3 3 5-6m3 4h7M16 35h16", |
| 162 | "lightwell-parts": "M7 15h34v23H7zm0 8h34m-26-8v23m0-7h26M13 9h22m-13 10h9m-9 8h13m-13 8h6", |
| 163 | |
| 164 | "aosp-platform": "M6 12h26v24H6zM6 18h26m-21 6 4 4-4 4m8-1h6m11-12h7v20h-7z", |
| 165 | "linux-app-port": "M5 10h38v23H5zm15 23v4m8-4v4M15 39h18M12 16h9v10h-9zm13 1h11m-11 4h11m-11 4h8", |
| 166 | "glimmer-identity-sync": "M6 12h14v22H6zm22 0h14v22H28zM10 29h6m16 0h6M15 7h16l-3-3m3 3-3 3M33 40H17l3-3m-3 3 3 3", |
| 167 | |
| 168 | "preventive-vet": "M12 14a4 4 0 1 0 8 0 4 4 0 1 0-8 0zm8-4a4 4 0 1 0 8 0 4 4 0 1 0-8 0zm8 4a4 4 0 1 0 8 0 4 4 0 1 0-8 0zM12 31c0-5 6-12 12-12s12 7 12 12c0 5-6 6-12 2-6 4-12 3-12-2Z", |
| 169 | "preventive-clinical": "M10 8h28v33H10zm10 0V6h8v2M13 25h6l3-8 4 14 3-6h6M16 35h16", |
| 170 | "preventive-dental": "M10 17c0-9 9-12 14-7 5-5 14-2 14 7 0 6-4 8-4 14 0 5-3 8-5 8-4 0-1-12-5-12s-1 12-5 12c-2 0-5-3-5-8 0-6-4-8-4-14zm23-8 1-4m4 9 4-1", |
| 171 | |
| 172 | "printer-motion": "M6 10h36v28H6z M6 10l7-5h22l7 5 M12 30h24m-21-9h18m-15-4-4 4 4 4m12-8 4 4-4 4", |
| 173 | "printer-toolhead": "M8 8h32v8H8z M13 16v11l4 4 4-4V16m6 0v11l4 4 4-4V16M9 38h30m-16-3 1 4 1-4", |
| 174 | "printer-controls": "M14 14h20v20H14z M9 18h5m-5 6h5m-5 6h5m20-12h5m-5 6h5m-5 6h5m-21-1 3-6 4 4 4-6M20 9v5m8-5v5m-8 20v5m8-5v5", |
| 175 | "printer-filament": "M6 15a7 7 0 1 0 14 0 7 7 0 1 0-14 0zm4 0a3 3 0 1 0 6 0 3 3 0 1 0-6 0zm18 0a7 7 0 1 0 14 0 7 7 0 1 0-14 0zm4 0a3 3 0 1 0 6 0 3 3 0 1 0-6 0z M13 22v5l11 7 11-7v-5M18 39h12", |
| 176 | "printer-cad": "M8 33l10-6 10 6-10 6zm0 0V22l10-6 10 6v11m-10-6V16m12 1 7-4 6 4-6 4zm7 4v10m6-14v10l-6 4-7-4V17", |
| 177 | "printer-test": "M11 8h26v33H11zm8 0V6h10v2m-12 8 2 2 4-4m4 3h5m-15 8 2 2 4-4m4 3h5m-15 8 2 2 4-4m4 3h5", |
| 178 | "printer-materials": "M5 32 14 26l9 6-9 6zm10-9 9-6 9 6-9 6zm10-9 9-6 9 6-9 6z M24 37h12m-3-4 4 4-4 4", |
| 179 | "printer-liquid": "M8 15v23h32V15M8 25c6-6 10 6 16 0s10 6 16 0 M21 7v12l3 3 3-3V7m-7 23q4 5 8 0", |
| 180 | |
| 181 | "build-cat-tree": "cat-tree", "build-scratching-post": "scratch", "build-dog-walking-gear": "collar", |
| 182 | "build-pet-friendly-fabrics": "weave", "build-global-distribution": "truck", |
| 183 | } |
| 184 | |
| 185 | def role_motif(title, trade): |
| 186 | tag = trade.removeprefix("atom-") |
| 187 | if tag == "build-global-distribution" and "software" in title.lower(): return "code" |
| 188 | if tag in OPEN_DESIGN_MOTIFS: return OPEN_DESIGN_MOTIFS[tag] |
| 189 | if tag in {"build-solar-roof-tiles", "civilian-nuclear-energy"}: |
| 190 | return TRADES[tag] |
| 191 | return motif_for(title, TRADES[tag]) |
| 192 | |
| 193 | def art(write, group, key, motif): |
| 194 | digest = sha256((group + "/" + key).encode()).digest() |
| 195 | base, shade, warm, cool = PAL[digest[0] % len(PAL)] |
| 196 | drift = (digest[2] % 41) - 20 |
| 197 | elevation = 56 + digest[1] % 21 |
| 198 | accent = warm if digest[3] % 2 else cool |
| 199 | dots = "".join(f'<circle cx="{12+v%190}" cy="{12+digest[i+8]%90}" r="{1+v%2}" fill="{cool}" opacity=".46"/>' for i,v in enumerate(digest[18:25])) |
| 200 | drawing = MOTIFS[motif] |
| 201 | src = f"/assets/role-art/{group}/{key}.svg" |
| 202 | markup = f'''<svg xmlns="http://www.w3.org/2000/svg" width="224" height="112" viewBox="0 0 224 112"> |
| 203 | <defs><linearGradient id="b" x2="1" y2="1" gradientUnits="objectBoundingBox"><stop stop-color="{base}"/><stop offset="1" stop-color="{shade}"/></linearGradient></defs> |
| 204 | <rect width="224" height="112" fill="url(#b)"/><path d="M0 {elevation+17}Q56 {elevation-19} 112 {elevation}t112 {-20}" fill="none" stroke="{cool}" opacity=".22"/> |
| 205 | <circle cx="{112+drift}" cy="56" r="41" fill="none" stroke="{cool}" opacity=".19"/><circle cx="{112+drift}" cy="56" r="36" fill="{shade}" stroke="{cool}" stroke-opacity=".44"/>{dots} |
| 206 | <path d="{drawing}" transform="translate({88+drift} 32)" fill="none" stroke="{accent}" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>''' |
| 207 | write(src[1:], markup) |
| 208 | return src |
| 209 | |
| 210 | def image(src, kind="thumb"): |
| 211 | return f'<img class="role-art role-art-{kind}" src="{src}" width="224" height="112" alt="" loading="lazy" decoding="async">' |