Вернуться к чату

Установи готовый чат CatWorld Games from FireBase на свой сайт

Инструкция <style type="text/css"> .topnav { position: fixed; top: 0; left: 0; right: 0; overflow: hidden; background-color: #000; height:50px; } .topnav a { float: left; display: block; color: #f2f2f2; text-align: center; padding: 16px 20px; text-decoration: none; font-size: 17px; } .topnav a:hover { background-color: #ddd; color: black; } .topnav a.active { background-color: #0c170c; color: white; } .topnav .icon { display: none; } @media screen and (max-width: 600px) { .topnav a:not(:first-child) {display: none;} .topnav a.icon { float: right; display: block; } } @media screen and (max-width: 600px) { .topnav.responsive {position: relative;} .topnav.responsive .icon { position: absolute; right: 0; top: 0; } .topnav.responsive a { float: none; display: block; text-align: left; } } </style> <script> function auth() { document.location.href = "auth.html"; } </script> <script> function myFunction() { var x = document.getElementById("myTopnav"); if (x.className === "topnav") { x.className += " responsive"; } else { x.className = "topnav"; } } </script> <link rel="preload" href="https://adservice.google.ru/adsid/integrator.js?domain=catworldweb.github.io" as="script"><script type="text/javascript" src="https://adservice.google.ru/adsid/integrator.js?domain=catworldweb.github.io"></script><link rel="preload" href="https://adservice.google.com/adsid/integrator.js?domain=catworldweb.github.io" as="script"><script type="text/javascript" src="https://adservice.google.com/adsid/integrator.js?domain=catworldweb.github.io"></script></head> <body bgcolor="#232323"> <div class="topnav"> <center><strong><p id="title" class="room">в</p></strong></center><p></p> </div> <p></p> <script src="https://www.gstatic.com/firebasejs/8.0.0/firebase-app.js"></script> <script src="https://www.gstatic.com/firebasejs/8.0.0/firebase-database.js"></script> <script src="https://www.gstatic.com/firebasejs/8.0.0/firebase-analytics.js"></script> <script src="https://catworldweb.github.io/database.js"> </script> <style> .room { color:orange; font-size:20px; } </style> <script> document.getElementById("title").innerHTML = room; </script> <script> </script> <script> function sendMessage() { var message = document.getElementById("message").value; if (myName != "" && message != "" ) { firebase.database().ref(room).push().set({ "sender": myName, "message": message, "rooms":room, }); document.getElementById("message").value = ""; return false; } } </script> <p></p> <style> .text{ color:orange; cursor:pointer; } </style> <hr><hr><hr><hr></hr><hr></hr> <center> <button onclick = "fon()"class = "send">Код для установки своего фона</button> <button onclick = "image()"class = "send">Код для отправки изображения по URL</button> <button onclick = "kapets()"class = "send">код для ссылки</button> <p></p> <script> function fon() { document.getElementById("message").value = "<style> body{background-image:url(ссылка на изображение);}</style>"; } </script> <script> function image() { document.getElementById("message").value = "<img src = 'ссылка на изображение'width = '100' height = '100' ></img>"; } </script> <script> function kapets() { document.getElementById("message").value = "<a href = 'ссылка'>текст ссылки</a>"; } </script> <a href="plagin.html"><font size="4px"><font color="blue">Установить чат на свой сайт</font></font></a> <script data-ad-client="ca-pub-7088445945474705" async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js" data-checked-head="true"></script> <form> <textarea id="message" placeholder="Введите сообщение" autocomplete="off" class="displaymessage"></textarea> <input type="button" class="senders" ,="" onclick="return sendMessage();" width="500" height="100" value="отправить"> </form></center> <style> .senders{ border:3px solid white; border-radius: 100px; } </style> <ul id="messages"></ul> <script> firebase.database().ref(room).on("child_added", function (snapshot) { document.title = "(уведомление)Сообщение отправил:" + snapshot.val().sender; var money = 0; var d = new Date(); var hours = d.getHours(); var mins = d.getMinutes(); var secs = d.getSeconds(); var html = ""; if (snapshot.val().sender != myName) { html += "<p><li id='message-" + snapshot.key + "' class= 'canvaschat'>"; html += snapshot.val().sender + ": " + snapshot.val().message + " " + hours+":"+mins+":"+secs ; html += "</p></li>"; } if (snapshot.val().sender == myName) { html += "<p><li id='message-" + snapshot.key + "' class= 'you'>"; html += snapshot.val().sender + ": " + snapshot.val().message + " " + hours+":"+mins+":"+secs ; html += "</p></li>"; } if (snapshot.val().sender == myName || myName =="кодер сишарпов") { html += "<p><button data-id='" + snapshot.key + "' onclick='deleteMessage(this);' class = 'send'>"; html += "Delete"; html += "</p></button>"; } let audio = new Audio('https://catworldweb.github.io/audios.getkeep/u_edomlenie-9.mp3'); audio.play(); console.log (snapshot.val().sender + ":" + snapshot.val().message); document.getElementById("messages").innerHTML += html; }); </script> <script> function deleteMessage(self) { var messageId = self.getAttribute("data-id"); firebase.database().ref(room).child(messageId).remove(); } firebase.database().ref(room).on("child_removed", function (snapshot) { document.getElementById("message-" + snapshot.key).innerHTML = "сообщение удалено"; }); </script> <style> .text{ color: black; } .send { background-color: red; border:5px solid red; border-radius:15px; color:yellow; } .work { background-color: blue; border:5px solid blue; border-radius:15px; color:yellow; } .canvaschat { background-color:blue; border:10px solid blue; border-radius:15px; width: 300px; height:50; color:yellow; } .displaymessage { border: 10px solid white; border-radius:50px; } .you { background-color:green; border:3px solid green; border-radius:15px; width: 200px; color:yellow; } </style> <ins class="adsbygoogle adsbygoogle-noablate" data-adsbygoogle-status="done" style="display: none !important;"><ins id="aswift_0_expand" style="display:inline-table;border:none;height:0px;margin:0;padding:0;position:relative;visibility:visible;width:0px;background-color:transparent;"><ins id="aswift_0_anchor" style="display:block;border:none;height:0px;margin:0;padding:0;position:relative;visibility:visible;width:0px;background-color:transparent;"><iframe id="aswift_0" name="aswift_0" style="left:0;position:absolute;top:0;border:0;width:undefinedpx;height:undefinedpx;" sandbox="allow-forms allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-top-navigation-by-user-activation" frameborder="0" src="https://googleads.g.doubleclick.net/pagead/ads?guci=2.2.0.0.2.2.0.0&amp;client=ca-pub-7088445945474705&amp;output=html&amp;adk=1812271804&amp;adf=3025194257&amp;lmt=1605947559&amp;plat=1%3A32776%2C2%3A16809992%2C9%3A32776%2C10%3A32%2C11%3A32%2C16%3A8388608%2C17%3A32%2C24%3A32%2C25%3A32%2C30%3A1081344%2C32%3A32%2C40%3A32&amp;format=0x0&amp;url=https%3A%2F%2Fcatworldweb.github.io%2Fchatik.html&amp;ea=0&amp;flash=32.0.0&amp;pra=5&amp;wgl=1&amp;tt_state=W3siaXNzdWVyT3JpZ2luIjoiaHR0cHM6Ly9hZHNlcnZpY2UuZ29vZ2xlLmNvbSIsInN0YXRlIjowfSx7Imlzc3Vlck9yaWdpbiI6Imh0dHBzOi8vYXR0ZXN0YXRpb24uYW5kcm9pZC5jb20iLCJzdGF0ZSI6MH1d&amp;dt=1606057129236&amp;bpp=20&amp;bdt=3927&amp;idt=97&amp;shv=r20201112&amp;cbv=r20190131&amp;ptt=9&amp;saldr=aa&amp;abxe=1&amp;nras=1&amp;correlator=7356424862046&amp;frm=20&amp;pv=2&amp;ga_vid=1990993347.1604661404&amp;ga_sid=1606057129&amp;ga_hid=266397875&amp;ga_fc=1&amp;iag=0&amp;icsg=2795534&amp;dssz=20&amp;mdo=0&amp;mso=0&amp;u_tz=180&amp;u_his=2&amp;u_java=0&amp;u_h=768&amp;u_w=1366&amp;u_ah=728&amp;u_aw=1366&amp;u_cd=24&amp;u_nplug=5&amp;u_nmime=9&amp;adx=-12245933&amp;ady=-12245933&amp;biw=1708&amp;bih=815&amp;scr_x=0&amp;scr_y=0&amp;eid=21065725&amp;oid=3&amp;pvsid=2147908974283544&amp;pem=976&amp;ref=https%3A%2F%2Fcatworldweb.github.io%2F&amp;rx=0&amp;eae=2&amp;fc=1920&amp;brdim=0%2C0%2C0%2C0%2C1366%2C0%2C1366%2C728%2C1707%2C815&amp;vis=1&amp;rsz=%7C%7Cs%7C&amp;abl=NS&amp;fu=8192&amp;bc=31&amp;ifi=0&amp;uci=a!0&amp;fsb=1&amp;dtd=129" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no" allowfullscreen="true" data-google-container-id="a!0" data-load-complete="true"></iframe></ins></ins></ins><iframe id="google_osd_static_frame_5439771821931" name="google_osd_static_frame" style="display: none; width: 0px; height: 0px;"></iframe></body><iframe id="google_esf" name="google_esf" src="https://googleads.g.doubleclick.net/pagead/html/r20201112/r20190131/zrt_lookup.html#" data-ad-client="ca-pub-7088445945474705" style="display: none;"></iframe></html>