Skip to content

Commit 2e45b3b

Browse files
committed
Trying to fix colors
1 parent 8e0a731 commit 2e45b3b

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

script.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ let problemsData = {
44
vicutils: []
55
};
66

7+
const container = document.getElementById("container")
8+
9+
710
async function scanForProblems() {
811
const platforms = ['leetcode', 'kattis', 'vicutils'];
912

@@ -206,7 +209,7 @@ async function generatePage(platform, problem) {
206209
async function renderProblemPage(platform, problemName) {
207210
const problem = problemsData[platform]?.find(p => p.name === problemName);
208211
if (!problem) {
209-
document.body.innerHTML = '<div class="error">Item not found</div>';
212+
container.innerHTML = '<div class="error">Item not found</div>';
210213
return;
211214
}
212215

@@ -283,7 +286,7 @@ async function renderProblemPage(platform, problemName) {
283286

284287
pageContent += `</div>`;
285288

286-
document.body.innerHTML = pageContent;
289+
div.innerHTML = pageContent;
287290
document.title = `${pageTitle} - ${platformTitle}`;
288291

289292
if (!document.querySelector('link[rel="icon"]')) {
@@ -354,7 +357,7 @@ function addNavigationToCurrentPage() {
354357
<a href="../../index.html#${platform}" class="nav-btn">${platform.charAt(0).toUpperCase() + platform.slice(1)} Problems</a>
355358
</div>
356359
`;
357-
document.body.insertBefore(backButton, document.body.firstChild);
360+
container.insertBefore(backButton, container.firstChild);
358361
}
359362
}
360363

@@ -399,9 +402,3 @@ window.addEventListener('hashchange', () => {
399402
location.reload(); // Reload to show main page
400403
}
401404
});
402-
403-
// Recharger le script Highlight.js
404-
const script = document.createElement('script');
405-
script.src = 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js';
406-
script.onload = () => hljs.highlightAll();
407-
document.body.appendChild(script);

styles.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ h1 {
409409
color: #2d3748;
410410
}
411411

412-
/* .code-content {
412+
.code-content {
413413
background: #1e293b;
414414
color: #e2e8f0;
415415
padding: 1.5rem;
@@ -419,7 +419,7 @@ h1 {
419419
line-height: 1.6;
420420
white-space: pre-wrap;
421421
overflow-x: auto;
422-
} */
422+
}
423423

424424
@media (max-width: 768px) {
425425
.container {

0 commit comments

Comments
 (0)