forked from Sulagna-Dutta-Roy/GGExtensions
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'yash-work2' of https://github.com/Yashgabani845/GGExten…
…sions into yash-work2
- Loading branch information
Showing
11 changed files
with
214 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"manifest_version": 2, | ||
"name": "Football Live Score Tracker", | ||
"description": "Track live football scores right from your browser!", | ||
"version": "1.0.0", | ||
"permissions": ["storage", "activeTab"], | ||
"browser_action": { | ||
"default_popup": "popup.html" | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Live Football Scores Extension</title> | ||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"> | ||
<link rel="stylesheet" href="style.css"> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<h1 class="mt-4 mb-4">Live Football Scores</h1> | ||
<div id="scores-container"></div> | ||
</div> | ||
|
||
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"></script> | ||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script> | ||
|
||
<script src="script.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
document.addEventListener('DOMContentLoaded', function () { | ||
const apiUrl = 'https://api.soccersapi.com/v2.2/livescores/?user=gabaniyash847&token=7e4a5c820e72104fc7362a33473d7f69&t=today'; | ||
const scoresContainer = document.getElementById('scores-container'); | ||
|
||
function fetchLiveScores() { | ||
fetch(apiUrl) | ||
.then(response => response.json()) | ||
.then(data => { | ||
console.log(data); | ||
scoresContainer.innerHTML = ''; | ||
|
||
data.data.forEach(match => { | ||
const matchElement = document.createElement('div'); | ||
matchElement.classList.add('match'); | ||
|
||
const homeTeam = document.createElement('div'); | ||
homeTeam.classList.add('team'); | ||
homeTeam.innerHTML = `<img src="${match.teams.home.img}" alt="${match.teams.home.name}"> ${match.teams.home.name}`; | ||
|
||
const awayTeam = document.createElement('div'); | ||
awayTeam.classList.add('team'); | ||
awayTeam.innerHTML = `<img src="${match.teams.away.img}" alt="${match.teams.away.name}"> ${match.teams.away.name}`; | ||
|
||
const score = document.createElement('div'); | ||
score.innerHTML = `<strong>${match.scores.home_score} - ${match.scores.away_score}</strong>`; | ||
|
||
const matchDetails = document.createElement('div'); | ||
matchDetails.classList.add('score-details'); | ||
matchDetails.innerHTML = ` | ||
<p>Status: ${match.status_name}</p> | ||
<p>Date: ${match.time.date}</p> | ||
<p>Time: ${match.time.time}</p> | ||
`; | ||
|
||
matchElement.appendChild(homeTeam); | ||
matchElement.appendChild(score); | ||
matchElement.appendChild(awayTeam); | ||
matchElement.appendChild(matchDetails); | ||
|
||
scoresContainer.appendChild(matchElement); | ||
}); | ||
}) | ||
.catch(error => console.log('Error fetching live scores:', error)); | ||
} | ||
|
||
fetchLiveScores(); | ||
setInterval(fetchLiveScores, 30000); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
body { | ||
font-family: Arial, sans-serif; | ||
} | ||
.match { | ||
margin-bottom: 20px; | ||
border: 1px solid #ccc; | ||
padding: 10px; | ||
border-radius: 5px; | ||
width: 250px; | ||
} | ||
.team { | ||
display: flex; | ||
align-items: center; | ||
} | ||
.team img { | ||
width: 30px; | ||
height: 30px; | ||
margin-right: 10px; | ||
} | ||
.score-details { | ||
margin-top: 5px; | ||
color: #666; | ||
} |