ChatGPT-Next-Web/app/components/home.module.scss

393 lines
6.1 KiB
SCSS
Raw Normal View History

2023-03-14 00:25:07 +08:00
@import "./window.scss";
2023-03-13 03:21:48 +08:00
@mixin container {
2023-03-10 01:01:40 +08:00
background-color: var(--white);
border: var(--border-in-light);
border-radius: 20px;
box-shadow: var(--shadow);
2023-03-13 03:06:21 +08:00
color: var(--black);
background-color: var(--white);
2023-03-13 03:21:48 +08:00
min-width: 600px;
min-height: 480px;
2023-03-15 01:56:39 +08:00
max-width: 900px;
2023-03-10 01:01:40 +08:00
display: flex;
overflow: hidden;
2023-03-13 03:21:48 +08:00
box-sizing: border-box;
2023-03-14 00:25:07 +08:00
width: var(--window-width);
height: var(--window-height);
2023-03-13 03:21:48 +08:00
}
.container {
@include container();
}
2023-03-22 01:16:36 +08:00
@media only screen and (min-width: 600px) {
.tight-container {
--window-width: 100vw;
--window-height: 100vh;
--window-content-width: calc(100% - var(--sidebar-width));
2023-03-14 00:25:07 +08:00
2023-03-22 01:16:36 +08:00
@include container();
2023-03-13 03:21:48 +08:00
2023-03-22 01:16:36 +08:00
max-width: 100vw;
max-height: 100vh;
2023-03-15 01:56:39 +08:00
2023-03-22 01:16:36 +08:00
border-radius: 0;
}
2023-03-10 01:01:40 +08:00
}
.sidebar {
2023-03-15 13:50:11 +08:00
top: 0;
2023-03-14 00:25:07 +08:00
width: var(--sidebar-width);
box-sizing: border-box;
2023-03-10 01:01:40 +08:00
padding: 20px;
background-color: var(--second);
display: flex;
flex-direction: column;
2023-03-11 02:25:33 +08:00
box-shadow: inset -2px 0px 2px 0px rgb(0, 0, 0, 0.05);
2023-03-10 01:01:40 +08:00
}
2023-03-15 01:44:42 +08:00
.window-content {
width: var(--window-content-width);
height: 100%;
2023-03-22 00:20:32 +08:00
display: flex;
flex-direction: column;
2023-03-15 01:44:42 +08:00
}
.mobile {
display: none;
}
@media only screen and (max-width: 600px) {
.container {
min-height: unset;
2023-03-15 01:56:39 +08:00
min-width: unset;
max-height: unset;
min-width: unset;
2023-03-15 01:44:42 +08:00
border: 0;
border-radius: 0;
}
.sidebar {
position: absolute;
2023-03-15 13:50:11 +08:00
left: -100%;
2023-03-15 01:44:42 +08:00
z-index: 999;
2023-03-15 13:50:11 +08:00
height: 100vh;
2023-03-15 01:44:42 +08:00
transition: all ease 0.3s;
2023-03-15 13:50:11 +08:00
box-shadow: none;
2023-03-15 01:44:42 +08:00
}
.sidebar-show {
2023-03-15 13:50:11 +08:00
left: 0;
2023-03-15 01:44:42 +08:00
}
.mobile {
display: block;
}
}
2023-03-10 01:01:40 +08:00
.sidebar-header {
position: relative;
padding-top: 20px;
padding-bottom: 20px;
}
.sidebar-logo {
position: absolute;
right: 0;
bottom: 18px;
}
.sidebar-title {
font-size: 20px;
font-weight: bold;
}
.sidebar-sub-title {
2023-03-11 02:25:33 +08:00
font-size: 12px;
2023-03-10 01:01:40 +08:00
font-weight: 400px;
}
.sidebar-body {
flex: 1;
overflow: auto;
}
2023-03-22 00:20:32 +08:00
.chat-list {
}
2023-03-10 01:01:40 +08:00
.chat-item {
padding: 10px 14px;
background-color: var(--white);
border-radius: 10px;
margin-bottom: 10px;
box-shadow: var(--card-shadow);
2023-03-11 02:25:33 +08:00
transition: all 0.3s ease;
2023-03-10 01:01:40 +08:00
cursor: pointer;
user-select: none;
2023-03-11 02:25:33 +08:00
border: 2px solid transparent;
position: relative;
overflow: hidden;
}
@keyframes slide-in {
from {
opacity: 0;
transform: translateY(20px);
}
2023-03-15 11:54:14 +08:00
2023-03-11 02:25:33 +08:00
to {
opacity: 1;
transform: translateY(0px);
}
2023-03-10 01:01:40 +08:00
}
.chat-item:hover {
background-color: var(--hover-color);
}
.chat-item-selected {
2023-03-11 02:25:33 +08:00
border-color: var(--primary);
2023-03-10 01:01:40 +08:00
}
.chat-item-title {
font-size: 14px;
font-weight: bolder;
2023-03-11 02:25:33 +08:00
display: block;
width: 200px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.chat-item-delete {
position: absolute;
top: 10px;
right: -20px;
transition: all ease 0.3s;
opacity: 0;
}
2023-03-22 00:20:32 +08:00
.chat-item:hover > .chat-item-delete {
2023-03-11 02:25:33 +08:00
opacity: 0.5;
right: 10px;
}
2023-03-22 00:20:32 +08:00
.chat-item:hover > .chat-item-delete:hover {
2023-03-11 02:25:33 +08:00
opacity: 1;
2023-03-10 01:01:40 +08:00
}
.chat-item-info {
display: flex;
justify-content: space-between;
color: rgb(166, 166, 166);
font-size: 12px;
margin-top: 8px;
}
2023-03-22 00:20:32 +08:00
.chat-item-count {
}
2023-03-11 02:25:33 +08:00
2023-03-22 00:20:32 +08:00
.chat-item-date {
}
2023-03-10 01:01:40 +08:00
.sidebar-tail {
display: flex;
justify-content: space-between;
padding-top: 20px;
}
.sidebar-actions {
display: inline-flex;
}
2023-03-11 02:25:33 +08:00
2023-03-15 01:44:42 +08:00
.sidebar-action:not(:last-child) {
margin-right: 15px;
2023-03-12 01:14:07 +08:00
}
2023-03-10 01:01:40 +08:00
.chat {
display: flex;
flex-direction: column;
position: relative;
2023-03-12 01:14:07 +08:00
height: 100%;
2023-03-10 01:01:40 +08:00
}
.chat-body {
flex: 1;
overflow: auto;
padding: 20px;
margin-bottom: 100px;
}
2023-03-11 02:25:33 +08:00
2023-03-10 01:01:40 +08:00
.chat-message {
display: flex;
2023-03-11 02:25:33 +08:00
flex-direction: row;
2023-03-10 01:01:40 +08:00
}
2023-03-10 01:16:20 +08:00
.chat-message-user {
2023-03-10 01:01:40 +08:00
display: flex;
flex-direction: row-reverse;
}
.chat-message-container {
2023-03-15 01:44:42 +08:00
max-width: var(--message-max-width);
2023-03-10 01:01:40 +08:00
display: flex;
flex-direction: column;
align-items: flex-start;
2023-03-11 02:25:33 +08:00
animation: slide-in ease 0.3s;
&:hover {
.chat-message-top-actions {
opacity: 1;
right: 10px;
pointer-events: all;
}
}
2023-03-10 01:01:40 +08:00
}
2023-03-22 00:20:32 +08:00
.chat-message-user > .chat-message-container {
2023-03-10 01:01:40 +08:00
align-items: flex-end;
}
2023-03-11 02:25:33 +08:00
.chat-message-avatar {
margin-top: 20px;
}
.chat-message-status {
font-size: 12px;
color: #aaa;
line-height: 1.5;
margin-top: 5px;
}
.user-avtar {
height: 30px;
width: 30px;
display: flex;
align-items: center;
justify-content: center;
border: var(--border-in-light);
box-shadow: var(--card-shadow);
border-radius: 10px;
}
2023-03-10 01:01:40 +08:00
.chat-message-item {
2023-03-15 01:44:42 +08:00
box-sizing: border-box;
2023-03-14 00:25:07 +08:00
max-width: 100%;
2023-03-13 03:06:21 +08:00
margin-top: 10px;
2023-03-10 01:01:40 +08:00
border-radius: 10px;
background-color: rgba(0, 0, 0, 0.05);
padding: 10px;
font-size: 14px;
user-select: text;
2023-03-14 00:25:07 +08:00
word-break: break-word;
2023-03-13 03:06:21 +08:00
border: var(--border-in-light);
position: relative;
}
.chat-message-top-actions {
font-size: 12px;
position: absolute;
right: 20px;
top: -26px;
transition: all ease 0.3s;
opacity: 0;
pointer-events: none;
display: flex;
flex-direction: row-reverse;
.chat-message-top-action {
opacity: 0.5;
color: var(--black);
cursor: pointer;
&:hover {
opacity: 1;
}
&:not(:first-child) {
margin-right: 10px;
}
}
2023-03-10 01:01:40 +08:00
}
2023-03-10 01:16:20 +08:00
2023-03-22 00:20:32 +08:00
.chat-message-user > .chat-message-container > .chat-message-item {
2023-03-10 01:16:20 +08:00
background-color: var(--second);
}
2023-03-11 02:25:33 +08:00
.chat-message-actions {
2023-03-10 01:01:40 +08:00
display: flex;
flex-direction: row-reverse;
width: 100%;
2023-03-11 02:25:33 +08:00
padding-top: 5px;
2023-03-10 01:01:40 +08:00
box-sizing: border-box;
font-size: 12px;
2023-03-10 01:01:40 +08:00
}
2023-03-11 02:25:33 +08:00
.chat-message-action-date {
2023-03-10 01:01:40 +08:00
color: #aaa;
}
2023-03-11 02:25:33 +08:00
2023-03-10 01:01:40 +08:00
.chat-input-panel {
position: absolute;
bottom: 20px;
display: flex;
width: 100%;
padding: 20px;
box-sizing: border-box;
}
.chat-input-panel-inner {
display: flex;
flex: 1;
}
.chat-input {
height: 100%;
width: 100%;
border-radius: 10px;
border: var(--border-in-light);
2023-03-15 01:44:42 +08:00
box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.03);
2023-03-13 03:06:21 +08:00
background-color: var(--white);
color: var(--black);
2023-03-10 01:01:40 +08:00
font-family: inherit;
padding: 10px 14px;
resize: none;
outline: none;
}
2023-03-17 00:08:16 +08:00
@media only screen and (max-width: 600px) {
.chat-input {
font-size: 16px;
}
}
2023-03-10 01:01:40 +08:00
.chat-input:focus {
border: 1px solid var(--primary);
}
2023-03-11 02:25:33 +08:00
.chat-input-send {
2023-03-10 01:01:40 +08:00
background-color: var(--primary);
color: white;
position: absolute;
right: 30px;
bottom: 10px;
2023-03-16 01:24:03 +08:00
}
.export-content {
white-space: break-spaces;
2023-03-19 22:13:00 +08:00
}
.loading-content {
display: flex;
flex-direction: column;
2023-03-19 22:13:00 +08:00
justify-content: center;
align-items: center;
height: 100%;
width: 100%;
2023-03-22 00:20:32 +08:00
}