diff --git a/public/checklist.html b/public/checklist.html index 9f4e3aa..ec324a5 100644 --- a/public/checklist.html +++ b/public/checklist.html @@ -18,18 +18,34 @@ color: #ddd; } .movie-table { - margin-top: 20px; + margin-top: 20px; + } + + /* New styles for the first column */ + .movie-table th:first-child, + .movie-table td:first-child { + width: 1%; /* Shrink to fit the content */ + white-space: nowrap; /* Prevent wrapping */ + } + + .movie-table { + table-layout: auto; /* Allow the browser to size columns automatically */ } .ratio { font-weight: bold; margin-top: 10px; } .navbar-toggler { - border-color: white; /* Make the border white */ + border-color: white; } .navbar-toggler-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='white' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E"); } + /* New styles for table */ + .table-hover tbody tr:hover { + background-color: #f1f1f1; + cursor: pointer; + }
@@ -65,12 +81,12 @@ -| Titre | Regardé | -Date du visionnage | +Titre | +Date du visionnage | ${movie.title} | + | ${movie.title} | ${watchedDate} | `; + movieTableBody.appendChild(movieRow); + movieRow.addEventListener('click', (event) => { + const checkbox = document.getElementById(`movie-${movie.imdb_id}`); + if (event.target.tagName !== 'INPUT') { + checkbox.checked = !checkbox.checked; + checkbox.dispatchEvent(new Event('change')); + } + }); + const checkbox = document.getElementById(`movie-${movie.imdb_id}`); checkbox.addEventListener('change', async (event) => { const isChecked = event.target.checked; @@ -215,4 +230,4 @@ }; -
|---|