T.AI / src /components /RubricBuilder.css
Aaron Meslin
start
c82f7c8
Raw
History Blame Contribute Delete
18 kB
/* Base colors */
:root {
--bg-primary: rgba(255, 255, 255, 0.9);
--bg-secondary: rgba(255, 255, 255, 0.95);
--bg-tertiary: rgba(248, 250, 252, 0.9);
--accent-primary: #0066ff;
--accent-hover: #0052cc;
--text-primary: #1a1f36;
--text-secondary: #697386;
--border-color: #e5e9f2;
--success: #00875a;
--error: #de350b;
--input-bg: #ffffff;
--shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
--shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
--shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.03), 0 3px 6px rgba(0, 0, 0, 0.05);
}
.rubric-builder {
background: rgba(255, 255, 255, 0.9);
backdrop-filter: blur(10px);
padding: 3rem;
border-radius: 20px;
box-shadow: var(--shadow-lg);
color: var(--text-primary);
border: 1px solid var(--border-color);
max-width: 1000px;
margin: 0 auto;
box-sizing: border-box;
width: 100%;
padding-right: 3rem;
}
.rubric-header {
text-align: center;
margin-bottom: 4rem;
}
.rubric-header h2 {
font-size: 2.6rem;
color: var(--text-primary);
margin-bottom: 1rem;
font-weight: 800;
letter-spacing: -0.02em;
}
.rubric-description {
color: var(--text-secondary);
font-size: 1.15rem;
max-width: 600px;
margin: 0 auto;
line-height: 1.6;
}
.questions-container {
display: grid;
gap: 3rem;
}
.previous-questions {
background: var(--bg-tertiary);
padding: 2.5rem;
border-radius: 16px;
border: 1px solid var(--border-color);
box-shadow: var(--shadow-sm);
}
.previous-questions h3 {
color: var(--text-primary);
margin-bottom: 2rem;
font-size: 1.5rem;
border-bottom: 2px solid var(--border-color);
padding-bottom: 1rem;
font-weight: 600;
}
.question-preview {
background: rgba(255, 255, 255, 0.95);
padding: 2rem;
border-radius: 12px;
margin-bottom: 2rem;
border: 1px solid var(--border-color);
box-shadow: var(--shadow-sm);
transition: all 0.2s ease;
}
.question-preview:last-child {
margin-bottom: 0;
}
.question-preview-header {
display: flex;
justify-content: flex-start;
align-items: center;
margin-bottom: 1.5rem;
flex-wrap: wrap;
gap: 1rem;
}
.question-number {
font-weight: 600;
color: var(--text-primary);
font-size: 1.2rem;
margin-right: auto;
}
.question-points {
background: var(--accent-primary);
color: white;
padding: 0.6rem 1.2rem;
border-radius: 30px;
font-weight: 500;
font-size: 0.95rem;
letter-spacing: 0.02em;
}
.new-question-section {
background: rgba(255, 255, 255, 0.9);
backdrop-filter: blur(5px);
padding: 2.5rem;
border-radius: 16px;
border: 1px solid var(--border-color);
box-sizing: border-box;
max-width: 100%;
}
.form-group {
margin-bottom: 2rem;
}
.form-group label {
display: block;
margin-bottom: 0.75rem;
color: var(--text-primary);
font-weight: 500;
font-size: 1.05rem;
}
.form-group input[type="number"],
.form-group textarea {
width: 100%;
box-sizing: border-box;
max-width: 100%;
padding: 1rem 1.2rem;
background: var(--input-bg);
border: 1px solid var(--border-color);
border-radius: 10px;
color: var(--text-primary);
font-size: 1rem;
transition: all 0.2s ease;
}
.form-group textarea {
min-height: 120px;
resize: vertical;
line-height: 1.6;
}
.form-group input:focus,
.form-group textarea:focus {
border-color: var(--accent-primary);
box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
outline: none;
}
.criterion-form {
background: #f8fafc;
padding: 2rem;
border-radius: 12px;
margin: 1.5rem 0;
border: 1px solid #e2e8f0;
box-sizing: border-box;
max-width: 100%;
}
.criterion-form h4 {
color: var(--text-primary);
font-size: 1.1rem;
margin-bottom: 1.5rem;
padding-bottom: 0.8rem;
border-bottom: 1px solid #e2e8f0;
}
.criterion-actions {
display: flex;
gap: 1rem;
margin-top: 2rem;
}
.criterion-actions button {
flex: 1;
padding: 0.8rem;
border-radius: 8px;
font-weight: 500;
transition: all 0.3s ease;
}
.criterion-actions .add-btn {
background: #3b82f6;
color: white;
border: none;
}
.criterion-actions .cancel-btn {
background: white;
color: #ef4444;
border: 1px solid #ef4444;
}
.criterion-actions button:hover {
transform: translateY(-2px);
}
.builder-actions {
display: flex;
gap: 1rem;
margin-top: 3rem;
justify-content: flex-end;
padding-top: 2rem;
border-top: 2px solid var(--border-color);
}
.complete-btn,
.cancel-btn,
.add-btn {
padding: 1rem 2rem;
border-radius: 10px;
cursor: pointer;
font-weight: 600;
transition: all 0.2s ease;
display: flex;
align-items: center;
gap: 0.75rem;
font-size: 1rem;
}
.complete-btn {
background: var(--success);
padding: 1rem 2.5rem;
}
.cancel-btn {
background: var(--error);
}
.add-btn {
background: var(--accent-primary);
}
button:disabled {
opacity: 0.6;
cursor: not-allowed;
}
.criterion-item {
background: var(--bg-secondary);
padding: 1.2rem 1.5rem;
border-radius: 10px;
margin-bottom: 1rem;
border: 1px solid var(--border-color);
display: flex;
align-items: center;
gap: 1.5rem;
}
.points-positive,
.points-negative {
font-weight: 600;
padding: 0.5rem 1rem;
border-radius: 20px;
font-size: 0.95rem;
min-width: 100px;
text-align: center;
flex-shrink: 0;
}
.points-positive {
color: var(--success);
background: rgba(0, 135, 90, 0.1);
}
.points-negative {
color: var(--error);
background: rgba(222, 53, 11, 0.1);
}
.criterion-item span:nth-child(2) {
flex-grow: 1;
text-align: left;
line-height: 1.5;
}
/* Placeholder styling */
::placeholder {
color: var(--text-secondary);
opacity: 0.7;
}
/* Scrollbar styling */
::-webkit-scrollbar {
width: 8px;
}
::-webkit-scrollbar-track {
background: var(--bg-tertiary);
}
::-webkit-scrollbar-thumb {
background: #d1d5db;
border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
background: #9ca3af;
}
/* Update App background */
.App {
background: var(--bg-tertiary);
}
/* Update Navbar */
.navbar {
background: var(--bg-secondary);
border-bottom: 1px solid var(--border-color);
box-shadow: var(--shadow-sm);
}
.navbar-brand a {
color: var(--text-primary);
}
.navbar-brand a:hover {
color: var(--accent-primary);
}
/* Button states */
button:not(:disabled):hover {
transform: translateY(-2px);
box-shadow: var(--shadow-md);
}
/* Placeholder text */
::placeholder {
color: var(--text-secondary);
opacity: 0.7;
}
/* Keep all headings consistent */
h2, h3, h4 {
color: var(--text-primary);
}
/* Keep text consistent */
p, span {
color: var(--text-secondary);
}
/* Update borders and shadows globally */
.rubric-display,
.criterion-preview,
.feedback-item {
background: var(--bg-secondary);
border: 1px solid var(--border-color);
box-shadow: var(--shadow-sm);
}
/* Update hover states */
.question-preview:hover,
button:not(:disabled):hover {
transform: translateY(-2px);
box-shadow: var(--shadow-md);
}
/* Keep accent colors for important elements */
.add-question-btn {
width: 100%;
padding: 1.4rem;
margin-top: 2rem;
background: linear-gradient(to right, #3b82f6, #60a5fa);
border: none;
border-radius: 12px;
color: white;
cursor: pointer;
transition: all 0.3s ease;
font-weight: 600;
font-size: 1.1rem;
display: flex;
align-items: center;
justify-content: center;
gap: 0.8rem;
box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}
.add-question-btn:hover:not(:disabled) {
transform: translateY(-2px);
box-shadow: 0 8px 16px rgba(59, 130, 246, 0.3);
}
.add-question-btn:disabled {
background: #e2e8f0;
cursor: not-allowed;
transform: none;
box-shadow: none;
}
.add-question-btn i {
font-size: 1.2rem;
}
.add-criterion-btn {
width: 100%;
padding: 1.2rem;
margin-top: 1.5rem;
background: white;
border: 2px dashed #3b82f6;
border-radius: 12px;
color: #3b82f6;
cursor: pointer;
transition: all 0.3s ease;
font-weight: 500;
font-size: 1rem;
display: flex;
align-items: center;
justify-content: center;
gap: 0.8rem;
}
.add-criterion-btn:hover {
background: rgba(59, 130, 246, 0.05);
border-color: #60a5fa;
}
.add-criterion-btn i {
font-size: 1rem;
}
/* Keep success/error colors */
.points-positive {
color: var(--success);
}
.points-negative {
color: var(--error);
}
/* Update button styles */
.complete-btn,
.cancel-btn,
.add-btn {
color: white;
}
.complete-btn {
background: var(--success);
}
.cancel-btn {
background: var(--error);
}
.add-btn {
background: var(--accent-primary);
}
/* Update placeholders */
::placeholder {
color: var(--text-secondary);
opacity: 0.7;
}
/* Add subtle transitions */
.rubric-builder * {
transition: all 0.2s ease;
}
/* Update the criteria preview in the added questions section */
.criterion-preview {
background: var(--bg-secondary);
padding: 1.2rem 1.5rem;
border-radius: 8px;
margin-top: 0.8rem;
border: 1px solid var(--border-color);
display: flex;
align-items: center;
gap: 1.5rem;
}
.criterion-preview .criterion-description {
flex-grow: 1;
text-align: left;
line-height: 1.5;
}
/* Add a header for the criteria section */
.criteria-preview h4 {
color: var(--text-primary);
margin: 1.5rem 0 1rem;
font-size: 1.1rem;
padding-bottom: 0.5rem;
border-bottom: 1px solid var(--border-color);
}
/* Add this to your CSS file */
input[type="number"] {
/* Keep the default appearance but prevent scroll behavior */
}
/* Chrome, Safari, Edge, Opera */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
/* Keep the spinners but make them not respond to scroll */
cursor: pointer;
}
/* Add responsive padding to containers */
.criterion-form {
background: #f8fafc;
padding: 2rem;
border-radius: 12px;
margin: 1.5rem 0;
border: 1px solid #e2e8f0;
box-sizing: border-box;
max-width: 100%;
}
/* Ensure the new question section respects container boundaries */
.new-question-section {
background: rgba(255, 255, 255, 0.9);
backdrop-filter: blur(5px);
padding: 2.5rem;
border-radius: 16px;
border: 1px solid var(--border-color);
box-sizing: border-box;
max-width: 100%;
}
/* Add responsive styling for smaller screens */
@media (max-width: 768px) {
.rubric-builder {
padding: 2rem;
}
.new-question-section,
.criterion-form {
padding: 1.5rem;
}
}
/* Add styles for the remove criterion button */
.remove-criterion-btn {
background-color: transparent;
color: var(--error);
border: none;
border-radius: 50%;
width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.2s ease;
flex-shrink: 0;
}
.remove-criterion-btn:hover {
background-color: rgba(222, 53, 11, 0.1);
transform: scale(1.1);
}
/* Add styles for the criterion actions container */
.criterion-actions-container {
display: flex;
gap: 0.5rem;
margin-left: auto;
flex-shrink: 0;
}
/* Add styles for the edit criterion button */
.edit-criterion-btn {
background-color: transparent;
color: var(--accent-primary);
border: none;
border-radius: 50%;
width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.2s ease;
}
.edit-criterion-btn:hover {
background-color: rgba(0, 102, 255, 0.1);
transform: scale(1.1);
}
/* Add styles for the question actions container */
.question-actions-container {
display: flex;
gap: 0.5rem;
margin-left: 1rem;
}
/* Update the question preview header to accommodate the actions */
.question-preview-header {
display: flex;
justify-content: flex-start;
align-items: center;
margin-bottom: 1.5rem;
flex-wrap: wrap;
gap: 1rem;
}
.question-number {
font-weight: 600;
color: var(--text-primary);
font-size: 1.2rem;
margin-right: auto;
}
/* Add styles for the edit question button */
.edit-question-btn {
background-color: var(--accent-primary);
color: white;
border: none;
border-radius: 50%;
width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.2s ease;
}
.edit-question-btn:hover {
background-color: var(--accent-hover);
transform: scale(1.1);
}
/* Add styles for the remove question button */
.remove-question-btn {
background-color: var(--error);
color: white;
border: none;
border-radius: 50%;
width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.2s ease;
}
.remove-question-btn:hover {
background-color: #c62d0a;
transform: scale(1.1);
}
/* Rubric Overview Panel */
.rubric-overview {
position: fixed;
width: 250px;
max-height: calc(100vh - 40px);
background: var(--bg-secondary);
border-radius: 12px;
box-shadow: var(--shadow-lg);
border: 1px solid var(--border-color);
overflow-y: auto;
z-index: 100;
display: flex;
flex-direction: column;
transition: box-shadow 0.3s ease;
cursor: default;
}
.rubric-overview.dragging {
box-shadow: var(--shadow-lg), 0 0 0 3px rgba(0, 102, 255, 0.2);
opacity: 0.9;
cursor: grabbing;
}
.overview-header {
padding: 1rem;
border-bottom: 1px solid var(--border-color);
background: var(--bg-tertiary);
position: sticky;
top: 0;
z-index: 1;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
display: flex;
align-items: center;
cursor: grab;
}
.drag-handle {
margin-right: 10px;
color: var(--text-secondary);
}
.overview-header h3 {
margin: 0;
font-size: 1.1rem;
color: var(--text-primary);
flex-grow: 1;
text-align: center;
}
.overview-questions {
padding: 0.5rem;
overflow-y: auto;
}
.overview-question {
position: relative;
background: white;
border-radius: 8px;
padding: 0.75rem;
margin-bottom: 0.75rem;
border: 1px solid var(--border-color);
cursor: pointer;
transition: all 0.2s ease;
animation: fadeIn 0.3s ease;
display: flex;
flex-direction: column;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}
.overview-question:hover {
transform: translateY(-2px);
box-shadow: var(--shadow-md);
}
.overview-question.active {
border-left: 3px solid var(--accent-primary);
background: rgba(0, 102, 255, 0.05);
}
.overview-question-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 0.5rem;
padding-left: 1rem;
}
.overview-question-number {
font-weight: 600;
color: var(--text-primary);
}
.overview-question-points {
background: var(--accent-primary);
color: white;
padding: 0.2rem 0.5rem;
border-radius: 12px;
font-size: 0.8rem;
}
.overview-question-text {
font-size: 0.85rem;
color: var(--text-secondary);
margin: 0;
line-height: 1.4;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
word-wrap: break-word;
overflow-wrap: break-word;
hyphens: auto;
}
.no-questions {
color: var(--text-secondary);
text-align: center;
font-style: italic;
padding: 1rem 0;
}
/* Responsive adjustments */
@media (max-width: 1200px) {
.rubric-overview {
width: 250px;
}
.rubric-builder {
padding-right: 3rem;
}
}
@media (max-width: 992px) {
.rubric-overview {
display: none;
}
.rubric-builder {
padding-right: 3rem;
}
}
/* Fix text wrapping in the main question preview */
.question-text {
word-wrap: break-word;
overflow-wrap: break-word;
white-space: pre-wrap;
hyphens: auto;
line-height: 1.5;
}
/* Fix text wrapping in criterion descriptions */
.criterion-description {
word-wrap: break-word;
overflow-wrap: break-word;
white-space: pre-wrap;
}
/* Styles for the question being edited */
.question-preview.editing {
position: relative;
opacity: 0.7;
border: 2px dashed var(--accent-primary);
}
.editing-overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.05);
display: flex;
align-items: center;
justify-content: center;
z-index: 1;
border-radius: 12px;
}
.editing-overlay span {
background: var(--accent-primary);
color: white;
padding: 0.5rem 1rem;
border-radius: 20px;
font-weight: 600;
font-size: 0.9rem;
box-shadow: var(--shadow-md);
}
/* Edit mode message */
.edit-mode-message {
background: rgba(0, 102, 255, 0.1);
border: 1px solid var(--accent-primary);
border-radius: 8px;
padding: 1rem;
margin-bottom: 1.5rem;
}
.edit-mode-message p {
color: var(--accent-primary);
margin: 0;
font-weight: 500;
}
/* Cancel edit button */
.cancel-edit-btn {
width: 100%;
padding: 1rem;
margin-top: 1rem;
background: white;
border: 2px solid var(--error);
border-radius: 12px;
color: var(--error);
cursor: pointer;
transition: all 0.3s ease;
font-weight: 600;
font-size: 1rem;
display: flex;
align-items: center;
justify-content: center;
gap: 0.8rem;
}
.cancel-edit-btn:hover {
background: rgba(222, 53, 11, 0.05);
transform: translateY(-2px);
}
/* Add styles for question reordering */
.overview-question {
position: relative;
background: white;
border-radius: 8px;
padding: 0.75rem;
margin-bottom: 0.75rem;
border: 1px solid var(--border-color);
cursor: pointer;
transition: all 0.2s ease;
animation: fadeIn 0.3s ease;
display: flex;
flex-direction: column;
}
.question-drag-handle {
position: absolute;
top: 8px;
left: 8px;
color: var(--text-secondary);
opacity: 0.5;
cursor: grab;
font-size: 0.8rem;
}
.overview-question:hover .question-drag-handle {
opacity: 1;
}
.overview-question.dragging-question {
opacity: 0.5;
transform: scale(0.95);
box-shadow: var(--shadow-md);
}
.overview-question.drag-over {
border: 2px dashed var(--accent-primary);
padding-top: 1.5rem;
background-color: rgba(0, 102, 255, 0.05);
}
.overview-question-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 0.5rem;
padding-left: 1rem;
}