Script to to add lightframe and translation to Floater | Float | Flazio CMS
Thu Sep 04 2025 09:07:28 GMT+0000 (Coordinated Universal Time)
Saved by @Shira
<!----- FROM TOBEY ------>
<script>
(function() {
function initFH() {
var p = parent.window.document;
if (!p.getElementById('fhFixedButton')) {
if (!p.getElementById('fhScript')) {
var fhScript = p.createElement('script');
fhScript.src = "https://fareharbor.com/embeds/api/v1/?autolightframe=yes";
fhScript.id = "fhScript";
p.body.appendChild(fhScript);
}
if (!p.getElementById('fhStyle')) {
var fhStyleSheet = p.createElement('link');
fhStyleSheet.href = 'https://fh-kit.com/buttons/v2/?orange=F7931F';
fhStyleSheet.rel = 'stylesheet';
fhStyleSheet.type = 'text/css';
fhStyleSheet.id = "fhStyle";
p.body.appendChild(fhStyleSheet);
}
var fhFixedButton = p.createElement('a');
fhFixedButton.href = 'https://fareharbor.com/embeds/book/fuerteventuraquad/?full-items=yes';
fhFixedButton.className = 'fh-lang fh-hide--mobile fh-shape--round fh-fixed--bottom fh-icon--cal fh-button-true-flat-orange';
fhFixedButton.innerHTML = 'BOOK NOW';
fhFixedButton.style = 'letter-spacing: 1.5px !important; padding: .3em 2em !important; border: 1px solid #FFFFFF !important; box-shadow:none !important; left: 20px !important; right: inherit !important;';
fhFixedButton.id = 'fhFixedButton';
var fhFixedButtonMobile = p.createElement('a');
fhFixedButtonMobile.href = 'https://fareharbor.com/embeds/book/fuerteventuraquad/?full-items=yes';
fhFixedButtonMobile.className = 'fh-lang fh-hide--desktop fh-size--small fh-fixed--side fh-button-true-flat-orange fh-color--white';
fhFixedButtonMobile.innerHTML = 'BOOK NOW';
fhFixedButtonMobile.style = 'font-size: 1.1em !important; margin-top: 6em !important; letter-spacing: .7px !important; border: 2px solid #FFFFFF !important; box-shadow:none !important; text-align: center !important; padding: .15em 2em !important;';
p.body.appendChild(fhFixedButton);
p.body.appendChild(fhFixedButtonMobile);
}
var lang = p.querySelector('html').getAttribute('lang');
var buttons = p.querySelectorAll('a.fh-lang');
buttons.forEach(function(btn) {
switch(lang) {
case 'en': btn.innerHTML = 'BOOK NOW'; break;
case 'es': btn.innerHTML = 'RESERVA AHORA'; break;
case 'it': btn.innerHTML = 'PRENOTA ORA'; break;
case 'fr': btn.innerHTML = 'RÉSERVEZ MAINTENANT'; break;
case 'de': btn.innerHTML = 'JETZT BUCHEN'; break;
}
});
}
document.addEventListener("DOMContentLoaded", initFH);
window.addEventListener("popstate", initFH);
window.addEventListener("pushState", initFH);
window.addEventListener("replaceState", initFH);
var observer = new MutationObserver(function() {
initFH();
});
observer.observe(document.body, { childList: true, subtree: true });
})();
</script>



Comments