Compare commits

...

2 Commits

Author SHA1 Message Date
waifu fdeef6efae NTR'd markdown parser 7 months ago
waifu 2396ac9cbd library 7 months ago
  1. 42
      home/library/index.html
  2. 49
      home/library/styles.css
  3. 6
      libs/marked.min.js

@ -3,9 +3,47 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>library</title>
<title>Library | waifuism.life</title>
<link rel="stylesheet" href="styles.css">
<script src="/libs/marked.min.js"></script>
</head>
<body>
Test
<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>
</body>
</html>

@ -0,0 +1,49 @@
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background-color: #f0f0f0;
}
.window {
display: flex;
width: 60%;
height: 60%;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
background-color: white;
border-radius: 8px;
}
.nav {
width: 25%;
background-color: #50372c;
color: white;
display: flex;
flex-direction: column;
align-items: center;
padding: 20px;
border-top-left-radius: 8px;
border-bottom-left-radius: 8px;
}
.nav button {
width: 100%;
margin: 10px 0;
padding: 10px;
border: none;
border-radius: 4px;
background-color: #7e5b53;
color: white;
cursor: pointer;
transition: background-color 0.3s;
}
.nav button:hover {
background-color: #1abc9c;
}
.content {
width: 75%;
padding: 20px;
border-top-right-radius: 8px;
border-bottom-right-radius: 8px;
overflow-y: auto;
}

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save