Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
File size: 4,663 Bytes
cbfe36d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 | /* styles/components/feedback.css - Message feedback buttons and modal */
/* Message container to hold bubble + feedback buttons */
.message-container {
display: flex;
flex-direction: column;
margin-bottom: 8px;
}
.message-container .msg-bubble {
margin-bottom: 4px;
}
/* The horizontal row containing ONLY bubble and copy button */
.bubble-row {
display: flex;
align-items: flex-end; /* Keeps button at the bottom of the bubble height TODO */
gap: 8px;
}
/* USER: Bubble on right, Copy on left */
.message-container.user {
align-items: flex-end;
}
.message-container.user .bubble-row {
flex-direction: row-reverse; /* Flips the copy button to the left */
}
/* ASSISTANT: Bubble on left, Copy on right */
.message-container.assistant {
align-items: flex-start;
}
.message-container.assistant .bubble-row {
flex-direction: row; /* Copy button stays on the right */
justify-content: flex-start;
}
/* Copy Button Styling */
.copy-btn {
opacity: 0;
transition: opacity 0.2s ease;
border: none;
background: transparent;
padding: 5px;
cursor: pointer;
height: fit-content;
}
.message-container:hover .copy-btn {
opacity: 1;
}
/* A slight lift and a subtle background glow */
.copy-btn:hover {
background: rgba(255, 255, 255, 0.08);
border-color: rgba(255, 255, 255, 0.3);
color: #ffffff;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
/* The button "sinks" into the page and glows blue/green */
.copy-btn:active {
transform: scale(0.9); /* Noticeable "squish" effect */
background: rgba(76, 111, 255, 0.2); /* Tint of your brand color */
border-color: #4c6fff;
transition: transform 0.05s; /* Make the click feel instant */
}
/* Feedback buttons */
.feedback-buttons {
display: flex;
gap: 4px;
opacity: 0;
transition: opacity 0.2s ease;
margin-left: 8px;
align-self: flex-start;
}
/* Show feedback buttons on hover of the message container */
.message-container:hover .feedback-buttons {
opacity: 1;
}
/* Always show if a button is active (rated) */
.feedback-buttons:has(.feedback-btn.active) {
opacity: 1;
}
.feedback-btn {
background: rgba(255, 255, 255, 0.05);
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 6px;
padding: 4px 8px;
font-size: 0.9rem;
cursor: pointer;
transition: all 0.2s ease;
color: #c0c6e0;
width: 20px;
display: flex;
align-items: center;
justify-content: center;
box-sizing: content-box;
}
.feedback-btn:hover {
background: rgba(255, 255, 255, 0.1);
border-color: rgba(255, 255, 255, 0.2);
transform: scale(1.1);
}
.feedback-btn.active {
background: rgba(76, 111, 255, 0.2);
border-color: #4c6fff;
color: #4c6fff;
}
/* Feedback modal */
.feedback-modal {
position: relative;
width: 90%;
}
.feedback-modal h2 {
margin-bottom: 1rem;
color: #f5f5f5;
font-size: 1.3rem;
}
.feedback-message-preview {
background: rgba(13, 19, 36, 0.5);
border: 1px solid #2c3554;
border-radius: 8px;
margin-bottom: 1rem;
padding: 8px;
margin-top: 16px;
}
.feedback-label {
font-size: 0.85rem;
color: #c0c6e0;
margin-top: 0;
margin-bottom: 6px;
font-weight: 500;
}
.message-preview-text {
font-size: 0.9rem;
color: #f5f5f5;
line-height: 1.4;
max-height: 100px;
overflow-y: auto;
}
.feedback-modal .form-group {
margin-bottom: 1rem;
}
.feedback-modal label {
display: block;
margin-bottom: 8px;
color: #c0c6e0;
font-weight: 500;
}
.feedback-modal textarea {
width: 100%;
background: #0d1324;
border: 1px solid #2c3554;
border-radius: 8px;
padding: 10px;
color: #f5f5f5;
font-family: inherit;
font-size: 0.95rem;
resize: vertical;
min-height: 80px;
box-sizing: border-box;
}
.feedback-modal textarea:focus {
outline: none;
border-color: #4c6fff;
}
.form-hint {
display: block;
margin-top: 6px;
font-size: 0.8rem;
color: #c0c6e0;
font-style: italic;
}
.feedback-modal .button-group {
display: flex;
gap: 12px;
margin: auto;
}
.feedback-modal .ok-button,
.feedback-modal .cancelBtn {
padding: 10px 20px;
border-radius: 8px;
font-weight: 500;
}
.feedback-modal .ok-button {
background: #4c6fff;
color: white;
border: none;
}
.feedback-modal .ok-button:hover {
background: #3d5ae6;
}
.feedback-modal .cancelBtn {
background: transparent;
border: 1px solid #2c3554;
color: #c0c6e0;
}
.feedback-modal .cancelBtn:hover {
background: rgba(255, 255, 255, 0.05);
}
/* Responsive */
@media (max-width: 768px) {
.feedback-modal {
min-width: unset;
width: 95%;
}
.feedback-buttons {
opacity: 1; /* Always show on mobile */
}
.feedback-modal .button-group button {
width: 100%;
}
} |