Spaces:
Sleeping
Sleeping
hr.append-display { | |
margin: 8px 0; | |
border: none; | |
height: 1px; | |
border-top-width: 0; | |
background-image: linear-gradient(to right, rgba(50,50,50, 0.1), rgba(150, 150, 150, 0.8), rgba(50,50,50, 0.1)); | |
} | |
.source-a { | |
font-size: 0.8em; | |
max-width: 100%; | |
margin: 0; | |
display: flex; | |
flex-direction: row; | |
flex-wrap: wrap; | |
align-items: center; | |
/* background-color: #dddddd88; */ | |
border-radius: 1.5rem; | |
padding: 0.2em; | |
} | |
.source-a a { | |
display: inline-block; | |
background-color: #aaaaaa50; | |
border-radius: 1rem; | |
padding: 0.5em; | |
text-align: center; | |
text-overflow: ellipsis; | |
overflow: hidden; | |
min-width: 20%; | |
white-space: nowrap; | |
margin: 0.2rem 0.1rem; | |
text-decoration: none ; | |
flex: 1; | |
transition: flex 0.5s; | |
} | |
.source-a a:hover { | |
background-color: #aaaaaa20; | |
flex: 2; | |
} | |
/* 川虎助理 */ | |
.agent-prefix { | |
font-size: smaller; | |
opacity: 0.6; | |
padding: 6px 0 4px; | |
} | |
.agent-prefix::before { | |
content: '🐯'; | |
filter: grayscale(); | |
padding: 0 4px; | |
} | |
/* 阻止generating时的border */ | |
#chuanhu-chatbot > .wrap { | |
border: none ; | |
} | |
#chatbot-input-row { | |
align-items: end; | |
gap: 6px; | |
} | |
#chatbot-input-row .gradio-html { | |
min-width: 0; | |
max-width: 42px; | |
width: 42px; | |
} | |
#chatbot-input-tb-row { | |
gap: 0; | |
justify-content: end; | |
border-radius: 21px; | |
background: var(--chatbot-input-background-color); | |
box-shadow: var(--shadow-md); | |
} | |
#user-input-tb { | |
padding: 0 ; | |
/* border: 1px solid rgba(167, 167, 167, 0.5) !important; */ | |
/* border-radius: 21px !important; */ | |
} | |
#user-input-tb textarea { | |
/* max-height: 110px; */ | |
background: transparent; | |
} | |
#user-input-tb .wrap { | |
background: none ; | |
border-radius: 21px ; | |
} | |
/* 亮色(默认) */ | |
#chuanhu-chatbot { | |
background-color: var(--chatbot-background-color-light) ; | |
color: var(--chatbot-color-light) ; | |
} | |
[data-testid = "bot"] { | |
background-color: var(--message-bot-background-color-light) ; | |
} | |
[data-testid = "user"] { | |
background-color: var(--message-user-background-color-light) ; | |
} | |
/* 暗色 */ | |
.dark #chuanhu-chatbot { | |
background-color: var(--chatbot-background-color-dark) ; | |
color: var(--chatbot-color-dark) ; | |
} | |
.dark [data-testid = "bot"] { | |
background-color: var(--message-bot-background-color-dark) ; | |
} | |
.dark [data-testid = "user"] { | |
background-color: var(--message-user-background-color-dark) ; | |
} | |
/* 对话气泡 */ | |
.message { | |
border-radius: var(--radius-xl) ; | |
border: none; | |
padding: var(--spacing-xl) ; | |
font-size: var(--text-md) ; | |
line-height: var(--line-md) ; | |
min-height: calc(var(--text-md)*var(--line-md) + 2*var(--spacing-xl)); | |
min-width: calc(var(--text-md)*var(--line-md) + 2*var(--spacing-xl)); | |
} | |
[data-testid = "bot"] { | |
max-width: calc(85% - 40px); | |
border-bottom-left-radius: 0 ; | |
} | |
[data-testid = "user"] { | |
max-width: calc(85% - 40px); | |
width: auto ; | |
border-bottom-right-radius: 0 ; | |
} | |
.message-row { | |
align-self: unset ; | |
} | |
.message-row.user-row { | |
justify-content: flex-end; | |
} | |
/* .message-row.has-message-btn-row{ | |
padding-bottom: 19px !important; | |
} */ | |
/* 屏幕宽度大于等于500px的设备 */ | |
/* update on 2023.4.8: 高度的细致调整已写入JavaScript */ | |
@media screen and (min-width: 500px) { | |
/* #chuanhu-chatbot { | |
height: calc(100*var(--vh) - 200px); | |
} | |
#chuanhu-chatbot>.wrapper>.wrap { | |
max-height: calc(100*var(--vh) - 200px - var(--line-sm)*1rem - 2*var(--block-label-margin) ); | |
} */ | |
} | |
/* 屏幕宽度小于500px的设备 */ | |
@media screen and (max-width: 499px) { | |
/* #chuanhu-chatbot { | |
height: calc(100*var(--vh) - 140px); | |
} | |
#chuanhu-chatbot>.wrapper>.wrap { | |
max-height: calc(100*var(--vh) - 140px - var(--line-sm)*1rem - 2*var(--block-label-margin) ); | |
} */ | |
[data-testid = "bot"] { | |
max-width: calc(100% - 84px) ; | |
} | |
[data-testid = "user"] { | |
max-width: calc(100% - 84px) ; | |
} | |
#app-title { | |
transform: scale(0.95); | |
transform-origin: left center; | |
} | |
#app-title h1{ | |
letter-spacing: -1px; font-size: 22px; | |
} | |
} | |
#chuanhu-chatbot { | |
height: calc(100*var(--vh) - 65px) ; | |
border-radius: 0; | |
} | |
#chuanhu-chatbot>.wrapper>.wrap { | |
overflow-x: hidden; | |
display: flex; | |
width: 100%; | |
flex-direction: column; | |
padding-inline: 20px; | |
padding-top: 72px; | |
padding-bottom: 180px; | |
} | |
#chuanhu-chatbot>.wrapper>.wrap .message-wrap { | |
align-self: center; | |
width: 100%; | |
max-width: 1024px; | |
} | |
.message.user p { | |
white-space: pre-wrap; | |
} | |
.message .user-message { | |
display: block; | |
padding: 0 ; | |
white-space: pre-wrap; | |
} | |
.message .md-message p { | |
margin-top: 0.6em ; | |
margin-bottom: 0.6em ; | |
} | |
.message .md-message p:first-child { margin-top: 0 ; } | |
.message .md-message p:last-of-type { margin-bottom: 0 ; } | |
.message .md-message { | |
display: block; | |
padding: 0 ; | |
} | |
.message .raw-message p { | |
margin:0 ; | |
} | |
.message .raw-message { | |
display: block; | |
padding: 0 ; | |
white-space: pre-wrap; | |
} | |
.message .hideM { | |
display: none; | |
} | |
/* custom buttons */ | |
.chuanhu-btn { | |
border-radius: 5px; | |
/* background-color: #E6E6E6 !important; */ | |
color: rgba(120, 120, 120, 0.64) ; | |
padding: 4px ; | |
cursor: pointer ; | |
transition: color .2s ease, background-color .2s ease; | |
} | |
.chuanhu-btn:hover { | |
background-color: rgba(167, 167, 167, 0.25) ; | |
color: unset ; | |
} | |
.chuanhu-btn:active { | |
background-color: rgba(167, 167, 167, 0.5) ; | |
} | |
.chuanhu-btn:focus { | |
outline: none; | |
} | |
.message-btn-column { | |
position: absolute; | |
right: -23px; | |
bottom: 0; | |
display: flex; | |
flex-direction: column; | |
align-content: end; | |
gap: 2px; | |
} | |
.message-btn-row { | |
/* background: red; */ | |
width: 100%; | |
height: 19px; | |
position: absolute; | |
top: calc(100% + 2px); | |
left: 0; | |
display: flex; | |
justify-content: space-between; | |
} | |
.message-btn-row-leading, .message-btn-row-trailing { | |
display: inline-flex; | |
gap: 4px; | |
} | |
.message-btn-row button { | |
font-size: 10px; | |
align-self: center; | |
align-items: center; | |
flex-wrap: nowrap; | |
white-space: nowrap; | |
display: inline-flex; | |
flex-direction: row; | |
gap: 4px; | |
padding-block: 2px ; | |
} | |
.like-latest-btn, .dislike-latest-btn { | |
display: none ; | |
/* filter: grayscale(); */ | |
} | |
.is-xmchat .like-latest-btn, .is-xmchat .dislike-latest-btn { | |
display: inline-flex ; | |
} | |
/* .copy-bot-btn { | |
top: 18px; */ | |
/* bottom: 0; | |
} | |
.toggle-md-btn { | |
top: 0; */ | |
/* bottom: 20px; | |
} */ | |
/* note: this is deprecated */ | |
.copy-code-btn { | |
position: relative; | |
float: right; | |
font-size: 1em; | |
cursor: pointer; | |
} | |
/* note: the button below disabled in chatbot.py */ | |
.message div.icon-button > button[title="copy"] { | |
display: none; | |
} | |
/* disable share button and other buttons in hugging face spaces */ | |
#chuanhu-chatbot > .wrapper > .icon-button { | |
display: none ; | |
} | |
/* history message */ | |
.wrapper>.wrap>.history-message { | |
padding-bottom: 10px ; | |
} | |
.history-message { | |
/* padding: 0 !important; */ | |
opacity: 80%; | |
display: flex; | |
flex-direction: column; | |
} | |
.history-message>.history-message { | |
padding: 0 ; | |
} | |
.history-message>.message-wrap { | |
padding: 0 ; | |
margin-bottom: 16px; | |
} | |
.history-message>.message { | |
margin-bottom: 16px; | |
} | |
.wrapper>.wrap>.history-message::after { | |
content: ""; | |
display: block; | |
height: 2px; | |
background-color: var(--body-text-color-subdued); | |
margin-bottom: 10px; | |
margin-top: -10px; | |
clear: both; | |
} | |
.wrapper>.wrap>.history-message>:last-child::after { | |
content: "仅供查看"; | |
display: block; | |
text-align: center; | |
color: var(--body-text-color-subdued); | |
font-size: 0.8em; | |
} | |
/* #chuanhu-chatbot { | |
transition: height 0.3s ease; | |
note: find it better without transition animation...; | |
} */ | |
img.avatar-image { | |
border-radius: 5px ; | |
} | |
.avatar-container { | |
width: 32px ; | |
height: 32px ; | |
background-color: transparent; | |
background-size: cover; | |
} | |