LLM / static /css /style.css
Tristan
Hide Enable Sampling checkbox and fix tooltip spacing
2ac94f7
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
padding: 20px;
}
.container {
max-width: 800px;
margin: 0 auto;
background: white;
border-radius: 16px;
padding: 40px;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
h1 {
color: #333;
margin-bottom: 30px;
text-align: center;
font-size: 2.5em;
}
h2 {
color: #555;
margin-bottom: 15px;
font-size: 1.3em;
}
/* Mode Toggle Styles */
.mode-toggle {
display: flex;
gap: 10px;
margin-bottom: 30px;
padding: 5px;
background: #f0f0f0;
border-radius: 12px;
}
.toggle-option {
flex: 1;
text-align: center;
cursor: pointer;
transition: all 0.3s ease;
}
.toggle-option input[type="radio"] {
display: none;
}
.toggle-label {
display: block;
padding: 12px 20px;
border-radius: 8px;
font-weight: 600;
color: #666;
transition: all 0.3s ease;
}
.toggle-option input[type="radio"]:checked + .toggle-label {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}
.toggle-option:hover .toggle-label {
background: #e0e0e0;
}
.toggle-option input[type="radio"]:checked + .toggle-label:hover {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
/* Input Section */
.input-section {
margin-bottom: 30px;
}
label {
display: block;
margin-bottom: 8px;
color: #555;
font-weight: 600;
}
textarea {
width: 100%;
padding: 15px;
border: 2px solid #ddd;
border-radius: 8px;
font-size: 16px;
font-family: inherit;
resize: vertical;
transition: border-color 0.3s ease;
}
textarea:focus {
outline: none;
border-color: #667eea;
}
.controls {
display: flex;
gap: 20px;
margin: 20px 0;
flex-wrap: wrap;
}
.control-group {
flex: 1;
min-width: 200px;
}
.control-group input[type="number"] {
width: 100%;
padding: 10px;
border: 2px solid #ddd;
border-radius: 8px;
font-size: 16px;
transition: border-color 0.3s ease;
}
.control-group input[type="number"]:focus {
outline: none;
border-color: #667eea;
}
.control-group input[type="checkbox"] {
margin-right: 8px;
width: 18px;
height: 18px;
cursor: pointer;
}
button {
width: 100%;
padding: 15px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
border: none;
border-radius: 8px;
font-size: 18px;
font-weight: 600;
cursor: pointer;
transition: transform 0.2s ease, box-shadow 0.3s ease;
}
button:hover {
transform: translateY(-2px);
box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}
button:active {
transform: translateY(0);
}
/* Output Section */
.output-section {
margin-top: 30px;
}
.output-box {
background: #f8f9fa;
border: 2px solid #ddd;
border-radius: 8px;
padding: 20px;
min-height: 150px;
color: #333;
line-height: 1.6;
white-space: pre-wrap;
word-wrap: break-word;
}
.output-box.loading {
color: #999;
font-style: italic;
}
/* Interactive Token Display */
.interactive-output {
line-height: 2;
font-size: 16px;
white-space: normal;
}
.hoverable-token {
position: relative;
display: inline-block;
padding: .5px;
margin: 0 1px;
border-radius: 4px;
cursor: pointer;
transition: all 0.2s ease;
background: transparent;
}
.hoverable-token:hover {
background: #e3f2fd;
box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}
/* Tooltip for alternatives */
.token-tooltip {
visibility: hidden;
opacity: 0;
position: absolute;
bottom: 100%;
left: 50%;
transform: translateX(-50%) translateY(-10px);
background: #2c3e50;
color: white;
border-radius: 8px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
z-index: 1000;
min-width: 250px;
max-width: 350px;
transition: all 0.3s ease;
pointer-events: none;
}
.token-tooltip::after {
content: '';
position: absolute;
top: 100%;
left: 50%;
transform: translateX(-50%);
border: 8px solid transparent;
border-top-color: #2c3e50;
}
.hoverable-token:hover .token-tooltip {
visibility: visible;
opacity: 1;
transform: translateX(-50%) translateY(0);
}
.tooltip-header {
font-weight: 700;
font-size: 0.9em;
margin-bottom: 8px;
color: #ecf0f1;
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
padding-bottom: 4px;
}
.tooltip-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 4px 6px;
margin: 0;
border-radius: 4px;
background: rgba(255, 255, 255, 0.05);
transition: background 0.2s ease;
}
.tooltip-item:hover {
background: rgba(255, 255, 255, 0.1);
}
.tooltip-item.chosen {
background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
border: 1px solid rgba(102, 126, 234, 0.5);
}
.tooltip-token {
font-family: 'Courier New', monospace;
font-weight: 600;
font-size: 0.95em;
color: #ecf0f1;
margin-right: 8px;
flex: 1;
}
.tooltip-prob {
font-weight: 700;
color: #3498db;
font-size: 0.9em;
margin-left: 8px;
}
.chosen-badge {
background: #27ae60;
color: white;
padding: 2px 8px;
border-radius: 10px;
font-size: 0.75em;
font-weight: 600;
margin-left: 8px;
}
/* Predictions Section */
.predictions-section {
margin-top: 30px;
padding-top: 30px;
border-top: 2px solid #eee;
}
.predictions-section button {
margin-bottom: 20px;
}
.predictions-box {
background: #f8f9fa;
border: 2px solid #ddd;
border-radius: 8px;
padding: 20px;
min-height: 100px;
color: #555;
}
.predictions-list {
display: flex;
flex-direction: column;
gap: 12px;
}
.prediction-item {
background: white;
border-radius: 8px;
padding: 12px;
border: 1px solid #e0e0e0;
transition: all 0.2s ease;
}
.prediction-item:hover {
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
transform: translateX(4px);
}
.prediction-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 8px;
gap: 10px;
}
.prediction-rank {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 4px 10px;
border-radius: 12px;
font-size: 0.85em;
font-weight: 600;
min-width: 35px;
text-align: center;
}
.prediction-token {
flex: 1;
font-family: 'Courier New', monospace;
font-weight: 600;
color: #333;
font-size: 1.1em;
}
.prediction-probability {
color: #667eea;
font-weight: 700;
font-size: 1em;
}
.prediction-bar-container {
width: 100%;
height: 6px;
background: #e0e0e0;
border-radius: 3px;
overflow: hidden;
}
.prediction-bar {
height: 100%;
background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
border-radius: 3px;
transition: width 0.5s ease;
}
@media (max-width: 600px) {
.container {
padding: 20px;
}
h1 {
font-size: 1.8em;
}
.controls {
flex-direction: column;
}
.mode-toggle {
flex-direction: column;
}
.prediction-header {
flex-wrap: wrap;
}
.prediction-token {
font-size: 0.95em;
}
/* Mobile tooltip adjustments */
.token-tooltip {
min-width: 200px;
max-width: 280px;
font-size: 0.9em;
}
.hoverable-token {
padding: 3px 5px;
}
}