preview csv mobile
Deploy HouseHub / deploy (push) Successful in 2s

This commit is contained in:
FeFeClochette committed 2026-10-12 11:43:14 +02:00
1 parent 1997624065
commit b450a345f6
2 files changed
+767 -626

No files matched your search

-626
View File
@@ -1,626 +0,0 @@
<!doctype html>
<html lang="fr">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
/>
<title>HouseHub - Planning Repas</title>
<style>
/* --- VARIABLES --- */
:root {
--primary: #3b82f6;
--bg-page: #f8fafc;
--bg-panel: #ffffff;
--bg-subtle: #f1f5f9;
--text-main: #0f172a;
--text-muted: #64748b;
--border-light: #e2e8f0;
--border-strong: #cbd5e1;
--shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
--shadow-lg: 0 -4px 20px rgba(0, 0, 0, 0.15);
--alert-success-bg: #dcfce7;
}
body {
font-family:
"Inter",
-apple-system,
sans-serif;
background: var(--bg-page);
color: var(--text-main);
margin: 0;
padding: 10px;
overscroll-behavior-y: none;
padding-bottom: 70px; /* Espace pour la toolbar fixe */
}
/* --- EN-TÊTE --- */
.header-bar {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 12px;
}
.header-bar h1 {
margin: 0;
font-size: 1.3rem;
color: var(--text-main);
display: flex;
align-items: center;
gap: 8px;
}
.pf-btn {
background: var(--bg-panel);
color: var(--text-main);
border: 1px solid var(--border-strong);
padding: 8px 12px;
border-radius: 8px;
font-weight: 600;
cursor: pointer;
font-size: 0.85rem;
box-shadow: var(--shadow-sm);
}
.pf-btn.primary {
background: var(--primary);
color: white;
border-color: var(--primary);
}
/* --- MATRICE ULTRA-COMPACTE --- */
.meals-wrapper {
background: var(--bg-panel);
border-radius: 8px;
border: 1px solid var(--border-strong);
box-shadow: var(--shadow-sm);
overflow: hidden;
}
.meals-table {
width: 100%;
table-layout: fixed;
border-collapse: collapse;
}
.meals-table th,
.meals-table td {
border: 1px solid var(--border-light);
padding: 0;
text-align: center;
vertical-align: middle;
}
.meals-table th {
background: var(--bg-subtle);
font-size: 0.6rem;
font-weight: 800;
color: var(--text-muted);
padding: 6px 2px;
text-transform: uppercase;
}
.col-sticky {
width: 40px;
background: var(--bg-subtle);
border-right: 2px solid var(--border-strong) !important;
padding: 4px 2px !important;
}
.day-label {
font-size: 0.65rem;
font-weight: 800;
color: var(--text-main);
text-transform: uppercase;
display: block;
margin-bottom: 2px;
}
.day-label.invisible {
visibility: hidden;
height: 0;
margin: 0;
}
.service-icon {
background: white;
border: 1px solid var(--border-strong);
border-radius: 6px;
font-size: 1rem;
width: 26px;
height: 26px;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto;
cursor: pointer;
box-shadow: var(--shadow-sm);
transition: transform 0.1s;
}
.service-icon:active {
transform: scale(0.9);
}
.row-lunch td {
border-top: 2px solid var(--border-strong) !important;
}
.row-dinner td {
border-top: 1px dashed var(--border-light);
}
.meal-input-cell {
position: relative;
height: 100%;
background: var(--bg-panel);
}
.meal-input {
width: 100%;
height: 44px;
border: none;
background: transparent;
text-align: center;
font-size: 0.75rem;
padding: 4px;
color: var(--text-main);
font-family: inherit;
resize: none;
box-sizing: border-box;
outline: none;
}
.meal-input:focus {
background: #eff6ff;
}
/* --- BARRE CONTEXTUELLE (FIXE EN BAS) --- */
.context-toolbar {
position: fixed;
bottom: -80px;
left: 0;
right: 0;
height: 60px;
background: var(--bg-panel);
border-top: 1px solid var(--border-strong);
box-shadow: var(--shadow-lg);
display: flex;
justify-content: center;
align-items: center;
gap: 12px;
transition: bottom 0.2s cubic-bezier(0.16, 1, 0.3, 1);
z-index: 1000;
padding: 0 10px;
}
.context-toolbar.active {
bottom: 0;
}
.ctx-btn {
background: var(--bg-subtle);
border: 1px solid var(--border-strong);
border-radius: 8px;
padding: 10px 16px;
font-size: 0.85rem;
font-weight: 700;
color: var(--text-main);
cursor: pointer;
display: flex;
align-items: center;
gap: 6px;
}
.ctx-btn.primary {
background: var(--primary);
color: white;
border-color: var(--primary);
}
/* --- MODALE : COPIER VERS (DESIGN GRILLE) --- */
.pf-modal {
display: none;
position: fixed;
inset: 0;
background: rgba(15, 23, 42, 0.6);
align-items: center;
justify-content: center;
z-index: 2000;
}
.pf-modal.open {
display: flex;
animation: fadeInBg 0.2s;
}
.pf-modal-content {
background: var(--bg-panel);
width: 95%;
max-width: 600px;
border-radius: 12px;
padding: 20px;
box-sizing: border-box;
box-shadow: var(--shadow-lg);
max-height: 90vh;
overflow-y: auto;
}
.modal-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 8px;
}
.modal-title {
margin: 0;
font-size: 1.1rem;
color: var(--text-main);
font-weight: 800;
display: flex;
align-items: center;
gap: 8px;
}
.modal-close {
background: none;
border: none;
font-size: 1.8rem;
cursor: pointer;
color: var(--text-muted);
line-height: 1;
margin-top: -5px;
}
.modal-source {
font-size: 0.85rem;
color: var(--text-muted);
font-weight: 600;
margin: 0 0 20px 0;
}
/* Grille des Jours */
.week-section-title {
background: var(--bg-subtle);
text-align: center;
padding: 6px;
font-weight: 700;
font-size: 0.85rem;
color: var(--text-muted);
border-radius: 4px;
margin: 15px 0 10px 0;
text-transform: uppercase;
border: 1px solid var(--border-light);
}
.days-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 10px;
}
.day-card {
background: var(--bg-panel);
border: 1px solid var(--border-light);
border-radius: 8px;
padding: 8px 4px;
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
box-shadow: var(--shadow-sm);
}
.day-card-title {
font-size: 0.8rem;
font-weight: 700;
color: var(--text-main);
}
.day-card-actions {
display: flex;
gap: 6px;
justify-content: center;
width: 100%;
}
.day-action-btn {
background: var(--bg-page);
border: 1px solid var(--border-strong);
border-radius: 6px;
width: 30px;
height: 30px;
display: flex;
align-items: center;
justify-content: center;
font-size: 1rem;
cursor: pointer;
transition: 0.1s;
}
.day-action-btn:active {
transform: scale(0.9);
background: #e2e8f0;
}
@media (max-width: 380px) {
.days-grid {
grid-template-columns: repeat(3, 1fr);
}
}
@keyframes fadeInBg {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
</style>
</head>
<body>
<div class="header-bar">
<h1>
<span style="opacity: 0.5">🍽️</span>
<span data-i18n="meals_board_title">Planning Repas</span>
</h1>
<button class="pf-btn" title="Générer les courses">
🛒 <span data-i18n="btn_groceries">Courses</span>
</button>
</div>
<!-- BARRE CONTEXTUELLE FIXE (Évite le conflit avec le clavier mobile) -->
<div class="context-toolbar" id="contextToolbar">
<button
class="ctx-btn"
onmousedown="
event.preventDefault();
applyToAllInRow();
"
>
➡️ <span data-i18n="btn_apply_all">Tous</span>
</button>
<button
class="ctx-btn primary"
onmousedown="
event.preventDefault();
openCopySheetFromCell();
"
>
🔄 <span data-i18n="btn_copy_to">Copier vers...</span>
</button>
</div>
<div class="meals-wrapper">
<table class="meals-table" id="mealsTable">
<thead>
<tr>
<th class="col-sticky"></th>
<th>PAPA</th>
<th>MAMAN</th>
<th>E1</th>
<th>E2</th>
</tr>
</thead>
<tbody>
<!-- Injecté via JS -->
</tbody>
</table>
</div>
<!-- MODALE DE COPIE (GRILLE LUNDI-DIMANCHE) -->
<div id="copyModal" class="pf-modal">
<div class="pf-modal-content">
<div class="modal-header">
<h3 class="modal-title">
🔄 <span data-i18n="modal_copy_title">Copier vers...</span>
</h3>
<button class="modal-close" onclick="closeCopyModal()">
&times;
</button>
</div>
<div id="copySourceLabel" class="modal-source">
Source : Plat individuel (Lundi Midi)
</div>
<div class="week-section-title" data-i18n="week_current">
Semaine actuelle
</div>
<div class="days-grid" id="currentWeekGrid"></div>
<div class="week-section-title" data-i18n="week_next">
Semaine prochaine
</div>
<div class="days-grid" id="nextWeekGrid"></div>
</div>
</div>
<script>
// --- I18N MOCKUP ---
window.I18N = {
meals_board_title: "Planning Repas",
btn_groceries: "Courses",
btn_apply_all: "Tous",
btn_copy_to: "Copier vers...",
modal_copy_title: "Copier vers...",
source_individual: "Plat individuel",
source_row: "Repas complet",
week_current: "Semaine actuelle",
week_next: "Semaine prochaine",
};
document
.querySelectorAll("[data-i18n]")
.forEach(
(el) => (el.innerHTML = window.I18N[el.getAttribute("data-i18n")]),
);
const days = ["Lun", "Mar", "Mer", "Jeu", "Ven", "Sam", "Dim"];
const fullDays = [
"Lundi",
"Mardi",
"Mercredi",
"Jeudi",
"Vendredi",
"Samedi",
"Dimanche",
];
const membersCount = 4;
const tbody = document.querySelector("#mealsTable tbody");
let copyState = {
type: null,
dayIdx: null,
service: null,
personIdx: null,
sourceElements: [],
};
// --- 1. GÉNÉRATION DE LA GRILLE PRINCIPALE ---
days.forEach((day, index) => {
let trLunch = document.createElement("tr");
trLunch.className = "row-lunch";
trLunch.innerHTML = `
<td class="col-sticky">
<span class="day-label">${day}</span>
<div class="service-icon" onclick="openCopySheetFromRow(${index}, 'lunch')" title="Copier la ligne">☀️</div>
</td>`;
for (let p = 0; p < membersCount; p++) {
trLunch.innerHTML += `<td class="meal-input-cell"><textarea class="meal-input js-meal-input" data-d="${index}" data-s="lunch" data-p="${p}" placeholder="-"></textarea></td>`;
}
tbody.appendChild(trLunch);
let trDinner = document.createElement("tr");
trDinner.className = "row-dinner";
trDinner.innerHTML = `
<td class="col-sticky">
<span class="day-label invisible">${day}</span>
<div class="service-icon" onclick="openCopySheetFromRow(${index}, 'dinner')" title="Copier la ligne">🌙</div>
</td>`;
for (let p = 0; p < membersCount; p++) {
trDinner.innerHTML += `<td class="meal-input-cell"><textarea class="meal-input js-meal-input" data-d="${index}" data-s="dinner" data-p="${p}" placeholder="-"></textarea></td>`;
}
tbody.appendChild(trDinner);
});
// --- 2. GÉNÉRATION DES GRILLES DE LA MODALE COPIE ---
function buildModalGrid(containerId, weekTarget) {
const container = document.getElementById(containerId);
let html = "";
fullDays.forEach((dayName, idx) => {
html += `
<div class="day-card">
<div class="day-card-title">${dayName}</div>
<div class="day-card-actions">
<button type="button" class="day-action-btn" onclick="executeCopy(${idx}, 'lunch', '${weekTarget}')">☀️</button>
<button type="button" class="day-action-btn" onclick="executeCopy(${idx}, 'dinner', '${weekTarget}')">🌙</button>
</div>
</div>`;
});
container.innerHTML = html;
}
buildModalGrid("currentWeekGrid", "current");
buildModalGrid("nextWeekGrid", "next");
// --- 3. GESTION DU FOCUS & DE LA TOOLBAR ---
document.addEventListener("focusin", (e) => {
if (e.target.classList.contains("js-meal-input")) {
copyState = {
type: "cell",
dayIdx: e.target.getAttribute("data-d"),
service: e.target.getAttribute("data-s"),
personIdx: e.target.getAttribute("data-p"),
sourceElements: [e.target],
};
document.getElementById("contextToolbar").classList.add("active");
}
});
document.addEventListener("focusout", (e) => {
setTimeout(() => {
if (!document.activeElement.classList.contains("js-meal-input")) {
document
.getElementById("contextToolbar")
.classList.remove("active");
}
}, 150);
});
function flashSuccess(input) {
input.style.transition = "background 0.3s";
input.style.background = "var(--alert-success-bg)";
setTimeout(() => (input.style.background = "transparent"), 400);
}
// --- 4. ACTIONS DE COPIE ---
function applyToAllInRow() {
if (
copyState.type !== "cell" ||
!copyState.sourceElements[0].value.trim()
)
return;
const val = copyState.sourceElements[0].value;
const inputs = document.querySelectorAll(
`.js-meal-input[data-d="${copyState.dayIdx}"][data-s="${copyState.service}"]`,
);
inputs.forEach((inp) => {
if (inp !== copyState.sourceElements[0]) {
inp.value = val;
flashSuccess(inp);
}
});
}
function openCopySheetFromCell() {
if (
!copyState.sourceElements[0] ||
!copyState.sourceElements[0].value.trim()
)
return;
document.getElementById("contextToolbar").classList.remove("active");
document.activeElement.blur(); // Masque le clavier mobile
const svcLabel = copyState.service === "lunch" ? "Midi" : "Soir";
document.getElementById("copySourceLabel").innerText =
`Source : ${window.I18N.source_individual} (${fullDays[copyState.dayIdx]} ${svcLabel})`;
document.getElementById("copyModal").classList.add("open");
document.body.classList.add("no-scroll");
}
function openCopySheetFromRow(dIdx, service) {
const inputs = document.querySelectorAll(
`.js-meal-input[data-d="${dIdx}"][data-s="${service}"]`,
);
const hasContent = Array.from(inputs).some(
(inp) => inp.value.trim() !== "",
);
if (!hasContent) return;
copyState = {
type: "row",
dayIdx: dIdx,
service: service,
sourceElements: Array.from(inputs),
};
const svcLabel = service === "lunch" ? "Midi" : "Soir";
document.getElementById("copySourceLabel").innerText =
`Source : ${window.I18N.source_row} (${fullDays[dIdx]} ${svcLabel})`;
document.getElementById("copyModal").classList.add("open");
document.body.classList.add("no-scroll");
}
function closeCopyModal() {
document.getElementById("copyModal").classList.remove("open");
document.body.classList.remove("no-scroll");
}
function executeCopy(targetDayIdx, targetService, targetWeek) {
if (targetWeek === "next") {
alert("Simulation : Copié avec succès vers la SEMAINE PROCHAINE !");
closeCopyModal();
return;
}
if (copyState.type === "cell") {
const val = copyState.sourceElements[0].value;
const targetInput = document.querySelector(
`.js-meal-input[data-d="${targetDayIdx}"][data-s="${targetService}"][data-p="${copyState.personIdx}"]`,
);
if (targetInput) {
targetInput.value = val;
flashSuccess(targetInput);
}
} else if (copyState.type === "row") {
const targetInputs = document.querySelectorAll(
`.js-meal-input[data-d="${targetDayIdx}"][data-s="${targetService}"]`,
);
copyState.sourceElements.forEach((inp, idx) => {
if (inp.value.trim() !== "") {
targetInputs[idx].value = inp.value;
flashSuccess(targetInputs[idx]);
}
});
}
closeCopyModal();
}
</script>
</body>
</html>
+767
View File
@@ -0,0 +1,767 @@
<!doctype html>
<html lang="fr">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
/>
<title>Preview Mobile - Import CSV</title>
<style>
/* === Variables HouseHub (Simulées) === */
:root {
--primary: #3b82f6;
--primary-dark: #1d4ed8;
--success: #10b981;
--danger: #ef4444;
--bg-page: #f8fafc;
--bg-panel: #ffffff;
--bg-subtle: #f1f5f9;
--text-main: #0f172a;
--text-muted: #64748b;
--border-light: #e2e8f0;
--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
--shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
--radius: 12px;
}
* {
box-sizing: border-box;
font-family:
-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
body {
margin: 0;
background: #333;
display: flex;
justify-content: center;
align-items: flex-start;
min-height: 100vh;
}
/* Conteneur simulant un écran mobile */
.mobile-simulator {
width: 100%;
max-width: 414px; /* Taille iPhone Max */
height: 100vh;
max-height: 896px;
background: var(--bg-page);
position: relative;
overflow: hidden;
display: flex;
flex-direction: column;
box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}
/* En-tête de la modale */
.preview-header {
background: var(--bg-panel);
padding: 16px;
border-bottom: 1px solid var(--border-light);
flex-shrink: 0;
z-index: 10;
}
.preview-title {
margin: 0 0 12px 0;
font-size: 1.1rem;
color: var(--text-main);
display: flex;
justify-content: space-between;
}
.preview-close {
background: none;
border: none;
font-size: 1.5rem;
color: var(--text-muted);
line-height: 1;
cursor: pointer;
}
/* Système d'onglets pour la preview */
.tabs {
display: flex;
background: var(--bg-subtle);
padding: 4px;
border-radius: 8px;
}
.tab-btn {
flex: 1;
padding: 6px;
border: none;
background: transparent;
border-radius: 6px;
font-size: 0.8rem;
font-weight: 600;
color: var(--text-muted);
cursor: pointer;
}
.tab-btn.active {
background: var(--bg-panel);
color: var(--primary);
box-shadow: var(--shadow-sm);
}
/* Conteneur principal scrollable */
.preview-body {
flex: 1;
overflow-y: auto;
overflow-x: hidden;
padding: 16px;
padding-bottom: 80px; /* Espace pour le bouton valider */
}
.view-section {
display: none;
animation: fadeIn 0.3s ease;
}
.view-section.active {
display: block;
}
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(5px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* Composants de formulaire communs */
.pf-label {
display: block;
font-size: 0.8rem;
font-weight: 600;
color: var(--text-muted);
margin-bottom: 4px;
}
.pf-select,
.pf-input {
width: 100%;
padding: 10px;
border: 1px solid var(--border-light);
border-radius: 8px;
font-size: 0.95rem;
background: var(--bg-panel);
color: var(--text-main);
margin-bottom: 10px;
}
.pf-select:focus {
border-color: var(--primary);
outline: none;
}
.amount-badge {
font-weight: 700;
font-size: 1.05rem;
}
.amount-expense {
color: var(--text-main);
}
.amount-income {
color: var(--success);
}
/* =========================================
PROPOSITION 1 : CARTES VERTICALES
========================================= */
.prop1-card {
background: var(--bg-panel);
border: 1px solid var(--border-light);
border-radius: var(--radius);
padding: 16px;
margin-bottom: 12px;
box-shadow: var(--shadow-sm);
}
.prop1-header {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 12px;
}
.prop1-date {
font-size: 0.75rem;
color: var(--text-muted);
font-weight: 600;
}
.prop1-label {
font-size: 0.95rem;
font-weight: 600;
color: var(--text-main);
margin: 4px 0 0 0;
line-height: 1.3;
}
.prop1-ignore-row {
display: flex;
align-items: center;
gap: 8px;
margin-top: 8px;
}
.prop1-ignore-row input[type="checkbox"] {
width: 18px;
height: 18px;
accent-color: var(--danger);
}
/* =========================================
PROPOSITION 2 : ACCORDÉON (Liste compacte)
========================================= */
.prop2-container {
background: var(--bg-panel);
border: 1px solid var(--border-light);
border-radius: var(--radius);
overflow: hidden;
}
.prop2-item {
border-bottom: 1px solid var(--border-light);
}
.prop2-item:last-child {
border-bottom: none;
}
.prop2-summary {
padding: 12px 16px;
display: flex;
justify-content: space-between;
align-items: center;
background: var(--bg-panel);
cursor: pointer;
}
.prop2-summary-left {
flex: 1;
min-width: 0;
padding-right: 12px;
}
.prop2-label {
font-size: 0.9rem;
font-weight: 600;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.prop2-date {
font-size: 0.75rem;
color: var(--text-muted);
}
.prop2-status {
width: 12px;
height: 12px;
border-radius: 50%;
background: var(--danger);
margin-left: 8px;
flex-shrink: 0;
}
.prop2-status.ok {
background: var(--success);
}
.prop2-details {
display: none;
padding: 16px;
background: var(--bg-subtle);
border-top: 1px dashed var(--border-light);
}
.prop2-item.open .prop2-details {
display: block;
}
.prop2-item.open .prop2-summary {
background: var(--bg-soft);
}
/* =========================================
PROPOSITION 3 : BOTTOM SHEET (Native feel)
========================================= */
.prop3-list {
display: flex;
flex-direction: column;
gap: 8px;
}
.prop3-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 14px 16px;
background: var(--bg-panel);
border: 1px solid var(--border-light);
border-radius: 10px;
cursor: pointer;
}
.prop3-item:active {
background: var(--bg-subtle);
}
.prop3-item.categorized {
border-left: 4px solid var(--success);
}
.prop3-item.pending {
border-left: 4px solid var(--warning);
}
.bottom-sheet-overlay {
position: absolute;
inset: 0;
background: rgba(0, 0, 0, 0.5);
z-index: 100;
display: none;
opacity: 0;
transition: opacity 0.3s;
}
.bottom-sheet {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background: var(--bg-panel);
border-radius: 20px 20px 0 0;
padding: 24px;
z-index: 101;
transform: translateY(100%);
transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.1);
}
.bottom-sheet.open {
transform: translateY(0);
}
.bottom-sheet-overlay.open {
display: block;
opacity: 1;
}
.bs-handle {
width: 40px;
height: 5px;
background: var(--border-strong);
border-radius: 5px;
margin: -10px auto 20px auto;
}
/* Footer fixe */
.preview-footer {
position: absolute;
bottom: 0;
left: 0;
right: 0;
padding: 16px;
background: var(--bg-panel);
border-top: 1px solid var(--border-light);
z-index: 50;
}
.pf-btn {
display: block;
width: 100%;
padding: 14px;
background: var(--primary);
color: white;
border: none;
border-radius: 8px;
font-size: 1rem;
font-weight: 600;
text-align: center;
cursor: pointer;
}
</style>
</head>
<body>
<div class="mobile-simulator">
<div class="preview-header">
<h2 class="preview-title">
<span>📥 Importation CSV</span>
<button class="preview-close">×</button>
</h2>
<div class="tabs">
<button class="tab-btn active" onclick="switchView('prop1')">
1. Cartes
</button>
<button class="tab-btn" onclick="switchView('prop2')">
2. Accordéon
</button>
<button class="tab-btn" onclick="switchView('prop3')">
3. Bottom Sheet
</button>
</div>
</div>
<div class="preview-body">
<!-- ======================================================= -->
<!-- PROPOSITION 1 : CARTES VERTICALES -->
<!-- ======================================================= -->
<div id="prop1" class="view-section active">
<p
style="font-size: 0.85rem; color: var(--text-muted); margin-top: 0"
>
Vision aérée. Parfait s'il y a peu de lignes à importer.
</p>
<!-- Ligne Dépense -->
<div class="prop1-card">
<div class="prop1-header">
<div>
<div class="prop1-date">12/10/2026</div>
<h4 class="prop1-label">AUCHAN SUPERMARCHE</h4>
</div>
<div class="amount-badge amount-expense">- 45,20 €</div>
</div>
<label class="pf-label">Catégorie</label>
<select
class="pf-select"
onchange="toggleLinkedItem(this, 'prop1-linked-1')"
>
<option value="">-- À définir --</option>
<option value="FMCG">🛒 Courses (FMCG)</option>
<option value="FIXED">🏢 Charges Fixes</option>
<option value="INCOME">💵 Revenus</option>
</select>
<div id="prop1-linked-1" style="display: none">
<label class="pf-label">Lier à une charge fixe</label>
<select class="pf-select">
<option value="">-- Sélectionner --</option>
<option value="1">Assurance Auto</option>
<option value="2">Loyer</option>
</select>
</div>
<label
class="prop1-ignore-row pf-label"
style="margin: 0; font-weight: 500; cursor: pointer"
>
<input type="checkbox" /> Ignorer cette ligne
</label>
</div>
<!-- Ligne Abonnement -->
<div class="prop1-card">
<div class="prop1-header">
<div>
<div class="prop1-date">14/10/2026</div>
<h4 class="prop1-label">NETFLIX.COM</h4>
</div>
<div class="amount-badge amount-expense">- 13,49 €</div>
</div>
<label class="pf-label">Catégorie</label>
<select
class="pf-select"
onchange="toggleLinkedItem(this, 'prop1-linked-2')"
>
<option value="FIXED" selected>🏢 Charges Fixes</option>
<option value="FMCG">🛒 Courses (FMCG)</option>
</select>
<div id="prop1-linked-2" style="display: block">
<label class="pf-label">Lier à une charge fixe</label>
<select class="pf-select">
<option value="3" selected>Abonnement Netflix</option>
<option value="1">Assurance Auto</option>
</select>
</div>
</div>
<!-- Ligne Revenu -->
<div class="prop1-card">
<div class="prop1-header">
<div>
<div class="prop1-date">15/10/2026</div>
<h4 class="prop1-label">VIR SEPA M. PERCO</h4>
</div>
<div class="amount-badge amount-income">+ 1 500,00 €</div>
</div>
<label class="pf-label">Catégorie</label>
<select class="pf-select">
<option value="INCOME" selected>💵 Revenus</option>
<option value="FMCG">🛒 Courses (FMCG)</option>
</select>
</div>
</div>
<!-- ======================================================= -->
<!-- PROPOSITION 2 : ACCORDÉON -->
<!-- ======================================================= -->
<div id="prop2" class="view-section">
<p
style="font-size: 0.85rem; color: var(--text-muted); margin-top: 0"
>
Vision compacte. Idéal pour un gros volume d'imports.
</p>
<div class="prop2-container">
<!-- Item 1 -->
<div class="prop2-item" onclick="toggleAccordion(this)">
<div class="prop2-summary">
<div class="prop2-summary-left">
<div class="prop2-date">12/10/2026</div>
<div class="prop2-label">AUCHAN SUPERMARCHE</div>
</div>
<div class="amount-badge amount-expense">- 45,20 €</div>
<div class="prop2-status" title="À définir"></div>
</div>
<div class="prop2-details" onclick="event.stopPropagation()">
<label class="pf-label">Catégorie</label>
<select
class="pf-select"
onchange="
toggleLinkedItem(this, 'prop2-linked-1');
updateAccordionStatus(this);
"
>
<option value="">-- À définir --</option>
<option value="FMCG">🛒 Courses (FMCG)</option>
<option value="FIXED">🏢 Charges Fixes</option>
</select>
<div id="prop2-linked-1" style="display: none">
<label class="pf-label">Lier à une charge fixe</label>
<select class="pf-select">
<option value="">-- Sélectionner --</option>
<option value="1">Assurance Auto</option>
</select>
</div>
<label
class="prop1-ignore-row pf-label"
style="margin: 0; font-weight: 500"
>
<input
type="checkbox"
onchange="updateAccordionStatus(this, true)"
/>
Ignorer
</label>
</div>
</div>
<!-- Item 2 -->
<div class="prop2-item">
<div
class="prop2-summary"
onclick="toggleAccordion(this.parentElement)"
>
<div class="prop2-summary-left">
<div class="prop2-date">14/10/2026</div>
<div class="prop2-label">NETFLIX.COM</div>
</div>
<div class="amount-badge amount-expense">- 13,49 €</div>
<div class="prop2-status ok" title="Validé"></div>
</div>
<div class="prop2-details" onclick="event.stopPropagation()">
<label class="pf-label">Catégorie</label>
<select class="pf-select">
<option value="FIXED" selected>🏢 Charges Fixes</option>
</select>
<label class="pf-label">Lien</label>
<select class="pf-select">
<option value="3" selected>Abonnement Netflix</option>
</select>
</div>
</div>
</div>
</div>
<!-- ======================================================= -->
<!-- PROPOSITION 3 : LISTE + BOTTOM SHEET -->
<!-- ======================================================= -->
<div id="prop3" class="view-section">
<p
style="font-size: 0.85rem; color: var(--text-muted); margin-top: 0"
>
Expérience 100% Mobile Native. Garde la liste toujours visible.
</p>
<div class="prop3-list">
<div
class="prop3-item pending"
onclick="
openBottomSheet('AUCHAN SUPERMARCHE', '-45.20', 'expense', '')
"
>
<div>
<div class="prop1-date">12/10/2026</div>
<div class="prop1-label" style="font-size: 0.85rem">
AUCHAN SUPERMARCHE
</div>
<div
style="
font-size: 0.7rem;
color: var(--danger);
margin-top: 2px;
"
>
À définir
</div>
</div>
<div class="amount-badge amount-expense">- 45,20 €</div>
</div>
<div
class="prop3-item categorized"
onclick="
openBottomSheet('NETFLIX.COM', '-13.49', 'expense', 'FIXED')
"
>
<div>
<div class="prop1-date">14/10/2026</div>
<div class="prop1-label" style="font-size: 0.85rem">
NETFLIX.COM
</div>
<div
style="
font-size: 0.7rem;
color: var(--success);
margin-top: 2px;
"
>
Charges Fixes
</div>
</div>
<div class="amount-badge amount-expense">- 13,49 €</div>
</div>
</div>
</div>
</div>
<!-- Footer Fixe -->
<div class="preview-footer">
<button class="pf-btn">Valider l'importation</button>
</div>
<!-- Modale Bottom Sheet (Pour Prop 3) -->
<div
class="bottom-sheet-overlay"
id="bs-overlay"
onclick="closeBottomSheet()"
></div>
<div class="bottom-sheet" id="bs-modal">
<div class="bs-handle"></div>
<div
style="
display: flex;
justify-content: space-between;
margin-bottom: 20px;
"
>
<div>
<h3
id="bs-title"
style="margin: 0; font-size: 1.1rem; color: var(--text-main)"
>
Titre
</h3>
<div
id="bs-date"
style="font-size: 0.8rem; color: var(--text-muted)"
>
12/10/2026
</div>
</div>
<div id="bs-amount" class="amount-badge">0,00 €</div>
</div>
<label class="pf-label">Catégorie</label>
<select
class="pf-select"
id="bs-select-cat"
onchange="toggleLinkedItem(this, 'bs-linked-item')"
>
<option value="">-- À définir --</option>
<option value="FMCG">🛒 Courses (FMCG)</option>
<option value="FIXED">🏢 Charges Fixes</option>
<option value="INCOME">💵 Revenus</option>
</select>
<div id="bs-linked-item" style="display: none">
<label class="pf-label">Lier à une charge / revenu</label>
<select class="pf-select">
<option value="">-- Sélectionner --</option>
<option value="1">Loyer</option>
<option value="2">Assurance</option>
</select>
</div>
<div style="display: flex; gap: 10px; margin-top: 20px">
<button
class="pf-btn"
style="background: var(--bg-subtle); color: var(--danger); flex: 1"
onclick="closeBottomSheet()"
>
Ignorer
</button>
<button class="pf-btn" style="flex: 2" onclick="closeBottomSheet()">
Appliquer
</button>
</div>
</div>
</div>
<script>
// Navigation entre les propositions
function switchView(id) {
document
.querySelectorAll(".view-section")
.forEach((el) => el.classList.remove("active"));
document
.querySelectorAll(".tab-btn")
.forEach((el) => el.classList.remove("active"));
document.getElementById(id).classList.add("active");
event.target.classList.add("active");
}
// Affichage conditionnel des selects liés (Charges fixes / Revenus)
function toggleLinkedItem(selectEl, targetId) {
const target = document.getElementById(targetId);
if (selectEl.value === "FIXED" || selectEl.value === "INCOME") {
target.style.display = "block";
} else {
target.style.display = "none";
}
}
// Logique Accordéon (Prop 2)
function toggleAccordion(itemEl) {
const isOpen = itemEl.classList.contains("open");
document
.querySelectorAll(".prop2-item")
.forEach((el) => el.classList.remove("open"));
if (!isOpen) {
itemEl.classList.add("open");
}
}
function updateAccordionStatus(element, isIgnore = false) {
const itemEl = element.closest(".prop2-item");
const statusDot = itemEl.querySelector(".prop2-status");
if (isIgnore && element.checked) {
statusDot.className = "prop2-status ok";
statusDot.style.background = "var(--text-muted)";
} else if (itemEl.querySelector("select").value !== "") {
statusDot.className = "prop2-status ok";
statusDot.style.background = "var(--success)";
} else {
statusDot.className = "prop2-status";
statusDot.style.background = "var(--danger)";
}
}
// Logique Bottom Sheet (Prop 3)
function openBottomSheet(title, amount, type, currentCat) {
document.getElementById("bs-title").innerText = title;
document.getElementById("bs-amount").innerText = amount + " €";
document.getElementById("bs-amount").className =
"amount-badge " +
(type === "expense" ? "amount-expense" : "amount-income");
const select = document.getElementById("bs-select-cat");
select.value = currentCat;
toggleLinkedItem(select, "bs-linked-item");
document.getElementById("bs-overlay").classList.add("open");
document.getElementById("bs-modal").classList.add("open");
}
function closeBottomSheet() {
document.getElementById("bs-overlay").classList.remove("open");
document.getElementById("bs-modal").classList.remove("open");
}
</script>
</body>
</html>