fix(ui): opaque .glass-menu for floating popovers (readability)
Floating menus hover over undimmed content (no backdrop scrim like dialogs), so the frosted .glass (78%) let the content bleed through and hurt readability. Add a near-opaque .glass-menu (surface 92%, keeps blur) and use it for the account, language, notification and add-to-playlist popovers. Dialogs/chrome keep the frostier .glass (they sit over a dark scrim / the ambient bg). perf-mode disables its blur too.
This commit is contained in:
parent
41cdc85051
commit
2442e462c4
5 changed files with 16 additions and 4 deletions
|
|
@ -139,7 +139,7 @@ export default function AddToPlaylist({
|
||||||
<div
|
<div
|
||||||
ref={panelRef}
|
ref={panelRef}
|
||||||
style={{ position: "fixed", top: coords.top, left: coords.left, width: 240 }}
|
style={{ position: "fixed", top: coords.top, left: coords.left, width: 240 }}
|
||||||
className="z-50 glass rounded-xl p-2 shadow-2xl"
|
className="z-50 glass-menu rounded-xl p-2 shadow-2xl"
|
||||||
onClick={(e) => e.stopPropagation()}
|
onClick={(e) => e.stopPropagation()}
|
||||||
>
|
>
|
||||||
<div className="text-xs text-muted px-1.5 pb-1.5">
|
<div className="text-xs text-muted px-1.5 pb-1.5">
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ export default function LanguageSwitcher({
|
||||||
|
|
||||||
{open && (
|
{open && (
|
||||||
<div
|
<div
|
||||||
className={`glass absolute ${
|
className={`glass-menu absolute ${
|
||||||
align === "right" ? "right-0" : "left-0"
|
align === "right" ? "right-0" : "left-0"
|
||||||
} mt-1 w-40 rounded-xl p-1.5 z-40 animate-[popIn_0.16s_ease]`}
|
} mt-1 w-40 rounded-xl p-1.5 z-40 animate-[popIn_0.16s_ease]`}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,7 @@ export default function NavSidebar({
|
||||||
{acctOpen && (
|
{acctOpen && (
|
||||||
<>
|
<>
|
||||||
<div className="fixed inset-0 z-20" onClick={() => setAcctOpen(false)} />
|
<div className="fixed inset-0 z-20" onClick={() => setAcctOpen(false)} />
|
||||||
<div className="glass absolute left-full bottom-0 ml-2 w-60 rounded-xl p-3 z-30 animate-[popIn_0.16s_ease]">
|
<div className="glass-menu absolute left-full bottom-0 ml-2 w-60 rounded-xl p-3 z-30 animate-[popIn_0.16s_ease]">
|
||||||
<div className="flex items-center gap-3 pb-3 border-b border-border">
|
<div className="flex items-center gap-3 pb-3 border-b border-border">
|
||||||
<AvatarImg
|
<AvatarImg
|
||||||
src={me.avatar_url}
|
src={me.avatar_url}
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ export default function NotificationCenter({
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
{open && (
|
{open && (
|
||||||
<div className="glass absolute right-0 mt-2 w-80 max-w-[calc(100vw-2rem)] rounded-xl z-30 flex flex-col max-h-[70vh] animate-[popIn_0.16s_ease]">
|
<div className="glass-menu absolute right-0 mt-2 w-80 max-w-[calc(100vw-2rem)] rounded-xl z-30 flex flex-col max-h-[70vh] animate-[popIn_0.16s_ease]">
|
||||||
<div className="flex items-center justify-between px-3 py-2 border-b border-border">
|
<div className="flex items-center justify-between px-3 py-2 border-b border-border">
|
||||||
<div className="text-sm font-semibold">{t("notifications.title")}</div>
|
<div className="text-sm font-semibold">{t("notifications.title")}</div>
|
||||||
{notifications.length > 0 && (
|
{notifications.length > 0 && (
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,17 @@ body {
|
||||||
inset 0 1px 0 color-mix(in srgb, #fff 8%, transparent),
|
inset 0 1px 0 color-mix(in srgb, #fff 8%, transparent),
|
||||||
0 8px 22px -14px rgba(0, 0, 0, 0.45);
|
0 8px 22px -14px rgba(0, 0, 0, 0.45);
|
||||||
}
|
}
|
||||||
|
.glass-menu {
|
||||||
|
/* Floating menus/popovers hover over undimmed content (no backdrop scrim like dialogs),
|
||||||
|
so they must be near-opaque to stay readable — only a hint of translucency + the blur. */
|
||||||
|
background: color-mix(in srgb, var(--surface) 92%, transparent);
|
||||||
|
backdrop-filter: blur(30px) saturate(1.8);
|
||||||
|
-webkit-backdrop-filter: blur(30px) saturate(1.8);
|
||||||
|
border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
|
||||||
|
box-shadow:
|
||||||
|
inset 0 1px 0 color-mix(in srgb, #fff 14%, transparent),
|
||||||
|
0 18px 44px -16px rgba(0, 0, 0, 0.6);
|
||||||
|
}
|
||||||
.glass-hover:hover {
|
.glass-hover:hover {
|
||||||
border-color: color-mix(in srgb, var(--accent) 55%, transparent);
|
border-color: color-mix(in srgb, var(--accent) 55%, transparent);
|
||||||
box-shadow:
|
box-shadow:
|
||||||
|
|
@ -78,6 +89,7 @@ html[data-theme="dark"] body {
|
||||||
|
|
||||||
/* Performance mode (Settings → Appearance) drops the expensive blur + soft shadows. */
|
/* Performance mode (Settings → Appearance) drops the expensive blur + soft shadows. */
|
||||||
html[data-perf="1"] .glass,
|
html[data-perf="1"] .glass,
|
||||||
|
html[data-perf="1"] .glass-menu,
|
||||||
html[data-perf="1"] .glass-card {
|
html[data-perf="1"] .glass-card {
|
||||||
backdrop-filter: none;
|
backdrop-filter: none;
|
||||||
-webkit-backdrop-filter: none;
|
-webkit-backdrop-filter: none;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue