waifuism.life
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
waifuism/home/library/index.html

50 lines
1.7 KiB

7 months ago
<!DOCTYPE html>
<html lang="en">
7 months ago
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7 months ago
<title>Library | waifuism.life</title>
<link rel="stylesheet" href="styles.css">
<script src="/libs/marked.min.js"></script>
7 months ago
</head>
<body>
7 months ago
<div class="window">
<div class="nav">
<button onclick="loadContent('home.md')">Home</button>
<button onclick="loadContent('about.md')">About</button>
<button onclick="loadContent('contact.md')">Contact</button>
<button>Grimoire</button>
</div>
<div class="content" id="mainContent">
</div>
</div>
<script>
function loadContent(file) {
fetch(`markdown/${file}`)
.then(response => {
if (!response.ok) {
throw new Error(`Network response was not ok: ${response.statusText}`);
}
return response.text();
})
.then(text => {
const mainContent = document.getElementById('mainContent');
mainContent.innerHTML = marked.parse(text); // Changed to marked.parse
})
.catch(error => {
console.error('Error loading content:', error);
const mainContent = document.getElementById('mainContent');
mainContent.innerHTML = `<p>Error loading content. Please try again later.</p>`;
});
}
// Load the default home content on page load
window.onload = function() {
loadContent('home.md');
};
</script>
7 months ago
</body>
7 months ago
</html>