Spaces:
Running
Running
Update index.html
Browse files- index.html +12 -2
index.html
CHANGED
|
@@ -7,6 +7,8 @@
|
|
| 7 |
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
<link href="https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300&family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,700;1,9..144,300&display=swap" rel="stylesheet">
|
| 9 |
<script src="https://cdnjs.cloudflare.com/ajax/libs/marked/11.2.0/marked.min.js"></script>
|
|
|
|
|
|
|
| 10 |
<script>
|
| 11 |
tailwind.config = {
|
| 12 |
theme: {
|
|
@@ -176,6 +178,7 @@ tailwind.config = {
|
|
| 176 |
</style>
|
| 177 |
</head>
|
| 178 |
<body class="h-screen flex overflow-hidden">
|
|
|
|
| 179 |
<!-- Privacy notice -->
|
| 180 |
<div id="privacy-modal" class="fixed inset-0 z-50 flex items-center justify-center bg-black/70 backdrop-blur-sm">
|
| 181 |
<div class="bg-smoke border border-ash rounded-xl p-6 max-w-sm w-full mx-4 shadow-2xl">
|
|
@@ -594,6 +597,9 @@ function toggleTheme() {
|
|
| 594 |
document.getElementById('theme-icon-dark').classList.toggle('hidden', isLight);
|
| 595 |
document.getElementById('theme-icon-light').classList.toggle('hidden', !isLight);
|
| 596 |
localStorage.setItem('nexus_theme', isLight ? 'light' : 'dark');
|
|
|
|
|
|
|
|
|
|
| 597 |
}
|
| 598 |
// ββ Settings βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 599 |
function saveSettings() {
|
|
@@ -775,7 +781,11 @@ function renderMarkdown(text) {
|
|
| 775 |
if (!text) return '';
|
| 776 |
try {
|
| 777 |
marked.setOptions({ breaks: true, gfm: true });
|
| 778 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 779 |
} catch(e) {
|
| 780 |
return escHtml(text).replace(/\n/g, '<br>');
|
| 781 |
}
|
|
@@ -1040,4 +1050,4 @@ function closeSidebar() {
|
|
| 1040 |
init();
|
| 1041 |
</script>
|
| 1042 |
</body>
|
| 1043 |
-
</html>
|
|
|
|
| 7 |
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
<link href="https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300&family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,700;1,9..144,300&display=swap" rel="stylesheet">
|
| 9 |
<script src="https://cdnjs.cloudflare.com/ajax/libs/marked/11.2.0/marked.min.js"></script>
|
| 10 |
+
<link id="hljs-theme" rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github-dark.min.css">
|
| 11 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
|
| 12 |
<script>
|
| 13 |
tailwind.config = {
|
| 14 |
theme: {
|
|
|
|
| 178 |
</style>
|
| 179 |
</head>
|
| 180 |
<body class="h-screen flex overflow-hidden">
|
| 181 |
+
|
| 182 |
<!-- Privacy notice -->
|
| 183 |
<div id="privacy-modal" class="fixed inset-0 z-50 flex items-center justify-center bg-black/70 backdrop-blur-sm">
|
| 184 |
<div class="bg-smoke border border-ash rounded-xl p-6 max-w-sm w-full mx-4 shadow-2xl">
|
|
|
|
| 597 |
document.getElementById('theme-icon-dark').classList.toggle('hidden', isLight);
|
| 598 |
document.getElementById('theme-icon-light').classList.toggle('hidden', !isLight);
|
| 599 |
localStorage.setItem('nexus_theme', isLight ? 'light' : 'dark');
|
| 600 |
+
document.getElementById('hljs-theme').href = isLight
|
| 601 |
+
? 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github.min.css'
|
| 602 |
+
: 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github-dark.min.css';
|
| 603 |
}
|
| 604 |
// ββ Settings βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 605 |
function saveSettings() {
|
|
|
|
| 781 |
if (!text) return '';
|
| 782 |
try {
|
| 783 |
marked.setOptions({ breaks: true, gfm: true });
|
| 784 |
+
const html = marked.parse(text);
|
| 785 |
+
const wrapper = document.createElement('div');
|
| 786 |
+
wrapper.innerHTML = html;
|
| 787 |
+
wrapper.querySelectorAll('pre code').forEach(block => hljs.highlightElement(block));
|
| 788 |
+
return wrapper.innerHTML;
|
| 789 |
} catch(e) {
|
| 790 |
return escHtml(text).replace(/\n/g, '<br>');
|
| 791 |
}
|
|
|
|
| 1050 |
init();
|
| 1051 |
</script>
|
| 1052 |
</body>
|
| 1053 |
+
</html>
|