danbooru-viewer/index.scss
defaultkavy a992af35c2
v0.3.5
new: danbooru account login with api is available now.
new: class Client User
adjust: [css] route element padding inline.
new: [css] color variable.
new: interface APIError.
new: [page] /login route.
new: [$nav] menu button and account button.
new: class $Drawer, with user account basic detail, and login/logout button.
new: function numberFormat.
optimize: [$IconButton] $icon default is hiding, method icon will set $icon visible.
new: [$IconButton] method link, set 'click' listener with open link.
2024-10-07 22:03:10 +08:00

206 lines
5.1 KiB
SCSS

// components
@import '/src/component/PostGrid/$PostGrid';
@import '/src/component/PostTile/$PostTile';
@import '/src/component/Searchbar/$Searchbar';
@import '/src/component/IconButton/$IconButton';
@import '/src/component/Drawer/$Drawer';
// routes
@import '/src/route/post/$post_route';
@import '/src/route/login/$login_route';
:root {
--background-color: #1e1e2c;
--background-color-lighter: #3b3b66;
--background-color-light: #24243b;
--background-color-dark: #12121f;
--background-color-darker: #07070c;
--primary-color: #d1d1ee;
--primary-color-dark: #9696b3;
--primary-color-darker: #72728d;
--secondary-color: #aeaeec;
--secondary-color-dark: #6d6da1;
--secondary-color-darker: #424268;
--shadow-color: #09090e50;
--border-radius-small: 0.4rem;
--border-radius-medium: 0.8rem;
--border-radius-large: 1.2rem;
--nav-height: 50px;
}
html {
overflow-x: hidden;
font-size: 14px;
::-webkit-scrollbar {
background-color: var(--background-color);
width: 8px;
}
::-webkit-scrollbar-thumb {
background-color: #aeaeec;
border-radius: 2px;
}
}
body {
overflow-x: hidden;
background-color: var(--background-color);
color: var(--primary-color);
margin: 0;
font-family: Microsoft Yahei;
}
nav {
display: flex;
width: 100%;
height: var(--nav-height);
position: fixed;
top: 0;
z-index: 100;
background-color: color-mix(in srgb, var(--background-color) 70%, transparent);
justify-content: space-between;
align-items: center;
padding-inline: 1rem;
box-sizing: border-box;
backdrop-filter: blur(3px);
a.title {
display: flex;
align-items: center;
gap: 0.4rem;
text-decoration: none;
.booru-name {
color: var(--secondary-color);
margin: 0;
}
.app {
display: flex;
align-items: center;
border-radius: var(--border-radius-small);
// border: 1px solid var(--secondary-color);
// padding: 0.2rem 0.4rem;
margin: 0;
gap: 0.4rem;
.version {
color: var(--background-color);
background-color: var(--secondary-color);
padding: 0.2em 0.4em;
border-radius: var(--border-radius-small);
font-size: 0.8rem;
font-weight: bold;
}
.app-name {
display: none;
font-size: 1rem;
color: var(--secondary-color);
}
}
}
div.searchbar {
padding: 0.4rem 10%;
max-width: 500px;
background-color: color-mix(in srgb, var(--background-color-light) 30%, transparent);
border: 1px solid var(--primary-color-darker);
border-radius: var(--border-radius-small);
color: var(--primary-color-dark);
transition: 0.3s all ease;
cursor: pointer;
&:hover {
color: var(--primary-color);
}
}
div.buttons {
display: flex;
align-items: center;
gap: 1rem;
ion-icon {
// background-color: var(--background-color);
transition: all 0.3s ease;
border-radius: 1rem;
padding: 0.4rem;
&:hover {
background-color: color-mix(in srgb, var(--background-color-lighter) 50%, transparent);
}
}
ion-icon.search {
display: none;
}
div.account {
height: 2rem;
width: 2rem;
display: flex;
justify-content: center;
align-items: center;
border-radius: 2rem;
font-weight: bolder;
color: var(--secondary-color);
background-color: var(--secondary-color-darker);
user-select: none;
cursor: pointer;
}
}
@media (max-width: 800px) {
div.searchbar {
display: none;
}
div.buttons ion-icon.search {
display: inline-block;
}
}
}
router {
display: block;
position: relative;
route {
display: block;
position: relative;
padding-inline: 1rem;
padding-top: var(--nav-height);
}
}
button {
background-color: var(--secondary-color-darker);
color: var(--secondary-color);
padding: 0.8rem 1.2rem;
border-radius: 1rem;
border: none;
cursor: pointer;
&:hover {
background-color: var(--secondary-color-dark);
color: var(--primary-color);
}
}
ion-icon {
font-size: 24px;
color: var(--primary-color);
cursor: pointer;
&:hover {
color: var(--secondary-color);
}
}
a {
color: var(--secondary-color);
text-decoration: none;
}
input {
background-color: var(--background-color-light);
border-radius: var(--border-radius-small);
border: 1px solid var(--background-color-lighter);
font-size: 0.9rem;
padding: 0.8rem 1.2rem;
color: var(--primary-color);
outline: none;
&:focus {
border-color: var(--secondary-color);
}
}