{"id":25,"date":"2025-11-16T04:15:15","date_gmt":"2025-11-16T04:15:15","guid":{"rendered":"https:\/\/lakecityscrabbleclub.com\/stats\/home\/"},"modified":"2025-11-16T04:32:22","modified_gmt":"2025-11-16T04:32:22","slug":"home","status":"publish","type":"page","link":"https:\/\/lakecityscrabbleclub.com\/stats\/","title":{"rendered":"Home"},"content":{"rendered":"\n<div class=\"wp-block-group alignfull has-tertiary-background-color has-background has-global-padding is-layout-constrained wp-container-core-group-is-layout-d36960fe wp-block-group-is-layout-constrained\" style=\"margin-top:0;margin-bottom:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0\">\n<div id=\"scrabble-leaderboard\" style=\"max-width:80%; margin: 0 auto;\">\n  <nav id=\"slb-tabs\">\n    <button data-tab=\"raw\" class=\"active\">Raw Standings<\/button>\n    <button data-tab=\"adjusted\">Adjusted Standings<\/button>\n    <button data-tab=\"ratings\">Elo Ratings<\/button>\n  <\/nav>\n\n  <div id=\"slb-content\">\n    <div id=\"slb-raw\" class=\"slb-panel active\"><\/div>\n    <div id=\"slb-adjusted\" class=\"slb-panel\"><\/div>\n    <div id=\"slb-ratings\" class=\"slb-panel\"><\/div>\n  <\/div>\n<\/div>\n\n<script>\n\/\/ Fetch and Display Leaderboards\n(async function() {\n  const API_URL = \"https:\/\/script.google.com\/macros\/s\/AKfycbzYk7trgLUXBLq4AFdyIw8lLZwZQun7n-gyJW2z_8uRcW4LU_tpMk01phL8FssQU6c\/exec\";\n\n  const panels = {\n    raw: document.getElementById(\"slb-raw\"),\n    adjusted: document.getElementById(\"slb-adjusted\"),\n    ratings: document.getElementById(\"slb-ratings\")\n  };\n\n  try {\n    const res = await fetch(API_URL);\n    const data = await res.json();\n\n    renderTable(panels.raw, data.raw, [\n      \"Rank\", \"Player\", \"Games\", \"Wins\", \"Losses\", \"Ties\", \"Win%\", \n      \"Points\", \"OppPoints\", \"High\", \"Low\", \"Streak\", \n      \"LongestWin\", \"LongestLoss\"\n    ]);\n\n    renderTable(panels.adjusted, data.adjusted, [\n      \"Rank\", \"Player\", \"Games\", \"AdjWins\", \"AdjLosses\", \"AdjTies\",\n      \"AdjWin%\", \"AdjPoints\", \"AdjOppPoints\"\n    ]);\n\n    renderTable(panels.ratings, data.ratings, [\n      \"Rank\", \"Player\", \"Rating\", \"Games\", \"Wins\", \"Losses\"\n    ]);\n\n  } catch (err) {\n    panels.raw.innerHTML = \"<p>Error loading leaderboard.<\/p>\";\n    console.error(err);\n  }\n\n\n  \/\/ RENDER TABLE FUNCTION (with styling)\n  function renderTable(container, rows, headers) {\n    let html = \"<table class='slb-table'><thead><tr>\";\n    headers.forEach(h => { html += `<th>${h}<\/th>`; });\n    html += \"<\/tr><\/thead><tbody>\";\n\n    rows.forEach((r, i) => {\n      let rowClass = \"\";\n      if (i === 0) rowClass = \"first-place\";\n      else if (i === 1) rowClass = \"second-place\";\n      else if (i === 2) rowClass = \"third-place\";\n\n      html += `<tr class=\"${rowClass}\">`;\n\n      r.forEach((cell, colIndex) => {\n        let output = cell;\n\n        \/\/ Percentage formatting\n        if (headers[colIndex] === \"Win%\" || headers[colIndex] === \"AdjWin%\") {\n          output = (cell * 100).toFixed(1) + \"%\";\n        }\n\n        \/\/ Streak coloring\n        if (headers[colIndex] === \"Streak\" && typeof cell === \"string\") {\n          if (cell.startsWith(\"W\")) {\n            output = `<span class=\"streak-win\">${cell}<\/span>`;\n          } else if (cell.startsWith(\"L\")) {\n            output = `<span class=\"streak-loss\">${cell}<\/span>`;\n          } else {\n            output = `<span class=\"streak-tie\">${cell}<\/span>`;\n          }\n        }\n\n        html += `<td>${output}<\/td>`;\n      });\n\n      html += \"<\/tr>\";\n    });\n\n    html += \"<\/tbody><\/table>\";\n    container.innerHTML = html;\n  }\n})();\n<\/script>\n\n<style>\n\/* CONTAINER *\/\n#scrabble-leaderboard {\n  width: 80%;\n  max-width: 1200px;\n  margin: 0 auto;\n  font-size: 18px;\n  line-height: 1.4;\n}\n\n\/* TABS *\/\n#slb-tabs {\n  margin-bottom: 20px;\n  display: flex;\n  gap: 10px;\n}\n#slb-tabs button {\n  padding: 10px 18px;\n  background: #ddd;\n  border: none;\n  border-radius: 4px;\n  font-size: 18px;\n  cursor: pointer;\n}\n#slb-tabs button.active {\n  background: #006699;\n  color: white;\n}\n\n\/* PANELS *\/\n.slb-panel { display: none; }\n.slb-panel.active { display: block; }\n\n\/* TABLE *\/\n.slb-table {\n  width: 100%;\n  border-collapse: collapse;\n  font-size: 17px;\n}\n.slb-table th, .slb-table td {\n  border: 1px solid #ccc;\n  padding: 10px 8px;\n}\n.slb-table th {\n  background: #f4f4f4;\n  font-weight: bold;\n}\n\n\/* HIGHLIGHTS FOR TOP 3 *\/\n.first-place {\n  background: #e6ffe6 !important;\n  font-weight: bold;\n}\n.second-place {\n  background: #e6f0ff !important;\n}\n.third-place {\n  background: #fff0e6 !important;\n}\n\n\/* STREAK COLORS *\/\n.streak-win {\n  color: #008000;\n  font-weight: bold;\n}\n.streak-loss {\n  color: #cc0000;\n  font-weight: bold;\n}\n.streak-tie {\n  color: #666666;\n}\n\n\/* RESPONSIVE *\/\n@media (max-width: 800px) {\n  #scrabble-leaderboard {\n    width: 95%;\n    font-size: 16px;\n  }\n  #slb-tabs button {\n    font-size: 16px;\n    padding: 8px 12px;\n  }\n  .slb-table th, .slb-table td {\n    padding: 6px 4px;\n  }\n}\n<\/style>\n\n<script>\n\/\/ TAB SWITCHING\ndocument.addEventListener(\"click\", function(e) {\n  if (e.target.matches(\"#slb-tabs button\")) {\n    document.querySelectorAll(\"#slb-tabs button\").forEach(btn => btn.classList.remove(\"active\"));\n    document.querySelectorAll(\".slb-panel\").forEach(p => p.classList.remove(\"active\"));\n\n    e.target.classList.add(\"active\");\n    const tab = e.target.getAttribute(\"data-tab\");\n    document.getElementById(\"slb-\" + tab).classList.add(\"active\");\n  }\n});\n<\/script>\n\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Raw Standings Adjusted Standings Elo Ratings<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"no-title","meta":{"_EventAllDay":false,"_EventTimezone":"","_EventStartDate":"","_EventEndDate":"","_EventStartDateUTC":"","_EventEndDateUTC":"","_EventShowMap":false,"_EventShowMapLink":false,"_EventURL":"","_EventCost":"","_EventCostDescription":"","_EventCurrencySymbol":"","_EventCurrencyCode":"","_EventCurrencyPosition":"","_EventDateTimeSeparator":"","_EventTimeRangeSeparator":"","_EventOrganizerID":[],"_EventVenueID":[],"_OrganizerEmail":"","_OrganizerPhone":"","_OrganizerWebsite":"","_VenueAddress":"","_VenueCity":"","_VenueCountry":"","_VenueProvince":"","_VenueState":"","_VenueZip":"","_VenuePhone":"","_VenueURL":"","_VenueStateProvince":"","_VenueLat":"","_VenueLng":"","_VenueShowMap":false,"_VenueShowMapLink":false,"footnotes":""},"class_list":["post-25","page","type-page","status-publish","hentry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/lakecityscrabbleclub.com\/stats\/wp-json\/wp\/v2\/pages\/25","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lakecityscrabbleclub.com\/stats\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/lakecityscrabbleclub.com\/stats\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/lakecityscrabbleclub.com\/stats\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lakecityscrabbleclub.com\/stats\/wp-json\/wp\/v2\/comments?post=25"}],"version-history":[{"count":3,"href":"https:\/\/lakecityscrabbleclub.com\/stats\/wp-json\/wp\/v2\/pages\/25\/revisions"}],"predecessor-version":[{"id":43,"href":"https:\/\/lakecityscrabbleclub.com\/stats\/wp-json\/wp\/v2\/pages\/25\/revisions\/43"}],"wp:attachment":[{"href":"https:\/\/lakecityscrabbleclub.com\/stats\/wp-json\/wp\/v2\/media?parent=25"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}