Í kvöld mættust Afturelding og Fram 2 í Grill 66 deild kvenna í Myntkaup höllinni í Mosfellsbæ. Fyrir leik voru Aftureldingar stelpur búnar að tapa 5 leikjum í röð og voru neðstar í deildinni með 7 stig. Fram 2 sátu í 4. sæti með 10 stig. Fyrri hálfleikur var mjög jafn allan tímann en Afturelding hafði örlitla yfirhönd lengst af. Fóru þeir inn til búningsherbergja með 2 marka forystu 14-12. Í seinni hálfleik náði Afturelding fljótlega 4 marka forystu og útlitið gott. En eftir 10 mín leik í seinni náði Fram að jafna og þegar korter var eftir náðu þær 2 marka forskoti. Miklar sveiflur. Á lokasprettinum voru þær einfaldlega mun betri. Mest náði Fram 2 fimm marka forskoti og Afturelding náði ekki að ógna þeim að neinu ráði. Lokatölur leiksins urðu 27-29 fyrir Fram 2. Hjá Fram 2 var Sara Rún Gísladóttir markahæst með 12 mörk. Arna Sif Jónsdóttir varði 16 skot. Hjá Aftureldingu var Katrín Helga Davíðsdóttir með 13 mörk. Ingibjörg Gróa Guðmundsdóttir varði 19 skot.
Sjáðu stöðuna í deildinni.
/* ===== Mobile-first styles ===== */
:root{
--bg: #9a9a9a;
--card: #111822;
--muted: #24240a;
--text: #0a0a09;
--accent: #3aa0ff;
--accent-2: #10b981;
--danger: #ef4444;
--radius: 16px;
--shadow: 0 10px 30px rgba(0,0,0,.25);
}
#hb-match-root{ font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial; color: var(--text); background: var(--bg); padding: 14px; }
.hb-card{ max-width: 720px; margin: 0 auto; background: linear-gradient(180deg, #9a9a9a, #9a9a9a); border: 1px solid rgba(255,255,255,.06); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.hb-top{ display: grid; grid-template-columns: 1fr; gap: 12px; align-items: center; padding: 14px; border-bottom: 1px solid rgba(255,255,255,.06); }
/* Team rows stack on mobile */
.hb-team{ display: flex; grid-template-columns: 56px 1fr; gap: 10px; align-items: center; justify-content:center; }
.hb-team img{ width: 56px; height: 56px; border-radius: 12px; object-fit: contain; background: #9a9a9a; border: 1px solid rgba(255,255,255,.08); }
.hb-team .name{ font-weight: 800; font-size: clamp(18px, 5vw, 22px); line-height: 1.1 }
.hb-team .meta{ color: var(--muted); font-size: 12px }
/* Score block centered and touch-friendly */
.hb-vs{ display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; padding: 6px 0; }
.hb-score{ display:flex; align-items: baseline; gap: 8px; font-weight: 900; letter-spacing: .5px; }
.hb-score .home, .hb-score .away{ font-size: clamp(34px, 12vw, 48px) }
.hb-score .dash{ color: var(--muted); font-size: clamp(22px, 7vw, 28px) }
.hb-badge{ font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding: 6px 10px; border-radius: 999px; background: rgba(58,160,255,.15); color: var(--accent); border: 1px solid rgba(58,160,255,.35); }
.hb-badge.live{ background: rgba(239,68,68,.12); color: #ffb3b3; border-color: rgba(239,68,68,.35) }
.hb-badge.final{ background: rgba(16,185,129,.14); color: #a6f3d7; border-color: rgba(16,185,129,.35) }
.hb-meta{ display:grid; gap: 10px; padding: 12px 14px; }
.hb-rows{ display:grid; grid-template-columns: 1fr; gap: 10px; }
.hb-pill{ background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07); padding: 12px; border-radius: 12px; }
.hb-pill .label{ color: var(--muted); font-size: 12px; letter-spacing:.02em }
.hb-pill .value{ font-size: clamp(14px, 4.2vw, 14px); margin-top: 4px }
.hb-footer{ display:flex; flex-wrap: wrap; gap:8px; align-items:center; justify-content: space-between; padding: 12px 14px; background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.00)); border-top: 1px solid rgba(255,255,255,.06); }
.hb-tags{ display:flex; gap:8px; flex-wrap:wrap }
.hb-tag{ font-size: 12px; color: var(--muted); background: rgba(255,255,255,.04); border: 1px dashed rgba(255,255,255,.08); padding: 6px 10px; border-radius: 999px; }
.hb-time{ color: var(--muted); font-size: 13px }
/* match statistics container */
/* same background as your card */
.hb-stats {
max-width: 720px;
margin: 8px auto;
padding: 14px;
background: linear-gradient(180deg, #9a9a9a, #9a9a9a);
border: 1px solid rgba(255,255,255,.06);
border-radius: var(--radius);
box-shadow: var(--shadow);
}
/* column headings */
.hb-col h4 {
font-size: 13px;
font-weight: 700;
margin: 0 0 6px;
text-transform: uppercase;
letter-spacing: .08em;
}
/* tables styled like scoreboard */
.hb-stats table{
width: 100%;
border-collapse: collapse;
background: rgba(255,255,255,.04);
border: 1px solid rgba(255,255,255,.08);
border-radius: 10px;
overflow: hidden;
table-layout: fixed; /* important */
}
.hb-stats td {
border: none;
}
.hb-stats tr:not(:last-child) td {
border-bottom: 1px solid rgba(255,255,255,.08);
}
.hb-stats td + td {
border-left: none; /* make sure no vertical line between name & score */
}
.hb-stats tr:last-child td{ border-bottom: none; }
/* .hb-stats td:first-child{ text-align:left; } */
/* name column: take remaining space, never wrap; ellipsize instead */
.hb-stats td:first-child{
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
/* .hb-stats td:last-child{
text-align:right; font-weight:800; font-variant-numeric: tabular-nums;
} */
/* score column: right aligned, no wrap, fixed width that fits "10 / 2" */
.hb-stats td:last-child{
width: 8ch; /* fits "10 / 2" or "12" comfortably */
white-space: nowrap;
text-align: right;
font-weight: 800;
font-variant-numeric: tabular-nums;
}
/* rows container */
.hb-stats-rows {
display: grid;
gap: 16px;
}
.hb-row {
display: grid;
grid-template-columns: 1fr; /* one column on mobile */
gap: 16px;
align-items: start;
}
@media (min-width: 680px) {
.hb-row { grid-template-columns: 1fr 1fr; }
}
/* keep your existing .hb-stats table styles */
.hb-stats section h4 {
font-size: 13px;
font-weight: 700;
margin: 0 0 6px;
text-transform: uppercase;
letter-spacing: .08em;
/*color: rgba(255,255,255,.85);*/
}
#hb-events-root{ max-width:720px; margin:16px auto 0; padding: 0 14px; }
.hb-events{ display:grid; gap:10px; }
.hb-ev{
display:grid; grid-template-columns: auto 1fr auto; gap:10px; align-items:center;
background: rgba(255,255,255,.04); border:1px solid rgba(255,255,255,.07);
border-radius:12px; padding:10px 12px;
}
.hb-ev .kind{ font-size:12px; padding:6px 10px; border-radius:999px;
border:1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); }
.hb-ev .main{ line-height:1.2 }
.hb-ev .title{ font-weight:700; font-size:14px }
.hb-ev .meta{ color: var(--muted, #9fb0c2); font-size:12px; margin-top:2px }
.hb-ev .score{ font-weight:800; font-size:14px }
/* ===== Responsive upsizes ===== */
@media (min-width: 480px){
#hb-match-root{ padding: 18px }
.hb-top{ padding: 16px }
.hb-team{ grid-template-columns: 64px 1fr }
.hb-team img{ width: 64px; height: 64px }
}
@media (min-width: 680px){
.hb-top{ grid-template-columns: 1fr auto 1fr; text-align: left }
.hb-rows{ grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (min-width:680px){ #hb-events-root{ padding: 0 } }
/* Accessibility: reduce motion */
@media (prefers-reduced-motion: reduce){ *{ animation: none!important; transition: none!important } }
const MATCH_STATS_SRC = '/wp-json/azure/v1/matchstats?hsi_match_number=';
// Json mapped files
const TOURNAMENT_MAP_SRC = '/wp-content/uploads/tournaments.json?v=1'; // Tournaments
const TEAM_LOGO_MAP_SRC = '/wp-content/uploads/teams-logo.json?v=1'; // Team logos
//const TEAM_MAP_SRC = '/wp-content/uploads/teams.json?v=1'; // Team names
let HOME_LOGO_PATH = '';
let AWAY_LOGO_PATH = '';
let HOME_TEAM_NAME = '';
let AWAY_TEAM_NAME = '';
// Load Tournament Map
async function loadJsonMap(url){
try {
const res = await fetch(url, { cache: "reload" }); // or "force-cache"
if (!res.ok) throw new Error('HTTP ' + res.status);
return await res.json();
} catch (e) {
console.warn('Json map load failed:', e);
return {};
}
}
function getTournamentName(id, map){
const key = String(id || '').trim();
return (map && map[key]) || `Mót #${key || '—'} fannst ekki`;
}
// Helpers
const toInt = (v, d=0) => { const n = parseInt(v, 10); return Number.isFinite(n) ? n : d; };
const eventMs = ev => {
const t = (ev['Current Time'] || '').toString().replace(' ', 'T');
const ms = Date.parse(t);
return Number.isFinite(ms) ? ms : toInt(ev['HBStatz Event ID'], 0);
};
function renderMatch(rootId, matchData, tournamentMap, teamLogoMap){
const root = document.getElementById(rootId);
if (!root){ return; }
if (!matchData){
root.innerHTML = '';
return;
}
// Local variables
const match = matchData.MatchStats;
const topScorers = matchData.TopScorers;
const goalKeeperSaves = matchData.GoalkeeperSaves;
const warnings = matchData.Warnings;
const homeId = match.HomeTeamId;
const homeName = match.HomeTeamName;
const homeScore = match.HomeTeamScore;
const homeHT = match.HomeTeamHalftimeScore;
const awayId = match.AwayTeamId;
const awayName = match.AwayTeamName;
const awayScore = match.AwayTeamScore;
const awayHT = match.AwayTeamHalftimeScore;
const homeLogo = teamLogoMap && teamLogoMap[homeId] ? teamLogoMap[homeId] : match.HomeTeamLogo;
const awayLogo = teamLogoMap && teamLogoMap[awayId] ? teamLogoMap[awayId] : match.AwayTeamLogo;
HOME_LOGO_PATH = homeLogo;
AWAY_LOGO_PATH = awayLogo;
HOME_TEAM_NAME = homeName;
AWAY_TEAM_NAME = awayName;
const tourId = match.TournamentId;
const tourName = getTournamentName(tourId, tournamentMap);
const gameTime = document.getElementById('hb-hsi-data')?.dataset.gametime ?? null;
const dateFmt = gameTime !== null ? match.MatchDateFmt.replace('00:00', gameTime) : match.MatchDateFmt;
const clock = match.Clock;
const statusCode = match.StatusCode;
const statusText = match.StatusText;
const gender = match.Gender;
const isLive = statusCode === 2;
const isFinal = statusCode === 4;
// Update the HTML Body (Posts)
document.querySelectorAll("p.testid").forEach(el => {
el.innerHTML = el.innerHTML.replace("{HomeTeamName}", homeName);
el.innerHTML = el.innerHTML.replace("{AwayTeamName}", awayName);
el.innerHTML = el.innerHTML.replace("{TourName}", tourName);
});
// IDs / tags
const tags = [
gender,
tourName
].filter(Boolean);
// Template
root.innerHTML = `
${homeScore}
–
${awayScore}
${statusText}
${homeName} – Markaskorarar
${renderTopScorers(topScorers, "home")}
${awayName} – Markaskorarar
${renderTopScorers(topScorers, "away")}
${homeName} – Varin skot
${renderGoalKeeperSaves(goalKeeperSaves, "home")}
${awayName} – Varin skot
${renderGoalKeeperSaves(goalKeeperSaves, "away")}
${homeName} - Brottvísanir
${renderWarnings(warnings, "home")}
${awayName} - Brottvísanir
${renderWarnings(warnings, "away")}
`;
}
function renderMatchNotFound(rootId, hsi) {
const root = document.getElementById(rootId);
if (!root) return;
root.innerHTML = `
`;
}
function renderTopScorers(topScorers, homeOrAway) {
if (topScorers === null) return ` `;
return topScorers
.filter(s => (s.HomeOrAway || '').toLowerCase() === homeOrAway)
.sort((a, b) =>
b.Goals - a.Goals ||
b.Penalties - a.Penalties ||
a.PlayerName.localeCompare(b.PlayerName)
)
.map(s => {
const score = s.Penalties > 0 ? `${s.Goals} / ${s.Penalties}` : s.Goals;
return `${s.PlayerName} ${score} `;
})
.join('');
}
function renderGoalKeeperSaves(goalKeepers, homeOrAway) {
if (goalKeepers === null) return ` `;
return goalKeepers
.filter(s => (s.HomeOrAway || '').toLowerCase() === homeOrAway)
.sort((a, b) =>
b.Saves - a.Saves ||
a.PlayerName.localeCompare(b.PlayerName)
)
.map(s => {
const save = s.Saves;
return `${s.PlayerName} ${save} `;
})
.join('');
}
function renderWarnings(warnings, homeOrAway) {
if (warnings === null) return ` `;
return warnings
.filter(s => (s.HomeOrAway || '').toLowerCase() === homeOrAway)
.map(s => {
const warning = s.TotalMin;
return `${s.TotalMin} mín. `;
})
.join('');
}
async function loadAndRenderMatch(url, TOURNAMENT_MAP, TEAM_LOGO_MAP) {
try {
const matchNumber = document.getElementById('hb-hsi-data')?.dataset.hsi ?? null;
url += `${encodeURIComponent(matchNumber)}&t=${Date.now()}`;
const res = await fetch(url, { cache: 'reload' });
if (!res.ok) throw new Error('HTTP ' + res.status);
const data = await res.json();
if (!data || data === null || data.MatchStats === null) {
renderMatchNotFound('hb-match-root', matchNumber);
const evRoot = document.getElementById('hb-events-root');
if (evRoot) evRoot.innerHTML = ''; // don’t show events if no match
} else {
renderMatch('hb-match-root', data, TOURNAMENT_MAP, TEAM_LOGO_MAP);
if (data.MatchEvents !== null) {
renderEvents('hb-events-root', data.MatchEvents);
}
}
} catch (e) {
console.warn('Match load failed:', e);
renderMatch('hb-match-root', data, {}, {}); // graceful fallback
}
}
function renderEvents(rootId, events) {
const root = document.getElementById(rootId);
if (!root){ return; }
if (!events){
root.innerHTML = 'Engir atburðir fundust
';
return;
}
root.innerHTML = `${
events.map(ev => {
const clock = ev.Clock;
const label = ev.Label;
const scoreHtml = `${ev.HomeScore ?? 0} – ${ev.AwayScore ?? 0}`;
const metaParts = [clock]; // include match clock first
let teamIcon = '';
// Team Icon
if (ev.HomeOrAway.toLowerCase() == 'home') {
teamIcon = HOME_LOGO_PATH ? `
` : '';
} else {
teamIcon = AWAY_LOGO_PATH ? `
` : '';
}
if (ev.IsPlayerOrTeamInfo) {
metaParts.push(ev.PlayerOrTeamInfo)
metaParts.push(teamIcon)
}
const meta = metaParts.filter(Boolean).join(' • ');
const iconPath = getEventIconPath(ev.Event);
const iconHTML = iconPath ? `
` : label;
return `
`;
}).join('')
}
`;
}
function getEventIconPath(eventCode,subCode){
const e = parseInt(eventCode||0,10);
const s = (subCode===null||subCode===undefined||subCode==='') ? null : parseInt(subCode,10);
switch(e){
case 1: return '/wp-content/uploads/2025/08/icon_goal.png';
case 2: return '/wp-content/uploads/2025/08/icon_yellow.png';
case 3: return '/wp-content/uploads/2025/08/icon_2min.png';
case 4: return '/wp-content/uploads/2025/08/icon_redcard.png';
case 5: return '/wp-content/uploads/2025/08/icon_redcard.png';
case 6: return '/wp-content/uploads/2025/08/icon_save.png';
case 7: return s===1 ? '/wp-content/uploads/2025/08/icon_clockstart.png' : s===0 ? '/wp-content/uploads/2025/08/icon_clockstop.png' : '/wp-content/uploads/2025/08/icon_clockstart.png';
case 17: return '/wp-content/uploads/2025/08/icon_timeout.png'; // Time out
case 18:
if(s===1) return '/wp-content/uploads/2025/08/icon_halftime.png';
if(s===2) return '/wp-content/uploads/2025/08/icon_gameended.png';
if(s===3) return '/wp-content/uploads/2025/08/icon_clockstart.png';
if(s===4) return '/wp-content/uploads/2025/08/icon_clockstart.png';
if(s===5) return '/wp-content/uploads/2025/08/icon_clockstart.png';
return '/wp-content/uploads/2025/08/icon_clockstart.png';
default: return '/wp-content/uploads/2025/08/icon_clockstart.png';
}
}
// Boot: wait for JSON, then render
document.addEventListener('DOMContentLoaded', async () => {
try {
const TOURNAMENT_MAP = await loadJsonMap(TOURNAMENT_MAP_SRC);
//const TEAM_MAP = await loadJsonMap(TEAM_MAP_SRC);
const TEAM_LOGO_MAP = await loadJsonMap(TEAM_LOGO_MAP_SRC);
loadAndRenderMatch(MATCH_STATS_SRC, TOURNAMENT_MAP, TEAM_LOGO_MAP);
} catch (e) {
console.warn('Tournament map failed, rendering with fallback names', e);
loadAndRenderMatch(MATCH_STATS_SRC);
}
});