Implement Code Challenge component with styling and WebSocket integration

This commit is contained in:
ishikabhoyar
2025-07-22 15:26:54 +05:30
parent e61bd7cfca
commit e12bbcfc6a
4 changed files with 1017 additions and 2 deletions

View File

@@ -1025,4 +1025,286 @@ body {
.panel-close-btn:hover {
opacity: 1;
}
/* Code Challenge Component Styles */
.code-challenge-container {
display: flex;
flex-direction: column;
height: 100vh;
background-color: var(--vscode-background);
color: var(--vscode-foreground);
}
.code-challenge-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 8px 16px;
background-color: var(--vscode-background);
border-bottom: 1px solid rgba(128, 128, 128, 0.35);
}
.code-challenge-header h1 {
margin: 0;
font-size: 18px;
font-weight: 400;
}
.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;
font-size: 14px;
cursor: pointer;
}
.sign-in-btn:hover {
background-color: rgba(255, 255, 255, 0.05);
}
.code-challenge-problem-nav {
padding: 8px 16px;
border-bottom: 1px solid rgba(128, 128, 128, 0.35);
}
.problem-number {
margin: 0;
font-size: 16px;
font-weight: 400;
}
.code-challenge-main {
display: flex;
height: 60vh;
border-bottom: 1px solid rgba(128, 128, 128, 0.35);
}
.problem-tabs {
display: flex;
flex-direction: column;
width: 130px;
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;
cursor: pointer;
border-bottom: 1px solid rgba(128, 128, 128, 0.2);
}
.problem-tabs button.tab-active {
background-color: var(--vscode-background);
font-weight: 500;
border-left: 2px solid #007acc;
}
.problem-tabs button:hover:not(.tab-active) {
background-color: rgba(255, 255, 255, 0.05);
}
.problem-content {
flex: 1;
overflow-y: auto;
padding: 16px;
border-right: 1px solid rgba(128, 128, 128, 0.35);
width: 50%;
}
.problem-container h1 {
margin-top: 0;
font-size: 22px;
margin-bottom: 16px;
}
.problem-description {
margin-bottom: 20px;
font-size: 14px;
line-height: 1.5;
}
.problem-examples h2 {
font-size: 16px;
margin-top: 24px;
margin-bottom: 12px;
}
.example-box {
background-color: rgba(0, 0, 0, 0.3);
padding: 12px;
border-radius: 6px;
margin-bottom: 12px;
font-family: 'Consolas', 'Monaco', monospace;
font-size: 14px;
line-height: 1.5;
}
.editor-section {
width: 50%;
display: flex;
flex-direction: column;
}
.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);
}
.editor-controls {
display: flex;
align-items: center;
}
.language-selector {
background-color: #3c3c3c;
color: #d4d4d4;
border: 1px solid #3c3c3c;
border-radius: 4px;
padding: 4px 8px;
font-size: 13px;
margin-right: 8px;
}
.auto-btn {
background-color: #3c3c3c;
color: #d4d4d4;
border: none;
border-radius: 4px;
padding: 4px 12px;
font-size: 13px;
cursor: pointer;
}
.auto-selected {
background-color: #4d4d4d;
}
.editor-actions {
display: flex;
gap: 8px;
}
.run-btn {
display: flex;
align-items: center;
gap: 4px;
background-color: #3c3c3c;
color: #d4d4d4;
border: none;
border-radius: 4px;
padding: 4px 12px;
font-size: 13px;
cursor: pointer;
}
.submit-btn {
display: flex;
align-items: center;
gap: 4px;
background-color: #0e639c;
color: #ffffff;
border: none;
border-radius: 4px;
padding: 4px 12px;
font-size: 13px;
cursor: pointer;
}
.run-btn:hover {
background-color: #4d4d4d;
}
.submit-btn:hover {
background-color: #1177bb;
}
.editor-container {
flex: 1;
}
.terminal-section {
flex: 1;
display: flex;
flex-direction: column;
background-color: var(--vscode-panel-background);
}
.terminal-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 4px 12px;
background-color: #252526;
font-size: 13px;
}
.terminal-controls {
display: flex;
gap: 4px;
}
.terminal-btn {
background-color: transparent;
color: #d4d4d4;
border: none;
cursor: pointer;
font-size: 12px;
width: 20px;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
}
.terminal-content {
flex: 1;
padding: 8px 12px;
font-family: 'Consolas', 'Monaco', monospace;
font-size: 14px;
overflow-y: auto;
white-space: pre-wrap;
}
.terminal-line {
margin-bottom: 4px;
line-height: 1.4;
}
.terminal-line.system {
color: #569cd6;
}
.terminal-line.error {
color: #f48771;
}
.terminal-prompt {
display: flex;
align-items: center;
margin-top: 8px;
}
.prompt-symbol {
color: #569cd6;
margin-right: 8px;
}
.terminal-input {
background-color: transparent;
color: #d4d4d4;
border: none;
outline: none;
flex: 1;
font-family: 'Consolas', 'Monaco', monospace;
font-size: 14px;
}