Skip to content

Commit 52371fd

Browse files
authored
Merge pull request #69 from Nl-T-lN/main
fix: Audio button isn't matching the theme
2 parents 0c8f06b + ee48430 commit 52371fd

2 files changed

Lines changed: 31 additions & 12 deletions

File tree

script.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -479,18 +479,6 @@ function missedTheSpot() {
479479
const muteBtn = document.createElement("button");
480480
muteBtn.id = "muteBtn";
481481
muteBtn.textContent = "🔊";
482-
Object.assign(muteBtn.style, {
483-
position: "absolute",
484-
top: "20px",
485-
left: "20px",
486-
background: "rgba(255,255,255,0.7)",
487-
border: "none",
488-
borderRadius: "8px",
489-
fontSize: "20px",
490-
padding: "5px 10px",
491-
cursor: "pointer",
492-
zIndex: "1000",
493-
});
494482
document.body.appendChild(muteBtn);
495483
muteBtn.addEventListener("click", () => {
496484
muted = !muted;

style.css

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,37 @@ body {
343343
transition: transform 0.3s ease, box-shadow 0.3s ease;
344344
}
345345

346+
#muteBtn {
347+
position: absolute;
348+
top: clamp(8px, 2.5vh, 20px);
349+
left: clamp(12px, 2.5vw, 24px); /* Changed from 'right' */
350+
font-family: "Montserrat", sans-serif;
351+
font-size: clamp(1.5rem, 4vw, 2.5rem);
352+
font-weight: 900;
353+
padding: 0.5rem 1.25rem;
354+
background: linear-gradient(145deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.1));
355+
border-radius: 12px;
356+
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.3);
357+
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
358+
backdrop-filter: blur(8px);
359+
-webkit-backdrop-filter: blur(8px);
360+
z-index: 11;
361+
display: flex;
362+
align-items: center;
363+
justify-content: center; /* Added to center the icon */
364+
transition: transform 0.3s ease, box-shadow 0.3s ease;
365+
color: white; /* Added to make sure icon is visible */
366+
border: none; /* Added from JS */
367+
cursor: pointer; /* Added from JS */
368+
line-height: 1; /* Helps center the icon */
369+
}
370+
371+
/* Optional: Add a matching hover effect */
372+
#muteBtn:hover {
373+
transform: scale(1.05);
374+
box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.3);
375+
}
376+
346377
/* Add diamond icon after score */
347378
#score::after {
348379
content: '◆';

0 commit comments

Comments
 (0)