chore: fixes
This commit is contained in:
parent
77a445393f
commit
0b69096d76
1 changed files with 18 additions and 23 deletions
41
legacy.html
41
legacy.html
|
|
@ -110,6 +110,7 @@ function showMembers(event) {
|
|||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
function showAbout(event) {
|
||||
if (event) event.preventDefault();
|
||||
|
||||
|
|
@ -126,37 +127,31 @@ function showAbout(event) {
|
|||
const temp = document.createElement("div");
|
||||
temp.innerHTML = html;
|
||||
|
||||
const article = temp.querySelector("article.home-text.text-containers-secondary-bg");
|
||||
const section = temp.querySelector("#aboutSection");
|
||||
|
||||
if (!article) {
|
||||
target.innerHTML = "<h2>About</h2><p>Missing article.home-text.text-containers-secondary-bg in about.html</p>";
|
||||
return;
|
||||
}
|
||||
|
||||
// Convert children so we can get everything after the article
|
||||
const children = Array.from(temp.children);
|
||||
const index = children.indexOf(article);
|
||||
|
||||
let afterArticle = "";
|
||||
|
||||
if (index !== -1) {
|
||||
afterArticle = children
|
||||
.slice(index + 1)
|
||||
.map(el => el.outerHTML)
|
||||
.join("");
|
||||
}
|
||||
|
||||
target.innerHTML = `
|
||||
${article.outerHTML}
|
||||
${afterArticle}
|
||||
`;
|
||||
target.innerHTML = section
|
||||
? section.innerHTML
|
||||
: "<h2>About</h2><p>Missing #aboutSection in about.html</p>";
|
||||
})
|
||||
.catch(err => {
|
||||
console.error(err);
|
||||
target.innerHTML = "<h2>About</h2><p>Error loading page</p>";
|
||||
});
|
||||
}
|
||||
|
||||
function showCode(event) {
|
||||
if (event) event.preventDefault();
|
||||
|
||||
document.getElementById("content").innerHTML = `
|
||||
<div class="text-containers-main-bg content-box">
|
||||
<center><h2>Code</h2></center>
|
||||
<p>Project repositories and experiments will be listed here.</p>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
start about on line under home-text text-containers-secondary-bg
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue