Add sidebar footer in ToolsFramework.tsx
This commit is contained in:
@@ -30,6 +30,7 @@ body {
|
|||||||
height: 40px;
|
height: 40px;
|
||||||
font-size: constants.$SIZE_ICON_SM;
|
font-size: constants.$SIZE_ICON_SM;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
|
cursor: pointer;
|
||||||
span {
|
span {
|
||||||
transform: rotateZ(180deg);
|
transform: rotateZ(180deg);
|
||||||
transition: all .3s;
|
transition: all .3s;
|
||||||
@@ -45,6 +46,7 @@ body {
|
|||||||
font-size: 2em;
|
font-size: 2em;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
letter-spacing: 0.6em;
|
letter-spacing: 0.6em;
|
||||||
|
transform: translateX(0.3em);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -178,6 +180,40 @@ body {
|
|||||||
opacity: 0.4;
|
opacity: 0.4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
font-weight: bold;
|
||||||
|
padding: 10px 14px;
|
||||||
|
color: constants.$main-color;
|
||||||
|
|
||||||
|
.icon-box {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
padding: 10px;
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
font-size: constants.$SIZE_ICON_SM;
|
||||||
|
border-radius: 8px;
|
||||||
|
span {
|
||||||
|
transform: rotateZ(180deg);
|
||||||
|
transition: all .3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: constants.$background-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.text {
|
||||||
|
flex: 1;
|
||||||
|
font-size: 2em;
|
||||||
|
text-align: center;
|
||||||
|
letter-spacing: 0.6em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&.hide {
|
&.hide {
|
||||||
width: 68px;
|
width: 68px;
|
||||||
|
|
||||||
|
|||||||
@@ -4,15 +4,17 @@ import '@/assets/css/pages/tools-framework.scss'
|
|||||||
import Icon from '@ant-design/icons'
|
import Icon from '@ant-design/icons'
|
||||||
import { toolsJsonObjects } from '@/router/tools.tsx'
|
import { toolsJsonObjects } from '@/router/tools.tsx'
|
||||||
import HideScrollbar, { HideScrollbarElement } from '@/components/common/HideScrollbar.tsx'
|
import HideScrollbar, { HideScrollbarElement } from '@/components/common/HideScrollbar.tsx'
|
||||||
|
import { getLocalStorage, setLocalStorage } from '@/utils/common.ts'
|
||||||
|
|
||||||
const ToolsFramework: React.FC = () => {
|
const ToolsFramework: React.FC = () => {
|
||||||
const hideScrollbarRef = useRef<HideScrollbarElement>(null)
|
const hideScrollbarRef = useRef<HideScrollbarElement>(null)
|
||||||
const [submenuTop, setSubmenuTop] = useState(0)
|
const [submenuTop, setSubmenuTop] = useState(0)
|
||||||
const [submenuLeft, setSubmenuLeft] = useState(0)
|
const [submenuLeft, setSubmenuLeft] = useState(0)
|
||||||
const [hideSidebar, setHideSidebar] = useState(false)
|
const [hideSidebar, setHideSidebar] = useState(getLocalStorage('hideSidebar') === 'false')
|
||||||
|
|
||||||
const switchSidebar = () => {
|
const switchSidebar = () => {
|
||||||
setHideSidebar(!hideSidebar)
|
setHideSidebar(!hideSidebar)
|
||||||
|
setLocalStorage('hideSidebar', hideSidebar ? 'true' : 'false')
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
hideScrollbarRef.current?.refreshLayout()
|
hideScrollbarRef.current?.refreshLayout()
|
||||||
}, 300)
|
}, 300)
|
||||||
@@ -90,7 +92,7 @@ const ToolsFramework: React.FC = () => {
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<div className={'separate'} />
|
<div className={'separate'} style={{ marginBottom: 0 }} />
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div className={'toolsMenu'}>
|
<div className={'toolsMenu'}>
|
||||||
@@ -177,7 +179,13 @@ const ToolsFramework: React.FC = () => {
|
|||||||
</HideScrollbar>
|
</HideScrollbar>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={'title'}>氮工具</div>
|
<div className={'separate'} style={{ marginTop: 0, marginBottom: 0 }} />
|
||||||
|
<div className={'footer'}>
|
||||||
|
<span className={'icon-box'} onClick={switchSidebar}>
|
||||||
|
<Icon component={IconFatwebExpand} />
|
||||||
|
</span>
|
||||||
|
<span className={'text'}>氮工具</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={'right-panel'}></div>
|
<div className={'right-panel'}></div>
|
||||||
</FitFullScreen>
|
</FitFullScreen>
|
||||||
|
|||||||
Reference in New Issue
Block a user