Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1e1daceb84 | |||
| 66a7c701ed |
@@ -7,10 +7,7 @@ import Tag from "@/tag/Tag";
|
||||
const instrumentSans = Instrument_Sans({
|
||||
variable: "--font-instrument-sans", subsets: ["latin"],
|
||||
});
|
||||
"use client";
|
||||
|
||||
import { useState, useEffect } from "react";
|
||||
import { Volume2, VolumeX } from "lucide-react";
|
||||
'use client';
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Premium Hookah Store | Quality & Tradition",
|
||||
@@ -18,46 +15,6 @@ export const metadata: Metadata = {
|
||||
keywords: ["hookah store", "premium hookah", "hookah accessories", "hookah tobacco", "traditional hookah"]
|
||||
};
|
||||
|
||||
function AudioPlayer() {
|
||||
const [isMuted, setIsMuted] = useState(true);
|
||||
|
||||
useEffect(() => {
|
||||
const audioElement = document.getElementById("lofi-background-music");
|
||||
if (audioElement) {
|
||||
if (isMuted) {
|
||||
audioElement.pause();
|
||||
} else {
|
||||
audioElement.play().catch(() => {
|
||||
console.log("Autoplay prevented by browser");
|
||||
});
|
||||
}
|
||||
}
|
||||
}, [isMuted]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<audio
|
||||
id="lofi-background-music"
|
||||
src="https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3"
|
||||
loop
|
||||
preload="auto"
|
||||
/>
|
||||
<button
|
||||
onClick={() => setIsMuted(!isMuted)}
|
||||
className="fixed bottom-6 right-6 z-50 bg-amber-600 hover:bg-amber-700 text-white p-3 rounded-full shadow-lg transition-all duration-200 flex items-center justify-center"
|
||||
aria-label={isMuted ? "Unmute music" : "Mute music"}
|
||||
title={isMuted ? "Play lofi music" : "Pause lofi music"}
|
||||
>
|
||||
{isMuted ? (
|
||||
<VolumeX size={20} />
|
||||
) : (
|
||||
<Volume2 size={20} />
|
||||
)}
|
||||
</button>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default function RootLayout({
|
||||
children,
|
||||
}: Readonly<{
|
||||
@@ -69,7 +26,6 @@ export default function RootLayout({
|
||||
<body
|
||||
className={instrumentSans.variable}
|
||||
>
|
||||
<AudioPlayer />
|
||||
<Tag />
|
||||
{children}
|
||||
|
||||
@@ -134,14 +90,6 @@ export default function RootLayout({
|
||||
' font-weight: 600 !important;' +
|
||||
' font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;' +
|
||||
' pointer-events: none !important;' +
|
||||
'}'
|
||||
}}
|
||||
/>
|
||||
</body>
|
||||
</ServiceWrapper>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
' white-space: nowrap !important;' +
|
||||
' box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;' +
|
||||
' letter-spacing: 0.3px !important;' +
|
||||
|
||||
Reference in New Issue
Block a user