semi working darkmode

This commit is contained in:
2025-08-16 21:44:29 +02:00
parent 68b7b81741
commit 57a7b0e68f
7 changed files with 928 additions and 456 deletions

View File

@@ -1,3 +1,49 @@
:root {
--bg: #f8f9fa;
--card: #fff;
--text: #333;
--heading: #2c3e50;
--heading-secondary: #34495e;
--accent: #3498db;
--accent-hover: #2980b9;
--success: #27ae60;
--success-hover: #229954;
--error: #e74c3c;
--muted: #6c757d;
--muted-hover: #5a6268;
--border: #ddd;
--code-bg: #f4f4f4;
--success-bg: #d4edda;
--success-text: #155724;
--error-bg: #f8d7da;
--error-text: #721c24;
--hover-bg: #e3f2fd;
--shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
html.dark {
--bg: #0f172a;
--card: #1e293b;
--text: #f1f5f9;
--heading: #3b82f6;
--heading-secondary: #94a3b8;
--accent: #3b82f6;
--accent-hover: #2563eb;
--success: #22c55e;
--success-hover: #16a34a;
--error: #ef4444;
--muted: #64748b;
--muted-hover: #475569;
--border: #334155;
--code-bg: #1e293b;
--success-bg: #065f46;
--success-text: #d1fae5;
--error-bg: #7f1d1d;
--error-text: #fecaca;
--hover-bg: #1e40af;
--shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
/* Reset and base styles */
* {
margin: 0;
@@ -6,39 +52,43 @@
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
font-family:
-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
line-height: 1.6;
color: #333;
background-color: #f8f9fa;
color: var(--text);
background-color: var(--bg);
padding: 20px;
max-width: 1200px;
margin: 0 auto;
transition:
background-color 0.3s ease,
color 0.3s ease;
}
/* Main heading */
h1 {
color: #2c3e50;
color: var(--heading);
margin-bottom: -10px;
padding-bottom: 3px;
border-bottom: 3px solid #3498db;
border-bottom: 3px solid var(--accent);
font-size: 2.2em;
}
h2 {
color: #34495e;
color: var(--heading-secondary);
margin: 30px 0 20px 0;
font-size: 1.5em;
}
h3 {
color: #34495e;
color: var(--heading-secondary);
margin: 25px 0 15px 0;
font-size: 1.3em;
}
/* Links and buttons */
a {
color: #3498db;
color: var(--accent);
text-decoration: none;
padding: 8px 16px;
border-radius: 5px;
@@ -46,13 +96,13 @@ a {
}
a:hover {
background-color: #e3f2fd;
background-color: var(--hover-bg);
text-decoration: none;
}
/* Primary action link (Submit New Problem) */
a[href="/problem/new"] {
background-color: #3498db;
background-color: var(--accent);
color: white;
font-weight: 600;
margin-bottom: 30px;
@@ -62,22 +112,23 @@ a[href="/problem/new"] {
}
a[href="/problem/new"]:hover {
background-color: #2980b9;
background-color: var(--accent-hover);
}
/* Problem list */
ul {
list-style: none;
background: white;
background: var(--card);
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
box-shadow: var(--shadow);
padding: 25px;
margin: 20px 0;
transition: background-color 0.3s ease;
}
li {
padding: 15px 0;
border-bottom: 1px solid #eee;
border-bottom: 1px solid var(--border);
}
li:last-child {
@@ -93,7 +144,7 @@ li a {
}
li a:hover {
background-color: #f8f9fa;
background-color: var(--hover-bg);
transform: translateX(5px);
transition: all 0.2s ease;
}
@@ -107,7 +158,7 @@ li a:hover {
}
.back-btn {
background-color: #95a5a6;
background-color: var(--muted);
color: white;
border: none;
padding: 10px 20px;
@@ -119,30 +170,32 @@ li a:hover {
}
.back-btn:hover {
background-color: #7f8c8d;
background-color: var(--muted-hover);
}
.problem-desc {
background: white;
background: var(--card);
padding: 30px;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
box-shadow: var(--shadow);
margin-bottom: 30px;
font-size: 1.1em;
line-height: 1.7;
transition: background-color 0.3s ease;
}
/* Editor section */
.editor-section {
background: white;
background: var(--card);
padding: 30px;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
box-shadow: var(--shadow);
margin-bottom: 30px;
transition: background-color 0.3s ease;
}
#editor {
border: 2px solid #ddd;
border: 2px solid var(--border);
border-radius: 8px;
margin: 20px 0;
height: 400px;
@@ -155,7 +208,7 @@ li a:hover {
}
form button[type="submit"] {
background-color: #27ae60;
background-color: var(--success);
color: white;
border: none;
padding: 12px 30px;
@@ -167,50 +220,52 @@ form button[type="submit"] {
}
form button[type="submit"]:hover {
background-color: #229954;
background-color: var(--success-hover);
}
/* Results section */
b {
color: #2c3e50;
color: var(--heading);
display: inline-block;
margin: 10px 0 5px 0;
}
pre {
background-color: #f4f4f4;
background-color: var(--code-bg);
padding: 20px;
border-radius: 6px;
border-left: 4px solid #3498db;
border-left: 4px solid var(--accent);
margin: 10px 0 20px 0;
overflow-x: auto;
font-family: 'JetBrains Mono', 'Courier New', monospace;
font-family: "JetBrains Mono", "Courier New", monospace;
font-size: 14px;
line-height: 1.4;
border: 1px solid var(--border);
transition: background-color 0.3s ease;
}
pre[style*="color:red"] {
border-left-color: #e74c3c;
background-color: #fdf2f2;
border-left-color: var(--error);
background-color: var(--error-bg);
}
/* Status messages */
p[style*="color:green"] {
background-color: #d4edda;
color: #155724;
background-color: var(--success-bg);
color: var(--success-text);
padding: 15px 20px;
border-radius: 6px;
border-left: 4px solid #27ae60;
border-left: 4px solid var(--success);
margin: 20px 0;
font-weight: 600;
}
p[style*="color:red"] {
background-color: #f8d7da;
color: #721c24;
background-color: var(--error-bg);
color: var(--error-text);
padding: 15px 20px;
border-radius: 6px;
border-left: 4px solid #e74c3c;
border-left: 4px solid var(--error);
margin: 20px 0;
font-weight: 600;
}
@@ -219,7 +274,7 @@ p[style*="color:red"] {
a[href="/"] {
display: inline-block;
margin-top: 30px;
background-color: #6c757d;
background-color: var(--muted);
color: white;
padding: 10px 20px;
border-radius: 6px;
@@ -227,7 +282,7 @@ a[href="/"] {
}
a[href="/"]:hover {
background-color: #5a6268;
background-color: var(--muted-hover);
}
/* Responsive design */
@@ -235,25 +290,27 @@ a[href="/"]:hover {
body {
padding: 15px;
}
.problem-header {
flex-direction: column;
align-items: flex-start;
gap: 15px;
}
h1 {
font-size: 1.8em;
}
.problem-desc, .editor-section, ul {
.problem-desc,
.editor-section,
ul {
padding: 20px;
}
#editor {
height: 300px;
}
.editor-actions {
text-align: center;
}