A physical exploration?
A metaphorical journey?
A scientific perspective?
A sense of wonder and awe?
Not even close! Just a nerdy space made by some nerdy guy with too much time on his hands intrigued by fellow creative people making websites. So, I decided
I wanted to bring those people together in some way, and here we are. I made a global chat widget that I host that allows websites to be interconnected,
maybe even form some type of community who knows. I'm interested to see where it goes; and to see how other people react to it.
Copy and paste the code in the box below and add it in right before your </BODY> tag.
I even took the time to thoroughly label it so you can customize it to fit your site. :)
<!-- Chat Widget Embed -->
<style>
/* CHAT TOGGLE BUTTON: change the size, colors, shadow, etc. */
#chatToggle {
position: fixed;
bottom: 20px; /* distance from bottom */
right: 20px; /* distance from right */
width: 50px; /* button size */
height: 50px;
font-size: 28px; /* icon size */
background: #111; /* background color */
color: #0ff; /* icon color */
border: 2px solid #0ff; /* border color and thickness */
border-radius: 50%; /* make the button round (0–50%) */
cursor: pointer;
z-index: 10000;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 0 10px #0ff; /* glow shadow */
user-select: none;
transition:
box-shadow 1.5s ease-in-out,
border-color 1.5s ease-in-out,
color 1.5s ease-in-out; /* hover/animation timing */
}
/* PULSE GLOW: customize colors, timing */
@keyframes pulseGlow {
0%, 100% {
box-shadow: 0 0 15px 4px #a020f0; /* color and spread (of the glow) */
border-color: #a020f0;
color: #d580ff;
}
50% {
box-shadow: 0 0 25px 8px #d580ff;
border-color: #d580ff;
color: #f0a0ff;
}
}
/* APPLY PULSE WHEN NEW MESSAGE APPEARS: change class name or timing */
#chatToggle.newMsg {
animation: pulseGlow 3s infinite; /* duration and how often it repeats */
}
/* NEW MESSAGE DOT: tweak size, position, colors */
#newMsgDot {
position: absolute;
top: 8px; /* position inside toggle */
right: 8px; /* position inside toggle */
width: 12px; /* dot size */
height: 12px;
background: #a020f0; /* dot color (if you can't tell I like purple) :) */
border-radius: 50%;
display: none;
z-index: 10001;
animation: pulse 2s infinite; /* dot pulse timing */
}
/* DOT PULSE KEYFRAMES: change shadow spread & timing */
@keyframes pulse {
0%, 100% { box-shadow: 0 0 6px #a020f0; }
50% { box-shadow: 0 0 14px #d580ff; }
}
/* IFRAME WINDOW: size, position, shadow, background */
#chatFrame {
position: fixed;
bottom: 80px; /* space from button */
right: 20px; /* align with button */
width: 350px; /* chat window width */
height: 500px; /* chat window height */
border: none;
z-index: 9999;
display: none;
box-shadow: 0 0 10px #0ff; /* window glow */
background: #000; /* window background */
transition: right 0.3s ease, transform 0.3s ease; /* timing */
}
/* MOBILE RESPONSIVENESS */
@media (max-width: 600px) {
#chatToggle {
right: 50% !important; /* center horizontally */
transform: translateX(50%); /* adjust centering */
}
#chatFrame {
right: 50% !important;
transform: translateX(50%);
}
}
</style>
<div id="chatToggle" tabindex="0">
<div style="position: relative;">
💬
<span id="newMsgDot"></span>
</div>
</div>
<iframe
id="chatFrame"
src="https://cosmos.pcdomain.com/embed.html"
allow="clipboard-write"></iframe>
<script>
(function(){
const toggle = document.getElementById("chatToggle");
const frame = document.getElementById("chatFrame");
const dot = document.getElementById("newMsgDot");
let isOpen = false;
/* Show/hide the purple pulse and dot */
function showNewMessageAlert() {
dot.style.display = "block";
toggle.classList.add("newMsg");
}
function hideNewMessageAlert() {
dot.style.display = "none";
toggle.classList.remove("newMsg");
}
/* TOGGLE CLICK — change display method or animation */
toggle.addEventListener("click", () => {
isOpen = !isOpen;
frame.style.display = isOpen ? "block" : "none";
if (isOpen) hideNewMessageAlert();
});
/* LISTEN FOR FRAME MESSAGES — origin and data */
window.addEventListener("message", (event) => {
if (event.origin !== "https://cosmos.pcdomain.com") return;
if (event.data === "new-message" && !isOpen) {
showNewMessageAlert();
}
});
})();
</script>
It has come to my attention that a space theme wouldn’t match everyone’s website. That said, I realize I can’t create a skin that suits every site. So, I made two simple ones, unoriginally named Light Mode and Dark Mode. I even styled the widget (widget? I guess we can call it that?) to match both modes. The widget is, of course, is yours to customize, and the CSS, just like above, is very editable. Below are some screenshots of how it looks and a button to copy the code. This time, I’ve hidden the code from view to avoid flooding the entire page, enjoy.
<!-- Chat Widget Embed --> <style> #chatToggle { position: fixed; bottom: 20px; right: 20px; width: 50px; height: 50px; font-size: 28px; background: #ffffff; color: #5c3ebc; border: 2px solid #5c3ebc; border-radius: 50%; cursor: pointer; z-index: 10000; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 8px rgba(92, 62, 188, 0.3); user-select: none; transition: box-shadow 1.5s ease-in-out, border-color 1.5s ease-in-out, color 1.5s ease-in-out; } @keyframes pulseGlow { 0%, 100% { box-shadow: 0 0 12px 4px #5c3ebc; border-color: #5c3ebc; color: #8d6cff; } 50% { box-shadow: 0 0 20px 8px #8d6cff; border-color: #8d6cff; color: #a091ff; } } #chatToggle.newMsg { animation: pulseGlow 3s infinite; } #newMsgDot { position: absolute; top: 8px; right: 8px; width: 12px; height: 12px; background: #5c3ebc; border-radius: 50%; display: none; z-index: 10001; animation: pulse 2s infinite; } @keyframes pulse { 0%, 100% { box-shadow: 0 0 6px #5c3ebc; } 50% { box-shadow: 0 0 14px #8d6cff; } } #chatFrame { position: fixed; bottom: 80px; right: 20px; width: 350px; height: 500px; border: none; z-index: 9999; display: none; box-shadow: 0 0 10px #5c3ebc; background: #fff; transition: right 0.3s ease, transform 0.3s ease; } @media (max-width: 600px) { #chatToggle { right: 50% !important; transform: translateX(50%); } #chatFrame { right: 50% !important; transform: translateX(50%); } } </style> <div id="chatToggle" tabindex="0"> <div style="position: relative;"> 💬 <span id="newMsgDot"></span> </div> </div> <iframe id="chatFrame" src="https://cosmos.pcdomain.com/embed.html" allow="clipboard-write"></iframe> <script> (function(){ const toggle = document.getElementById("chatToggle"); const frame = document.getElementById("chatFrame"); const dot = document.getElementById("newMsgDot"); let isOpen = false; function showNewMessageAlert() { dot.style.display = "block"; toggle.classList.add("newMsg"); } function hideNewMessageAlert() { dot.style.display = "none"; toggle.classList.remove("newMsg"); } toggle.addEventListener("click", () => { isOpen = !isOpen; frame.style.display = isOpen ? "block" : "none"; if (isOpen) hideNewMessageAlert(); }); window.addEventListener("message", (event) => { if (event.origin !== "https://cosmos.pcdomain.com") return; if (event.data === "new-message" && !isOpen) { showNewMessageAlert(); } }); })(); </script>
<!-- Chat Widget Embed --> <style> #chatToggle { position: fixed; bottom: 20px; right: 20px; width: 50px; height: 50px; font-size: 28px; background: #111; color: #a020f0; border: 2px solid #a020f0; border-radius: 50%; cursor: pointer; z-index: 10000; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 10px #a020f0; user-select: none; transition: box-shadow 1.5s ease-in-out, border-color 1.5s ease-in-out, color 1.5s ease-in-out; } @keyframes pulseGlow { 0%, 100% { box-shadow: 0 0 15px 4px #a020f0; border-color: #a020f0; color: #d580ff; } 50% { box-shadow: 0 0 25px 8px #d580ff; border-color: #d580ff; color: #f0a0ff; } } #chatToggle.newMsg { animation: pulseGlow 3s infinite; } #newMsgDot { position: absolute; top: 8px; right: 8px; width: 12px; height: 12px; background: #a020f0; border-radius: 50%; display: none; z-index: 10001; animation: pulse 2s infinite; } @keyframes pulse { 0%, 100% { box-shadow: 0 0 6px #a020f0; } 50% { box-shadow: 0 0 14px #d580ff; } } #chatFrame { position: fixed; bottom: 80px; right: 20px; width: 350px; height: 500px; border: none; z-index: 9999; display: none; box-shadow: 0 0 10px #a020f0; background: #000; transition: right 0.3s ease, transform 0.3s ease; } @media (max-width: 600px) { #chatToggle { right: 50% !important; transform: translateX(50%); } #chatFrame { right: 50% !important; transform: translateX(50%); } } </style> <div id="chatToggle" tabindex="0"> <div style="position: relative;"> 💬 <span id="newMsgDot"></span> </div> </div> <iframe id="chatFrame" src="https://cosmos.pcdomain.com/embed.html" allow="clipboard-write"></iframe> <script> (function(){ const toggle = document.getElementById("chatToggle"); const frame = document.getElementById("chatFrame"); const dot = document.getElementById("newMsgDot"); let isOpen = false; function showNewMessageAlert() { dot.style.display = "block"; toggle.classList.add("newMsg"); } function hideNewMessageAlert() { dot.style.display = "none"; toggle.classList.remove("newMsg"); } toggle.addEventListener("click", () => { isOpen = !isOpen; frame.style.display = isOpen ? "block" : "none"; if (isOpen) hideNewMessageAlert(); }); window.addEventListener("message", (event) => { if (event.origin !== "https://cosmos.pcdomain.com") return; if (event.data === "new-message" && !isOpen) { showNewMessageAlert(); } }); })(); </script>
I've only thought of a couple of these, as I answer questions about the chat (which I'm sure I will) I'll add more content here.
Q: So basically I use one of the three sets of code (original, dark, or light), slap it on my website, and I can chat with anyone who does the same?
A: Yes! You can also chat with anyone on your own website at the same time. For example: you and five other people could join the chat from your own site and talk with ten others from ten different sites, all at once. There isn't any limit that I know of... well, no limit that I can currently see.
Q: Can I do or say anything I want in this global chat?
A: I know moderation is going to be something I have to think about eventually. Right now, I’ve written a command that lets me ban users by name or ID (if they log in). I can also ban guests by IP. I really don’t want to have to do that, so just be nice to each other, please. That said, if moderation becomes necessary, I’ll do it. I may even assign helpers down the line. But for now, I’m hoping it stays a fun and respectful space (if anyone even uses it at all). :)
Q: What if I just wanted to chat but I don't want to use the widget on my website?
A: Well you can just go straight to the source! Here are the links: