ChatGPT-Next-Web/app/components/home.module.scss
[witbox2018] 7c448656a9 4
2023-04-10 15:08:14 +08:00

652 lines
12 KiB
SCSS

@import "./window.scss";
@import "../styles/animation.scss";
@mixin container {
background-clip: padding-box,
border-box;
background-origin: padding-box,
border-box;
background-image: linear-gradient(to right, var(--white), var(--white)),
linear-gradient(90deg, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0.8) 73.67%, rgba(255, 255, 255, 0) 99.95%),
linear-gradient(0deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.2));
box-shadow: 0px 16px 32px -16px rgba(0, 0, 0, 0.5),
0px 0px 0px 0.9375px rgba(0, 0, 0, 0.5);
background-color: var(--white);
border: 2px solid hsla(0, 0%, 100%, .1);
border-radius: 20px;
box-shadow: var(--shadow);
color: var(--black);
background-color: var(--white);
min-width: 600px;
min-height: 480px;
max-width: 1200px;
display: flex;
overflow: hidden;
box-sizing: border-box;
width: var(--window-width);
height: var(--window-height);
}
.container {
@include container();
}
@media only screen and (min-width: 600px) {
.tight-container {
--window-width: 100vw;
--window-height: var(--full-height);
--window-content-width: 868px;
@include container();
max-width: 100vw;
max-height: var(--full-height);
background: var(--gray);
border-radius: 0;
}
}
.sidebar {
top: 0;
width: var(--sidebar-width);
box-sizing: border-box;
padding: 14px;
background-color: var(--second);
display: flex;
flex-direction: column;
// box-shadow: inset -2px 0px 2px 0px rgb(0, 0, 0, 0.05);
position: relative;
transition: width ease 0.1s;
}
.sidebar-drag {
$width: 10px;
position: absolute;
top: 0;
right: 0;
height: 100%;
width: $width;
background-color: var(--black);
cursor: ew-resize;
opacity: 0;
transition: all ease 0.3s;
&:hover,
&:active {
opacity: 0.2;
}
}
.window-content {
width: var(--window-content-width);
height: 100%;
display: flex;
flex-direction: column;
margin: 0 auto;
background-color: var(--white);
}
.mobile {
display: none;
}
@media only screen and (max-width: 600px) {
.container {
min-height: unset;
min-width: unset;
max-height: unset;
min-width: unset;
border: 0;
border-radius: 0;
}
.sidebar {
position: absolute;
left: -100%;
z-index: 1000;
height: var(--full-height);
transition: all ease 0.3s;
box-shadow: none;
background-color: var(--white);
}
.sidebar-show {
left: 0;
}
.mobile {
display: block;
}
}
.sidebar-header {
position: relative;
padding-top: 20px;
padding-bottom: 20px;
}
.sidebar-logo {
// position: absolute;
// right: 0;
// bottom: 18px;
width: 222px;
}
.sidebar-title {
font-size: 20px;
font-weight: bold;
}
.sidebar-sub-title {
font-size: 12px;
font-weight: 400px;
color: var(--text);
}
.sidebar-body {
flex: 1;
overflow: auto;
}
.chat-list {}
.chat-item {
box-sizing: border-box;
padding: 12px 10px;
color: var(--black);
background: rgba(255, 255, 255, 0.05);
border-radius: 10px;
margin: 0 1px;
margin-bottom: 14px;
// transition: all 0.5s ease;
cursor: pointer;
user-select: none;
position: relative;
overflow: hidden;
border: var(--border-in-light);
background-clip: padding-box,
border-box;
background-origin: padding-box,
border-box;
background-image: linear-gradient(to right, var(--second), var(--second)),
linear-gradient(90deg, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0.8) 73.67%, rgba(255, 255, 255, 0) 99.95%),
linear-gradient(0deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.2));
}
@keyframes slide-in {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0px);
}
}
.chat-item:hover {
background-color: var(--hover-color);
}
.chat-item-selected {
color: var(--black);
border: 1px solid transparent;
background-clip: padding-box,
border-box;
background-origin: padding-box,
border-box;
background-image: linear-gradient(to right, var(--white), var(--white)),
linear-gradient(90deg, rgba(255, 99, 99, 0.8), rgba(155, 77, 255, 0.8));
transition: all 0.5s ease;
}
.chat-item-title {
font-size: 14px;
font-weight: bolder;
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;
cursor: pointer;
}
.chat-item:hover>.chat-item-delete {
opacity: 0.5;
right: 10px;
}
.chat-item:hover>.chat-item-delete:hover {
opacity: 1;
}
.chat-item-info {
display: flex;
justify-content: space-between;
color: #AEB9CA;
font-size: 12px;
margin-top: 14px;
}
.chat-item-count,
.chat-item-date {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.sidebar-tail {
display: flex;
justify-content: space-between;
padding-top: 20px;
}
.sidebar-actions {
display: inline-flex;
}
.sidebar-action:not(:last-child) {
margin-right: 15px;
}
.chat {
display: flex;
flex-direction: column;
position: relative;
height: 100%;
}
.chat-body {
flex: 1;
overflow: auto;
padding: 18px;
position: relative;
// padding-bottom: 120px;
}
.chat-body-title {
cursor: pointer;
&:hover {
text-decoration: underline;
}
}
.chat-message {
display: flex;
flex-direction: row;
}
.chat-message-user {
display: flex;
flex-direction: row-reverse;
}
.chat-message-container {
max-width: var(--message-max-width);
display: flex;
flex-direction: column;
align-items: flex-start;
animation: slide-in ease 0.3s;
&:hover {
.chat-message-top-actions {
opacity: 1;
right: 10px;
pointer-events: all;
}
}
}
.chat-message-user>.chat-message-container {
align-items: flex-end;
}
.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;
}
.chat-message-item {
box-sizing: border-box;
max-width: 100%;
margin-top: 26px;
border-radius: 4px 10px 10px 10px;
padding: 10px;
font-size: 15px;
line-height: 2;
user-select: text;
word-break: break-word;
position: relative;
background: linear-gradient(90.13deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 100%),
rgba(255, 255, 255, 0.05);
border: var(--border-in-light);
}
.chat-message-top-actions {
font-size: 12px;
position: absolute;
right: 20px;
top: -26px;
left: 100px;
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);
white-space: nowrap;
cursor: pointer;
&:hover {
opacity: 1;
}
&:not(:first-child) {
margin-right: 10px;
}
}
}
.chat-message-user>.chat-message-container>.chat-message-item {
background: var(--chatpop);
border-radius: 10px 4px 10px 10px;
border: none;
}
.chat-message-actions {
display: flex;
flex-direction: row-reverse;
width: 100%;
padding-top: 5px;
box-sizing: border-box;
font-size: 12px;
}
.chat-message-action-date {
color: var(--text);
}
.chat-input-panel {
width: 100%;
padding: 18px;
box-sizing: border-box;
flex-direction: column;
// background: rgba(4, 4, 21, 0.18);
backdrop-filter: blur(1px);
vertical-align: middle;
}
@media only screen and (max-width: 600px) {
.chat-input-panel {
width: 100%;
padding: 18px 18px 32px 18px;
box-sizing: border-box;
flex-direction: column;
background: var(--second);
backdrop-filter: blur(1px);
vertical-align: middle;
}
}
@mixin single-line {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.prompt-hints {
min-height: 20px;
width: 100%;
max-height: 50vh;
overflow: auto;
display: flex;
flex-direction: column-reverse;
background-color: var(--white);
border: var(--border-in-light);
border-radius: 10px;
margin-bottom: 10px;
box-shadow: var(--shadow);
.prompt-hint {
color: var(--black);
padding: 6px 10px;
animation: slide-in ease 0.3s;
cursor: pointer;
transition: all ease 0.3s;
border: transparent 1px solid;
margin: 4px;
border-radius: 8px;
&:not(:last-child) {
margin-top: 0;
}
.hint-title {
font-size: 12px;
font-weight: bolder;
@include single-line();
}
.hint-content {
font-size: 12px;
@include single-line();
}
&-selected,
&:hover {
border-color: var(--primary);
}
}
}
.chat-input-panel-inner {
display: flex;
flex: 1;
align-items: center;
vertical-align: middle;
}
.chat-input {
height: 100%;
width: 100%;
max-height: 222px;
width: 100%;
border-radius: 10px;
border: var(--border-in-light);
// box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.03);
background-color: var(--white);
color: var(--black);
padding: 12px 62px 12px 12px;
resize: none;
outline: none;
background-color: var(--white);
font-family: inherit;
font-size: 15px;
transition: all 0.8s ease;
}
.chat-input::placeholder {
color: var(--text);
font-size: 15px;
vertical-align: middle;
line-height: normal;
}
@media only screen and (max-width: 600px) {
.chat-input {
font-size: 16px;
}
}
.chat-input:focus {
background-clip: padding-box,
border-box;
background-origin: padding-box,
border-box;
background-image: linear-gradient(to right, var(--white), var(--white)),
linear-gradient(90deg, rgba(255, 99, 99, 0.8), rgba(155, 77, 255, 0.8));
box-shadow: 0px 3px 22px 0px rgb(69 80 219 / 50%);
// padding: inherit;
transition: all 0.5s ease;
}
.chat-input-send {
// background-color: var(--primary);
color: white;
width: 48px;
height: 34px;
box-sizing: border-box;
border-radius: 6px;
position: absolute;
bottom: 24px;
right: 26px;
}
.chat-input-send:hover {
background-color: var(--primary);
}
@media only screen and (max-width: 600px) {
.chat-input-send {
// background-color: var(--primary);
color: white;
// width: 72px;
// height: 32px;
box-sizing: border-box;
border-radius: 6px;
position: absolute;
right: 30px;
bottom: 228px;
display: none;
}
}
.export-content {
white-space: break-spaces;
padding: 10px !important;
}
.loading-content {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100%;
width: 100%;
}
.addConversation {
box-sizing:border-box;
color: var(--black);
font-weight: bold;
height: 52px;
width: 100%;
border-radius: 10px;
margin-bottom: 14px;
border: var(--border-in-light);
background-color: var(--white);
box-shadow: var(--card-shadow);
font-size: 14px;
align-items: center;
display: flex;
// justify-content: center;
padding: 12px 10px;
transition: all 0.5s ease;
cursor: pointer;
}
.addConversationDark {
box-sizing: border-box;
color: var(--black);
font-weight: bold;
height: 52px;
width: 100%;
background: linear-gradient(0deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.42));
// linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 100%);
box-shadow: 0px 0px 12px rgba(121, 159, 255, 0.44),
// 0px 0px 20px rgba(255, 255, 255, 0.36),
inset 0px 0px 5px rgba(255, 255, 255, 0.17);
backdrop-filter: blur(12px);
/* Note: backdrop-filter has minimal browser support */
box-shadow: 0px 0px 32px 0px rgba(102, 94, 177, 0.37) inset;
border-radius: 10px;
margin-bottom: 14px;
border: 2px solid rgba(255, 255, 255, 0.14);
font-size: 14px;
align-items: center;
display: flex;
// justify-content: center;
padding: 12px 10px;
transition: all 0.5s ease;
cursor: pointer;
}
.addConversation:hover {
background-color: var(--hover-color);
}