appstore/dist/components/dock.js

123 lines
2.6 KiB
JavaScript
Raw Normal View History

2023-12-19 18:53:48 +08:00
/**
* {}
* @author yutent<yutent.io@gmail.com>
* @date 2023/12/19 16:53:27
*/
import { html, css, Component } from 'wkit'
class Dock extends Component {
static styles = [
css`
:host {
display: flex;
position: fixed;
left: 8px;
top: 50%;
z-index: 2;
width: 72px;
transform: translateY(-50%);
}
.container {
display: flex;
flex-direction: column;
align-items: center;
width: 72px;
min-height: 256px;
gap: 12px;
padding: 12px;
border-radius: 16px;
background: rgba(255, 255, 255, 0.5);
2023-12-21 15:34:37 +08:00
color: var(--color-grey-3);
2023-12-20 19:06:35 +08:00
transform: translateX(-100%);
transition: transform 0.2s ease-in-out;
2023-12-19 18:53:48 +08:00
box-shadow: 0 0 12px rgba(0, 0, 0, 0.1);
2023-12-20 19:06:35 +08:00
2023-12-21 15:34:37 +08:00
--wc-icon-size: 24px;
2023-12-20 19:06:35 +08:00
&:hover {
transform: translateX(0);
}
2023-12-19 18:53:48 +08:00
}
`,
css`
2023-12-21 15:34:37 +08:00
.icon {
display: flex;
align-items: center;
justify-content: center;
}
2023-12-19 18:53:48 +08:00
.apps {
display: flex;
flex-direction: column;
width: 48px;
gap: 12px;
cursor: pointer;
.item {
width: 48px;
height: 48px;
border-radius: 12px;
background: var(--color-blue-1);
transition: transform 0.2s ease-in-out;
&:nth-child(2) {
background: var(--color-teal-1);
}
&:nth-child(3) {
background: var(--color-red-1);
}
&:nth-child(4) {
background: var(--color-dark-1);
}
&:hover {
transform: scale(1.2) translateX(10%);
}
}
}
.pipe {
width: 32px;
height: 1px;
background: var(--color-plain-3);
}
.dashboard,
.trash {
width: 48px;
height: 48px;
border-radius: 12px;
background: var(--color-plain-3);
cursor: pointer;
}
`
]
render() {
return html`
2023-12-20 19:06:35 +08:00
<main class="container">
<span
2023-12-21 15:34:37 +08:00
class="dashboard icon"
2023-12-20 19:06:35 +08:00
@click=${_ => (this.$store.storeAppShow = true)}
2023-12-21 15:34:37 +08:00
><wc-icon name="app"></wc-icon
2023-12-20 19:06:35 +08:00
></span>
2023-12-19 18:53:48 +08:00
<mark class="pipe"></mark>
<nav class="apps">
2023-12-21 15:34:37 +08:00
<a class="item icon"></a>
<a class="item icon"></a>
<a class="item icon"></a>
<a class="item icon"></a>
2023-12-19 18:53:48 +08:00
</nav>
<mark class="pipe"></mark>
2023-12-20 19:06:35 +08:00
<span
2023-12-21 15:34:37 +08:00
class="trash icon"
2023-12-20 19:06:35 +08:00
@click=${_ => (this.$store.aboutAppShow = true)}
2023-12-21 15:34:37 +08:00
>
<wc-icon name="info"></wc-icon>
</span>
2023-12-20 19:06:35 +08:00
</main>
2023-12-19 18:53:48 +08:00
`
}
}
Dock.reg('dock')