Refactor BottomNav and CommunityPage to enhance community forum integration; update navigation logic for mobile and desktop views. Add new localized strings for community page and system settings, including device information and user prompts.
This commit is contained in:
+45
-28
@@ -6,7 +6,7 @@
|
||||
2. Two action cards: 批量编辑 / 添加耳机型号
|
||||
3. Headphone model row: [Name ▼] [−] [+]
|
||||
4. Freq response chart: legend + A/B + 复制到B + DIFF + SVG curve
|
||||
5. Band grid: 10 pills (2 rows × 5)
|
||||
5. Band grid: below lg breakpoint 2×5 pills; lg+ single row ×10
|
||||
6. Band detail card: 滤波器 / FREQ / GAIN / Q值
|
||||
7. Total gain card: 总增益 value + AUTO toggle + slider
|
||||
============================================================ */
|
||||
@@ -998,11 +998,11 @@ export default function EQPage() {
|
||||
const handleSaveAddPreset = async () => {
|
||||
const nextName = addPresetMode === "copy" ? copyPresetName.trim() : flatPresetName.trim();
|
||||
if (!nextName) {
|
||||
toast.error("名称不能为空");
|
||||
toast.error(eqUi.addPresetNameEmpty);
|
||||
return;
|
||||
}
|
||||
if (headphoneModels.includes(nextName)) {
|
||||
toast.error("名称已存在,请修改后再保存");
|
||||
toast.error(eqUi.addPresetNameExists);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1056,9 +1056,9 @@ export default function EQPage() {
|
||||
setHeadphoneIdx(headphoneModels.length);
|
||||
}
|
||||
setIsAddPresetDialogOpen(false);
|
||||
toast.success("已新增预设");
|
||||
toast.success(eqUi.toastAddPresetOk);
|
||||
} catch {
|
||||
toast.error("新增预设失败");
|
||||
toast.error(eqUi.toastAddPresetFail);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1545,13 +1545,13 @@ export default function EQPage() {
|
||||
eqUi={eqUi}
|
||||
/>
|
||||
|
||||
{/* ── Band grid (2 rows × 5) ── */}
|
||||
{/* ── Band grid: 2×5 below lg, 1×10 on lg+ (typical desktop) ── */}
|
||||
<div className="ios-list-group p-3">
|
||||
<div className="grid grid-cols-5 gap-1.5">
|
||||
<div className="grid grid-cols-5 gap-1.5 lg:grid-cols-10 lg:gap-1">
|
||||
{bands.map((b, i) => (
|
||||
<button key={i}
|
||||
className={cn(
|
||||
"flex flex-col items-center py-2.5 px-1 rounded-[10px] transition-all duration-150 active:scale-95",
|
||||
"flex flex-col items-center rounded-[10px] transition-all duration-150 active:scale-95 py-2.5 px-1 lg:py-2 lg:px-0.5",
|
||||
selectedBand === i ? "text-black" : "text-white/55"
|
||||
)}
|
||||
style={selectedBand === i ? {
|
||||
@@ -1561,8 +1561,8 @@ export default function EQPage() {
|
||||
background: "rgba(44,44,46,0.65)",
|
||||
}}
|
||||
onClick={() => setSelectedBand(i)}>
|
||||
<span className="text-[12px] font-bold leading-tight">{freqLabel(b.freq)}</span>
|
||||
<span className="text-[9px] mt-0.5 opacity-70 leading-tight">{getFilterShortName(b.type)}</span>
|
||||
<span className="text-[12px] font-bold leading-tight lg:text-[11px]">{freqLabel(b.freq)}</span>
|
||||
<span className="text-[9px] mt-0.5 opacity-70 leading-tight lg:text-[8px] lg:mt-0">{getFilterShortName(b.type)}</span>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
@@ -1697,69 +1697,86 @@ export default function EQPage() {
|
||||
</div>
|
||||
|
||||
{isAddPresetDialogOpen && (
|
||||
<div className="fixed inset-0 z-[120] flex items-center justify-center bg-black/60 px-4">
|
||||
<div className="fixed inset-0 z-[120] flex items-center justify-center bg-black/65 px-4">
|
||||
<div
|
||||
className="w-full max-w-[420px] rounded-[14px] p-5"
|
||||
style={{
|
||||
background: "rgba(236,236,238,0.97)",
|
||||
border: "1px solid rgba(255,255,255,0.35)",
|
||||
background: "linear-gradient(180deg, rgba(34,36,40,0.98) 0%, rgba(24,26,30,0.98) 100%)",
|
||||
border: "1px solid rgba(255,255,255,0.12)",
|
||||
boxShadow: "0 18px 48px rgba(0,0,0,0.55)",
|
||||
}}
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
>
|
||||
<div className="flex items-center justify-between mb-5">
|
||||
<h3 className="text-[31px] text-black/75 font-semibold">新增预设</h3>
|
||||
<div className="flex items-center justify-between mb-4">
|
||||
<h3 className="text-[18px] font-semibold leading-tight text-white/90">{eqUi.addPresetTitle}</h3>
|
||||
<button
|
||||
type="button"
|
||||
className="text-black/45 hover:text-black/70 transition-colors"
|
||||
className="rounded-full p-1.5 text-white/45 transition-colors hover:bg-white/10 hover:text-white/80"
|
||||
onClick={() => setIsAddPresetDialogOpen(false)}
|
||||
aria-label={eqUi.closeDrawer}
|
||||
>
|
||||
<X size={20} />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div className="space-y-4">
|
||||
<label className="flex items-center gap-3">
|
||||
<div className="space-y-3">
|
||||
<label
|
||||
className={cn(
|
||||
"flex cursor-pointer items-center gap-3 rounded-[12px] border border-white/10 p-3 transition-colors",
|
||||
addPresetMode === "copy" ? "bg-white/[0.06]" : "bg-white/[0.02] hover:bg-white/[0.04]",
|
||||
)}
|
||||
>
|
||||
<input
|
||||
type="radio"
|
||||
name="add-preset-mode"
|
||||
checked={addPresetMode === "copy"}
|
||||
onChange={() => setAddPresetMode("copy")}
|
||||
className="w-4 h-4"
|
||||
className="h-4 w-4 shrink-0 accent-[#00FFF6]"
|
||||
/>
|
||||
<input
|
||||
value={copyPresetName}
|
||||
onChange={(e) => setCopyPresetName(e.target.value)}
|
||||
className="flex-1 h-10 px-3 rounded-[5px] text-[15px] text-black/70 bg-[#f0f0f2] border border-black/15 outline-none"
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
className="h-10 min-w-0 flex-1 rounded-[10px] border border-white/12 bg-[#15171b] px-3 text-[15px] text-white/90 outline-none ring-0 ring-offset-0 placeholder:text-white/30 focus:border-white/15 focus:ring-0 focus-visible:ring-0"
|
||||
/>
|
||||
</label>
|
||||
|
||||
<label className="flex items-center gap-3">
|
||||
<label
|
||||
className={cn(
|
||||
"flex cursor-pointer items-center gap-3 rounded-[12px] border border-white/10 p-3 transition-colors",
|
||||
addPresetMode === "flat" ? "bg-white/[0.06]" : "bg-white/[0.02] hover:bg-white/[0.04]",
|
||||
)}
|
||||
>
|
||||
<input
|
||||
type="radio"
|
||||
name="add-preset-mode"
|
||||
checked={addPresetMode === "flat"}
|
||||
onChange={() => setAddPresetMode("flat")}
|
||||
className="w-4 h-4"
|
||||
className="h-4 w-4 shrink-0 accent-[#00FFF6]"
|
||||
/>
|
||||
<input
|
||||
value={flatPresetName}
|
||||
onChange={(e) => setFlatPresetName(e.target.value)}
|
||||
className="flex-1 h-10 px-3 rounded-[5px] text-[15px] text-black/70 bg-[#f0f0f2] border border-black/15 outline-none"
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
className="h-10 min-w-0 flex-1 rounded-[10px] border border-white/12 bg-[#15171b] px-3 text-[15px] text-white/90 outline-none ring-0 ring-offset-0 placeholder:text-white/30 focus:border-white/15 focus:ring-0 focus-visible:ring-0"
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div className="mt-6 flex items-center justify-center gap-16">
|
||||
<div className="mt-6 flex items-center justify-center gap-4 sm:gap-8">
|
||||
<button
|
||||
type="button"
|
||||
className="px-5 py-2 rounded-full text-[26px] text-black/80 bg-[#d2d2d5] hover:bg-[#c7c7ca] transition-colors"
|
||||
className="min-w-[112px] rounded-full px-5 py-2.5 text-[15px] font-medium text-white/85 transition-colors bg-[#3f4349] hover:bg-[#4a4f56] active:scale-[0.98]"
|
||||
onClick={() => setIsAddPresetDialogOpen(false)}
|
||||
>
|
||||
取消
|
||||
{eqUi.cancel}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="px-5 py-2 rounded-full text-[26px] text-black bg-[#00FFF6] hover:brightness-95 transition-all"
|
||||
className="min-w-[112px] rounded-full px-5 py-2.5 text-[15px] font-semibold text-black transition-all bg-[#00FFF6] hover:brightness-95 active:scale-[0.98]"
|
||||
onClick={handleSaveAddPreset}
|
||||
>
|
||||
保存
|
||||
{eqUi.save}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user