feat: new window style
This commit is contained in:
parent
29d6d607da
commit
5c95373a37
@ -4,12 +4,12 @@ export const appConfig = new Store()
|
|||||||
|
|
||||||
export const titleBarOverlayDark = {
|
export const titleBarOverlayDark = {
|
||||||
height: 41,
|
height: 41,
|
||||||
color: '#1f1f1f',
|
color: '#00000000',
|
||||||
symbolColor: '#ffffff'
|
symbolColor: '#ffffff'
|
||||||
}
|
}
|
||||||
|
|
||||||
export const titleBarOverlayLight = {
|
export const titleBarOverlayLight = {
|
||||||
height: 41,
|
height: 41,
|
||||||
color: '#f8f8f8',
|
color: '#00000000',
|
||||||
symbolColor: '#000000'
|
symbolColor: '#000000'
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,6 +28,8 @@ function createWindow() {
|
|||||||
minHeight: 500,
|
minHeight: 500,
|
||||||
show: true,
|
show: true,
|
||||||
autoHideMenuBar: true,
|
autoHideMenuBar: true,
|
||||||
|
transparent: process.platform === 'darwin',
|
||||||
|
vibrancy: 'fullscreen-ui',
|
||||||
titleBarStyle: 'hidden',
|
titleBarStyle: 'hidden',
|
||||||
titleBarOverlay: theme === 'dark' ? titleBarOverlayDark : titleBarOverlayLight,
|
titleBarOverlay: theme === 'dark' ? titleBarOverlayDark : titleBarOverlayLight,
|
||||||
trafficLightPosition: { x: 8, y: 12 },
|
trafficLightPosition: { x: 8, y: 12 },
|
||||||
|
|||||||
@ -36,8 +36,8 @@
|
|||||||
--color-scrollbar-thumb: rgba(255, 255, 255, 0.15);
|
--color-scrollbar-thumb: rgba(255, 255, 255, 0.15);
|
||||||
--color-scrollbar-thumb-hover: rgba(255, 255, 255, 0.3);
|
--color-scrollbar-thumb-hover: rgba(255, 255, 255, 0.3);
|
||||||
|
|
||||||
--navbar-background: #1f1f1f;
|
--navbar-background: rgba(0, 0, 0, 0.8);
|
||||||
--sidebar-background: #1f1f1f;
|
--sidebar-background: rgba(0, 0, 0, 0.8);
|
||||||
|
|
||||||
--navbar-height: 42px;
|
--navbar-height: 42px;
|
||||||
--sidebar-width: 55px;
|
--sidebar-width: 55px;
|
||||||
@ -82,8 +82,8 @@ body[theme-mode='light'] {
|
|||||||
--color-scrollbar-thumb: rgba(0, 0, 0, 0.15);
|
--color-scrollbar-thumb: rgba(0, 0, 0, 0.15);
|
||||||
--color-scrollbar-thumb-hover: rgba(0, 0, 0, 0.3);
|
--color-scrollbar-thumb-hover: rgba(0, 0, 0, 0.3);
|
||||||
|
|
||||||
--navbar-background: #f8f8f8;
|
--navbar-background: rgba(255, 255, 255, 0.6);
|
||||||
--sidebar-background: #f8f8f8;
|
--sidebar-background: rgba(255, 255, 255, 0.6);
|
||||||
}
|
}
|
||||||
|
|
||||||
*,
|
*,
|
||||||
@ -102,10 +102,9 @@ body {
|
|||||||
display: flex;
|
display: flex;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
color: var(--color-text);
|
color: var(--color-text);
|
||||||
background: var(--color-background);
|
|
||||||
line-height: 1.6;
|
line-height: 1.6;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
background-size: cover;
|
background: transparent !important;
|
||||||
font-family:
|
font-family:
|
||||||
-apple-system,
|
-apple-system,
|
||||||
BlinkMacSystemFont,
|
BlinkMacSystemFont,
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import { isMac } from '@renderer/config/constant'
|
||||||
import { FC, PropsWithChildren } from 'react'
|
import { FC, PropsWithChildren } from 'react'
|
||||||
import styled from 'styled-components'
|
import styled from 'styled-components'
|
||||||
|
|
||||||
@ -26,14 +27,14 @@ const NavbarContainer = styled.div`
|
|||||||
min-height: var(--navbar-height);
|
min-height: var(--navbar-height);
|
||||||
max-height: var(--navbar-height);
|
max-height: var(--navbar-height);
|
||||||
-webkit-app-region: drag;
|
-webkit-app-region: drag;
|
||||||
background-color: var(--navbar-background);
|
|
||||||
margin-left: calc(var(--sidebar-width) * -1);
|
margin-left: calc(var(--sidebar-width) * -1);
|
||||||
padding-left: var(--sidebar-width);
|
padding-left: ${isMac ? 'var(--sidebar-width)' : 0};
|
||||||
border-bottom: 0.5px solid var(--color-border);
|
border-bottom: 0.5px solid var(--color-border);
|
||||||
|
background-color: var(--navbar-background);
|
||||||
`
|
`
|
||||||
|
|
||||||
const NavbarLeftContainer = styled.div`
|
const NavbarLeftContainer = styled.div`
|
||||||
min-width: var(--assistants-width);
|
min-width: ${isMac ? 'var(--assistants-width)' : 'calc(var(--sidebar-width) + var(--assistants-width))'};
|
||||||
padding: 0 10px;
|
padding: 0 10px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
@ -47,7 +48,7 @@ const NavbarCenterContainer = styled.div`
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 0 20px;
|
padding: 0 ${isMac ? '20px' : '15px'};
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: var(--color-text-1);
|
color: var(--color-text-1);
|
||||||
|
|||||||
@ -14,7 +14,6 @@ const Sidebar: FC = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Container style={isWindows ? { paddingTop: 0 } : {}}>
|
<Container style={isWindows ? { paddingTop: 0 } : {}}>
|
||||||
{isMac ? <PlaceholderBorderMac /> : <PlaceholderBorderWin />}
|
|
||||||
<StyledLink to="/">
|
<StyledLink to="/">
|
||||||
<AvatarImg src={avatar || Logo} draggable={false} />
|
<AvatarImg src={avatar || Logo} draggable={false} />
|
||||||
</StyledLink>
|
</StyledLink>
|
||||||
@ -53,13 +52,13 @@ const Container = styled.div`
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 8px 0;
|
padding: 8px 0;
|
||||||
min-width: var(--sidebar-width);
|
width: var(--sidebar-width);
|
||||||
min-height: 100%;
|
height: calc(100vh - var(--navbar-height));
|
||||||
-webkit-app-region: drag !important;
|
-webkit-app-region: drag !important;
|
||||||
background-color: var(--sidebar-background);
|
|
||||||
border-right: 0.5px solid var(--color-border);
|
border-right: 0.5px solid var(--color-border);
|
||||||
padding-top: var(--navbar-height);
|
margin-top: var(--navbar-height);
|
||||||
position: relative;
|
margin-bottom: var(--navbar-height);
|
||||||
|
background-color: var(--sidebar-background);
|
||||||
`
|
`
|
||||||
|
|
||||||
const AvatarImg = styled.img`
|
const AvatarImg = styled.img`
|
||||||
@ -126,24 +125,4 @@ const StyledLink = styled(Link)`
|
|||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
const PlaceholderBorderMac = styled.div`
|
|
||||||
width: var(--sidebar-width);
|
|
||||||
height: var(--navbar-height);
|
|
||||||
background: var(--navbar-background);
|
|
||||||
border-right: 1px solid var(--navbar-background);
|
|
||||||
border-bottom: 0.5px solid var(--color-border);
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
`
|
|
||||||
|
|
||||||
const PlaceholderBorderWin = styled.div`
|
|
||||||
width: var(--sidebar-width);
|
|
||||||
height: var(--navbar-height);
|
|
||||||
position: absolute;
|
|
||||||
border-right: 1px solid var(--navbar-background);
|
|
||||||
top: -1px;
|
|
||||||
right: -1px;
|
|
||||||
`
|
|
||||||
|
|
||||||
export default Sidebar
|
export default Sidebar
|
||||||
|
|||||||
@ -101,6 +101,7 @@ const ContentContainer = styled.div`
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
|
background-color: var(--color-background);
|
||||||
`
|
`
|
||||||
|
|
||||||
const AssistantsContainer = styled.div`
|
const AssistantsContainer = styled.div`
|
||||||
|
|||||||
@ -30,8 +30,6 @@ const HomePage: FC = () => {
|
|||||||
setActiveAssistant(assistant)
|
setActiveAssistant(assistant)
|
||||||
}
|
}
|
||||||
|
|
||||||
console.debug('theme', theme)
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container>
|
<Container>
|
||||||
<Navbar>
|
<Navbar>
|
||||||
@ -82,6 +80,7 @@ const ContentContainer = styled.div`
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
background-color: var(--color-background);
|
||||||
`
|
`
|
||||||
|
|
||||||
export const NewButton = styled.div`
|
export const NewButton = styled.div`
|
||||||
|
|||||||
@ -43,7 +43,7 @@ const NavigationCenter: FC<Props> = ({ activeAssistant }) => {
|
|||||||
return (
|
return (
|
||||||
<NavbarCenter style={{ paddingLeft: isMac ? 16 : 8 }}>
|
<NavbarCenter style={{ paddingLeft: isMac ? 16 : 8 }}>
|
||||||
{!showAssistants && (
|
{!showAssistants && (
|
||||||
<NewButton onClick={toggleShowAssistants} style={{ marginRight: 8 }}>
|
<NewButton onClick={toggleShowAssistants} style={{ marginRight: isMac ? 8 : 25 }}>
|
||||||
<i className="iconfont icon-showsidebarhoriz" />
|
<i className="iconfont icon-showsidebarhoriz" />
|
||||||
</NewButton>
|
</NewButton>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@ -91,7 +91,6 @@ const Tab = styled.div`
|
|||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: var(--color-text-3);
|
color: var(--color-text-3);
|
||||||
border-bottom: 1px solid transparent;
|
|
||||||
&.active {
|
&.active {
|
||||||
color: var(--color-text-2);
|
color: var(--color-text-2);
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
|
|||||||
@ -62,6 +62,7 @@ const ContentContainer = styled.div`
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
background-color: var(--color-background);
|
||||||
`
|
`
|
||||||
|
|
||||||
const SettingMenus = styled.ul`
|
const SettingMenus = styled.ul`
|
||||||
|
|||||||
@ -233,6 +233,7 @@ const ContentContainer = styled.div`
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
|
background-color: var(--color-background);
|
||||||
`
|
`
|
||||||
|
|
||||||
const MenuContainer = styled.div`
|
const MenuContainer = styled.div`
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user