-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from TomasTNunes/dev
merge 'dev' into 'master' for release.
- Loading branch information
Showing
12 changed files
with
299 additions
and
41 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
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,13 +1,50 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title>TMDB Extension</title> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>TMDB Player</title> | ||
|
||
<!-- Include Font Awesome --> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"> | ||
|
||
<!-- Link to the external CSS file --> | ||
<link rel="stylesheet" href="styles.css"> | ||
</head> | ||
<body> | ||
<h3>TMDB Extension</h3> | ||
<button id="goToTmdb">Open TMDB</button> | ||
|
||
<div class="header"> | ||
TMDB Player | ||
</div> | ||
<div class="row"> | ||
<span>Open movie/tv show in new tab</span> | ||
<label class="toggle"> | ||
<input type="checkbox"> | ||
<span class="slider"></span> | ||
</label> | ||
</div> | ||
<div class="row"> | ||
<span>Default server</span> | ||
<select class="server-selection" id="server-select"> | ||
<option server-number="1">Rakan</option> | ||
<option server-number="2">Bard</option> | ||
<option server-number="3">Xayah</option> | ||
<option server-number="4">Ekko</option> | ||
<option server-number="5">Naafiri</option> | ||
<option server-number="6">Ryze</option> | ||
</select> | ||
</div> | ||
<div class="row center-row"> | ||
<button class="tmdb-button" id="tmdb-button">Open TMDB Website</button> | ||
</div> | ||
<div class="row center-row"> | ||
<div class="button-group"> | ||
<button class="git-button" id="git-button"> | ||
<i class="fab fa-github"></i> GitHub | ||
</button> | ||
<button class="bug-button" id="bug-button">Report Bug</button> | ||
</div> | ||
</div> | ||
|
||
<script src="popup.js"></script> | ||
</body> | ||
</html> | ||
</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 |
---|---|---|
@@ -1,5 +1,54 @@ | ||
document.addEventListener("DOMContentLoaded", () => { | ||
document.getElementById('goToTmdb').addEventListener('click', () => { | ||
chrome.tabs.create({ url: 'https://www.themoviedb.org/' }); | ||
// popup.js | ||
|
||
// Get references to DOM elements | ||
const toggleButton = document.querySelector('.toggle input'); | ||
const serverSelect = document.getElementById('server-select'); | ||
const tmdbButton = document.getElementById('tmdb-button'); | ||
const gitButton = document.getElementById('git-button'); | ||
const bugButton = document.getElementById('bug-button'); | ||
|
||
// Load saved preferences when the popup is opened | ||
document.addEventListener('DOMContentLoaded', () => { | ||
chrome.storage.sync.get(['isToggleActive', 'selectedServerNumber'], (data) => { | ||
// Set the toggle button state | ||
toggleButton.checked = data.isToggleActive !== undefined ? data.isToggleActive : true; // Default to true | ||
|
||
// Set the selected server based on the saved server number | ||
if (data.selectedServerNumber) { | ||
const optionToSelect = Array.from(serverSelect.options).find( | ||
(option) => option.getAttribute('server-number') === data.selectedServerNumber | ||
); | ||
if (optionToSelect) { | ||
serverSelect.value = optionToSelect.value; | ||
} | ||
} | ||
}); | ||
}); | ||
|
||
// Save toggle button state when changed | ||
toggleButton.addEventListener('change', () => { | ||
const isToggleActive = toggleButton.checked; | ||
chrome.storage.sync.set({ isToggleActive }); | ||
}); | ||
|
||
// Save selected server number when changed | ||
serverSelect.addEventListener('change', () => { | ||
const selectedOption = serverSelect.options[serverSelect.selectedIndex]; | ||
const selectedServerNumber = selectedOption.getAttribute('server-number'); | ||
chrome.storage.sync.set({ selectedServerNumber }); | ||
}); | ||
|
||
// Open TMDB Website | ||
tmdbButton.addEventListener('click', () => { | ||
window.open('https://www.themoviedb.org/', '_blank'); | ||
}); | ||
|
||
// Open GitHub Repository | ||
gitButton.addEventListener('click', () => { | ||
window.open('https://github.com/TomasTNunes/TMDB-Player/tree/master?tab=readme-ov-file#tmdb-player', '_blank'); | ||
}); | ||
|
||
// Open Bug Report Page | ||
bugButton.addEventListener('click', () => { | ||
window.open('https://github.com/TomasTNunes/TMDB-Player/issues', '_blank'); | ||
}); |
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 |
---|---|---|
@@ -1,42 +1,160 @@ | ||
/* General Body Styles */ | ||
body { | ||
font-family: Arial, sans-serif; | ||
font-family: 'Ubuntu', 'El Messiri', sans-serif; | ||
margin: 0; | ||
padding: 20px; /* Added padding for spacing */ | ||
background-color: #2e3a47; /* TMDB dark background */ | ||
color: #ffffff; /* White text */ | ||
width: 250px; /* Set width of popup */ | ||
padding: 0; | ||
width: 350px; | ||
background-color: #f9f9f9; | ||
color: #333; | ||
} | ||
|
||
.header { | ||
background: linear-gradient(to right, #90cea1, #01b4e4); | ||
font-family: 'Ubuntu', 'El Messiri', sans-serif; | ||
color: white; | ||
padding: 15px; | ||
text-align: center; | ||
border-radius: 10px; /* Rounded corners */ | ||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3); /* Shadow for depth */ | ||
font-size: 22px; | ||
font-weight: bold; | ||
} | ||
|
||
.row { | ||
padding: 15px 30px; | ||
font-size: 15px; | ||
border-bottom: 1px solid #e0e0e0; | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
flex-wrap: wrap; | ||
width: 100%; /* Ensure row takes full width */ | ||
box-sizing: border-box; /* Include padding in width calculation */ | ||
} | ||
|
||
.row:last-child { | ||
border-bottom: none; | ||
} | ||
|
||
.row span { | ||
max-width: 60%; | ||
word-wrap: break-word; | ||
} | ||
|
||
.toggle { | ||
position: relative; | ||
display: inline-block; | ||
width: 48px; | ||
height: 24px; | ||
box-sizing: border-box; | ||
} | ||
|
||
.toggle input { | ||
opacity: 0; | ||
width: 0; | ||
height: 0; | ||
} | ||
|
||
.slider { | ||
position: absolute; | ||
cursor: pointer; | ||
top: 0; | ||
left: 0; | ||
right: 0; | ||
bottom: 0; | ||
background-color: #ccc; | ||
-webkit-transition: .4s; | ||
transition: .4s; | ||
border-radius: 24px; | ||
box-sizing: border-box; | ||
min-width: 48px; | ||
} | ||
|
||
/* Header Styles */ | ||
h3 { | ||
font-size: 20px; | ||
color: #00b5e2; /* TMDB blue */ | ||
margin-top: 20px; | ||
.slider:before { | ||
position: absolute; | ||
content: ""; | ||
height: 18px; | ||
width: 18px; | ||
left: 3px; | ||
bottom: 3px; | ||
background-color: white; | ||
-webkit-transition: .4s; | ||
transition: .4s; | ||
border-radius: 50%; | ||
} | ||
|
||
/* Button Styles */ | ||
button { | ||
padding: 12px 20px; | ||
background-color: #00b5e2; /* TMDB blue */ | ||
input:checked + .slider { | ||
background-color: #4CAF50; | ||
} | ||
|
||
input:checked + .slider:before { | ||
-webkit-transform: translateX(24px); | ||
-ms-transform: translateX(24px); | ||
transform: translateX(24px); | ||
} | ||
|
||
.server-selection { | ||
padding: 8px 12px; | ||
background-color: transparent; | ||
border: 1px solid #0d253f; | ||
border-radius: 8px; | ||
cursor: pointer; | ||
font-family: 'Ubuntu', 'El Messiri', sans-serif; | ||
font-size: 14px; | ||
height: 36px; | ||
} | ||
|
||
.center-row { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; /* Center vertically */ | ||
width: 100%; /* Ensure it takes full width of parent */ | ||
max-width: 100%; /* Constrain to parent width */ | ||
gap: 10px; | ||
box-sizing: border-box; /* Include padding in width calculation */ | ||
} | ||
|
||
.tmdb-button { | ||
padding: 10px; | ||
background-color: #0d253f; | ||
color: white; | ||
font-family: 'Ubuntu', 'El Messiri', sans-serif; | ||
font-size: 15px; | ||
border: none; | ||
border-radius: 5px; | ||
border-radius: 18px; | ||
cursor: pointer; | ||
font-size: 16px; | ||
font-weight: bold; | ||
transition: background-color 0.3s ease; | ||
width: 100%; /* Full width */ | ||
margin-top: 20px; | ||
width: 65%; /* Make button take full width of its container */ | ||
max-width: 250px; /* Limit maximum width */ | ||
box-sizing: border-box; /* Include padding in width calculation */ | ||
} | ||
|
||
.button-group { | ||
display: flex; | ||
gap: 10px; | ||
justify-content: center; /* Center buttons horizontally */ | ||
width: 100%; | ||
box-sizing: border-box; /* Include padding in width calculation */ | ||
} | ||
|
||
button:hover { | ||
background-color: #0288d1; /* Darker blue for hover */ | ||
.git-button, | ||
.bug-button { | ||
padding: 10px; | ||
background-color: #0d253f; | ||
color: white; | ||
font-family: 'Ubuntu', 'El Messiri', sans-serif; | ||
font-size: 15px; | ||
border: none; | ||
border-radius: 8px; | ||
cursor: pointer; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
gap: 8px; /* Space between icon and text */ | ||
width: 140px; /* Fixed width for both buttons */ | ||
box-sizing: border-box; /* Include padding in width calculation */ | ||
} | ||
|
||
button:active { | ||
background-color: #0277bd; /* Even darker blue when pressed */ | ||
.git-button i { | ||
font-size: 18px; /* Adjust icon size */ | ||
} | ||
|
||
.bug-button::before { | ||
content: "🐛"; /* Bug emoji */ | ||
} |
Oops, something went wrong.