// Navigation cards
{
// SVG icon builder — all paths are hardcoded constants
const ns = "http://www.w3.org/2000/svg"
function svgIcon(children) {
const s = document.createElementNS(ns, "svg")
s.setAttribute("viewBox", "0 0 24 24")
s.setAttribute("width", "24")
s.setAttribute("height", "24")
s.setAttribute("fill", "none")
s.setAttribute("stroke", "#c89a3e")
s.setAttribute("stroke-width", "1.5")
s.setAttribute("stroke-linecap", "round")
s.setAttribute("stroke-linejoin", "round")
for (const c of children) {
const el = document.createElementNS(ns, c[0])
for (const [k, v] of Object.entries(c[1])) el.setAttribute(k, v)
s.appendChild(el)
}
return s
}
const icons = {
matches: () => svgIcon([
["rect", {x:2,y:5,width:20,height:14,rx:2}],
["line", {x1:12,y1:5,x2:12,y2:19}],
["line", {x1:7,y1:10,x2:7,y2:14}],
["line", {x1:17,y1:10,x2:17,y2:14}]
]),
"player-ratings": () => svgIcon([
["path", {d:"M12 20a8 8 0 1 1 8-8"}],
["path", {d:"M12 20a8 8 0 0 1-8-8"}],
["line", {x1:12,y1:12,x2:16,y2:8}],
["circle", {cx:12,cy:12,r:1.5,fill:"#c89a3e",stroke:"none"}]
]),
"player-stats": () => svgIcon([
["line", {x1:4,y1:20,x2:20,y2:20}],
["rect", {x:5,y:13,width:3,height:7,rx:0.5}],
["rect", {x:10.5,y:9,width:3,height:11,rx:0.5}],
["rect", {x:16,y:4,width:3,height:16,rx:0.5}]
]),
ladder: () => svgIcon([
["circle", {cx:6,cy:6,r:2,fill:"#c89a3e",stroke:"none",opacity:0.9}],
["line", {x1:11,y1:6,x2:20,y2:6}],
["circle", {cx:6,cy:12,r:2,fill:"#c89a3e",stroke:"none",opacity:0.5}],
["line", {x1:11,y1:12,x2:18,y2:12}],
["circle", {cx:6,cy:18,r:2,fill:"#c89a3e",stroke:"none",opacity:0.25}],
["line", {x1:11,y1:18,x2:16,y2:18}]
]),
"team-ratings": () => svgIcon([
["path", {d:"M12 2L4 6v5c0 5.25 3.4 10.2 8 12 4.6-1.8 8-6.75 8-12V6l-8-4z"}],
["polyline", {points:"9 12 11 14 15 10"}]
]),
"team-stats": () => svgIcon([
["rect", {x:3,y:3,width:18,height:18,rx:2}],
["line", {x1:3,y1:9,x2:21,y2:9}],
["line", {x1:3,y1:15,x2:21,y2:15}],
["line", {x1:9,y1:3,x2:9,y2:21}],
["line", {x1:15,y1:3,x2:15,y2:21}]
])
}
const pages = [
{ title: "Matches", desc: "Results, predictions & win probabilities", href: "matches", icon: "matches" },
{ title: "Player Ratings", desc: "Predictive TORP, EPR & PSR ratings", href: "player-ratings", icon: "player-ratings" },
{ title: "Player Stats", desc: "Per-game box scores & EPV values", href: "player-stats", icon: "player-stats" },
{ title: "Ladder", desc: "Current standings & season projections", href: "ladder", icon: "ladder" },
{ title: "Team Ratings", desc: "Squad strength & component ratings", href: "team-ratings", icon: "team-ratings" },
{ title: "Team Stats", desc: "Aggregated team match statistics", href: "team-stats", icon: "team-stats" }
]
const grid = document.createElement("div")
grid.className = "afl-dash-nav-grid"
for (const p of pages) {
const card = document.createElement("a")
card.href = p.href
card.className = "afl-dash-nav-card"
const iconSpan = document.createElement("span")
iconSpan.className = "afl-dash-nav-icon"
iconSpan.appendChild(icons[p.icon]())
const body = document.createElement("div")
const title = document.createElement("div")
title.className = "afl-dash-nav-title"
title.textContent = p.title
const desc = document.createElement("div")
desc.className = "afl-dash-nav-desc"
desc.textContent = p.desc
body.appendChild(title)
body.appendChild(desc)
card.appendChild(iconSpan)
card.appendChild(body)
grid.appendChild(card)
}
return grid
}