diff --git a/frontend/public/css/style.css b/frontend/public/css/style.css index 8f76808..281c6ce 100644 --- a/frontend/public/css/style.css +++ b/frontend/public/css/style.css @@ -330,9 +330,60 @@ h2 { font-size: 17px; margin: 0 0 4px; } .view[hidden] { display: none; } +.day-weekday-mobile { display: none; } + +.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; } + @media (max-width: 720px) { - .main { padding: 20px 14px 50px; } - .day-cell { min-height: 70px; } - .half-day { font-size: 9px; min-height: 28px; } + .main { padding: 16px 12px 50px; } .selector-card { flex-direction: column; align-items: stretch; } + .topbar { padding: 10px 14px; } + .topbar-user { gap: 8px; } +} + +/* Below this width the 7-column grid becomes unusable by touch, so the + calendar switches to a single-column list: one full-width row per day. */ +@media (max-width: 640px) { + .calendar-header { flex-direction: column; } + .calendar-weekdays { display: none; } + + .calendar-grid { + display: flex; + flex-direction: column; + gap: 6px; + } + .day-cell { + flex-direction: row; + align-items: center; + min-height: unset; + padding: 10px; + gap: 10px; + } + .day-cell.empty { display: none; } + .day-number { + flex: 0 0 auto; + width: 46px; + display: flex; + flex-direction: column; + align-items: center; + line-height: 1.2; + } + .day-weekday-mobile { + display: block; + font-size: 10px; + font-weight: 700; + color: var(--color-muted); + text-transform: uppercase; + } + .half-day-row { gap: 8px; } + .half-day { min-height: 44px; font-size: 11px; } + + .calendar-actions { justify-content: stretch; } + .calendar-actions .btn { width: 100%; } + + .legend { gap: 10px 14px; font-size: 12px; } + + .popover { max-width: calc(100vw - 16px); } + + .modal { padding: 20px; } } diff --git a/frontend/public/index.html b/frontend/public/index.html index a2749c3..7ed86af 100644 --- a/frontend/public/index.html +++ b/frontend/public/index.html @@ -98,10 +98,12 @@
- - - -
NomCadres actifsCréée le
+
+ + + +
NomCadres actifsCréée le
+
@@ -117,10 +119,12 @@ - - - -
NomE-mailRôleSociétéStatut
+
+ + + +
NomE-mailRôleSociétéStatut
+
@@ -165,10 +169,12 @@ - - - -
CadreStatutValidé le
+
+ + + +
CadreStatutValidé le
+
Export : diff --git a/frontend/public/js/app.js b/frontend/public/js/app.js index 1d8343c..917dd18 100644 --- a/frontend/public/js/app.js +++ b/frontend/public/js/app.js @@ -1,6 +1,7 @@ (() => { 'use strict'; + const WEEKDAY_SHORT = ['Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam']; const MONTH_NAMES = [ 'Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre', @@ -224,7 +225,7 @@ const num = document.createElement('div'); num.className = 'day-number'; - num.textContent = d; + num.innerHTML = `${WEEKDAY_SHORT[dateObj.getDay()]} ${d}`; cell.appendChild(num); const row = document.createElement('div'); @@ -258,10 +259,24 @@ popoverTarget = half; const label = half.dataset.period === 'AM' ? 'Matin' : 'Après-midi'; document.getElementById('popover-title').textContent = `${half.dataset.date} — ${label}`; - const rect = half.getBoundingClientRect(); - popover.style.top = `${window.scrollY + rect.bottom + 6}px`; - popover.style.left = `${window.scrollX + rect.left}px`; + popover.hidden = false; + const rect = half.getBoundingClientRect(); + const popRect = popover.getBoundingClientRect(); + const viewportWidth = document.documentElement.clientWidth; + const viewportHeight = document.documentElement.clientHeight; + const margin = 8; + + let top = window.scrollY + rect.bottom + 6; + if (rect.bottom + popRect.height + margin > viewportHeight) { + top = window.scrollY + rect.top - popRect.height - 6; + } + let left = window.scrollX + rect.left; + const maxLeft = window.scrollX + viewportWidth - popRect.width - margin; + left = Math.min(left, Math.max(window.scrollX + margin, maxLeft)); + + popover.style.top = `${Math.max(window.scrollY + margin, top)}px`; + popover.style.left = `${left}px`; }); document.addEventListener('click', (e) => {