modernize UI for Code Challenge page with new header, question palette, and improved styling

This commit is contained in:
ishikabhoyar
2025-10-30 21:54:07 +05:30
parent 4daafa726d
commit 9d6729e63c
3 changed files with 885 additions and 151 deletions

View File

@@ -1097,134 +1097,443 @@ body {
display: flex;
flex-direction: column;
height: 100vh;
background-color: var(--vscode-background);
color: var(--vscode-foreground);
background-color: #ffffff;
color: #1a1a1a;
}
.code-challenge-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px 16px;
background-color: var(--vscode-background);
border-bottom: 1px solid rgba(128, 128, 128, 0.35);
padding: 16px 24px;
background-color: #ffffff;
border-bottom: 1px solid #e5e7eb;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.code-challenge-header h1 {
margin: 0;
font-size: 25px;
font-weight: 400;
font-weight: bold;
font-size: 18px;
font-weight: 600;
color: #1a1a1a;
}
.header-left {
display: flex;
align-items: center;
gap: 12px;
}
.header-icon {
font-size: 24px;
}
.header-right {
display: flex;
align-items: center;
gap: 24px;
}
.timer-display {
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
}
.timer-label {
font-size: 12px;
color: #6b7280;
font-weight: 500;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.timer-value {
display: flex;
align-items: center;
gap: 4px;
}
.time-block {
background-color: #fee2e2;
color: #dc2626;
padding: 6px 10px;
border-radius: 6px;
font-size: 18px;
font-weight: 700;
min-width: 40px;
text-align: center;
font-family: 'Consolas', 'Monaco', monospace;
}
.time-separator {
color: #dc2626;
font-size: 18px;
font-weight: 700;
}
.time-up {
color: #dc2626;
font-size: 18px;
font-weight: 700;
}
.timer-labels {
display: flex;
gap: 16px;
font-size: 10px;
color: #9ca3af;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.timer-labels span {
min-width: 40px;
text-align: center;
}
.user-profile {
display: flex;
align-items: center;
gap: 8px;
}
.user-avatar {
width: 40px;
height: 40px;
border-radius: 50%;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
display: flex;
align-items: center;
justify-content: center;
color: white;
cursor: pointer;
transition: transform 0.2s ease;
}
.user-avatar:hover {
transform: scale(1.05);
}
.sign-in-btn {
background-color: transparent;
color: var(--vscode-foreground);
border: 1px solid rgba(128, 128, 128, 0.5);
padding: 4px 12px;
border-radius: 4px;
color: #6b7280;
border: 1px solid #d1d5db;
padding: 6px 16px;
border-radius: 6px;
font-size: 14px;
font-weight: 500;
cursor: pointer;
transition: all 0.2s ease;
}
.sign-in-btn:hover {
background-color: rgba(255, 255, 255, 0.05);
background-color: #f3f4f6;
border-color: #9ca3af;
color: #374151;
}
.code-challenge-problem-nav {
padding: 8px 16px;
border-bottom: 1px solid rgba(128, 128, 128, 0.35);
padding: 12px 24px;
border-bottom: 1px solid #e5e7eb;
background-color: #f9fafb;
}
.problem-number {
margin: 0;
font-size: 16px;
font-weight: 400;
font-weight: 500;
color: #374151;
}
.code-challenge-main {
display: flex;
height: 60vh;
border-bottom: 1px solid rgba(128, 128, 128, 0.35);
border-bottom: 1px solid #e5e7eb;
background-color: #ffffff;
}
.problem-tabs {
display: flex;
flex-direction: column;
width: 80px;
border-right: 1px solid rgba(128, 128, 128, 0.35);
}
.problem-tabs button {
padding: 16px;
background-color: transparent;
color: var(--vscode-foreground);
border: none;
text-align: left;
border-right: 1px solid #e5e7eb;
background-color: #f9fafb;
width: 240px;
overflow-y: auto;
}
.question-palette-header {
margin-bottom: 16px;
}
.question-palette-header h3 {
margin: 0;
font-size: 14px;
font-weight: 600;
color: #111827;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.question-palette-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 8px;
margin-bottom: 20px;
}
.question-palette-btn {
padding: 12px 8px;
background-color: #ffffff;
color: #6b7280;
border: 1px solid #e5e7eb;
border-radius: 6px;
text-align: center;
cursor: pointer;
border-bottom: 1px solid rgba(128, 128, 128, 0.2);
font-size: 14px;
font-weight: 600;
transition: all 0.2s ease;
min-width: 40px;
}
.problem-tabs button.tab-active {
background-color: var(--vscode-background);
font-weight: 500;
border-left: 2px solid #007acc;
.question-palette-btn:hover:not(.palette-active):not(:disabled) {
background-color: #f3f4f6;
border-color: #d1d5db;
transform: translateY(-1px);
}
.problem-tabs button:hover:not(.tab-active) {
background-color: rgba(255, 255, 255, 0.05);
.question-palette-btn.palette-active {
background-color: #2563eb;
color: #ffffff;
border-color: #2563eb;
box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}
.question-palette-btn:disabled {
opacity: 0.3;
cursor: not-allowed;
}
.palette-legend {
display: flex;
flex-direction: column;
gap: 12px;
padding-top: 16px;
border-top: 1px solid #e5e7eb;
}
.legend-item {
display: flex;
align-items: center;
gap: 8px;
font-size: 12px;
color: #6b7280;
}
.legend-dot {
width: 12px;
height: 12px;
border-radius: 50%;
flex-shrink: 0;
}
.legend-current {
background-color: #2563eb;
}
.legend-answered {
background-color: #10b981;
}
.legend-not-visited {
background-color: #e5e7eb;
}
.problem-content {
flex: 1;
overflow-y: auto;
padding: 16px;
border-right: 1px solid rgba(128, 128, 128, 0.35);
padding: 24px;
border-right: 1px solid #e5e7eb;
width: 50%;
background-color: #ffffff;
display: flex;
flex-direction: column;
}
.problem-header-info {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 16px;
font-size: 14px;
}
.question-label {
color: #374151;
font-weight: 600;
}
.question-points {
color: #6b7280;
}
.problem-container {
flex: 1;
}
.problem-container h1 {
margin-top: 0;
font-size: 22px;
font-size: 20px;
font-weight: 600;
margin-bottom: 16px;
color: #111827;
}
.problem-actions {
display: flex;
justify-content: flex-end;
gap: 12px;
padding-top: 20px;
margin-top: auto;
border-top: 1px solid #e5e7eb;
}
.action-btn {
display: flex;
align-items: center;
gap: 6px;
padding: 8px 16px;
border-radius: 6px;
font-size: 14px;
font-weight: 500;
cursor: pointer;
transition: all 0.2s ease;
border: none;
}
.action-btn-secondary {
background-color: #f3f4f6;
color: #374151;
border: 1px solid #d1d5db;
}
.action-btn-secondary:hover {
background-color: #e5e7eb;
border-color: #9ca3af;
}
.problem-description {
margin-bottom: 20px;
margin-bottom: 24px;
font-size: 14px;
line-height: 1.6;
color: #374151;
}
.problem-description strong {
color: #111827;
font-weight: 600;
}
.problem-description p {
margin-bottom: 12px;
}
.test-cases-section {
margin-top: 24px;
}
.test-cases-section h3 {
font-size: 16px;
font-weight: 600;
margin-bottom: 16px;
color: #111827;
}
.test-case-card {
background-color: #f9fafb;
border: 1px solid #e5e7eb;
border-radius: 8px;
margin-bottom: 12px;
overflow: hidden;
}
.test-case-label {
background-color: #e5e7eb;
padding: 8px 16px;
font-size: 12px;
font-weight: 600;
color: #374151;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.test-case-content {
padding: 16px;
}
.test-case-item {
display: flex;
flex-direction: column;
margin-bottom: 12px;
}
.test-case-item:last-child {
margin-bottom: 0;
}
.test-label {
font-size: 13px;
font-weight: 600;
color: #6b7280;
margin-bottom: 6px;
}
.test-value {
background-color: #ffffff;
border: 1px solid #e5e7eb;
padding: 10px 12px;
border-radius: 6px;
font-family: 'Consolas', 'Monaco', monospace;
font-size: 13px;
line-height: 1.5;
color: #111827;
}
.problem-examples h2 {
font-size: 16px;
font-weight: 600;
margin-top: 24px;
margin-bottom: 12px;
color: #111827;
}
.example-box {
background-color: rgba(0, 0, 0, 0.3);
padding: 12px;
border-radius: 6px;
background-color: #f9fafb;
border: 1px solid #e5e7eb;
padding: 16px;
border-radius: 8px;
margin-bottom: 12px;
font-family: 'Consolas', 'Monaco', monospace;
font-size: 14px;
line-height: 1.5;
font-size: 13px;
line-height: 1.6;
}
.editor-section {
width: 50%;
display: flex;
flex-direction: column;
background-color: #f9fafb;
}
.editor-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 8px 12px;
background-color: #252526;
border-bottom: 1px solid rgba(128, 128, 128, 0.35);
padding: 12px 16px;
background-color: #ffffff;
border-bottom: 1px solid #e5e7eb;
position: relative;
z-index: 200;
}
@@ -1235,27 +1544,34 @@ body {
}
.language-selector {
background-color: #3c3c3c;
color: #d4d4d4;
border: 1px solid #3c3c3c;
border-radius: 4px;
padding: 4px 8px;
font-size: 13px;
background-color: #f3f4f6;
color: #374151;
border: 1px solid #d1d5db;
border-radius: 6px;
padding: 6px 12px;
font-size: 14px;
margin-right: 8px;
}
.auto-btn {
background-color: #3c3c3c;
color: #d4d4d4;
border: none;
border-radius: 4px;
padding: 4px 12px;
font-size: 13px;
font-weight: 500;
cursor: pointer;
}
.language-selector:hover {
background-color: #e5e7eb;
}
.auto-btn {
background-color: #f3f4f6;
color: #374151;
border: 1px solid #d1d5db;
border-radius: 6px;
padding: 6px 12px;
font-size: 14px;
cursor: pointer;
font-weight: 500;
}
.auto-selected {
background-color: #4d4d4d;
background-color: #e5e7eb;
}
.editor-actions {
@@ -1268,87 +1584,168 @@ body {
.run-btn {
display: flex;
align-items: center;
gap: 4px;
background-color: #3c3c3c;
color: #d4d4d4;
gap: 6px;
background-color: #10b981;
color: #ffffff;
border: none;
border-radius: 4px;
padding: 4px 12px;
font-size: 13px;
border-radius: 6px;
padding: 8px 16px;
font-size: 14px;
font-weight: 500;
cursor: pointer;
transition: all 0.2s ease;
}
.submit-btn {
display: flex;
align-items: center;
gap: 4px;
background-color: #0e639c;
gap: 6px;
background-color: #2563eb;
color: #ffffff;
border: none;
border-radius: 4px;
padding: 4px 12px;
font-size: 13px;
border-radius: 6px;
padding: 8px 16px;
font-size: 14px;
font-weight: 500;
cursor: pointer;
transition: all 0.2s ease;
}
.run-btn:hover {
background-color: #4d4d4d;
.run-btn:hover:not(:disabled) {
background-color: #059669;
box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}
.submit-btn:hover {
background-color: #1177bb;
.submit-btn:hover:not(:disabled) {
background-color: #1d4ed8;
box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}
.run-btn:disabled,
.submit-btn:disabled {
opacity: 0.6;
cursor: not-allowed;
}
.loading-spinner {
display: inline-block;
width: 14px;
height: 14px;
border: 2px solid rgba(255, 255, 255, 0.3);
border-top-color: #ffffff;
border-radius: 50%;
animation: spin 0.6s linear infinite;
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}
.editor-container {
flex: 1;
background-color: #1e1e1e;
}
.terminal-section {
flex: 1;
display: flex;
flex-direction: column;
background-color: var(--vscode-panel-background);
padding-bottom: 30px; /* Reduced padding to keep buttons just above footer */
background-color: #ffffff;
border-top: 1px solid #e5e7eb;
position: relative;
}
.terminal-content-wrapper {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
}
.terminal-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 4px 12px;
background-color: #252526;
font-size: 13px;
padding: 0;
background-color: #f9fafb;
border-bottom: 1px solid #e5e7eb;
}
.terminal-tabs {
display: flex;
gap: 4px;
padding: 8px 16px;
}
.terminal-tab {
padding: 8px 16px;
background-color: transparent;
color: #6b7280;
border: none;
border-bottom: 2px solid transparent;
cursor: pointer;
font-size: 14px;
font-weight: 500;
transition: all 0.2s ease;
}
.terminal-tab:hover {
color: #374151;
background-color: #f3f4f6;
}
.terminal-tab-active {
color: #2563eb;
border-bottom-color: #2563eb;
background-color: transparent;
}
.terminal-controls {
display: flex;
gap: 4px;
padding-right: 16px;
}
.terminal-btn {
background-color: transparent;
color: #d4d4d4;
color: #6b7280;
border: none;
cursor: pointer;
font-size: 12px;
width: 20px;
height: 20px;
font-size: 14px;
width: 24px;
height: 24px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 4px;
transition: all 0.2s ease;
}
.terminal-btn:hover {
background-color: #e5e7eb;
color: #374151;
}
.terminal-content {
flex: 1;
padding: 8px 12px;
padding: 16px;
font-family: 'Consolas', 'Monaco', monospace;
font-size: 14px;
font-size: 13px;
overflow-y: auto;
overflow-x: hidden;
white-space: pre-wrap;
max-height: calc(100% - 10px); /* Ensure content doesn't expand beyond container */
background-color: #f9fafb;
scrollbar-width: thin;
scrollbar-color: #555555 #1e1e1e;
scrollbar-color: #d1d5db #f9fafb;
}
.terminal-placeholder {
color: #9ca3af;
font-style: italic;
text-align: center;
padding: 40px 20px;
}
.terminal-content::-webkit-scrollbar {
@@ -1369,37 +1766,120 @@ body {
}
.terminal-line {
margin-bottom: 4px;
line-height: 1.4;
margin-bottom: 6px;
line-height: 1.5;
color: #374151;
}
.terminal-line.system {
color: #569cd6;
color: #2563eb;
font-weight: 500;
}
.terminal-line.error {
color: #f48771;
color: #dc2626;
font-weight: 500;
}
.terminal-line.output {
color: #111827;
}
.terminal-prompt {
display: flex;
align-items: center;
margin-top: 8px;
background-color: #ffffff;
padding: 8px;
border-radius: 6px;
border: 1px solid #e5e7eb;
}
.prompt-symbol {
color: #569cd6;
color: #2563eb;
margin-right: 8px;
font-weight: 600;
}
.terminal-input {
background-color: transparent;
color: #d4d4d4;
color: #374151;
border: none;
outline: none;
flex: 1;
font-family: 'Consolas', 'Monaco', monospace;
font-size: 13px;
}
.terminal-footer {
display: flex;
justify-content: space-between;
align-items: center;
padding: 16px 24px;
background-color: #ffffff;
border-top: 1px solid #e5e7eb;
box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.05);
}
.terminal-footer-actions {
display: flex;
gap: 12px;
}
.footer-btn {
display: flex;
align-items: center;
gap: 6px;
padding: 10px 20px;
border-radius: 6px;
font-size: 14px;
font-weight: 500;
cursor: pointer;
transition: all 0.2s ease;
border: none;
}
.footer-btn-outline {
background-color: #ffffff;
color: #6b7280;
border: 1px solid #d1d5db;
}
.footer-btn-outline:hover {
background-color: #f3f4f6;
border-color: #9ca3af;
color: #374151;
}
.footer-btn-primary {
background-color: #2563eb;
color: #ffffff;
border: none;
}
.footer-btn-primary:hover {
background-color: #1d4ed8;
box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}
.footer-btn-success {
background-color: #10b981;
color: #ffffff;
border: none;
}
.footer-btn-success:hover {
background-color: #059669;
box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}
.changes-saved {
display: flex;
align-items: center;
gap: 6px;
color: #10b981;
font-size: 14px;
font-weight: 500;
}
/* Login Page Styles */