This commit is contained in:
2025-08-12 20:42:26 +02:00
parent c1ef310f6a
commit 1374cb9cb1
23 changed files with 6 additions and 6 deletions

185
src/static/index.css Normal file
View File

@@ -0,0 +1,185 @@
:root {
--bg: #f6f8fb;
--card: #fff;
--muted: #6b7280;
--accent: #2563eb;
--shadow: 0 4px 12px rgba(16, 24, 40, 0.06);
--radius: 8px;
--mono: 'JetBrains Mono', monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
height: 100%;
}
body {
font-family: Inter, sans-serif;
background: var(--bg);
color: #0f172a;
padding: 16px;
display: flex;
justify-content: center;
align-items: center;
}
.wrap {
width: 100%;
max-width: 1100px;
}
header {
margin-bottom: 14px;
}
header h1 {
font-size: 1.6rem;
color: #111827;
}
header p {
color: var(--muted);
font-size: 0.9rem;
}
.content {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 12px;
}
.content.single-column {
grid-template-columns: 1fr;
}
.card {
background: var(--card);
border-radius: var(--radius);
box-shadow: var(--shadow);
padding: 12px;
}
/* Search/filter controls */
.search-controls {
margin-bottom: 12px;
display: flex;
gap: 8px;
}
.search-input {
flex: 1;
padding: 6px 10px;
border: 1px solid #e5e7eb;
border-radius: 4px;
font-size: 0.9rem;
}
.filter-select {
padding: 6px 8px;
border: 1px solid #e5e7eb;
border-radius: 4px;
font-size: 0.9rem;
background: white;
}
/* Problems list */
.problems-list .problem-item {
padding: 8px;
border-bottom: 1px solid #e5e7eb;
display: flex;
justify-content: space-between;
align-items: center;
}
.problem-item:last-child {
border-bottom: none;
}
.problem-item a {
text-decoration: none;
color: #0077ff;
font-weight: 600;
}
/* Difficulty badge */
.difficulty {
display: inline-flex;
align-items: center;
padding: 0.25em 0.6em;
border-radius: 10px;
font-size: 0.85em;
font-weight: bold;
text-transform: uppercase;
color: white;
white-space: nowrap;
}
.difficulty[data-difficulty="easy"] {
background-color: #4CAF50; /* Green */
}
.difficulty[data-difficulty="medium"] {
background-color: #FFC107; /* Amber */
color: #333;
}
.difficulty[data-difficulty="hard"] {
background-color: #F44336; /* Red */
}
/* Leaderboard */
.leaderboard-head {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 6px;
}
.leaderboard-controls {
display: flex;
gap: 8px;
margin-bottom: 12px;
}
.leaderboard-table {
width: 100%;
border-collapse: collapse;
font-size: 0.9rem;
}
.leaderboard-table th,
.leaderboard-table td {
padding: 6px 8px;
border-bottom: 1px solid #e5e7eb;
text-align: left;
}
.leaderboard-table th {
background: #f9fafb;
font-weight: 600;
color: var(--muted);
}
.leaderboard-table tr:hover {
background: #f3f4f6;
}
/* Sort indicators */
.sortable {
cursor: pointer;
position: relative;
padding-right: 16px;
}
.sortable::after {
content: "↕";
position: absolute;
right: 4px;
top: 50%;
transform: translateY(-50%);
font-size: 0.8em;
opacity: 0.5;
}
.sort-asc::after {
content: "↑";
opacity: 1;
}
.sort-desc::after {
content: "↓";
opacity: 1;
}
/* Toggle button */
.btn {
border: none;
background: transparent;
cursor: pointer;
color: var(--accent);
font-size: 0.85rem;
padding: 4px 6px;
border-radius: 4px;
}
.btn:hover {
background: rgba(37, 99, 235, 0.08);
}
.btn.active {
background: rgba(37, 99, 235, 0.15);
}
@media (max-width: 800px) {
.content { grid-template-columns: 1fr; }
.leaderboard-controls {
flex-direction: column;
}
}

260
src/static/style.css Normal file
View File

