Skip to content

Commit e04bb28

Browse files
authored
Merge pull request #70 from Unity-Lab-AI/codex/implement-consistent-theming-across-website
Ensure transient UI elements respect active theme
2 parents 17c58bc + 4f68c92 commit e04bb28

4 files changed

Lines changed: 260 additions & 215 deletions

File tree

index.html

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@
6363
</script>
6464
</head>
6565
<body>
66-
<div id="screensaver-container" class="screensaver hidden">
67-
<img id="screensaver-image1" alt="Screensaver Image" style="opacity: 0;">
68-
<img id="screensaver-image2" alt="Screensaver Image" style="opacity: 0;">
66+
<div id="screensaver-container" class="screensaver hidden">
67+
<img id="screensaver-image1" alt="Screensaver Image">
68+
<img id="screensaver-image2" alt="Screensaver Image">
6969
<div id="screensaver-thumbnails-wrapper" class="screensaver-thumbnails-wrapper">
7070
<button id="screensaver-thumb-left" class="thumb-nav" aria-label="Scroll thumbnails left">&#9664;</button>
7171
<div id="screensaver-thumbnails" class="screensaver-thumbnails">
@@ -436,30 +436,28 @@ <h3 class="modal-title">Voice Settings</h3>
436436
<h3 class="modal-title">Voice Chat</h3>
437437
<button id="voice-chat-modal-close" class="close-btn" title="Close Voice Chat Window">×</button>
438438
</div>
439-
<div class="modal-body">
440-
<img id="voice-chat-image" src="" alt="Conversation Image" style="max-width: 100%; border-radius: 8px;">
441-
<p>Listening to your voice... Speak naturally, and I'll respond after pauses.</p>
442-
</div>
439+
<div class="modal-body">
440+
<img id="voice-chat-image" src="" alt="Conversation Image">
441+
<p>Listening to your voice... Speak naturally, and I'll respond after pauses.</p>
442+
</div>
443443
</div>
444444
</div>
445445
<script>
446-
function copyToClipboard(text) {
447-
navigator.clipboard.writeText(text).then(() => {
448-
const popup = document.createElement("div");
449-
popup.textContent = "Address copied. Thank you!";
450-
popup.style.position = "fixed";
451-
popup.style.bottom = "20px";
452-
popup.style.left = "50%";
453-
popup.style.transform = "translateX(-50%)";
454-
popup.style.backgroundColor = "rgba(0, 0, 0, 0.8)";
455-
popup.style.color = "#fff";
456-
popup.style.padding = "10px 20px";
457-
popup.style.borderRadius = "5px";
458-
popup.style.zIndex = "9999";
459-
document.body.appendChild(popup);
460-
setTimeout(() => {
461-
popup.style.opacity = "0";
462-
setTimeout(() => popup.remove(), 500);
446+
function copyToClipboard(text) {
447+
navigator.clipboard.writeText(text).then(() => {
448+
const popup = document.createElement("div");
449+
popup.textContent = "Address copied. Thank you!";
450+
popup.className = "clipboard-popup";
451+
const bodyStyles = getComputedStyle(document.body);
452+
const bgMatch = bodyStyles.backgroundColor.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);
453+
popup.style.backgroundColor = bgMatch
454+
? `rgba(${bgMatch[1]}, ${bgMatch[2]}, ${bgMatch[3]}, 0.85)`
455+
: bodyStyles.backgroundColor;
456+
popup.style.color = bodyStyles.color;
457+
document.body.appendChild(popup);
458+
setTimeout(() => {
459+
popup.style.opacity = "0";
460+
setTimeout(() => popup.remove(), 500);
463461
}, 2000);
464462
}).catch((err) => {
465463
console.error("Failed to copy: ", err);

js/chat/chat-core.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,15 +1016,19 @@ document.addEventListener("DOMContentLoaded", () => {
10161016
toast.id = "toast-notification";
10171017
toast.style.position = "fixed";
10181018
toast.style.top = "5%";
1019-
toast.style.left = "50%";
1020-
toast.style.transform = "translateX(-50%)";
1021-
toast.style.backgroundColor = "rgba(0,0,0,0.7)";
1022-
toast.style.color = "#fff";
1023-
toast.style.padding = "10px 20px";
1024-
toast.style.borderRadius = "5px";
1025-
toast.style.zIndex = "9999";
1026-
toast.style.transition = "opacity 0.3s";
1027-
document.body.appendChild(toast);
1019+
toast.style.left = "50%";
1020+
toast.style.transform = "translateX(-50%)";
1021+
const bodyStyles = getComputedStyle(document.body);
1022+
const bgMatch = bodyStyles.backgroundColor.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);
1023+
toast.style.backgroundColor = bgMatch
1024+
? `rgba(${bgMatch[1]}, ${bgMatch[2]}, ${bgMatch[3]}, 0.7)`
1025+
: bodyStyles.backgroundColor;
1026+
toast.style.color = bodyStyles.color;
1027+
toast.style.padding = "10px 20px";
1028+
toast.style.borderRadius = "5px";
1029+
toast.style.zIndex = "9999";
1030+
toast.style.transition = "opacity 0.3s";
1031+
document.body.appendChild(toast);
10281032
}
10291033
toast.textContent = message;
10301034
toast.style.opacity = "1";

0 commit comments

Comments
 (0)