Skip to content

Commit a284274

Browse files
committed
added support chat
1 parent 76210b4 commit a284274

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

index.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,22 @@ <h5 class="ud-widget-title">LNbits runs on:</h5>
686686

687687
window.document.addEventListener("scroll", onScroll);
688688
</script>
689+
690+
<div id="lnbits-chat-embed-root">
691+
<iframe id="lnbits-chat-embed-iframe" src="https://v1.lnbits.com/chat/embed/8cQkX3YdaxuVGEtUC5eX2a?min=1&label=Chat%20to%20us" style="position:fixed;right:24px;bottom:24px;width:360px;height:56px;border:0;border-radius:12px;box-shadow:0 16px 40px rgba(0,0,0,.35);z-index:9999;transition:height .2s ease;overflow:hidden;"></iframe>
692+
</div>
693+
<script>
694+
(function() {
695+
var iframe = document.getElementById('lnbits-chat-embed-iframe');
696+
if (!iframe) return;
697+
var minHeight = 56;
698+
var maxHeight = 520;
699+
window.addEventListener('message', function(event) {
700+
if (!event.data || event.data.source !== 'lnbits-chat-embed') return;
701+
iframe.style.height = event.data.open ? maxHeight + 'px' : minHeight + 'px';
702+
});
703+
})();
704+
</script>
689705
</body>
690706

691707
</html>

0 commit comments

Comments
 (0)