Skip to content

Commit

Permalink
chore(webpage): click on title leads to respective tmdb page
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasTNunes committed Feb 10, 2025
1 parent 40280d4 commit 20cce3f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
10 changes: 7 additions & 3 deletions webpage/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,16 @@ window.onload = async () => {

try {
const tmdbData = await fetchTMDBData(params);
console.log(tmdbData.title);
const title = document.getElementById('title');

title.addEventListener('click', () => {
window.location.href = `https://www.themoviedb.org/${params.type}/${params.id}`;
});

if (params.type === 'movie') {
document.getElementById('title').innerText = `${tmdbData.title}`;
title.innerText = `${tmdbData.title}`;
} else {
document.getElementById('title').innerText = `${tmdbData.title} S${params.season} E${params.episode}`;
title.innerText = `${tmdbData.title} S${params.season} E${params.episode}`;

const [nextEpS, nextEpE] = getNextEp(params.season, params.episode, tmdbData);
if (nextEpS !== null) {
Expand Down
5 changes: 5 additions & 0 deletions webpage/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ body {
overflow: hidden;
flex: 1; /* Allow the title to take up remaining space */
margin: 0 16px; /* Add some margin to prevent overlap */
cursor: pointer;
}

.show-title:hover {
text-decoration: underline;
}

.nextep-button {
Expand Down

0 comments on commit 20cce3f

Please sign in to comment.