First commit
This commit is contained in:
@@ -0,0 +1,816 @@
|
||||
/* ============================================================
|
||||
LOGIS — Thème sombre moderne, compatible mobile
|
||||
============================================================ */
|
||||
|
||||
/* ── Variables ───────────────────────────────────────────── */
|
||||
:root {
|
||||
--bg: #0d1117;
|
||||
--bg-card: #161b22;
|
||||
--bg-card-hov: #1c2430;
|
||||
--bg-sidebar: #111827;
|
||||
--border: #30363d;
|
||||
--accent: #e94560;
|
||||
--accent-hov: #c73652;
|
||||
--gold: #c9a84c;
|
||||
--text: #e6edf3;
|
||||
--text-muted: #8b949e;
|
||||
--text-faint: #484f58;
|
||||
--success: #3fb950;
|
||||
--shadow: 0 4px 16px rgba(0,0,0,.45);
|
||||
--radius: 10px;
|
||||
--radius-sm: 6px;
|
||||
--transition: .2s ease;
|
||||
--max-w: 1200px;
|
||||
}
|
||||
|
||||
/* ── Reset ───────────────────────────────────────────────── */
|
||||
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
html { font-size: 16px; scroll-behavior: smooth; }
|
||||
body {
|
||||
background: var(--bg);
|
||||
color: var(--text);
|
||||
font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
|
||||
line-height: 1.6;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
main { flex: 1; }
|
||||
img { display: block; max-width: 100%; height: auto; }
|
||||
a { color: inherit; text-decoration: none; }
|
||||
button { cursor: pointer; font: inherit; border: none; background: none; }
|
||||
ul { list-style: none; }
|
||||
|
||||
/* ── Utilitaires ─────────────────────────────────────────── */
|
||||
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; }
|
||||
|
||||
/* ── Boutons ─────────────────────────────────────────────── */
|
||||
.btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: .5rem;
|
||||
padding: .75rem 1.75rem;
|
||||
border-radius: var(--radius-sm);
|
||||
font-size: .95rem;
|
||||
font-weight: 600;
|
||||
transition: background var(--transition), transform var(--transition),
|
||||
box-shadow var(--transition);
|
||||
}
|
||||
.btn-primary {
|
||||
background: var(--accent);
|
||||
color: #fff;
|
||||
}
|
||||
.btn-primary:hover, .btn-primary:focus-visible {
|
||||
background: var(--accent-hov);
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 4px 14px rgba(233,69,96,.35);
|
||||
}
|
||||
.btn-full { width: 100%; }
|
||||
.btn-hero {
|
||||
margin-top: 1.5rem;
|
||||
padding: .9rem 2.5rem;
|
||||
font-size: 1.05rem;
|
||||
}
|
||||
|
||||
/* ── Navigation ──────────────────────────────────────────── */
|
||||
.site-header {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 100;
|
||||
background: rgba(13,17,23,.92);
|
||||
backdrop-filter: blur(12px);
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
.navbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 4rem;
|
||||
}
|
||||
.navbar-brand {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: .6rem;
|
||||
font-size: 1.3rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: .05em;
|
||||
}
|
||||
.brand-icon { font-size: 1.4rem; }
|
||||
.brand-name { color: var(--text); }
|
||||
|
||||
/* Sélecteur de langue */
|
||||
.lang-form { display: inline; }
|
||||
.lang-switcher {
|
||||
display: flex;
|
||||
gap: .25rem;
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 20px;
|
||||
padding: .2rem .3rem;
|
||||
}
|
||||
.lang-btn {
|
||||
padding: .25rem .65rem;
|
||||
border-radius: 16px;
|
||||
font-size: .8rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-muted);
|
||||
transition: background var(--transition), color var(--transition);
|
||||
}
|
||||
.lang-btn.active,
|
||||
.lang-btn:hover { background: var(--accent); color: #fff; }
|
||||
|
||||
/* ── Hero ────────────────────────────────────────────────── */
|
||||
.hero {
|
||||
position: relative;
|
||||
min-height: clamp(400px, 70vh, 680px);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: var(--bg-card)
|
||||
var(--hero-bg, none)
|
||||
center/cover no-repeat;
|
||||
}
|
||||
.hero-generic { background-image: none; background: linear-gradient(135deg,#0d1117,#1a1a2e); }
|
||||
.hero-overlay {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: linear-gradient(
|
||||
to right,
|
||||
rgba(13,17,23,.85) 0%,
|
||||
rgba(13,17,23,.55) 60%,
|
||||
rgba(13,17,23,.25) 100%
|
||||
);
|
||||
}
|
||||
.hero-content {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
max-width: 620px;
|
||||
}
|
||||
.hero-label {
|
||||
display: inline-block;
|
||||
padding: .3rem .9rem;
|
||||
background: var(--accent);
|
||||
color: #fff;
|
||||
border-radius: 20px;
|
||||
font-size: .8rem;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: .08em;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
.hero-title {
|
||||
font-size: clamp(1.8rem, 5vw, 3.2rem);
|
||||
font-weight: 800;
|
||||
line-height: 1.15;
|
||||
margin-bottom: .75rem;
|
||||
}
|
||||
.hero-meta {
|
||||
color: var(--text-muted);
|
||||
font-size: 1.05rem;
|
||||
margin-bottom: .5rem;
|
||||
}
|
||||
.hero-price {
|
||||
font-size: clamp(1.4rem, 3vw, 2rem);
|
||||
font-weight: 700;
|
||||
color: var(--gold);
|
||||
}
|
||||
.hero-subtitle {
|
||||
font-size: 1.15rem;
|
||||
color: var(--text-muted);
|
||||
margin-top: .5rem;
|
||||
}
|
||||
|
||||
/* ── Grille des biens ────────────────────────────────────── */
|
||||
.properties-section { padding: 4rem 0; }
|
||||
.properties-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
|
||||
gap: 1.5rem;
|
||||
}
|
||||
|
||||
/* ── Carte bien ──────────────────────────────────────────── */
|
||||
.property-card {
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius);
|
||||
overflow: hidden;
|
||||
transition: transform var(--transition), box-shadow var(--transition),
|
||||
border-color var(--transition);
|
||||
}
|
||||
.property-card:hover {
|
||||
transform: translateY(-4px);
|
||||
box-shadow: var(--shadow);
|
||||
border-color: var(--accent);
|
||||
}
|
||||
.property-card-link { display: block; }
|
||||
|
||||
.property-card-img-wrapper {
|
||||
position: relative;
|
||||
aspect-ratio: 4/3;
|
||||
overflow: hidden;
|
||||
background: var(--bg);
|
||||
}
|
||||
.property-card-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
transition: transform .4s ease;
|
||||
}
|
||||
.property-card:hover .property-card-img { transform: scale(1.04); }
|
||||
.property-card-img-placeholder {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
font-size: 4rem;
|
||||
color: var(--text-faint);
|
||||
}
|
||||
|
||||
/* Badges sur la vignette */
|
||||
.property-card-status {
|
||||
position: absolute;
|
||||
top: .75rem;
|
||||
left: .75rem;
|
||||
padding: .25rem .75rem;
|
||||
border-radius: 20px;
|
||||
font-size: .75rem;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: .06em;
|
||||
}
|
||||
.status-sale { background: var(--accent); color: #fff; }
|
||||
.status-rent { background: #0e7fe0; color: #fff; }
|
||||
|
||||
.property-card-dpe {
|
||||
position: absolute;
|
||||
top: .75rem;
|
||||
right: .75rem;
|
||||
width: 2rem;
|
||||
height: 2rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 4px;
|
||||
font-weight: 800;
|
||||
font-size: .9rem;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.property-card-body { padding: 1.25rem; }
|
||||
.property-card-title {
|
||||
font-size: 1.1rem;
|
||||
font-weight: 700;
|
||||
margin-bottom: .4rem;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.property-card-location {
|
||||
font-size: .85rem;
|
||||
color: var(--text-muted);
|
||||
margin-bottom: .85rem;
|
||||
}
|
||||
|
||||
.property-card-specs {
|
||||
display: flex;
|
||||
gap: .75rem;
|
||||
flex-wrap: wrap;
|
||||
font-size: .85rem;
|
||||
color: var(--text-muted);
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
.property-card-specs li { display: flex; align-items: center; gap: .3rem; }
|
||||
|
||||
.property-card-price {
|
||||
font-size: 1.25rem;
|
||||
font-weight: 800;
|
||||
color: var(--gold);
|
||||
}
|
||||
.property-card-price small { font-size: .8rem; font-weight: 400; color: var(--text-muted); }
|
||||
|
||||
.empty-state {
|
||||
text-align: center;
|
||||
padding: 4rem 1rem;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
/* ── Page de détail ──────────────────────────────────────── */
|
||||
.detail-page { padding-bottom: 4rem; }
|
||||
|
||||
.detail-header {
|
||||
padding-top: 2rem;
|
||||
padding-bottom: 1.5rem;
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
.detail-header-meta {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
margin-bottom: .75rem;
|
||||
}
|
||||
.back-link {
|
||||
font-size: .88rem;
|
||||
color: var(--text-muted);
|
||||
transition: color var(--transition);
|
||||
}
|
||||
.back-link:hover { color: var(--accent); }
|
||||
.detail-status {
|
||||
padding: .25rem .85rem;
|
||||
border-radius: 20px;
|
||||
font-size: .78rem;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.detail-title {
|
||||
font-size: clamp(1.5rem, 4vw, 2.4rem);
|
||||
font-weight: 800;
|
||||
margin-bottom: .5rem;
|
||||
}
|
||||
.detail-location { color: var(--text-muted); margin-bottom: .75rem; }
|
||||
.detail-price {
|
||||
font-size: clamp(1.4rem, 3vw, 2rem);
|
||||
font-weight: 800;
|
||||
color: var(--gold);
|
||||
}
|
||||
.detail-price small { font-size: .8rem; font-weight: 400; color: var(--text-muted); }
|
||||
|
||||
/* ── Galerie ─────────────────────────────────────────────── */
|
||||
.detail-gallery {
|
||||
margin-top: 2rem;
|
||||
}
|
||||
|
||||
.gallery-tabs {
|
||||
display: flex;
|
||||
gap: .5rem;
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 1rem;
|
||||
border-bottom: 1px solid var(--border);
|
||||
padding-bottom: .75rem;
|
||||
}
|
||||
.gallery-tab {
|
||||
padding: .4rem 1rem;
|
||||
border-radius: 20px;
|
||||
font-size: .85rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-muted);
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border);
|
||||
transition: background var(--transition), color var(--transition), border-color var(--transition);
|
||||
}
|
||||
.gallery-tab:hover { color: var(--text); border-color: var(--text-muted); }
|
||||
.gallery-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
|
||||
|
||||
.gallery-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
|
||||
gap: .5rem;
|
||||
display: none;
|
||||
}
|
||||
.gallery-grid.active { display: grid; }
|
||||
|
||||
.gallery-item {
|
||||
position: relative;
|
||||
aspect-ratio: 4/3;
|
||||
overflow: hidden;
|
||||
border-radius: var(--radius-sm);
|
||||
border: 2px solid transparent;
|
||||
transition: border-color var(--transition), transform var(--transition);
|
||||
background: var(--bg-card);
|
||||
}
|
||||
.gallery-item:hover { border-color: var(--accent); transform: scale(1.02); }
|
||||
.gallery-thumb {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
transition: transform .3s ease;
|
||||
}
|
||||
.gallery-item:hover .gallery-thumb { transform: scale(1.06); }
|
||||
.gallery-item-caption {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
padding: .35rem .5rem;
|
||||
background: linear-gradient(transparent, rgba(0,0,0,.7));
|
||||
color: #fff;
|
||||
font-size: .75rem;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.no-photos { color: var(--text-muted); padding: 2rem 0; }
|
||||
|
||||
/* ── Corps détail ────────────────────────────────────────── */
|
||||
.detail-body {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 340px;
|
||||
gap: 2rem;
|
||||
margin-top: 2.5rem;
|
||||
align-items: start;
|
||||
}
|
||||
@media (max-width: 900px) {
|
||||
.detail-body { grid-template-columns: 1fr; }
|
||||
}
|
||||
|
||||
.detail-section { margin-bottom: 2.5rem; }
|
||||
.section-title {
|
||||
font-size: 1.2rem;
|
||||
font-weight: 700;
|
||||
margin-bottom: 1rem;
|
||||
padding-bottom: .5rem;
|
||||
border-bottom: 2px solid var(--accent);
|
||||
display: inline-block;
|
||||
}
|
||||
.detail-description {
|
||||
color: var(--text-muted);
|
||||
line-height: 1.8;
|
||||
}
|
||||
.detail-description p { margin-bottom: .85rem; }
|
||||
|
||||
/* Environnement */
|
||||
.env-type {
|
||||
font-size: 1rem;
|
||||
font-weight: 600;
|
||||
margin-bottom: .75rem;
|
||||
}
|
||||
.env-description {
|
||||
color: var(--text-muted);
|
||||
margin-bottom: 1.5rem;
|
||||
line-height: 1.7;
|
||||
}
|
||||
.env-services {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
|
||||
gap: 1.5rem;
|
||||
}
|
||||
.env-group-title {
|
||||
font-size: .9rem;
|
||||
font-weight: 700;
|
||||
margin-bottom: .6rem;
|
||||
color: var(--text-muted);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: .05em;
|
||||
}
|
||||
.env-list { display: flex; flex-direction: column; gap: .3rem; }
|
||||
.env-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: .5rem;
|
||||
font-size: .88rem;
|
||||
}
|
||||
.env-available { color: var(--success); }
|
||||
.env-unavailable { color: var(--text-faint); }
|
||||
.env-icon {
|
||||
width: 1.2rem;
|
||||
text-align: center;
|
||||
font-weight: 700;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* ── Sidebar ─────────────────────────────────────────────── */
|
||||
.detail-sidebar { display: flex; flex-direction: column; gap: 1.25rem; }
|
||||
.sidebar-card {
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius);
|
||||
padding: 1.5rem;
|
||||
}
|
||||
.sidebar-title {
|
||||
font-size: 1rem;
|
||||
font-weight: 700;
|
||||
margin-bottom: 1rem;
|
||||
padding-bottom: .5rem;
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.key-info {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: .4rem 1rem;
|
||||
}
|
||||
.key-info dt {
|
||||
font-size: .78rem;
|
||||
color: var(--text-muted);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: .04em;
|
||||
padding-top: .6rem;
|
||||
border-top: 1px solid var(--border);
|
||||
}
|
||||
.key-info dd {
|
||||
font-size: .9rem;
|
||||
font-weight: 600;
|
||||
padding-top: .6rem;
|
||||
border-top: 1px solid var(--border);
|
||||
}
|
||||
.key-info dt:nth-child(1), .key-info dd:nth-child(2) { border-top: none; padding-top: 0; }
|
||||
|
||||
.exterior-badges { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; }
|
||||
.badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: .3rem;
|
||||
padding: .25rem .7rem;
|
||||
border-radius: 20px;
|
||||
font-size: .78rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
.badge-exterior { background: rgba(201,168,76,.15); color: var(--gold); border: 1px solid rgba(201,168,76,.3); }
|
||||
|
||||
.features-list { margin-top: 1.25rem; }
|
||||
.features-title {
|
||||
font-size: .8rem;
|
||||
font-weight: 700;
|
||||
color: var(--text-muted);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: .05em;
|
||||
margin-bottom: .6rem;
|
||||
}
|
||||
.features-list ul {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: .35rem;
|
||||
}
|
||||
.features-list li {
|
||||
font-size: .88rem;
|
||||
color: var(--text-muted);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: .4rem;
|
||||
}
|
||||
.features-list li::before { content: '✓'; color: var(--success); font-size: .85rem; }
|
||||
|
||||
/* Diagnostics */
|
||||
.diagnostics-card {}
|
||||
.diag-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: .6rem 0;
|
||||
border-bottom: 1px solid var(--border);
|
||||
gap: .5rem;
|
||||
}
|
||||
.diag-row:last-of-type { border-bottom: none; }
|
||||
.diag-label { font-size: .85rem; color: var(--text-muted); }
|
||||
|
||||
.dpe-badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: .5rem;
|
||||
padding: .3rem .8rem;
|
||||
border-radius: var(--radius-sm);
|
||||
color: #fff;
|
||||
font-weight: 700;
|
||||
}
|
||||
.dpe-badge strong { font-size: 1.1rem; }
|
||||
.dpe-badge small { font-size: .75rem; font-weight: 400; opacity: .85; }
|
||||
.dpe-unknown { background: #444; color: var(--text-muted); }
|
||||
|
||||
.dpe-scale-wrapper { margin-top: 1rem; }
|
||||
.dpe-scale { display: flex; flex-direction: column; gap: 3px; }
|
||||
.dpe-scale-label { font-size: .75rem; color: var(--text-faint); margin-bottom: .4rem; }
|
||||
.dpe-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
min-width: 50px;
|
||||
height: 22px;
|
||||
border-radius: 0 4px 4px 0;
|
||||
padding: 0 8px;
|
||||
color: #fff;
|
||||
font-size: .75rem;
|
||||
font-weight: 700;
|
||||
transition: filter .2s;
|
||||
}
|
||||
.dpe-active { filter: brightness(1.2); box-shadow: 0 0 0 2px #fff; }
|
||||
.dpe-arrow { font-size: .7rem; font-weight: 400; opacity: .9; }
|
||||
|
||||
/* Contact sidebar */
|
||||
.contact-intro {
|
||||
font-size: .9rem;
|
||||
color: var(--text-muted);
|
||||
margin-bottom: 1.25rem;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
/* ── Modal générique ─────────────────────────────────────── */
|
||||
.modal {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 1000;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 1rem;
|
||||
}
|
||||
.modal[hidden] { display: none; }
|
||||
.modal-overlay {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: rgba(0,0,0,.7);
|
||||
backdrop-filter: blur(4px);
|
||||
}
|
||||
.modal-box {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius);
|
||||
width: 100%;
|
||||
max-width: 520px;
|
||||
max-height: 90vh;
|
||||
overflow-y: auto;
|
||||
padding: 2rem;
|
||||
box-shadow: var(--shadow);
|
||||
}
|
||||
.modal-close {
|
||||
position: absolute;
|
||||
top: 1rem;
|
||||
right: 1rem;
|
||||
font-size: 1.5rem;
|
||||
color: var(--text-muted);
|
||||
line-height: 1;
|
||||
transition: color var(--transition);
|
||||
}
|
||||
.modal-close:hover { color: var(--accent); }
|
||||
.modal-title {
|
||||
font-size: 1.15rem;
|
||||
font-weight: 700;
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
/* ── Formulaire de contact ───────────────────────────────── */
|
||||
.hp-field { position: absolute; left: -9999px; top: -9999px; opacity: 0; }
|
||||
.contact-form { display: flex; flex-direction: column; gap: 1rem; }
|
||||
.form-group { display: flex; flex-direction: column; gap: .35rem; }
|
||||
.form-group label {
|
||||
font-size: .85rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
.required { color: var(--accent); }
|
||||
.optional { color: var(--text-faint); font-weight: 400; }
|
||||
.form-group input,
|
||||
.form-group textarea {
|
||||
background: var(--bg);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-sm);
|
||||
color: var(--text);
|
||||
padding: .65rem .9rem;
|
||||
font-size: .95rem;
|
||||
transition: border-color var(--transition);
|
||||
width: 100%;
|
||||
}
|
||||
.form-group input:focus,
|
||||
.form-group textarea:focus {
|
||||
outline: none;
|
||||
border-color: var(--accent);
|
||||
}
|
||||
.form-group textarea { resize: vertical; min-height: 100px; }
|
||||
.field-error { font-size: .8rem; color: var(--accent); min-height: 1em; }
|
||||
.form-notice {
|
||||
font-size: .78rem;
|
||||
color: var(--text-faint);
|
||||
line-height: 1.5;
|
||||
}
|
||||
.form-global-error {
|
||||
background: rgba(233,69,96,.12);
|
||||
border: 1px solid rgba(233,69,96,.3);
|
||||
border-radius: var(--radius-sm);
|
||||
padding: .75rem 1rem;
|
||||
font-size: .88rem;
|
||||
color: var(--accent);
|
||||
}
|
||||
.form-global-error[hidden] { display: none; }
|
||||
|
||||
.contact-success {
|
||||
text-align: center;
|
||||
padding: 1.5rem 0;
|
||||
}
|
||||
.contact-success[hidden] { display: none; }
|
||||
.success-icon { font-size: 2.5rem; color: var(--success); }
|
||||
.success-title { font-size: 1.15rem; font-weight: 700; margin: .75rem 0 .4rem; }
|
||||
.success-body { color: var(--text-muted); }
|
||||
|
||||
/* ── Modal galerie ───────────────────────────────────────── */
|
||||
.gallery-modal {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 1100;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.gallery-modal[hidden] { display: none; }
|
||||
.gallery-modal-overlay {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: rgba(0,0,0,.92);
|
||||
}
|
||||
.gallery-modal-content {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
width: 100%;
|
||||
max-width: 1100px;
|
||||
padding: 1rem;
|
||||
}
|
||||
.gallery-modal-figure {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: .75rem;
|
||||
}
|
||||
.gallery-modal-figure img {
|
||||
max-height: 80vh;
|
||||
max-width: 100%;
|
||||
border-radius: var(--radius-sm);
|
||||
object-fit: contain;
|
||||
user-select: none;
|
||||
}
|
||||
.gallery-modal-caption {
|
||||
color: rgba(255,255,255,.7);
|
||||
font-size: .88rem;
|
||||
text-align: center;
|
||||
}
|
||||
.gallery-modal-counter {
|
||||
position: absolute;
|
||||
top: 1.25rem;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
color: rgba(255,255,255,.5);
|
||||
font-size: .8rem;
|
||||
background: rgba(0,0,0,.5);
|
||||
padding: .2rem .6rem;
|
||||
border-radius: 20px;
|
||||
}
|
||||
.gallery-modal-close {
|
||||
position: absolute;
|
||||
top: 1rem;
|
||||
right: 1rem;
|
||||
color: rgba(255,255,255,.7);
|
||||
font-size: 2rem;
|
||||
line-height: 1;
|
||||
z-index: 2;
|
||||
transition: color var(--transition);
|
||||
}
|
||||
.gallery-modal-close:hover { color: #fff; }
|
||||
.gallery-modal-nav {
|
||||
color: rgba(255,255,255,.6);
|
||||
font-size: 3rem;
|
||||
line-height: 1;
|
||||
padding: .5rem;
|
||||
transition: color var(--transition), transform var(--transition);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.gallery-modal-nav:hover { color: #fff; transform: scale(1.15); }
|
||||
.gallery-modal-nav:disabled { opacity: .2; pointer-events: none; }
|
||||
|
||||
/* ── Pied de page ────────────────────────────────────────── */
|
||||
.site-footer {
|
||||
background: var(--bg-card);
|
||||
border-top: 1px solid var(--border);
|
||||
padding: 2rem 0;
|
||||
margin-top: 2rem;
|
||||
}
|
||||
.footer-inner {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: .4rem;
|
||||
text-align: center;
|
||||
}
|
||||
.footer-brand {
|
||||
font-weight: 700;
|
||||
font-size: 1rem;
|
||||
letter-spacing: .05em;
|
||||
}
|
||||
.footer-copy { font-size: .82rem; color: var(--text-muted); }
|
||||
|
||||
/* ── Responsive ──────────────────────────────────────────── */
|
||||
@media (max-width: 768px) {
|
||||
.hero { min-height: 320px; }
|
||||
.hero-content { max-width: 100%; }
|
||||
|
||||
.properties-grid { grid-template-columns: 1fr; }
|
||||
|
||||
.gallery-grid { grid-template-columns: repeat(2, 1fr); }
|
||||
|
||||
.env-services { grid-template-columns: 1fr; }
|
||||
|
||||
.gallery-modal-nav { display: none; }
|
||||
.gallery-modal-content { padding: 3rem .5rem .5rem; }
|
||||
|
||||
.key-info { grid-template-columns: 1fr; }
|
||||
.key-info dt, .key-info dd { border-top: none; padding-top: 0; }
|
||||
.key-info dt { margin-top: .5rem; }
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.navbar { height: 3.5rem; }
|
||||
.brand-name { display: none; }
|
||||
.gallery-grid { grid-template-columns: repeat(2, 1fr); }
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
|
||||
<rect width="32" height="32" rx="6" fill="#1a1a2e"/>
|
||||
<text x="16" y="24" font-size="22" text-anchor="middle" font-family="sans-serif">🏠</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 218 B |
@@ -0,0 +1,188 @@
|
||||
/**
|
||||
* Gestion du formulaire de contact en modal avec envoi AJAX.
|
||||
* Protections : CSRF, honeypot, limitation de débit côté session.
|
||||
*/
|
||||
class ContactForm {
|
||||
/**
|
||||
* @param {HTMLFormElement} form
|
||||
* @param {HTMLElement} modal
|
||||
* @param {string} url - endpoint POST
|
||||
* @param {string} csrfToken
|
||||
*/
|
||||
constructor(form, modal, url, csrfToken) {
|
||||
this.form = form;
|
||||
this.modal = modal;
|
||||
this.url = url;
|
||||
this.csrfToken = csrfToken;
|
||||
|
||||
this.overlay = modal.querySelector('#contact-overlay');
|
||||
this.btnClose = modal.querySelector('#contact-modal-close');
|
||||
this.btnOpen = document.querySelector('#open-contact-modal');
|
||||
this.submit = form.querySelector('#contact-submit');
|
||||
this.success = modal.querySelector('#contact-success');
|
||||
this.globalErr = modal.querySelector('#contact-global-error');
|
||||
|
||||
this._bindEvents();
|
||||
}
|
||||
|
||||
// ── Initialisation ─────────────────────────────────────────────────────────
|
||||
|
||||
_bindEvents() {
|
||||
// Ouvrir
|
||||
if (this.btnOpen) {
|
||||
this.btnOpen.addEventListener('click', () => {
|
||||
this._setPropertyId(this.btnOpen.dataset.property);
|
||||
this.open();
|
||||
});
|
||||
}
|
||||
|
||||
// Fermer
|
||||
if (this.btnClose) this.btnClose.addEventListener('click', () => this.close());
|
||||
if (this.overlay) this.overlay.addEventListener('click', () => this.close());
|
||||
|
||||
// Clavier
|
||||
document.addEventListener('keydown', (e) => {
|
||||
if (e.key === 'Escape' && !this.modal.hidden) this.close();
|
||||
});
|
||||
|
||||
// Soumission
|
||||
this.form.addEventListener('submit', (e) => this._handleSubmit(e));
|
||||
|
||||
// Nettoyage des erreurs à la saisie
|
||||
this.form.querySelectorAll('input, textarea').forEach((el) => {
|
||||
el.addEventListener('input', () => this._clearFieldError(el.name));
|
||||
});
|
||||
}
|
||||
|
||||
// ── API publique ───────────────────────────────────────────────────────────
|
||||
|
||||
open() {
|
||||
this._resetForm();
|
||||
this.modal.hidden = false;
|
||||
document.body.style.overflow = 'hidden';
|
||||
this.form.querySelector('#id_name')?.focus();
|
||||
}
|
||||
|
||||
close() {
|
||||
this.modal.hidden = true;
|
||||
document.body.style.overflow = '';
|
||||
}
|
||||
|
||||
// ── Soumission ─────────────────────────────────────────────────────────────
|
||||
|
||||
async _handleSubmit(e) {
|
||||
e.preventDefault();
|
||||
if (!this._validateLocal()) return;
|
||||
|
||||
this._setLoading(true);
|
||||
this._hideGlobalError();
|
||||
|
||||
const formData = new FormData(this.form);
|
||||
|
||||
try {
|
||||
const response = await fetch(this.url, {
|
||||
method: 'POST',
|
||||
body: formData,
|
||||
headers: {
|
||||
'X-Requested-With': 'XMLHttpRequest',
|
||||
'X-CSRFToken': this.csrfToken,
|
||||
},
|
||||
});
|
||||
|
||||
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
||||
const data = await response.json();
|
||||
|
||||
if (data.success) {
|
||||
this._showSuccess();
|
||||
} else if (data.errors) {
|
||||
this._showFieldErrors(data.errors);
|
||||
} else if (data.error) {
|
||||
this._showGlobalError(data.error);
|
||||
}
|
||||
} catch (err) {
|
||||
this._showGlobalError(
|
||||
(window.I18N?.networkError) || 'Une erreur est survenue. Veuillez réessayer.'
|
||||
);
|
||||
} finally {
|
||||
this._setLoading(false);
|
||||
}
|
||||
}
|
||||
|
||||
// ── Validation locale légère ───────────────────────────────────────────────
|
||||
|
||||
_validateLocal() {
|
||||
let valid = true;
|
||||
const name = this.form.querySelector('#id_name');
|
||||
const email = this.form.querySelector('#id_email');
|
||||
const msg = this.form.querySelector('#id_message');
|
||||
|
||||
if (!name.value.trim()) {
|
||||
this._setFieldError('name', name.required ? 'Ce champ est requis.' : '');
|
||||
valid = false;
|
||||
}
|
||||
if (!email.value.trim() || !email.value.includes('@')) {
|
||||
this._setFieldError('email', 'Adresse email invalide.');
|
||||
valid = false;
|
||||
}
|
||||
if (!msg.value.trim() || msg.value.trim().length < 10) {
|
||||
this._setFieldError('message', 'Votre message est trop court.');
|
||||
valid = false;
|
||||
}
|
||||
return valid;
|
||||
}
|
||||
|
||||
// ── Utilitaires ────────────────────────────────────────────────────────────
|
||||
|
||||
_setPropertyId(id) {
|
||||
const input = this.form.querySelector('#id_property_id');
|
||||
if (input) input.value = id || '';
|
||||
}
|
||||
|
||||
_setLoading(loading) {
|
||||
if (!this.submit) return;
|
||||
const i18n = window.I18N || {};
|
||||
this.submit.disabled = loading;
|
||||
this.submit.textContent = loading
|
||||
? (i18n.sending || 'Envoi en cours…')
|
||||
: (i18n.send || 'Envoyer');
|
||||
}
|
||||
|
||||
_showSuccess() {
|
||||
this.form.hidden = true;
|
||||
this.success.hidden = false;
|
||||
}
|
||||
|
||||
_resetForm() {
|
||||
this.form.reset();
|
||||
this.form.hidden = false;
|
||||
this.success.hidden = true;
|
||||
this._hideGlobalError();
|
||||
this.form.querySelectorAll('.field-error').forEach(el => { el.textContent = ''; });
|
||||
}
|
||||
|
||||
_setFieldError(name, msg) {
|
||||
const el = this.form.querySelector(`.field-error[data-field="${name}"]`);
|
||||
if (el) el.textContent = msg;
|
||||
}
|
||||
|
||||
_clearFieldError(name) {
|
||||
this._setFieldError(name, '');
|
||||
}
|
||||
|
||||
_showFieldErrors(errors) {
|
||||
for (const [field, msgs] of Object.entries(errors)) {
|
||||
const list = Array.isArray(msgs) ? msgs : [msgs];
|
||||
this._setFieldError(field, list.join(' '));
|
||||
}
|
||||
}
|
||||
|
||||
_showGlobalError(msg) {
|
||||
if (!this.globalErr) return;
|
||||
this.globalErr.textContent = msg;
|
||||
this.globalErr.hidden = false;
|
||||
}
|
||||
|
||||
_hideGlobalError() {
|
||||
if (this.globalErr) this.globalErr.hidden = true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
/**
|
||||
* Galerie photos avec modal plein écran.
|
||||
* Gère : onglets par pièce, navigation clavier, swipe mobile.
|
||||
*/
|
||||
class Gallery {
|
||||
/**
|
||||
* @param {Object} data - { 'gallery-key': [{src, caption}, …], … }
|
||||
* @param {HTMLElement} modal - élément .gallery-modal
|
||||
*/
|
||||
constructor(data, modal) {
|
||||
this.data = data; // toutes les galeries indexées par clé
|
||||
this.currentKey = null; // clé de la galerie active
|
||||
this.currentIndex = 0; // index dans la galerie active
|
||||
|
||||
this.modal = modal;
|
||||
this.img = modal.querySelector('#gallery-modal-img');
|
||||
this.caption = modal.querySelector('#gallery-modal-caption');
|
||||
this.counter = modal.querySelector('#gallery-counter');
|
||||
this.overlay = modal.querySelector('#gallery-overlay');
|
||||
this.btnClose = modal.querySelector('#gallery-close');
|
||||
this.btnPrev = modal.querySelector('#gallery-prev');
|
||||
this.btnNext = modal.querySelector('#gallery-next');
|
||||
|
||||
this._touchStartX = 0;
|
||||
|
||||
this._bindEvents();
|
||||
this._initTabs();
|
||||
}
|
||||
|
||||
// ── Initialisation ─────────────────────────────────────────────────────────
|
||||
|
||||
_bindEvents() {
|
||||
// Boutons de navigation
|
||||
this.btnClose.addEventListener('click', () => this.close());
|
||||
this.overlay.addEventListener('click', () => this.close());
|
||||
this.btnPrev.addEventListener('click', () => this.prev());
|
||||
this.btnNext.addEventListener('click', () => this.next());
|
||||
|
||||
// Clavier
|
||||
document.addEventListener('keydown', (e) => {
|
||||
if (this.modal.hidden) return;
|
||||
if (e.key === 'Escape') this.close();
|
||||
if (e.key === 'ArrowLeft') this.prev();
|
||||
if (e.key === 'ArrowRight') this.next();
|
||||
});
|
||||
|
||||
// Swipe mobile
|
||||
this.modal.addEventListener('touchstart', (e) => {
|
||||
this._touchStartX = e.touches[0].clientX;
|
||||
}, { passive: true });
|
||||
this.modal.addEventListener('touchend', (e) => {
|
||||
const dx = e.changedTouches[0].clientX - this._touchStartX;
|
||||
if (Math.abs(dx) > 50) {
|
||||
dx < 0 ? this.next() : this.prev();
|
||||
}
|
||||
});
|
||||
|
||||
// Délégation : clic sur les vignettes
|
||||
document.addEventListener('click', (e) => {
|
||||
const item = e.target.closest('.gallery-item[data-gallery]');
|
||||
if (!item) return;
|
||||
this.open(item.dataset.gallery, parseInt(item.dataset.index, 10));
|
||||
});
|
||||
}
|
||||
|
||||
_initTabs() {
|
||||
document.querySelectorAll('.gallery-tab').forEach((tab) => {
|
||||
tab.addEventListener('click', () => {
|
||||
// Mise à jour des onglets actifs
|
||||
document.querySelectorAll('.gallery-tab').forEach(t => {
|
||||
t.classList.remove('active');
|
||||
t.setAttribute('aria-selected', 'false');
|
||||
});
|
||||
tab.classList.add('active');
|
||||
tab.setAttribute('aria-selected', 'true');
|
||||
|
||||
// Affichage du panneau correspondant
|
||||
const roomId = tab.dataset.room;
|
||||
const panelId = roomId === 'general' ? 'room-general' : `room-${roomId}`;
|
||||
document.querySelectorAll('.gallery-grid').forEach(g => g.classList.remove('active'));
|
||||
const panel = document.getElementById(panelId);
|
||||
if (panel) panel.classList.add('active');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// ── API publique ───────────────────────────────────────────────────────────
|
||||
|
||||
open(key, index) {
|
||||
this.currentKey = key;
|
||||
this.currentIndex = index;
|
||||
this._render();
|
||||
this.modal.hidden = false;
|
||||
document.body.style.overflow = 'hidden';
|
||||
this.btnClose.focus();
|
||||
}
|
||||
|
||||
close() {
|
||||
this.modal.hidden = true;
|
||||
document.body.style.overflow = '';
|
||||
}
|
||||
|
||||
prev() {
|
||||
const photos = this.data[this.currentKey] || [];
|
||||
this.currentIndex = (this.currentIndex - 1 + photos.length) % photos.length;
|
||||
this._render();
|
||||
}
|
||||
|
||||
next() {
|
||||
const photos = this.data[this.currentKey] || [];
|
||||
this.currentIndex = (this.currentIndex + 1) % photos.length;
|
||||
this._render();
|
||||
}
|
||||
|
||||
// ── Rendu ──────────────────────────────────────────────────────────────────
|
||||
|
||||
_render() {
|
||||
const photos = this.data[this.currentKey] || [];
|
||||
if (!photos.length) return;
|
||||
|
||||
const photo = photos[this.currentIndex];
|
||||
this.img.src = photo.src;
|
||||
this.img.alt = photo.caption || '';
|
||||
this.caption.textContent = photo.caption || '';
|
||||
|
||||
const total = photos.length;
|
||||
const of = (window.I18N && I18N.of) ? I18N.of : '/';
|
||||
this.counter.textContent = `${this.currentIndex + 1} ${of} ${total}`;
|
||||
|
||||
// Désactiver les flèches si une seule photo
|
||||
this.btnPrev.disabled = total <= 1;
|
||||
this.btnNext.disabled = total <= 1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* Point d'entrée principal — instancie Gallery et ContactForm
|
||||
* après le chargement du DOM.
|
||||
*/
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
|
||||
// ── Galerie photos ─────────────────────────────────────────────────────────
|
||||
const galleryModal = document.getElementById('gallery-modal');
|
||||
if (galleryModal && typeof GALLERY_DATA !== 'undefined') {
|
||||
window._gallery = new Gallery(GALLERY_DATA, galleryModal);
|
||||
}
|
||||
|
||||
// ── Formulaire de contact ──────────────────────────────────────────────────
|
||||
const contactModal = document.getElementById('contact-modal');
|
||||
const contactForm = document.getElementById('contact-form');
|
||||
if (contactModal && contactForm && typeof CONTACT_URL !== 'undefined') {
|
||||
window._contactForm = new ContactForm(
|
||||
contactForm,
|
||||
contactModal,
|
||||
CONTACT_URL,
|
||||
typeof CSRF_TOKEN !== 'undefined' ? CSRF_TOKEN : '',
|
||||
);
|
||||
}
|
||||
|
||||
// ── Disparition auto des messages flash Django ─────────────────────────────
|
||||
document.querySelectorAll('.alert-auto-hide').forEach((alert) => {
|
||||
setTimeout(() => {
|
||||
alert.style.opacity = '0';
|
||||
alert.style.transition = 'opacity .5s';
|
||||
setTimeout(() => alert.remove(), 500);
|
||||
}, 4000);
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user