nuke everything but accident lmao
This commit is contained in:
@@ -185,6 +185,13 @@
|
||||
<td id="watched-date-${movie.imdb_id}">${watchedDate}</td>
|
||||
`;
|
||||
|
||||
// Set initial row color based on watched state
|
||||
if (watchedMovie) {
|
||||
movieRow.style.backgroundColor = 'rgba(144, 238, 144, 0.6)'; // Lighter light green with transparency
|
||||
} else {
|
||||
movieRow.style.backgroundColor = 'rgba(255, 99, 71, 0.6)'; // Lighter light red with transparency
|
||||
}
|
||||
|
||||
movieTableBody.appendChild(movieRow);
|
||||
|
||||
movieRow.addEventListener('click', (event) => {
|
||||
@@ -199,10 +206,14 @@
|
||||
checkbox.addEventListener('change', async (event) => {
|
||||
const isChecked = event.target.checked;
|
||||
const watchedDateCell = document.getElementById(`watched-date-${movie.imdb_id}`);
|
||||
const row = event.target.closest('tr'); // Get the parent row
|
||||
|
||||
if (isChecked) {
|
||||
watchedDateCell.textContent = new Date().toLocaleString();
|
||||
row.style.backgroundColor = 'rgba(144, 238, 144, 0.6)'; // Apply light green with transparency
|
||||
} else {
|
||||
watchedDateCell.textContent = '';
|
||||
row.style.backgroundColor = 'rgba(255, 99, 71, 0.6)'; // Apply light red with transparency
|
||||
}
|
||||
|
||||
await fetch('/api/movies/users/updateWatchedMovies', {
|
||||
|
||||
+1
-1
@@ -101,7 +101,7 @@
|
||||
window.location.href = '/movies.html'; // Redirect to movies page on success
|
||||
} else {
|
||||
const error = await res.json();
|
||||
alert(`Login failed: ${error.message}`);
|
||||
alert(`${error.message}`);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -78,11 +78,12 @@
|
||||
const name = document.getElementById('name').value;
|
||||
const email = document.getElementById('email').value;
|
||||
const password = document.getElementById('password').value;
|
||||
const verifoof = document.getElementById('verifoof').value;
|
||||
|
||||
const res = await fetch('/api/users/register', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ name, email, password })
|
||||
body: JSON.stringify({ name, email, password, verifoof })
|
||||
});
|
||||
|
||||
const responseMessageElement = document.getElementById('response-message');
|
||||
|
||||
@@ -180,7 +180,7 @@
|
||||
movies.forEach(movie => {
|
||||
const movieItem = document.createElement('li');
|
||||
movieItem.classList.add('list-group-item');
|
||||
movieItem.textContent = movie.movieTitle;
|
||||
movieItem.textContent = movie.title;
|
||||
movieList.appendChild(movieItem);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user