PLONGEZ AU CŒUR DE LA LEGENDE !
Embarquez pour une aventure sous-marine extraordinaire et redécouvrez le Titanic comme si vous y étiez ! Préparez-vous à vivre une expérience immersive et narrative unique, mêlant Histoire, technologie et émotions sur le plus célèbre des paquebots !
<script>
window.addEventListener("load", function () {
const linksByCity = {
toulon: "#code_block-435-11997",
dijon: "https://eclipso-entertainment.com/titanic-le-reve-englouti-dijon/"
mulhouse: "https://feverup.com/m/522762",
cherbourg: "https://feverup.com/m/599636"
};
// toulon: "https://eclipso-entertainment.com/titanic-le-reve-englouti-toulon/", -> repasse par 4escape
// =========================
// RÉCUP VILLE
// =========================
const path = window.location.pathname.toLowerCase();
let city = null;
const match = path.match(/\/villes\/([^\/]+)/);
if (match) city = match[1];
// =========================
// CACHER ANCIENS BOUTONS
// =========================
[
"#link-483-11997",
"#div_block-479-11997",
"#link-510-11997"
].forEach(sel => {
const el = document.querySelector(sel);
if (el) el.style.display = "none";
});
// =========================
// CRÉER CONTAINER
// =========================
const container = document.createElement("div");
container.style.display = "flex";
container.style.justifyContent = "center";
container.style.gap = "10px";
container.style.flexWrap = "wrap";
container.style.marginBottom = "20px"; // important pour espacement avec le h2
// =========================
// BOUTON
// =========================
function createButton(cityName, url) {
const wrapper = document.createElement("div");
wrapper.className = "btn-da-rubis";
wrapper.style.textAlign = "center";
const a = document.createElement("a");
a.href = url;
a.textContent = "Réserver à " + cityName.charAt(0).toUpperCase() + cityName.slice(1);
a.style.cssText = `
display:inline-block;
background-color:#F16C00;
color:#ffffff;
padding:14px 32px;
font-size:16px;
font-weight:bold;
text-decoration:none;
border-radius:8px;
box-shadow:0 4px 10px rgba(0,0,0,0.2);
transition:all 0.3s ease;
white-space: nowrap;
`;
// hover clean
a.addEventListener("mouseenter", () => {
a.style.backgroundColor = "#d95f00";
a.style.transform = "translateY(-2px)";
});
a.addEventListener("mouseleave", () => {
a.style.backgroundColor = "#F16C00";
a.style.transform = "translateY(0)";
});
wrapper.appendChild(a);
return wrapper;
}
// =========================
// LOGIQUE
// =========================
if (city && linksByCity[city]) {
container.appendChild(createButton(city, linksByCity[city]));
// changer bouton principal si présent
const mainBtn = document.querySelector("#link-504-11997");
if (mainBtn && city && linksByCity[city]) {
mainBtn.href = linksByCity[city];
}
if (mainBtn) {
mainBtn.href = linksByCity[city];
}
} else {
Object.entries(linksByCity).forEach(([cityName, url]) => {
container.appendChild(createButton(cityName, url));
});
}
// =========================
// INSERTION EXACTE (ICI LE FIX)
// =========================
// =========================
// INSERTION PROPRE
// =========================
const target = document.querySelector("#div_block-478-11997");
if (target) {
// 👉 option 1 : dedans (recommandé)
// target.appendChild(container);
// 👉 option 2 : si tu préfères juste en dessous, utilise ça à la place :
target.insertAdjacentElement("afterend", container);
} else {
console.warn("div_block-478-11997 introuvable");
}
});
</script>
