ButterM40's picture
Add per-token alternatives + hover tooltip UI
5a6a589
:root {
--primary-purple: #8b5cf6;
--primary-purple-dark: #7c3aed;
--primary-gray: #1f2937;
--secondary-gray: #374151;
--text-light: #f3f4f6;
--text-dark: #111827;
--accent-gray: #4b5563;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
margin: 0;
padding: 0;
font-family: 'Inter', sans-serif;
background-color: var(--primary-gray);
color: var(--text-light);
height: 100vh;
display: flex;
}
.sidebar {
width: 250px;
background-color: var(--secondary-gray);
padding: 20px;
border-right: 1px solid var(--accent-gray);
display: flex;
flex-direction: column;
gap: 8px;
}
.sidebar .nav-item {
padding: 12px 16px;
border-radius: 8px;
cursor: pointer;
transition: all 0.3s ease;
font-weight: 500;
display: flex;
align-items: center;
gap: 12px;
color: var(--text-light);
text-decoration: none;
}
.sidebar .nav-item:hover {
background-color: var(--primary-purple);
transform: translateX(4px);
}
.sidebar .nav-item.active {
background-color: var(--primary-purple);
box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}
.sidebar .nav-item i {
font-size: 1.2em;
}
.sidebar .logo {
font-size: 1.5em;
font-weight: 600;
color: var(--primary-purple);
margin-bottom: 24px;
padding: 0 16px;
}
.main-content {
flex: 1;
padding: 32px;
height: 100vh;
overflow-y: auto;
}
.tab-content {
display: none;
max-width: 800px;
margin: 0 auto;
}
.tab-content.active {
display: block;
}
.content-header {
margin-bottom: 24px;
}
.content-header h1 {
font-size: 2em;
font-weight: 600;
margin-bottom: 8px;
}
.content-header p {
color: var(--text-light);
opacity: 0.8;
}
.input-container {
background: var(--secondary-gray);
border-radius: 12px;
padding: 24px;
margin-bottom: 24px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
textarea {
width: 100%;
min-height: 120px;
padding: 16px;
border-radius: 8px;
background-color: var(--primary-gray);
color: var(--text-light);
border: 2px solid var(--accent-gray);
resize: vertical;
font-size: 1rem;
line-height: 1.5;
transition: all 0.3s ease;
}
textarea:focus {
outline: none;
border-color: var(--primary-purple);
box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}
.button-container {
display: flex;
gap: 12px;
margin-top: 16px;
}
.word-predictions {
background-color: var(--secondary-gray);
border-radius: 8px;
padding: 16px;
margin-top: 12px;
animation: slideDown 0.3s ease;
}
.prediction-item {
display: flex;
justify-content: space-between;
padding: 12px;
border-radius: 6px;
margin-bottom: 4px;
background-color: var(--primary-gray);
transition: all 0.2s ease;
}
.prediction-item:hover {
background-color: var(--accent-gray);
}
.message {
padding: 16px;
border-radius: 12px;
margin-bottom: 16px;
max-width: 80%;
animation: messageSlide 0.3s ease;
}
.message.user {
background-color: var(--primary-purple);
margin-left: auto;
}
.message.assistant {
background-color: var(--secondary-gray);
margin-right: auto;
}
.message.system {
background-color: var(--accent-gray);
margin: 0 auto 24px auto;
text-align: center;
}
@keyframes messageSlide {
from {
opacity: 0;
transform: translateY(10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes slideDown {
from {
opacity: 0;
transform: translateY(-10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.button {
background-color: var(--primary-purple);
color: var(--text-light);
border: none;
padding: 12px 24px;
border-radius: 8px;
cursor: pointer;
font-weight: 500;
font-size: 1rem;
transition: all 0.3s ease;
display: inline-flex;
align-items: center;
gap: 8px;
}
.button:hover {
background-color: var(--primary-purple-dark);
transform: translateY(-1px);
}
.button:active {
transform: translateY(0);
}
.button.secondary {
background-color: var(--accent-gray);
}
.toggle-debug {
background-color: var(--accent-gray);
color: var(--text-light);
border: none;
padding: 8px 16px;
border-radius: 6px;
cursor: pointer;
font-size: 0.9rem;
transition: all 0.3s ease;
}
.toggle-debug:hover {
background-color: var(--primary-purple);
}
.toggle-debug.active {
background-color: var(--primary-purple);
}
.image-upload {
border: 2px dashed var(--primary-purple);
padding: 32px;
text-align: center;
border-radius: 12px;
margin-bottom: 20px;
background-color: var(--primary-gray);
cursor: pointer;
transition: all 0.3s ease;
position: relative;
display: flex;
flex-direction: column;
align-items: center;
gap: 12px;
}
.image-upload:hover {
border-color: var(--primary-purple-dark);
background-color: rgba(139, 92, 246, 0.1);
}
.image-upload i {
font-size: 2.5em;
color: var(--primary-purple);
}
.image-upload:hover i {
transform: scale(1.1);
color: var(--primary-purple-dark);
}
.image-upload input[type="file"] {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
opacity: 0;
cursor: pointer;
}
.image-upload p {
color: var(--text-light);
margin: 0;
font-size: 1rem;
}
.image-upload i {
font-size: 2rem;
color: var(--primary-purple);
margin-bottom: 12px;
}
.image-preview {
max-width: 100%;
margin-top: 16px;
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
#loading {
display: none;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: var(--secondary-gray);
padding: 24px 48px;
border-radius: 12px;
box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
z-index: 1000;
}
#loading.show {
display: block;
animation: fadeIn 0.3s ease;
}
.spinner {
border: 4px solid var(--accent-gray);
border-top: 4px solid var(--primary-purple);
border-radius: 50%;
width: 40px;
height: 40px;
animation: spin 1s linear infinite;
margin: 0 auto 12px auto;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
@keyframes fadeIn {
from {
opacity: 0;
transform: translate(-50%, -60%);
}
to {
opacity: 1;
transform: translate(-50%, -50%);
}
}
#chat-output, #summary-output, #image-output {
background-color: var(--secondary-gray);
border-radius: 12px;
padding: 24px;
margin-top: 24px;
min-height: 200px;
max-height: 600px;
overflow-y: auto;
}
.output-content {
background-color: var(--primary-gray);
border-radius: 8px;
padding: 16px;
margin-top: 16px;
white-space: pre-wrap;
font-family: 'Inter', monospace;
}
.output-content.error {
background-color: rgba(220, 38, 38, 0.2);
border-left: 4px solid rgb(220, 38, 38);
}
.input-container textarea::placeholder {
color: var(--text-light);
opacity: 0.5;
}
.keyboard-hint {
display: block;
margin-top: 8px;
font-size: 0.9rem;
color: var(--text-light);
opacity: 0.7;
font-style: italic;
text-align: center;
}
.button-container {
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
}
.button-container .button {
width: auto;
min-width: 200px;
}
.message.error {
background-color: rgba(220, 38, 38, 0.2);
border-left: 4px solid rgb(220, 38, 38);
margin: 0 auto;
}
/* Token hover alternatives */
.generated-text {
display: inline-block;
line-height: 1.6;
}
.generated-token {
display: inline-block;
padding: 2px 4px;
margin-right: 1px;
border-radius: 4px;
cursor: pointer;
color: var(--text-light);
}
.generated-token:hover {
background: rgba(139,92,246,0.12);
}
.alt-tooltip {
position: absolute;
display: none;
min-width: 160px;
background: linear-gradient(180deg, #111827, #0b1220);
color: var(--text-light);
border: 1px solid rgba(139,92,246,0.18);
border-radius: 8px;
padding: 8px;
box-shadow: 0 8px 24px rgba(2,6,23,0.6);
z-index: 2000;
}
.alt-title {
font-weight: 600;
font-size: 0.9rem;
margin-bottom: 6px;
opacity: 0.9;
}
.alt-row {
display: flex;
justify-content: space-between;
gap: 8px;
padding: 6px 6px;
border-radius: 6px;
}
.alt-row:hover { background: rgba(255,255,255,0.02); }
.alt-token { color: var(--text-light); }
.alt-prob { color: var(--accent-gray); font-size: 0.85rem; }