Add a token counter similar to automatic1111

It can now be found in the Default and Notebook tabs
This commit is contained in:
oobabooga 2023-08-20 19:13:01 -07:00
parent 120fb86c6a
commit 429cacd715
4 changed files with 38 additions and 14 deletions

View file

@ -140,7 +140,11 @@ div.svelte-15lo0d8 > *, div.svelte-15lo0d8 > .form > * {
@media screen and (max-width: 711px) {
.textbox_default textarea {
height: calc(100dvh - 295px);
height: calc(100dvh - 271px);
}
div .default-token-counter {
top: calc( 0.5 * (100dvh - 245px) ) !important;
}
}
@ -212,6 +216,27 @@ audio {
max-width: 100%;
}
/* Copied from https://github.com/AUTOMATIC1111/stable-diffusion-webui */
.token-counter {
position: absolute !important;
top: calc( 0.5 * (100dvh - 215px) ) !important;
right: 2px;
z-index: 100;
background: var(--input-background-fill) !important;
min-height: 0 !important;
}
.default-token-counter {
top: calc( 0.5 * (100dvh - 285px) ) !important;
}
.token-counter span {
padding: 1px;
box-shadow: 0 0 0 0.3em rgba(192,192,192,0.15), inset 0 0 0.6em rgba(192,192,192,0.075);
border: 2px solid rgba(192,192,192,0.4) !important;
border-radius: 0.4em;
}
/*****************************************************/
/*************** Chat UI declarations ****************/
/*****************************************************/