", {
id: "show",
style:
"position: relative; bottom: 10px; right: 10px; z-index: 9999; height: max-content; display:flex; background:#f47735; border-radius:50%; opacity: 1; transform: scale(1); transition: all 0.3s ease 0s; width:50px; height:50px; justify-content: center;",
});
var showButtonWelcomeText = $("
", {
id: "welcomeText",
style:
"position: relative; bottom: 10px; right: 1.5rem; z-index: 9999; height: max-content; display:flex; width:270px; padding:5px 14px; border-radius: 16px; background:#f47735; opacity: 0; transform: scale(1); transition: all 0.3s ease 0s; box-shadow: 0px 3px 1px 1px #000000d1;",
});
showButtonWelcomeText.append("
👋 I'm an AI-powered chatbot here to help you.
");
showButtonWelcomeText.append('
');
setTimeout(function() {
$("#welcomeText").animate({
opacity: "1",
}, 750);
}, 2000 );
var showImg = $("
", {
src: "https://drop-chat-files.s3.amazonaws.com/dropchat-assets/bubble-chat-show-icon.svg",
alt: "Hide",
style: "border-radius:50%;outline: none; cursor: pointer;width:30px;",
});
showButton.hover(function() {
$(this).css({"opacity": "0.8", "transform": "scale(1.2)", "transition": "0.3s"});
}, function() {
$(this).css({"opacity": "1", "transform": "scale(1)", "transition": "0.3s"});
});
$(".bubbleChatParent").append(showButtonWelcomeText);
showButton.append(showImg);
if(width > 1200){
var hideButton = $("
", {
id: "hide",
style:
"position: fixed; bottom: 10px; right: 10px; z-index: 9999; height: max-content; display:flex; background:#f47735; border-radius:50%; width:50px; height:50px; justify-content: center;",
});
var hideImg = $("
", {
src: "https://drop-chat-files.s3.amazonaws.com/dropchat-assets/bubble-chat-hide-icon.svg",
alt: "Show",
style: "border-radius:50%;outline: none; cursor: pointer;width:30px;",
});
var hideIconButton = $("
", {
id: "hideIcon",
style:
"position: absolute;z-index: 9999;border-radius:50%;justify-content: center;top: -2.2em;right: 3.5em;",
});
var hideIcon = $("
", {
src: "https://book-chat.s3.amazonaws.com/5d94cd16-38aa-43d2-86fd-c5e87e77d2be/white-cross.svg-JTP54L.svg",
alt: "Show",
style: "outline: none; cursor: pointer; width:20px;",
});
hideIconButton.append(hideIcon);
} else {
if(device === "iOS") {
var hideButton = $("
", {
id: "hide",
style: "position: relative;right: 4px;top: 2.3dvh; z-index: 9999;width:30px; height:max-content; text-align:center; display:flex; justify-content: center;",
});
} else {
var hideButton = $("
", {
id: "hide",
style: "position: relative;right: 4px;top: 1.75dvh; z-index: 9999;width:30px; height:max-content; text-align:center; display:flex; justify-content: center;",
});
}
var hideImg = $("
", {
src: "https://book-chat.s3.amazonaws.com/5d94cd16-38aa-43d2-86fd-c5e87e77d2be/white-cross.svg-JTP54L.svg",
alt: "Show",
style: "outline: none; cursor: pointer; width:20px;",
});
}
hideButton.hover(function() {
$(this).css({"opacity": "0.8", "transform": "scale(1.2)", "transition": "0.3s"});
}, function() {
$(this).css({"opacity": "1", "transform": "scale(1)", "transition": "0.3s"});
});
hideButton.append(hideImg);
// add the buttons to the body of the page
$(".bubbleChatParent").append(hideIconButton);
$(".bubbleChatParent").append(showButton);
$(".bubbleChatParent").append(hideButton);
$("#hide").hide();
$("#hideIcon").hide();
$(".welcomeTextCross").click(function () {
$("#welcomeText").hide();
});
if(width > 1200){
$("#hide").click(function () {
$(".mobileIframe").css({"height": ""});
$(".bubbleChatIframe").hide();
$("#hide").hide();
$("#hideIcon").hide();
$("#show").show();
});
$("#hideIcon").click(function () {
$(".mobileIframe").css({"height": ""});
$(".bubbleChatIframe").hide();
$("#hide").hide();
$("#hideIcon").hide();
$("#show").show();
});
} else {
$("#hide").click(function () {
$(".mobileIframe").css({"height": ""});
$(".bubbleChatIframe").hide();
$("#hide").hide();
$("#hideIcon").hide();
$("#show").show();
$('html, body').css({
overflow: 'auto'
});
});
}
if(width > 1200){
$("#show").click(function () {
$(".mobileIframe").css({"height": "100%"});
$(".bubbleChatIframe").show();
$("#show").hide();
$("#hide").show();
$("#hideIcon").show();
$("#welcomeText").hide();
});
} else {
$("#show").click(function () {
$(".mobileIframe").css({"height": "100%"});
$(".bubbleChatIframe").show();
$("#show").hide();
$("#welcomeText").hide();
$("#hide").show();
$('html, body').css({
overflow: 'hidden'
});
});
}
});
$(document).ready(function () {
$(".bubbleChatIframe").hide();
$('head').append('
');
});