{"id":111,"date":"2025-11-25T20:20:57","date_gmt":"2025-11-25T20:20:57","guid":{"rendered":"https:\/\/homenorthbaseball.ca\/LNH\/?page_id=111"},"modified":"2025-12-08T02:36:52","modified_gmt":"2025-12-08T02:36:52","slug":"2025-schedule","status":"publish","type":"page","link":"https:\/\/homenorthbaseball.ca\/LNH\/2025-schedule\/","title":{"rendered":"2025 Schedule"},"content":{"rendered":"\n<h2 class=\"wp-block-heading has-text-align-center\">2025 REGULAR SEASON SCHEDULE<\/h2>\n\n\n\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <title>LNH 2025 Schedule<\/title>\n    <link href=\"https:\/\/fonts.googleapis.com\/css2?family=Roboto:wght@400;500;700&#038;display=swap\" rel=\"stylesheet\">\n    <script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/PapaParse\/5.4.1\/papaparse.min.js\"><\/script>\n    <style>\n        body {font-family:'Roboto',sans-serif;margin:0;padding:0px;background:#f4f4f4;color:#333;}\n        h1 {text-align:center;color:#F0C53C;margin:30px 0;font-size:34px;font-weight:700;}\n        .container {max-width:1100px;margin:0 auto;}\n        .filters {\n            margin: 20px 0;\n            padding: 20px;\n            background: white;\n            border-radius: 10px;\n            box-shadow: 0 4px 12px rgba(0,0,0,0.1);\n            display: flex;\n            flex-wrap: wrap;\n            gap: 20px;\n            align-items: center;\n            justify-content: center;\n            font-size: 16px;\n        }\n        .filters label {font-weight: 600; margin-right: 10px; color: #555;}\n        .filters select, .filters input {\n            padding: 10px 14px;\n            border: 1px solid #ccc;\n            border-radius: 6px;\n            font-size: 16px;\n            min-width: 200px;\n        }\n        .filters button {\n            padding: 10px 24px;\n            background: #F0C53C;\n            color: BLACK;\n            border: none;\n            border-radius: 6px;\n            cursor: pointer;\n            font-weight: 600;\n            font-size: 16px;\n        }\n        .filters button:hover {background: #D9D9D9;}\n        .filters .clear-btn {background: #666;}\n        .filters .clear-btn:hover {background: #444;}\n\n        \/* Desktop: your original perfect look *\/\n        table {\n            width:100%;\n            border-collapse:collapse;\n            background:white;\n            box-shadow:0 4px 12px rgba(0,0,0,0.1);\n            border:1px #000000;\n            font-size: 14.5px;\n            margin:20px 0;\n        }\n        th, td {\n            border:2px solid black !important;\n            padding:12px 8px;\n            text-align:center;\n        }\n        th {\n            background:#F0C53C;\n            color:BLACK;\n            font-weight:700;\n            text-transform:uppercase;\n            font-size: 15px;\n        }\n        tr:nth-child(even) {background:#f9f9f9;}\n        tr:hover {background:#d9d9d9;}\n\n        \/* Mobile wrapper *\/\n        .table-wrapper {\n            overflow-x: auto;\n            -webkit-overflow-scrolling: touch;\n            margin: 20px 0;\n            border-radius: 8px;\n            box-shadow: 0 4px 12px rgba(0,0,0,0.1);\n        }\n\n        \/* Mobile-only: super compact rows *\/\n        @media (max-width: 900px) {\n            .table-wrapper { \n                border: 1px solid #000000; \n            }\n            table {\n                font-size: 12.5px !important;     \/* tiny but readable *\/\n                min-width: 750px;\n            }\n            th, td {\n                padding: 6px 4px !important;      \/* much tighter rows *\/\n                line-height: 1.3;\n            }\n            th {\n                font-size: 13px !important;\n                padding: 8px 4px !important;\n            }\n            \/* Optional: make diamond colors pop even in small cells *\/\n            .diamond-green, .diamond-blue, .diamond-red {\n                font-size: 11px;\n                padding: 4px !important;\n            }\n        }\n\n        .empty {\n            text-align:center;\n            padding:80px;\n            color:#666;\n            font-style:italic;\n            font-size:18px;\n        }\n        .diamond-green { background:#4CAF50 !important; color:white !important; font-weight:700; }\n        .diamond-blue { background:#2196F3 !important; color:white !important; font-weight:700; }\n        .diamond-red { background:#F44336 !important; color:white !important; font-weight:700; }\n    <\/style>\n<\/head>\n<body>\n<div class=\"container\">\n    \n    <div class=\"filters\">\n        <div>\n            <label for=\"teamFilter\">Select Team:<\/label>\n            <select id=\"teamFilter\">\n                <option value=\"\">All Teams<\/option>\n            <\/select>\n        <\/div>\n        <div>\n            <label for=\"dateFilter\">Date:<\/label>\n            <input type=\"date\" id=\"dateFilter\">\n        <\/div>\n        <button onclick=\"applyFilters()\">Apply Filters<\/button>\n        <button class=\"clear-btn\" onclick=\"clearFilters()\">Clear All<\/button>\n    <\/div>\n\n    <div class=\"table-wrapper\">\n        <div id=\"scheduleTable\">\n            <div class=\"empty\">Loading schedule&#8230;<\/div>\n        <\/div>\n    <\/div>\n<\/div>\n\n<script>\n    const csvUrl = 'https:\/\/docs.google.com\/spreadsheets\/d\/e\/2PACX-1vQ9UPrNtLTGq4TisHjvKCskSRJtf3EOGG2WXqTSMPQUIoKzxzg37Eym9jlXViFeyrKgy07KyiXMxOqD\/pub?gid=526108272&single=true&output=csv';\n    \n    let allRows = [];\n    let headers = [];\n    let diamondIndex = -1;\n    let teamList = new Set();\n\n    fetch(csvUrl)\n        .then(r => r.text())\n        .then(text => {\n            Papa.parse(text, {\n                header: true,\n                skipEmptyLines: true,\n                complete: function(results) {\n                    allRows = results.data;\n                    if (allRows.length === 0) {\n                        document.getElementById('scheduleTable').innerHTML = '<div class=\"empty\">No games in the schedule yet.<\/div>';\n                        return;\n                    }\n\n                    headers = Object.keys(allRows[0]);\n                    diamondIndex = headers.findIndex(h => h.toUpperCase() === 'DIAMOND');\n                    if (diamondIndex === -1) {\n                        document.getElementById('scheduleTable').innerHTML = '<div class=\"empty\">No \"Diamond\" column found.<\/div>';\n                        return;\n                    }\n\n                    allRows.forEach(row => {\n                        const home = (row['Home'] || '').trim();\n                        const away = (row['Away'] || '').trim();\n                        const visitor = (row['Visitor'] || '').trim();\n                        if (home) teamList.add(home);\n                        if (away) teamList.add(away);\n                        if (visitor) teamList.add(visitor);\n                    });\n\n                    const sortedTeams = Array.from(teamList).sort((a, b) => a.localeCompare(b));\n                    const select = document.getElementById('teamFilter');\n                    sortedTeams.forEach(team => {\n                        const opt = document.createElement('option');\n                        opt.value = team;\n                        opt.textContent = team;\n                        select.appendChild(opt);\n                    });\n\n                    renderTable(allRows);\n                }\n            });\n        })\n        .catch(err => {\n            console.error(err);\n            document.getElementById('scheduleTable').innerHTML = '<div class=\"empty\">Error loading schedule. Please try again later.<\/div>';\n        });\n\n    function renderTable(rows) {\n        if (rows.length === 0) {\n            document.getElementById('scheduleTable').innerHTML = '<div class=\"empty\">No games match your filters.<\/div>';\n            return;\n        }\n\n        let html = '<table><thead><tr>';\n        headers.forEach(h => { html += `<th>${h}<\/th>`; });\n        html += '<\/tr><\/thead><tbody>';\n\n        rows.forEach(row => {\n            html += '<tr>';\n            headers.forEach((h, i) => {\n                const value = (row[h] || '').toString().trim();\n                let cellClass = '';\n                if (i === diamondIndex) {\n                    const lower = value.toLowerCase();\n                    if (lower === 'green') cellClass = 'diamond-green';\n                    else if (lower === 'blue' || lower === 'branlyn blue') cellClass = 'diamond-blue';\n                    else if (lower === 'red' || lower === 'branlyn red') cellClass = 'diamond-red';\n                }\n                html += `<td class=\"${cellClass}\">${value || '&nbsp;'}<\/td>`;\n            });\n            html += '<\/tr>';\n        });\n\n        html += '<\/tbody><\/table>';\n        document.getElementById('scheduleTable').innerHTML = html;\n    }\n\n    function applyFilters() {\n        const selectedTeam = document.getElementById('teamFilter').value;\n        const selectedDate = document.getElementById('dateFilter').value;\n\n        const filtered = allRows.filter(row => {\n            let matchTeam = true;\n            let matchDate = true;\n\n            if (selectedTeam) {\n                const home = (row['Home'] || '').trim();\n                const away = (row['Away'] || '').trim();\n                const visitor = (row['Visitor'] || '').trim();\n                matchTeam = [home, away, visitor].some(t => t === selectedTeam);\n            }\n\n            if (selectedDate) {\n                const gameDate = row['Date'] || row['date'] || '';\n                const d = new Date(gameDate.trim());\n                if (!isNaN(d)) {\n                    const iso = d.toISOString().split('T')[0];\n                    matchDate = iso === selectedDate;\n                } else {\n                    matchDate = false;\n                }\n            }\n\n            return matchTeam && matchDate;\n        });\n\n        renderTable(filtered);\n    }\n\n    function clearFilters() {\n        document.getElementById('teamFilter').value = '';\n        document.getElementById('dateFilter').value = '';\n        renderTable(allRows);\n    }\n\n    document.getElementById('teamFilter').addEventListener('change', applyFilters);\n    document.getElementById('dateFilter').addEventListener('change', applyFilters);\n<\/script>\n<\/body>\n<\/html>\n","protected":false},"excerpt":{"rendered":"<p>2025 REGULAR SEASON SCHEDULE LNH 2025 Schedule Select Team: All Teams Date: Apply Filters Clear All Loading schedule&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-111","page","type-page","status-publish","hentry"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/homenorthbaseball.ca\/LNH\/wp-json\/wp\/v2\/pages\/111","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/homenorthbaseball.ca\/LNH\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/homenorthbaseball.ca\/LNH\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/homenorthbaseball.ca\/LNH\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/homenorthbaseball.ca\/LNH\/wp-json\/wp\/v2\/comments?post=111"}],"version-history":[{"count":45,"href":"https:\/\/homenorthbaseball.ca\/LNH\/wp-json\/wp\/v2\/pages\/111\/revisions"}],"predecessor-version":[{"id":804,"href":"https:\/\/homenorthbaseball.ca\/LNH\/wp-json\/wp\/v2\/pages\/111\/revisions\/804"}],"wp:attachment":[{"href":"https:\/\/homenorthbaseball.ca\/LNH\/wp-json\/wp\/v2\/media?parent=111"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}