@@ -0,0 +1,260 @@
/* Reset and base styles */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
line-height: 1.6;
color: #333;
background-color: #f8f9fa;
padding: 20px;
max-width: 1200px;
margin: 0 auto;
}
/* Main heading */
h1 {
color: #2c3e50;
margin-bottom: -10px;
padding-bottom: 3px;
border-bottom: 3px solid #3498db;
font-size: 2.2em;
}
h2 {
color: #34495e;
margin: 30px 0 20px 0;
font-size: 1.5em;
}
h3 {
color: #34495e;
margin: 25px 0 15px 0;
font-size: 1.3em;
}
/* Links and buttons */
a {
color: #3498db;
text-decoration: none;
padding: 8px 16px;
border-radius: 5px;
transition: background-color 0.3s ease;
}
a:hover {
background-color: #e3f2fd;
text-decoration: none;
}
/* Primary action link (Submit New Problem) */
a[href="/problem/new"] {
background-color: #3498db;
color: white;
font-weight: 600;
margin-bottom: 30px;
display: inline-block;
padding: 12px 24px;
border-radius: 8px;
}
a[href="/problem/new"]:hover {
background-color: #2980b9;
}
/* Problem list */
ul {
list-style: none;
background: white;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
padding: 25px;
margin: 20px 0;
}
li {
padding: 15px 0;
border-bottom: 1px solid #eee;
}
li:last-child {
border-bottom: none;
}
li a {
display: block;
padding: 12px 20px;
margin: -12px -20px;
border-radius: 6px;
font-size: 1.1em;
}
li a:hover {
background-color: #f8f9fa;
transform: translateX(5px);
transition: all 0.2s ease;
}
/* Problem page specific styles */
.problem-header {
display: flex;
align-items: center;
margin-bottom: 30px;
gap: 20px;
}
.back-btn {
background-color: #95a5a6;
color: white;
border: none;
padding: 10px 20px;
border-radius: 6px;
cursor: pointer;
font-size: 14px;
font-weight: 500;
transition: background-color 0.3s ease;
}
.back-btn:hover {
background-color: #7f8c8d;
}
.problem-desc {
background: white;
padding: 30px;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
margin-bottom: 30px;
font-size: 1.1em;
line-height: 1.7;
}
/* Editor section */
.editor-section {
background: white;
padding: 30px;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
margin-bottom: 30px;
}
#editor {
border: 2px solid #ddd;
border-radius: 8px;
margin: 20px 0;
height: 400px;
overflow: hidden;
}
.editor-actions {
margin-top: 20px;
text-align: right;
}
form button[type="submit"] {
background-color: #27ae60;
color: white;
border: none;
padding: 12px 30px;
border-radius: 8px;
cursor: pointer;
font-size: 16px;
font-weight: 600;
transition: background-color 0.3s ease;
}
form button[type="submit"]:hover {
background-color: #229954;
}
/* Results section */
b {
color: #2c3e50;
display: inline-block;
margin: 10px 0 5px 0;
}
pre {
background-color: #f4f4f4;
padding: 20px;
border-radius: 6px;
border-left: 4px solid #3498db;
margin: 10px 0 20px 0;
overflow-x: auto;
font-family: 'JetBrains Mono', 'Courier New', monospace;
font-size: 14px;
line-height: 1.4;
}
pre[style*="color:red"] {
border-left-color: #e74c3c;
background-color: #fdf2f2;
}
/* Status messages */
p[style*="color:green"] {
background-color: #d4edda;
color: #155724;
padding: 15px 20px;
border-radius: 6px;
border-left: 4px solid #27ae60;
margin: 20px 0;
font-weight: 600;
}
p[style*="color:red"] {
background-color: #f8d7da;
color: #721c24;
padding: 15px 20px;
border-radius: 6px;
border-left: 4px solid #e74c3c;
margin: 20px 0;
font-weight: 600;
}
/* Back to Problems link */
a[href="/"] {
display: inline-block;
margin-top: 30px;
background-color: #6c757d;
color: white;
padding: 10px 20px;
border-radius: 6px;
font-weight: 500;
}
a[href="/"]:hover {
background-color: #5a6268;
}
/* Responsive design */
@media (max-width: 768px) {
body {
padding: 15px;
}
.problem-header {
flex-direction: column;
align-items: flex-start;
gap: 15px;
}
h1 {
font-size: 1.8em;
}
.problem-desc, .editor-section, ul {
padding: 20px;
}
#editor {
height: 300px;
}
.editor-actions {
text-align: center;
}
}