mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-24 20:36:40 +07:00
side pane
This commit is contained in:
parent
62e72d166f
commit
9b93012b08
9 changed files with 95 additions and 5 deletions
|
@ -24,6 +24,7 @@ $cols: $content_width / $cell;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex: 0 0;
|
flex: 0 0;
|
||||||
background: $cell_bg;
|
background: $cell_bg;
|
||||||
|
border-radius: 4px;
|
||||||
|
|
||||||
@include outer_shadow();
|
@include outer_shadow();
|
||||||
//&::after {
|
//&::after {
|
||||||
|
|
38
src/components/main/SidePane/index.tsx
Normal file
38
src/components/main/SidePane/index.tsx
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
import React, { useEffect, useState } from 'react';
|
||||||
|
import * as styles from './styles.scss';
|
||||||
|
import classNames from 'classnames';
|
||||||
|
|
||||||
|
export const SidePane = ({ }) => {
|
||||||
|
const [left, setLeft] = useState(0);
|
||||||
|
|
||||||
|
const moveThis = () => {
|
||||||
|
const shift = ((document.body.getBoundingClientRect().width - 1024) / 2) - 54 - 10;
|
||||||
|
setLeft(shift);
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
window.addEventListener('resize', moveThis)
|
||||||
|
|
||||||
|
return () => { window.removeEventListener('resize', moveThis); }
|
||||||
|
});
|
||||||
|
|
||||||
|
useEffect(moveThis, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={styles.pane} style={{ left }}>
|
||||||
|
<div className={classNames(styles.group, 'logo')} />
|
||||||
|
<div className={styles.group}>
|
||||||
|
<div className={styles.btn} />
|
||||||
|
<div className={styles.btn} />
|
||||||
|
<div className={styles.btn} />
|
||||||
|
<div className={styles.btn} />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className={styles.flexy} />
|
||||||
|
|
||||||
|
<div className={styles.group}>
|
||||||
|
<div className={styles.btn} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
44
src/components/main/SidePane/styles.scss
Normal file
44
src/components/main/SidePane/styles.scss
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
.pane {
|
||||||
|
width: 54px;
|
||||||
|
height: 100%;
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: $gap / 2 0;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group {
|
||||||
|
width: 54px;
|
||||||
|
border-radius: 4px;
|
||||||
|
margin: ($gap / 2) 0;
|
||||||
|
background: #191919;
|
||||||
|
box-sizing: border-box;
|
||||||
|
box-shadow: #111111 0 0 0 1px;
|
||||||
|
|
||||||
|
&:global(.logo) {
|
||||||
|
color: white;
|
||||||
|
height: (54px * 1.5) + $gap / 2;
|
||||||
|
background: url('http://vault48.org/pixmaps/logo.png') no-repeat -20px -40px #191919;
|
||||||
|
// #c1543d
|
||||||
|
background-size: 140px;
|
||||||
|
font-weight: 600;
|
||||||
|
font-family: Raleway;
|
||||||
|
font-size: 14px;
|
||||||
|
text-align: center;
|
||||||
|
padding-top: 66px;
|
||||||
|
box-shadow: inset #111111 0 -1px, inset #222222 0 1px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
height: 54px;
|
||||||
|
box-shadow: inset #111111 0 -1px, inset #222222 0 1px;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flexy {
|
||||||
|
flex: 1;
|
||||||
|
}
|
|
@ -1,11 +1,17 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { Header } from "$components/main/Header";
|
import { Header } from "$components/main/Header";
|
||||||
|
import {SidePane} from "$components/main/SidePane";
|
||||||
|
|
||||||
const style = require('./style.scss');
|
const style = require('./style.scss');
|
||||||
|
|
||||||
export const MainLayout = ({ children }) => (
|
export const MainLayout = ({ children }) => (
|
||||||
<div className={style.wrapper}>
|
<div className={style.wrapper}>
|
||||||
<Header />
|
{
|
||||||
|
// <Header />
|
||||||
|
}
|
||||||
|
{
|
||||||
|
<SidePane />
|
||||||
|
}
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
.wrapper {
|
.wrapper {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
//padding: $gap 0;
|
padding: $gap 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ $main_text_color: white;
|
||||||
$content_bg_color: #222222;
|
$content_bg_color: #222222;
|
||||||
$content_bg_secondary: darken($content_bg_color, 3%);
|
$content_bg_secondary: darken($content_bg_color, 3%);
|
||||||
|
|
||||||
$cell_bg: transparentize(white, 0.98);
|
$cell_bg: #222222;
|
||||||
|
|
||||||
$text_normal: 16px;
|
$text_normal: 16px;
|
||||||
$text_small: 14px;
|
$text_small: 14px;
|
||||||
|
|
|
@ -60,7 +60,7 @@ body {
|
||||||
}
|
}
|
||||||
|
|
||||||
:global(.content_container) {
|
:global(.content_container) {
|
||||||
background: $content_bg_color;
|
// background: $content_bg_color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
$cell: 256px;
|
$cell: 256px;
|
||||||
$content_width: $cell * 4;
|
$content_width: $cell * 4;
|
||||||
$gap: 8px;
|
$gap: 10px;
|
||||||
$spc: $gap * 2;
|
$spc: $gap * 2;
|
||||||
$panel_radius: 1px;
|
$panel_radius: 1px;
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"noImplicitAny": false,
|
"noImplicitAny": false,
|
||||||
"allowSyntheticDefaultImports": true,
|
"allowSyntheticDefaultImports": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"target": "es6",
|
"target": "es6",
|
||||||
"jsx": "react",
|
"jsx": "react",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue