localStorage.setItem('joinchat-open', false); // create body widget var body = document.createElement('joinchat'); body.className = "joinchat"; body.innerHTML = 'TelegramViber👋Привет! Я - Бот UVAPE. Заказывай через меня просто в Viber или Telegram'; document.getElementsByTagName('body')[0].appendChild(body); // create style widget var style = document.createElement('style'); style.innerHTML = '@-webkit-keyframes bounceIn{0%{opacity:0;-webkit-transform:scale(0.3) translate3d(0,0,0);transform:scale(0.3) translate3d(0,0,0)}50%{opacity:.9;-webkit-transform:scale(1.1);transform:scale(1.1)}80%{opacity:1;-webkit-transform:scale(0.89);transform:scale(0.89)}100%{opacity:1;-webkit-transform:scale(1) translate3d(0,0,0);transform:scale(1) translate3d(0,0,0)}}@keyframes bounceIn{0%{opacity:0;-webkit-transform:scale(0.3) translate3d(0,0,0);transform:scale(0.3) translate3d(0,0,0)}50%{opacity:.9;-webkit-transform:scale(1.1);transform:scale(1.1)}80%{opacity:1;-webkit-transform:scale(0.89);transform:scale(0.89)}100%{opacity:1;-webkit-transform:scale(1) translate3d(0,0,0);transform:scale(1) translate3d(0,0,0)}}@-webkit-keyframes pulse{0%{-webkit-transform:scale(1);transform:scale(1);opacity:0}50%{-webkit-transform:scale(1.2);transform:scale(1.2);opacity:1}100%{-webkit-transform:scale(1.6);transform:scale(1.6);opacity:0}}@keyframes pulse{0%{-webkit-transform:scale(1);transform:scale(1);opacity:0}50%{-webkit-transform:scale(1.2);transform:scale(1.2);opacity:1}100%{-webkit-transform:scale(1.6);transform:scale(1.6);opacity:0}}joindiv{box-sizing:border-box!important;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;display:block}#widget-am-main-block{display:inline-block;position:fixed;bottom:20px;right:20px;z-index:999999}.widget-am-platform:hover .widget-am-text-near-icon{display:block}#widget-am-main-block .widget-am-icons-block{position:relative}#widget-am-main-block .widget-am-icons-block .widget-am-messengers-block{display:block;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}#widget-am-main-block .widget-am-main-icon-block{position:relative;width:48px;height:48px;-webkit-animation-name:bounceIn;animation-name:bounceIn;-webkit-animation-duration:450ms;animation-duration:450ms;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}#widget-am-main-block .widget-am-border-animation{display:block;position:absolute;width:48px;height:48px;border:2px solid rgb(67,57,213);border-radius:13px;z-index:-1;top:0;margin-left:-2px;margin-top:-2px;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1);-webkit-animation-name:pulse;animation-name:pulse;-webkit-animation-duration:2000ms;animation-duration:2000ms;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-delay:1s;animation-delay:1s;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}#widget-am-main-block .widget-am-main-icon-block::after{content:"";display:block;position:absolute;top:-5px;right:-5px;background:#f55;border-radius:50%;width:12px;height:12px;border:2px solid #fff;-webkit-box-shadow:0 2px 1px rgba(0,0,0,.7);box-shadow:0 2px 1px rgba(0,0,0,.7);pointer-events:none}#widget-am-main-block .widget-am-main-icon-text{display:block;position:absolute;margin:0;top:9px;right:72px;white-space:nowrap;font-size:14px;line-height:14px;background:#fff;padding:8px 12px;border-radius:4px;border:1px solid #ddd;-webkit-transition:opacity .2s;-o-transition:opacity .2s;transition:opacity .2s;color:#777}#widget-am-main-block .widget-am-main-icon-text:before,#widget-am-main-block .widget-am-main-icon-text:after{content:"";position:absolute;top:calc(50%-6px);left:100%;border-color:transparent transparent transparent #ddd;border-style:solid;border-width:6px 0 6px 6px}#widget-am-main-block .widget-am-main-icon-text:after{left:calc(100%-1px);border-left-color:#fff}#widget-am-main-block .widget-am-main-icon-block>joindiv.widget-am-main-icon{width:48px;height:48px;display:inline-block;background-size:contain;background-position:center center;background-repeat:no-repeat;background-color:rgb(67,57,213);border-radius:10px;cursor:pointer}#widget-am-main-block .widget-am-messengers-block>joindiv{width:48px;height:48px;display:block;margin-bottom:-48px;background-position:center center;background-repeat:no-repeat;border-radius:10px;background-size:cover;position:relative;-webkit-transition:.5s;-o-transition:.5s;transition:.5s;cursor:pointer;box-shadow:0 10px 60px rgba(0,0,0,.35);-webkit-box-shadow:0 10px 60px rgba(0,0,0,.35)}#widget-am-main-block .widget-am-text-near-icon{position:absolute;margin:0;top:9px;right:72px;white-space:nowrap;font-size:14px;line-height:14px;background:#fff;padding:8px 12px;border-radius:4px;border:1px solid #ddd;-webkit-transition:.5s;-o-transition:.5s;transition:.5s;cursor:pointer;color:#777;opacity:0}#widget-am-main-block .widget-am-text-near-icon::before,#widget-am-main-block .widget-am-text-near-icon::after{content:"";position:absolute;top:calc(50%-6px);left:100%;border-color:transparent transparent transparent #ddd;border-style:solid;border-width:6px 0 6px 6px}#widget-am-main-block .widget-am-text-near-icon::after{left:calc(100%-1px);border-left-color:#fff}#widget-am-main-block .widget-am-messengers-block joindiv:hover>joindiv{opacity:1}#widget-am-main-block .widget-am-messengers-block>joindiv:hover{-webkit-box-shadow:0 10px 30px rgba(0,0,0,.35);box-shadow:0 10px 30px rgba(0,0,0,.35)}.join-c-paused{-webkit-animation-name:none!important;animation-name:none!important}.join-c-run-animation{-webkit-animation-name:pulse!important;animation-name:pulse!important}'; document.getElementsByTagName('head')[0].appendChild(style); var messengers = document.getElementsByClassName('widget-am-platform'); document.getElementsByClassName("widget-am-main-icon")[0].onclick = function () { if (localStorage.getItem('joinchat-open') === 'true') { time = 0; for (let i = 0; i < messengers.length; i++) { setTimeout(function () { messengers[i].style.marginBottom = '-48px'; }, time); time = time + 170; } document.getElementsByClassName('widget-am-main-icon-text')[0].style.display = 'block'; localStorage.setItem('joinchat-open', false); } else { time = 0; for (let i = 0; i < messengers.length; i++) { setTimeout(function () { messengers[i].style.marginBottom = '15px'; }, time); time = time + 170; } document.getElementsByClassName('widget-am-main-icon-text')[0].style.display = 'none'; localStorage.setItem('joinchat-open', true); } };