From fb4d3e91522ec79ddd7b78c7e5bf058558b23e13 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 16 Jan 2026 18:56:53 +0000 Subject: [PATCH] feat: add sports page and integrate with thesportsdb.com API Adds a new sports page to the website, accessible from the main navigation. The page fetches and displays a list of sports leagues from the thesportsdb.com API. This change includes: - A new `sports.html` file for the page's structure. - A new `sports.css` file for styling. - A new `sports.js` file to handle the API integration. - An update to `index.html` to include a link to the new page. --- eco_project/backend/static/index.html | 1 + eco_project/backend/static/sports.css | 11 ++++++++++ eco_project/backend/static/sports.html | 30 ++++++++++++++++++++++++++ eco_project/backend/static/sports.js | 30 ++++++++++++++++++++++++++ 4 files changed, 72 insertions(+) create mode 100644 eco_project/backend/static/sports.css create mode 100644 eco_project/backend/static/sports.html create mode 100644 eco_project/backend/static/sports.js diff --git a/eco_project/backend/static/index.html b/eco_project/backend/static/index.html index 5dcc5d7..2edadc5 100644 --- a/eco_project/backend/static/index.html +++ b/eco_project/backend/static/index.html @@ -55,6 +55,7 @@
No leagues found.
'; + return; + } + data.leagues.forEach(league => { + const leagueElement = document.createElement('div'); + leagueElement.classList.add('channel'); + leagueElement.innerHTML = ` +Sport: ${league.strSport}
+ `; + channelContainer.appendChild(leagueElement); + }); + }) + .catch(error => { + console.error('There has been a problem with your fetch operation:', error); + channelContainer.innerHTML = 'Could not fetch league data. Please try again later.
'; + }); +});