-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #114 from subquery/feat/chat-ui
Feat/chat UI
- Loading branch information
Showing
7 changed files
with
722 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,209 @@ | ||
.subql-chat { | ||
width: 100%; | ||
background: #0a0a0a; | ||
min-height: 500px; | ||
height: 500px; | ||
display: flex; | ||
|
||
&__navigate { | ||
height: 100%; | ||
width: 60px; | ||
padding: 4px; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
border-right: 2px solid #262626; | ||
} | ||
|
||
&__icon { | ||
color: #fff; | ||
font-size: 28px; | ||
cursor: pointer; | ||
transition: all .15s cubic-bezier(.4,0,.2,1); | ||
margin: 12px 0; | ||
&:hover { | ||
opacity: .5; | ||
} | ||
} | ||
|
||
&__workspace { | ||
padding: 12px; | ||
display: flex; | ||
flex-direction: column; | ||
gap: 8px; | ||
width: 290px; | ||
&-search { | ||
background: rgb(10, 10, 10); | ||
border: 1px solid #262626; | ||
color: rgb(250, 250, 250); | ||
font-size: 14px; | ||
&::placeholder { | ||
color: rgb(250, 250, 250); | ||
} | ||
} | ||
} | ||
|
||
&__chats { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
gap: 8px; | ||
} | ||
|
||
&__area { | ||
flex: 1; | ||
background: #26262680; | ||
position: relative; | ||
display: flex; | ||
} | ||
|
||
&__chat-url { | ||
position: absolute; | ||
top: 0; | ||
height: 40px; | ||
max-height: 40px; | ||
overflow: auto; | ||
color: #fff; | ||
padding: 5px 12.5%; | ||
display: flex; | ||
align-items: center; | ||
gap: 12px; | ||
white-space: nowrap; /* Prevent text from wrapping */ | ||
text-overflow: ellipsis; /* Display ellipsis (...) for overflowed text */ | ||
width: 100%; | ||
} | ||
|
||
&__chat-input-group { | ||
position: absolute; | ||
bottom: 0; | ||
padding: 20px 8px 32px; | ||
width: 100%; | ||
left: 50%; | ||
transform: translateX(-50%); | ||
max-width: 600px; | ||
} | ||
|
||
&__chat-input { | ||
background: transparent; | ||
border: 1px solid #262626; | ||
color: rgb(250, 250, 250); | ||
border-radius: 12px; | ||
|
||
.ant-input { | ||
background: transparent; | ||
color: rgb(250, 250, 250); | ||
font-size: 14px; | ||
height: 60px; | ||
padding: 10px 56px; | ||
border-radius: 12px; | ||
&::placeholder { | ||
color: rgb(250, 250, 250); | ||
opacity: .5; | ||
} | ||
} | ||
|
||
.ant-input-affix-wrapper&:hover { | ||
border-color: #262626; | ||
outline: none; | ||
box-shadow: none; | ||
} | ||
|
||
.ant-input-affix-wrapper&:focus { | ||
border-color: #262626; | ||
outline: none; | ||
box-shadow: none; | ||
} | ||
|
||
&-send { | ||
height: 30px; | ||
width: 30px; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
background: #fafafa; | ||
border-radius: 4px; | ||
opacity: .5; | ||
transition: all .15s cubic-bezier(.4,0,.2,1); | ||
&:hover { | ||
cursor: pointer; | ||
opacity: 1; | ||
} | ||
} | ||
} | ||
|
||
&__chat-placeholder { | ||
height: 100%; | ||
width: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
&-conversation-item { | ||
display: flex; | ||
align-items: center; | ||
gap: 8px; | ||
padding: 8px; | ||
width: 100%; | ||
background: transparent; | ||
color: #fff; | ||
cursor: pointer; | ||
transition: all .15s cubic-bezier(.4,0,.2,1); | ||
border-radius: 8px; | ||
&:hover { | ||
background: #262626; | ||
} | ||
|
||
&--active { | ||
background: #262626; | ||
} | ||
} | ||
|
||
&-conversation-message { | ||
overflow: auto; | ||
flex: 1; | ||
height: calc(100% - 162px); | ||
margin-top: 40px; | ||
display: flex; | ||
flex-direction: column; | ||
|
||
&__item { | ||
padding: 16px 12.5%; | ||
overflow-wrap: anywhere; | ||
display: flex; | ||
align-items: center; | ||
gap: 12px; | ||
color: rgb(209, 213, 219); | ||
} | ||
|
||
&__assistant { | ||
background: rgb(68,70,84); | ||
position: relative; | ||
&--lastOne { | ||
.subql-chat-conversation-message__item-span { | ||
&::after { | ||
content: "▍"; | ||
align-self: flex-end; | ||
margin-left: 8px;; | ||
} | ||
} | ||
} | ||
&--lastOne&--loading { | ||
.subql-chat-conversation-message__item-span { | ||
&::after { | ||
animation: pulseCursor 1s cubic-bezier(0.4, 0, 0.6, 1) infinite; | ||
|
||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
@keyframes pulseCursor { | ||
50% { | ||
opacity: 0; | ||
} | ||
} |
Oops, something went wrong.