Mobile: remove floating MusicToggle overlay (overlapped cards/tiles)
The fixed-position music button covered content on mobile. Removed it from the global overlay; mute now lives in the TopBar icon group (Home), and the in-game HUD + Profile settings already have their own audio controls. Tightened the TopBar icon row (p-1.5, gap-1, profile max-w-44%) so the extra button still fits 360px phones. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -20,7 +20,6 @@ import { DailyRewardModal } from "@/components/online/DailyRewardModal";
|
|||||||
import { NotificationToaster } from "@/components/online/NotificationToaster";
|
import { NotificationToaster } from "@/components/online/NotificationToaster";
|
||||||
import { ResumeGameBar } from "@/components/online/ResumeGameBar";
|
import { ResumeGameBar } from "@/components/online/ResumeGameBar";
|
||||||
import { CelebrationOverlay } from "@/components/online/CelebrationOverlay";
|
import { CelebrationOverlay } from "@/components/online/CelebrationOverlay";
|
||||||
import { MusicToggle } from "@/components/online/MusicToggle";
|
|
||||||
import { ErrorBoundary } from "@/components/ErrorBoundary";
|
import { ErrorBoundary } from "@/components/ErrorBoundary";
|
||||||
import { PublicProfileModal } from "@/components/online/PublicProfileModal";
|
import { PublicProfileModal } from "@/components/online/PublicProfileModal";
|
||||||
import { CapacitorBack } from "@/components/CapacitorBack";
|
import { CapacitorBack } from "@/components/CapacitorBack";
|
||||||
@@ -202,7 +201,6 @@ export default function Page() {
|
|||||||
<NotificationToaster />
|
<NotificationToaster />
|
||||||
<ResumeGameBar />
|
<ResumeGameBar />
|
||||||
<CelebrationOverlay />
|
<CelebrationOverlay />
|
||||||
<MusicToggle />
|
|
||||||
<PublicProfileModal />
|
<PublicProfileModal />
|
||||||
</ErrorBoundary>
|
</ErrorBoundary>
|
||||||
<CapacitorBack />
|
<CapacitorBack />
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { Bell, Crown, Gift, Store } from "lucide-react";
|
import { Bell, Crown, Gift, Music, Store } from "lucide-react";
|
||||||
import { useSessionStore } from "@/lib/session-store";
|
import { useSessionStore } from "@/lib/session-store";
|
||||||
|
import { useSoundStore } from "@/lib/sound-store";
|
||||||
import { useUIStore } from "@/lib/ui-store";
|
import { useUIStore } from "@/lib/ui-store";
|
||||||
import { useNotifStore } from "@/lib/notification-store";
|
import { useNotifStore } from "@/lib/notification-store";
|
||||||
import { useI18n } from "@/lib/i18n";
|
import { useI18n } from "@/lib/i18n";
|
||||||
@@ -14,6 +15,8 @@ export function TopBar() {
|
|||||||
const go = useUIStore((s) => s.go);
|
const go = useUIStore((s) => s.go);
|
||||||
const openDaily = useUIStore((s) => s.openDaily);
|
const openDaily = useUIStore((s) => s.openDaily);
|
||||||
const unread = useNotifStore((s) => s.unread);
|
const unread = useNotifStore((s) => s.unread);
|
||||||
|
const music = useSoundStore((s) => s.music);
|
||||||
|
const toggleMusic = useSoundStore((s) => s.toggleMusic);
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
if (!profile) return null;
|
if (!profile) return null;
|
||||||
|
|
||||||
@@ -25,7 +28,7 @@ export function TopBar() {
|
|||||||
<div className="flex items-center justify-between gap-2">
|
<div className="flex items-center justify-between gap-2">
|
||||||
<button
|
<button
|
||||||
onClick={() => go("profile")}
|
onClick={() => go("profile")}
|
||||||
className="glass rounded-full ltr:pr-3 rtl:pl-3 ltr:pl-1 rtl:pr-1 py-1 flex items-center gap-2 min-w-0 max-w-[46%] hover:bg-navy-800/80 transition"
|
className="glass rounded-full ltr:pr-3 rtl:pl-3 ltr:pl-1 rtl:pr-1 py-1 flex items-center gap-2 min-w-0 max-w-[44%] hover:bg-navy-800/80 transition"
|
||||||
>
|
>
|
||||||
<span className="relative size-9 shrink-0 rounded-full bg-navy-900 gold-border flex items-center justify-center overflow-hidden">
|
<span className="relative size-9 shrink-0 rounded-full bg-navy-900 gold-border flex items-center justify-center overflow-hidden">
|
||||||
<Avatar id={profile.avatar} image={profile.avatarImage} size={profile.avatarImage ? 36 : 26} />
|
<Avatar id={profile.avatar} image={profile.avatarImage} size={profile.avatarImage ? 36 : 26} />
|
||||||
@@ -50,7 +53,22 @@ export function TopBar() {
|
|||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<div className="flex items-center gap-1.5 shrink-0">
|
<div className="flex items-center gap-1 shrink-0">
|
||||||
|
<button
|
||||||
|
onClick={toggleMusic}
|
||||||
|
className="glass rounded-full p-1.5 hover:bg-navy-800/80 transition"
|
||||||
|
title={t("settings.music")}
|
||||||
|
aria-label={t("settings.music")}
|
||||||
|
>
|
||||||
|
{music ? (
|
||||||
|
<Music className="size-4 text-gold-400" />
|
||||||
|
) : (
|
||||||
|
<span className="relative grid place-items-center">
|
||||||
|
<Music className="size-4 text-cream/40" />
|
||||||
|
<span className="absolute block h-0.5 w-5 rotate-45 rounded bg-rose-400" />
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
<button
|
<button
|
||||||
onClick={() => go("notifications")}
|
onClick={() => go("notifications")}
|
||||||
className="glass rounded-full p-2 hover:bg-navy-800/80 transition relative"
|
className="glass rounded-full p-2 hover:bg-navy-800/80 transition relative"
|
||||||
@@ -65,14 +83,14 @@ export function TopBar() {
|
|||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
onClick={openDaily}
|
onClick={openDaily}
|
||||||
className="glass rounded-full p-2 hover:bg-navy-800/80 transition"
|
className="glass rounded-full p-1.5 hover:bg-navy-800/80 transition"
|
||||||
title={t("daily.title")}
|
title={t("daily.title")}
|
||||||
>
|
>
|
||||||
<Gift className="size-4 text-gold-400" />
|
<Gift className="size-4 text-gold-400" />
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
onClick={() => go("shop")}
|
onClick={() => go("shop")}
|
||||||
className="glass rounded-full p-2 hover:bg-navy-800/80 transition"
|
className="glass rounded-full p-1.5 hover:bg-navy-800/80 transition"
|
||||||
title={t("menu.shop")}
|
title={t("menu.shop")}
|
||||||
>
|
>
|
||||||
<Store className="size-4 text-gold-400" />
|
<Store className="size-4 text-gold-400" />
|
||||||
|
|||||||
Reference in New Issue
Block a user