|
| 1 | +const HEADER_LOGO = ` |
| 2 | + <svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"> |
| 3 | + {/* Leaf */} |
| 4 | + <path |
| 5 | + d="M16 4C20 4 24 7 26 12C24 18 20 22 16 24C12 22 8 18 6 12C8 7 12 4 16 4Z" |
| 6 | + fill="rgb(34, 197, 94)" |
| 7 | + className="drop-shadow-sm" |
| 8 | + /> |
| 9 | + {/* Leaf vein */} |
| 10 | + <path |
| 11 | + d="M16 6L16 22" |
| 12 | + stroke="rgb(21, 128, 61)" |
| 13 | + strokeWidth="1" |
| 14 | + className="opacity-60" |
| 15 | + /> |
| 16 | + {/* Small bar chart at bottom */} |
| 17 | + <g transform="translate(10, 25)"> |
| 18 | + <rect x="0" y="2" width="2" height="4" fill="rgb(34, 197, 94)" /> |
| 19 | + <rect x="3" y="0" width="2" height="6" fill="rgb(234, 179, 8)" /> |
| 20 | + <rect x="6" y="1" width="2" height="5" fill="rgb(239, 68, 68)" /> |
| 21 | + <rect x="9" y="3" width="2" height="3" fill="rgb(34, 197, 94)" /> |
| 22 | + </g> |
| 23 | + </svg> |
| 24 | +`; |
| 25 | + |
| 26 | +export const createHeader = () => { |
| 27 | + const header = document.createElement("header"); |
| 28 | + header.classList.add("cv-header"); |
| 29 | + |
| 30 | + header.innerHTML = HEADER_LOGO; |
| 31 | + const logo = header.querySelector("svg"); |
| 32 | + logo.classList.add("cv-header__logo"); |
| 33 | + |
| 34 | + const title = document.createElement("h1"); |
| 35 | + title.classList.add("cv-header__title"); |
| 36 | + title.innerText = "Carbon Visualizer"; |
| 37 | + header.append(title); |
| 38 | + |
| 39 | + return header; |
| 40 | +} |
0 commit comments