feat: improve mobile style

This commit is contained in:
Yifei Zhang 2023-03-15 05:50:11 +00:00
parent 653a740f0f
commit 64e331a3e3
7 changed files with 36 additions and 15 deletions

View File

@ -29,8 +29,8 @@
align-items: center; align-items: center;
} }
@media (prefers-color-scheme: dark) { @mixin dark-button {
div:not(:global(.no-dark)) > .icon-button-icon { div:not(:global(.no-dark))>.icon-button-icon {
filter: invert(0.5); filter: invert(0.5);
} }
@ -39,7 +39,15 @@
} }
} }
:global(.dark) {
@include dark-button;
}
@media (prefers-color-scheme: dark) {
@include dark-button;
}
.icon-button-text { .icon-button-text {
margin-left: 5px; margin-left: 5px;
font-size: 12px; font-size: 12px;
} }

View File

@ -38,6 +38,7 @@
} }
.sidebar { .sidebar {
top: 0;
width: var(--sidebar-width); width: var(--sidebar-width);
box-sizing: border-box; box-sizing: border-box;
padding: 20px; padding: 20px;
@ -68,17 +69,15 @@
.sidebar { .sidebar {
position: absolute; position: absolute;
top: -100%; left: -100%;
z-index: 999; z-index: 999;
border-bottom-left-radius: 20px; height: 100vh;
border-bottom-right-radius: 20px;
height: 80vh;
box-shadow: var(--shadow);
transition: all ease 0.3s; transition: all ease 0.3s;
box-shadow: none;
} }
.sidebar-show { .sidebar-show {
top: 0; left: 0;
} }
.mobile { .mobile {

View File

@ -26,7 +26,6 @@ import CloseIcon from "../icons/close.svg";
import { Message, SubmitKey, useChatStore, Theme } from "../store"; import { Message, SubmitKey, useChatStore, Theme } from "../store";
import { Settings } from "./settings"; import { Settings } from "./settings";
import dynamic from "next/dynamic";
export function Markdown(props: { content: string }) { export function Markdown(props: { content: string }) {
return ( return (

View File

@ -11,4 +11,4 @@
.avatar { .avatar {
cursor: pointer; cursor: pointer;
} }

View File

@ -1,4 +1,5 @@
import styles from "./ui-lib.module.scss"; import styles from "./ui-lib.module.scss";
import LoadingIcon from "../icons/three-dots.svg";
export function Popover(props: { export function Popover(props: {
children: JSX.Element; children: JSX.Element;
@ -36,3 +37,13 @@ export function ListItem(props: { children: JSX.Element[] }) {
export function List(props: { children: JSX.Element[] }) { export function List(props: { children: JSX.Element[] }) {
return <div className={styles.list}>{props.children}</div>; return <div className={styles.list}>{props.children}</div>;
} }
export function Loading() {
return <div style={{
height: "100vh",
width: "100vw",
display: "flex",
alignItems: "center",
justifyContent: "center"
}}><LoadingIcon /></div>
}

View File

@ -6,6 +6,7 @@
--primary: rgb(29, 147, 171); --primary: rgb(29, 147, 171);
--second: rgb(231, 248, 255); --second: rgb(231, 248, 255);
--hover-color: #f3f3f3; --hover-color: #f3f3f3;
--bar-color: var(--primary);
/* shadow */ /* shadow */
--shadow: 50px 50px 100px 10px rgb(0, 0, 0, 0.1); --shadow: 50px 50px 100px 10px rgb(0, 0, 0, 0.1);
@ -24,6 +25,8 @@
--second: rgb(27 38 42); --second: rgb(27 38 42);
--hover-color: #323232; --hover-color: #323232;
--bar-color: var(--primary);
--border-in-light: 1px solid rgba(255, 255, 255, 0.192); --border-in-light: 1px solid rgba(255, 255, 255, 0.192);
} }
@ -79,7 +82,9 @@ body {
} }
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 20px; --bar-width: 1px;
width: var(--bar-width);
height: var(--bar-width);
} }
::-webkit-scrollbar-track { ::-webkit-scrollbar-track {
@ -87,9 +92,8 @@ body {
} }
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.05); background-color: var(--bar-color);
border-radius: 20px; border-radius: 20px;
border: 6px solid transparent;
background-clip: content-box; background-clip: content-box;
} }

View File

@ -1,5 +1,5 @@
import { Home } from "./components/home";
import { Analytics } from "@vercel/analytics/react"; import { Analytics } from "@vercel/analytics/react";
import { Home } from './components/home'
export default function App() { export default function App() {
return ( return (