mirror of
https://github.com/SECTL/SecScore.git
synced 2026-07-19 19:04:23 +08:00
优化竖屏导航展开样式与左上角收起按钮
This commit is contained in:
@@ -100,6 +100,7 @@ export function ContentArea({
|
||||
: t("permissions.view")}
|
||||
</Tag>
|
||||
)
|
||||
const useFloatingSidebarToggle = floatingExpand && sidebarCollapsed
|
||||
|
||||
return (
|
||||
<Layout
|
||||
@@ -128,14 +129,20 @@ export function ContentArea({
|
||||
<div
|
||||
style={
|
||||
{
|
||||
paddingLeft: "8px",
|
||||
paddingLeft: useFloatingSidebarToggle ? 0 : "8px",
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
height: "100%",
|
||||
height: useFloatingSidebarToggle ? "auto" : "100%",
|
||||
WebkitAppRegion: "no-drag",
|
||||
flexShrink: 0,
|
||||
position: "relative",
|
||||
zIndex: floatingExpand && sidebarCollapsed && floatingExpanded ? 1301 : 1,
|
||||
position: useFloatingSidebarToggle ? "fixed" : "relative",
|
||||
left: useFloatingSidebarToggle ? "8px" : undefined,
|
||||
top: useFloatingSidebarToggle ? "4px" : undefined,
|
||||
zIndex: useFloatingSidebarToggle
|
||||
? 1402
|
||||
: floatingExpand && sidebarCollapsed && floatingExpanded
|
||||
? 1301
|
||||
: 1,
|
||||
} as React.CSSProperties
|
||||
}
|
||||
>
|
||||
|
||||
+51
-46
@@ -194,51 +194,53 @@ export function Sidebar({
|
||||
|
||||
const renderSidebarBody = (isCollapsedView: boolean, hideMenu = false) => (
|
||||
<>
|
||||
<div
|
||||
data-tauri-drag-region
|
||||
style={
|
||||
{
|
||||
padding: isCollapsedView ? "20px 8px 12px" : "24px 24px 16px",
|
||||
textAlign: "center",
|
||||
WebkitAppRegion: "drag",
|
||||
userSelect: "none",
|
||||
flexShrink: 0,
|
||||
} as React.CSSProperties
|
||||
}
|
||||
>
|
||||
<img
|
||||
src={appLogo}
|
||||
style={{
|
||||
width: isCollapsedView ? "40px" : "48px",
|
||||
height: isCollapsedView ? "40px" : "48px",
|
||||
marginBottom: isCollapsedView ? "0" : "12px",
|
||||
}}
|
||||
alt="logo"
|
||||
/>
|
||||
{!isCollapsedView && (
|
||||
<>
|
||||
<h2
|
||||
style={{
|
||||
color: "var(--ss-sidebar-text, var(--ss-text-main))",
|
||||
margin: 0,
|
||||
fontSize: "20px",
|
||||
}}
|
||||
>
|
||||
SecScore
|
||||
</h2>
|
||||
<div
|
||||
style={{
|
||||
fontSize: "12px",
|
||||
color: "var(--ss-sidebar-text, var(--ss-text-main))",
|
||||
opacity: 0.8,
|
||||
marginTop: "4px",
|
||||
}}
|
||||
>
|
||||
{t("settings.about.appName")}
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
{!(isCollapsedView && floatingExpand && collapsed) && (
|
||||
<div
|
||||
data-tauri-drag-region
|
||||
style={
|
||||
{
|
||||
padding: isCollapsedView ? "20px 8px 12px" : "24px 24px 16px",
|
||||
textAlign: "center",
|
||||
WebkitAppRegion: "drag",
|
||||
userSelect: "none",
|
||||
flexShrink: 0,
|
||||
} as React.CSSProperties
|
||||
}
|
||||
>
|
||||
<img
|
||||
src={appLogo}
|
||||
style={{
|
||||
width: isCollapsedView ? "40px" : "48px",
|
||||
height: isCollapsedView ? "40px" : "48px",
|
||||
marginBottom: isCollapsedView ? "0" : "12px",
|
||||
}}
|
||||
alt="logo"
|
||||
/>
|
||||
{!isCollapsedView && (
|
||||
<>
|
||||
<h2
|
||||
style={{
|
||||
color: "var(--ss-sidebar-text, var(--ss-text-main))",
|
||||
margin: 0,
|
||||
fontSize: "20px",
|
||||
}}
|
||||
>
|
||||
SecScore
|
||||
</h2>
|
||||
<div
|
||||
style={{
|
||||
fontSize: "12px",
|
||||
color: "var(--ss-sidebar-text, var(--ss-text-main))",
|
||||
opacity: 0.8,
|
||||
marginTop: "4px",
|
||||
}}
|
||||
>
|
||||
{t("settings.about.appName")}
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{!hideMenu && (
|
||||
<div style={{ flex: 1, overflowY: "auto", display: "flex", flexDirection: "column" }}>
|
||||
@@ -352,7 +354,10 @@ export function Sidebar({
|
||||
top: 0,
|
||||
bottom: 0,
|
||||
width: "200px",
|
||||
background: "var(--ss-sidebar-bg)",
|
||||
background:
|
||||
"linear-gradient(0deg, rgba(250, 250, 250, 0.72), rgba(250, 250, 250, 0.72)), var(--ss-sidebar-bg)",
|
||||
backdropFilter: "blur(14px)",
|
||||
WebkitBackdropFilter: "blur(14px)",
|
||||
borderRight: "1px solid var(--ss-border-color)",
|
||||
boxShadow: "6px 0 18px rgba(0, 0, 0, 0.12)",
|
||||
zIndex: 1200,
|
||||
|
||||
Reference in New Issue
Block a user