add sidebar buttons

This commit is contained in:
b1ek 2023-08-26 11:17:14 +10:00
parent 52e66737bf
commit caf5bf154e
Signed by: blek
GPG Key ID: 14546221E3595D0C
3 changed files with 53 additions and 4 deletions

View File

@ -1,5 +1,7 @@
:root { :root {
--sidebar-width: 60px; --sidebar-width: 60px;
--sidebar-button-margin: 8px;
--sidebar-button-icon-size: 16px;
} }
input[type=text] { input[type=text] {

View File

@ -1,7 +1,20 @@
<script lang="ts"> <script lang="ts">
import style from './style.module.scss'; import style from './style.module.scss';
import Icon from 'svelte-icons-pack/Icon.svelte';
import VscHome from 'svelte-icons-pack/vsc/VscHome';
import BsGearFill from 'svelte-icons-pack/bs/BsGearFill';
import { route } from '../../store/RouteStore';
</script> </script>
<div class={style.root}> <div class={style.sidebar}>
<button class={style.button} on:click={() => {route('/')}}>
<Icon src={VscHome} />
</button>
<div class={style.bottom}>
<button class={style.button}>
<Icon src={BsGearFill} />
</button>
</div>
</div> </div>

View File

@ -1,5 +1,5 @@
.root { .sidebar {
background: #050005; background: #080808;
position: fixed; position: fixed;
top: 32px; top: 32px;
@ -12,4 +12,38 @@
border-radius: 0 0 0 16px; border-radius: 0 0 0 16px;
transition: 1250ms ease; transition: 1250ms ease;
border-right: 1px solid #10101080;
clip-path: inset(0 0 0 0);
.button {
transition: 650ms ease;
width: calc(var(--sidebar-width) - (var(--sidebar-button-margin) * 2));
height: calc(var(--sidebar-width) - (var(--sidebar-button-margin) * 2));
margin: var(--sidebar-button-margin);
border: 3px solid #272222;
&:hover {
border: 3px solid #444;
}
&:active {
transition: 450ms ease;
border: 3px solid #777;
transform: translateY(3px) scale(0.95);
}
&[active] {
border: 3px solid #777;
}
svg {
transform: translate(-1px, 1px);
height: var(--sidebar-button-icon-size);
width: var(--sidebar-button-icon-size);
}
}
.bottom {
position: absolute;
bottom: 0;
}
} }