Initial commit
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Frontend Judge</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/main.tsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "@frontend-judge/frontend",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite --host 0.0.0.0",
|
||||
"build": "tsc && vite build",
|
||||
"preview": "vite preview --host 0.0.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@codemirror/lang-css": "^6.3.1",
|
||||
"@codemirror/lang-html": "^6.4.9",
|
||||
"@codemirror/lang-javascript": "^6.2.2",
|
||||
"@uiw/react-codemirror": "^4.23.7",
|
||||
"lucide-react": "^0.468.0",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"react-markdown": "^9.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "^18.3.18",
|
||||
"@types/react-dom": "^18.3.5",
|
||||
"@vitejs/plugin-react": "^4.3.4",
|
||||
"typescript": "^5.7.2",
|
||||
"vite": "^6.0.5"
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,684 @@
|
||||
:root {
|
||||
color: #17202a;
|
||||
background: #f4f6f8;
|
||||
font-family:
|
||||
Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
button,
|
||||
input,
|
||||
select,
|
||||
textarea {
|
||||
font: inherit;
|
||||
}
|
||||
|
||||
button {
|
||||
border: 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
button:disabled {
|
||||
cursor: wait;
|
||||
opacity: 0.65;
|
||||
}
|
||||
|
||||
input,
|
||||
select,
|
||||
textarea {
|
||||
width: 100%;
|
||||
border: 1px solid #cbd5df;
|
||||
border-radius: 6px;
|
||||
padding: 0.65rem 0.75rem;
|
||||
background: #fff;
|
||||
color: #17202a;
|
||||
}
|
||||
|
||||
textarea {
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
label {
|
||||
display: grid;
|
||||
gap: 0.38rem;
|
||||
color: #405060;
|
||||
font-weight: 650;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
p {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.auth-shell {
|
||||
min-height: 100vh;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
padding: 2rem;
|
||||
}
|
||||
|
||||
.auth-panel {
|
||||
width: min(100%, 380px);
|
||||
display: grid;
|
||||
gap: 1rem;
|
||||
padding: 2rem;
|
||||
background: #fff;
|
||||
border: 1px solid #d8e0e8;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 16px 40px rgba(25, 34, 43, 0.08);
|
||||
}
|
||||
|
||||
.app-shell {
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.topbar {
|
||||
min-height: 76px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
padding: 1rem 1.5rem;
|
||||
background: #ffffff;
|
||||
border-bottom: 1px solid #d8e0e8;
|
||||
}
|
||||
|
||||
.topbar h1 {
|
||||
margin-bottom: 0.1rem;
|
||||
font-size: 1.35rem;
|
||||
}
|
||||
|
||||
.topbar p {
|
||||
margin-bottom: 0;
|
||||
color: #5b6b79;
|
||||
}
|
||||
|
||||
.student-layout,
|
||||
.admin-layout {
|
||||
display: grid;
|
||||
grid-template-columns: 290px minmax(0, 1fr);
|
||||
min-height: calc(100vh - 76px);
|
||||
}
|
||||
|
||||
.sidebar {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
padding: 1rem;
|
||||
background: #ffffff;
|
||||
border-right: 1px solid #d8e0e8;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.task-group {
|
||||
display: grid;
|
||||
gap: 0.45rem;
|
||||
}
|
||||
|
||||
.group-heading {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 0.45rem;
|
||||
}
|
||||
|
||||
.task-group h2 {
|
||||
margin: 0.4rem 0 0.2rem;
|
||||
font-size: 0.86rem;
|
||||
color: #617283;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.group-editor {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) 64px 38px 38px;
|
||||
gap: 0.35rem;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.group-editor input {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.task-link,
|
||||
.history-row {
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
padding: 0.65rem 0.7rem;
|
||||
border-radius: 6px;
|
||||
color: #23313d;
|
||||
background: #eef3f7;
|
||||
}
|
||||
|
||||
.task-link {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.task-link span {
|
||||
min-width: 0;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.task-link.active {
|
||||
background: #d7ecff;
|
||||
color: #0b4f81;
|
||||
}
|
||||
|
||||
.passed-task-icon {
|
||||
flex: 0 0 auto;
|
||||
color: #16814b;
|
||||
}
|
||||
|
||||
.workspace,
|
||||
.admin-main {
|
||||
padding: 1rem;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.task-description {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) 280px;
|
||||
gap: 1rem;
|
||||
padding: 1rem;
|
||||
background: #fff;
|
||||
border: 1px solid #d8e0e8;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.task-description img,
|
||||
.markdown-preview img,
|
||||
.expected-image {
|
||||
max-width: 100%;
|
||||
border: 1px solid #d8e0e8;
|
||||
border-radius: 6px;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.expected-image {
|
||||
width: 100%;
|
||||
align-self: start;
|
||||
}
|
||||
|
||||
.expected-thumb {
|
||||
position: relative;
|
||||
margin: 0;
|
||||
align-self: start;
|
||||
}
|
||||
|
||||
.expected-image-button {
|
||||
position: relative;
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
border-radius: 6px;
|
||||
background: #fff;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.expected-image-button:focus-visible {
|
||||
outline: 3px solid rgba(31, 122, 140, 0.35);
|
||||
outline-offset: 3px;
|
||||
}
|
||||
|
||||
.expected-image-action {
|
||||
position: absolute;
|
||||
right: 0.55rem;
|
||||
top: 0.55rem;
|
||||
display: inline-grid;
|
||||
place-items: center;
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
border: 1px solid rgba(21, 33, 43, 0.16);
|
||||
border-radius: 6px;
|
||||
background: rgba(255, 255, 255, 0.94);
|
||||
color: #17202a;
|
||||
box-shadow: 0 8px 24px rgba(21, 33, 43, 0.12);
|
||||
}
|
||||
|
||||
.expected-image.large {
|
||||
max-height: 320px;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.image-lightbox {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 50;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
padding: 1.5rem;
|
||||
background: rgba(14, 24, 33, 0.72);
|
||||
}
|
||||
|
||||
.image-lightbox-panel {
|
||||
width: min(1120px, 100%);
|
||||
max-height: calc(100vh - 3rem);
|
||||
display: grid;
|
||||
grid-template-rows: auto minmax(0, 1fr) auto;
|
||||
gap: 0.8rem;
|
||||
padding: 1rem;
|
||||
border-radius: 8px;
|
||||
background: #fff;
|
||||
box-shadow: 0 24px 80px rgba(8, 16, 24, 0.35);
|
||||
}
|
||||
|
||||
.image-lightbox-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.image-lightbox-header h2 {
|
||||
margin: 0;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.image-lightbox-panel img {
|
||||
width: 100%;
|
||||
max-height: calc(100vh - 11rem);
|
||||
object-fit: contain;
|
||||
border: 1px solid #d8e0e8;
|
||||
border-radius: 6px;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.image-lightbox-panel a {
|
||||
justify-self: start;
|
||||
color: #1f6f82;
|
||||
font-weight: 750;
|
||||
}
|
||||
|
||||
.work-grid {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(360px, 1fr) minmax(320px, 42%);
|
||||
gap: 1rem;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.editors,
|
||||
.preview-pane,
|
||||
.history,
|
||||
.result,
|
||||
.editor-section,
|
||||
.markdown-preview,
|
||||
.checks,
|
||||
.submissions-table,
|
||||
.submission-detail {
|
||||
display: grid;
|
||||
gap: 0.7rem;
|
||||
}
|
||||
|
||||
.editor-section,
|
||||
.preview-pane,
|
||||
.history,
|
||||
.result,
|
||||
.markdown-preview,
|
||||
.checks,
|
||||
.submissions-table {
|
||||
padding: 1rem;
|
||||
background: #fff;
|
||||
border: 1px solid #d8e0e8;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.section-title,
|
||||
.section-heading {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 0.45rem;
|
||||
color: #405060;
|
||||
font-weight: 750;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.preview-pane iframe {
|
||||
width: 100%;
|
||||
height: 360px;
|
||||
border: 1px solid #cbd5df;
|
||||
border-radius: 6px;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.submitted-preview {
|
||||
display: grid;
|
||||
gap: 0.7rem;
|
||||
}
|
||||
|
||||
.submitted-preview iframe {
|
||||
width: 100%;
|
||||
height: 420px;
|
||||
border: 1px solid #cbd5df;
|
||||
border-radius: 6px;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.primary,
|
||||
.secondary,
|
||||
.ghost,
|
||||
.danger,
|
||||
.icon,
|
||||
.upload-button {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 0.45rem;
|
||||
min-height: 38px;
|
||||
padding: 0.55rem 0.8rem;
|
||||
border-radius: 6px;
|
||||
font-weight: 750;
|
||||
}
|
||||
|
||||
.primary {
|
||||
background: #1f7a8c;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.secondary {
|
||||
background: #e8eef3;
|
||||
color: #24313d;
|
||||
}
|
||||
|
||||
.secondary:disabled svg {
|
||||
animation: spin 1s linear infinite;
|
||||
}
|
||||
|
||||
.ghost {
|
||||
background: transparent;
|
||||
color: #405060;
|
||||
}
|
||||
|
||||
.danger {
|
||||
background: #ffe5e5;
|
||||
color: #a4262c;
|
||||
}
|
||||
|
||||
.icon {
|
||||
width: 38px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.full,
|
||||
.submit {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.upload-button {
|
||||
position: relative;
|
||||
width: max-content;
|
||||
background: #e8eef3;
|
||||
color: #24313d;
|
||||
}
|
||||
|
||||
.upload-button input {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
opacity: 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.result.pass {
|
||||
border-color: #80c99a;
|
||||
}
|
||||
|
||||
.result.fail {
|
||||
border-color: #e7aa72;
|
||||
}
|
||||
|
||||
.check-row {
|
||||
display: grid;
|
||||
grid-template-columns: 24px minmax(0, 1fr);
|
||||
gap: 0.55rem;
|
||||
align-items: start;
|
||||
}
|
||||
|
||||
.check-row p {
|
||||
margin: 0.2rem 0 0;
|
||||
color: #5b6b79;
|
||||
}
|
||||
|
||||
.score-threshold,
|
||||
.check-weight {
|
||||
color: #607080;
|
||||
font-size: 0.9rem;
|
||||
font-weight: 650;
|
||||
}
|
||||
|
||||
.check-weight {
|
||||
display: inline-block;
|
||||
margin-left: 0.5rem;
|
||||
}
|
||||
|
||||
.visual-diff {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
gap: 1rem;
|
||||
margin-top: 0.4rem;
|
||||
}
|
||||
|
||||
.comparison-image {
|
||||
display: grid;
|
||||
gap: 0.4rem;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.comparison-image figcaption {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 0.75rem;
|
||||
color: #405060;
|
||||
font-weight: 750;
|
||||
}
|
||||
|
||||
.comparison-image a {
|
||||
color: #1f7a8c;
|
||||
font-size: 0.9rem;
|
||||
font-weight: 750;
|
||||
}
|
||||
|
||||
.comparison-image-link {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.comparison-image img {
|
||||
width: 100%;
|
||||
max-height: 560px;
|
||||
object-fit: contain;
|
||||
border: 1px solid #d8e0e8;
|
||||
border-radius: 6px;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.history-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 0.8rem;
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
align-content: center;
|
||||
gap: 0.5rem;
|
||||
min-height: calc(100vh - 76px);
|
||||
color: #5b6b79;
|
||||
}
|
||||
|
||||
.form-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 2fr 1.4fr 0.55fr 0.75fr 0.75fr;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.wide {
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.asset-tools,
|
||||
.action-row,
|
||||
.inline-form {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.6rem;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.inline-form {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.split-preview {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) 340px;
|
||||
gap: 1rem;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.three-columns {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
gap: 1rem;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.submitted-code {
|
||||
display: grid;
|
||||
gap: 0.7rem;
|
||||
}
|
||||
|
||||
.submitted-code h3 {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.check-editor {
|
||||
display: grid;
|
||||
grid-template-columns: 170px repeat(5, minmax(96px, 1fr)) 38px;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.message-input {
|
||||
grid-column: span 2;
|
||||
}
|
||||
|
||||
.submission-row {
|
||||
display: grid;
|
||||
grid-template-columns: 160px minmax(0, 1fr) 120px 190px;
|
||||
gap: 0.8rem;
|
||||
width: 100%;
|
||||
padding: 0.65rem 0;
|
||||
border-bottom: 1px solid #e1e7ed;
|
||||
border-radius: 0;
|
||||
background: transparent;
|
||||
color: #17202a;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.submission-row.active {
|
||||
background: #edf7fb;
|
||||
border-radius: 6px;
|
||||
padding-inline: 0.65rem;
|
||||
}
|
||||
|
||||
.submission-detail {
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.submission-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.muted {
|
||||
color: #6b7a88;
|
||||
}
|
||||
|
||||
.error {
|
||||
color: #a4262c;
|
||||
}
|
||||
|
||||
.error-notice {
|
||||
display: grid;
|
||||
gap: 0.5rem;
|
||||
margin-top: 1rem;
|
||||
padding: 0.85rem 1rem;
|
||||
border: 1px solid #e6a3a3;
|
||||
border-radius: 6px;
|
||||
background: #fff4f4;
|
||||
color: #7f1d1d;
|
||||
}
|
||||
|
||||
.error-notice ul {
|
||||
margin: 0;
|
||||
padding-left: 1.15rem;
|
||||
}
|
||||
|
||||
.error-notice li + li {
|
||||
margin-top: 0.25rem;
|
||||
}
|
||||
|
||||
.success {
|
||||
color: #167142;
|
||||
font-weight: 750;
|
||||
}
|
||||
|
||||
.cm-editor {
|
||||
border: 1px solid #d8e0e8;
|
||||
border-radius: 6px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@media (max-width: 1050px) {
|
||||
.student-layout,
|
||||
.admin-layout,
|
||||
.work-grid,
|
||||
.task-description,
|
||||
.split-preview {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.sidebar {
|
||||
border-right: 0;
|
||||
border-bottom: 1px solid #d8e0e8;
|
||||
}
|
||||
|
||||
.three-columns,
|
||||
.form-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.check-editor,
|
||||
.submission-row,
|
||||
.visual-diff {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.submission-actions {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"useDefineForClassFields": true,
|
||||
"lib": ["DOM", "DOM.Iterable", "ES2020"],
|
||||
"allowJs": false,
|
||||
"skipLibCheck": true,
|
||||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"strict": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Node",
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"noEmit": true,
|
||||
"jsx": "react-jsx"
|
||||
},
|
||||
"include": ["src"],
|
||||
"references": []
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { defineConfig } from "vite";
|
||||
import react from "@vitejs/plugin-react";
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
server: {
|
||||
port: 5173,
|
||||
proxy: {
|
||||
"/api": "http://localhost:4000",
|
||||
"/generated": "http://localhost:4000"
|
||||
}
|
||||
},
|
||||
build: {
|
||||
outDir: "dist"
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user