Skip to content
#ask-lindo-button{
position:fixed;
right:24px;
bottom:88px;
z-index:99999;
background:linear-gradient(180deg,#d97a54 0%,#c96542 100%);
color:#fffaf6;
border:1px solid rgba(255,255,255,.45);
border-radius:999px;
padding:21px 33px;
font-size:21px;
font-weight:700;
letter-spacing:.08em;
text-transform:uppercase;
cursor:pointer;
box-shadow:0 10px 30px rgba(150,84,57,.28);
}
#ask-lindo-window{
position:fixed;
right:24px;
bottom:148px;
width:380px;
max-width:calc(100vw - 24px);
height:620px;
max-height:calc(100vh - 120px);
background:linear-gradient(180deg,#fff7f0 0%,#fde9d9 45%,#f7d8c2 100%);
border:1px solid rgba(201,120,82,.35);
border-radius:24px;
overflow:hidden;
z-index:99999;
display:none;
box-shadow:0 20px 50px rgba(136,80,55,.22);
}
#ask-lindo-window.open{
display:block;
}
#ask-lindo-frame{
width:100%;
height:100%;
border:0;
display:block;
background:transparent;
}
#ask-lindo-close{
position:absolute;
top:14px;
right:14px;
width:38px;
height:38px;
border:none;
border-radius:999px;
background:rgba(201,120,82,.92);
color:#fffaf6;
font-size:24px;
line-height:1;
cursor:pointer;
z-index:100000;
display:flex;
align-items:center;
justify-content:center;
box-shadow:0 6px 16px rgba(150,84,57,.18);
}
@media (max-width: 767px){
#ask-lindo-button{
right:16px;
bottom:72px;
padding:12px 18px;
font-size:13px;
}
#ask-lindo-window{
right:16px;
bottom:126px;
width:calc(100vw - 32px);
height:78vh;
max-height:78vh;
}
#ask-lindo-close{
top:12px;
right:12px;
width:36px;
height:36px;
font-size:22px;
}
}
(function () {
const button = document.getElementById("ask-lindo-button");
const windowEl = document.getElementById("ask-lindo-window");
const closeBtn = document.getElementById("ask-lindo-close");
const frame = document.getElementById("ask-lindo-frame");
const baseSrc = "https://ask.lindoguitars.com/";
function buildFreshSrc() {
const url = new URL(baseSrc);
url.searchParams.set("v", Date.now());
if (window.LindoMatildaMemberContext && window.LindoMatildaMemberContext.logged_in) {
if (window.LindoMatildaMemberContext.user_id) {
url.searchParams.set("wc_user_id", window.LindoMatildaMemberContext.user_id);
}
if (window.LindoMatildaMemberContext.email) {
url.searchParams.set("wc_email", window.LindoMatildaMemberContext.email);
}
if (window.LindoMatildaMemberContext.name) {
url.searchParams.set("wc_name", window.LindoMatildaMemberContext.name);
}
url.searchParams.set("wc_logged_in", "1");
}
return url.toString();
}
function openChat() {
frame.src = buildFreshSrc();
windowEl.classList.add("open");
windowEl.setAttribute("aria-hidden", "false");
}
function closeChat() {
windowEl.classList.remove("open");
windowEl.setAttribute("aria-hidden", "true");
frame.src = "about:blank";
}
button.addEventListener("click", openChat);
closeBtn.addEventListener("click", closeChat);
document.addEventListener("keydown", function (event) {
if (event.key === "Escape") {
closeChat();
}
});
})();