Skip to content

Commit

Permalink
Merge pull request #10 from NGSpace/release
Browse files Browse the repository at this point in the history
Release hudder wiki
  • Loading branch information
NGSpace authored Aug 17, 2024
2 parents 6935bb1 + 131b6b8 commit 0b2a587
Show file tree
Hide file tree
Showing 10 changed files with 1,028 additions and 201 deletions.
Binary file modified Images/Info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/Warning.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
440 changes: 296 additions & 144 deletions wiki/base.html

Large diffs are not rendered by default.

224 changes: 178 additions & 46 deletions wiki/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ document.addEventListener("DOMContentLoaded", function (event) {
gtag('config', 'G-M0SCB1X0YP');
</script>
<style>
#topbar {
#topbar {
background-color: #101010;
position: fixed;
width: 100%;
Expand All @@ -39,8 +39,8 @@ document.addEventListener("DOMContentLoaded", function (event) {
color: lightgray;
font-family: "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
font-size: 20px;
width: calc(79% - 3px);
left: 20%;
width: calc(84% - 3px);
left: 15%;
padding-top: 15vh;
padding-left: 1%;
text-wrap: wrap;
Expand All @@ -53,47 +53,47 @@ document.addEventListener("DOMContentLoaded", function (event) {
text-align: left;
color: white;
font-family: "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
font-size: 10px;
width: 20%;
font-size: 1.3vw;
width: 15%;
margin: 0px;
padding-top: 10px;
text-wrap: wrap;
border: none;
position: fixed;
top: 12vh;
top: 9vh;
left: 0%;
}
#sidebar h1 {
margin: 0px;
padding-left: 20px;
margin-bottom: 10px;
border-bottom: 3px solid aqua;
border-bottom: 3px solid gray;
}
#sidebar details {
font-size: 20px;
}
#sidebar details summary a {
margin-left: -5px;
}
#sidebar details summary {
list-style-image: url("/Images/Collapsed.png");
/* I know I could have used list but I decided to hide the button very late into dev and it was not worth it*/
pointer-events: none; /* prevents the hidden button from being clicked */
font-size: 0.9vw;
}
#sidebar details[open] summary {
list-style-image: url("/Images/Expanded.png");
}
#sidebar details summary[hidebutton] {
list-style: none;
margin-left: 23px;
#sidebar details a {
pointer-events: all; /* prevents click events */
position: relative;
left: 20px;
text-decoration: underline;
}
#sidebar details summary a {left: 27px;}
#sidebar details summary {list-style: none;}
#sidebar details ul {
list-style: none;
margin-top: 0px;
margin-bottom: 10px;
margin-bottom: 0px;
margin-left: -5px;
}
#sidebar details ul a {
color: #4f8bd1;
text-decoration: none;
}
p {margin: 10px;}
h1 {margin: 0px;margin-top: 10px;margin-bottom: 10px;}
h2 {margin: 0px;margin-top: 10px;margin-bottom: 10px;}
h1 {margin: 0px;margin-top: 10px;margin-bottom: 10px;scroll-margin-top: 15vh;}
h2 {margin: 0px;margin-top: 10px;margin-bottom: 10px;scroll-margin-top: 15vh;}
a {
color: #0969da;
text-decoration: none;
Expand Down Expand Up @@ -124,49 +124,181 @@ document.addEventListener("DOMContentLoaded", function (event) {
}
note {
display: inline-block;
border: 0.25em solid;
border-left: 0.25em solid;
border-color: #0969da;
padding: 5px;
padding: 10px;
padding-bottom: 10px;
border-collapse: collapse;
display: flex;
align-items: center; /* Align vertical */
margin-top: 10px;
margin-bottom: 10px;
}
note img {
padding-right: 10px;
}
warning {
display: inline-block;
border-left: 0.25em solid;
border-color: #FF9D00;
padding: 10px;
padding-bottom: 10px;
border-collapse: collapse;
display: flex;
align-items: center; /* Align vertical */
margin-top: 10px;
margin-bottom: 10px;
}
warning img {
padding-right: 10px;
}
table td {border: 3px solid gray;}
table th {border: 3px solid gray;}
table {border-collapse: collapse;border: 3px solid gray;max-width: 96%;}
</style>
<div id="topbar">
<img src="/Images/Hudder.webp" alt="Back to main wiki page" />
<div id="title">Hudder Wiki</div>
</div>
<div id="sidebar">
<h1>Explore</h1>
<details>
<summary hidebutton>
<a href="/wiki/base.html">Base.html</a>
</summary>
<h1>Explore</h1>
<details open>
<summary>
<a href="/wiki/index.html">Home</a>
</summary>
</details>
<details open>
<summary><a href="/wiki/howto.html">Basic Tutorial</a></summary>
<ul>
<li><a href="/wiki/howto.html#text">Normal text</a></li>
<li><a href="/wiki/howto.html#color">Character escaping and Color Codes</a></li>
<li><a href="/wiki/howto.html#sections">Text sections</a></li>
<li><a href="/wiki/howto.html#variables">Basic variables</a></li>
<li><a href="/wiki/howto.html#conditions">Basic conditions</a></li>
<li><a href="/wiki/howto.html#adv_variables">Advanced Variables</a></li>
<li><a href="/wiki/howto.html#methods">Inventory management and methods</a></li>
</ul>
</details>
<details open>
<summary><a href="/wiki/javascript.html">JavaScript</a></summary>
<ul>
<li><a href="/wiki/javascript.html#sections">Sections? Functions!</a></li>
<li><a href="/wiki/javascript.html#functions">List of functions and their descriptions</a></li>
</ul>
</details>
<details open>
<summary>
<a href="/wiki/varlist.html">Variable list</a>
</summary>
</details>
<details>
<summary><a href="/wiki/home.html">Tutorial</a></summary>
<ul>
<li><a href="/wiki/home.html#text">Normal text</a></li>
<li><a href="/wiki/home.html#color">Character escaping and Color Codes</a></li>
<li><a href="/wiki/home.html#sections">Text sections</a></li>
<li><a href="/wiki/home.html#variables">Basic variables</a></li>
<li><a href="/wiki/home.html#conditions">Basic conditions</a></li>
<li><a href="/wiki/home.html#adv_variables">Advanced Variables</a></li>
<li><a href="/wiki/home.html#methods">Inventory management and methods</a></li>
</ul>
<details open>
<summary>
<a href="/wiki/methodlist.html">Method list</a>
</summary>
</details>
<br>
<details open>
<summary>
<a href="/wiki/russian.html">Русский</a>
</summary>
</details>
</div>
<div id="contents">
</div>
`;
`;
contents = document.body.innerHTML;
document.body.innerHTML = basehtml;
document.getElementById("contents").innerHTML = contents;
document.body.style = "background-color: #202020";

//var code_blocks = document.getElementsByTagName('code');
//console.log(code_blocks);
var notes = document.getElementsByTagName('note');
for (var i = 0; i < notes.length; i++) {
let content = notes[i].innerHTML;
notes[i].innerHTML = "<img src=\"/Images/Info.png\" alt=\"INFO\" width=\"24px\">" + content;
}
var notes = document.getElementsByTagName('warning');
for (var i = 0; i < notes.length; i++) {
let content = notes[i].innerHTML;
notes[i].innerHTML = "<img src=\"/Images/Warning.png\" alt=\"INFO\" width=\"24px\">" + content;
}
var codes = Array.from(document.getElementsByTagName('code')).concat(Array.from(
document.getElementsByTagName("inline-code")));
for (var j = 0; j < codes.length; j++) {
if (codes[j].getAttribute("language") != "js") continue;
let content = codes[j].innerHTML;
let result = "";
let builder = "";
let color = "gray";
let state = 0;
for (i = 0; i < content.length; i++) {
if (content[i]=="\"") {
for (; i < content.length; i++) {
builder += content[i];
if (content[i] == "\"") break;
}
result += "<span style=\"color:#E0E000\">" + builder + "</span>";
builder = "";
state = 0;
color = "white";
continue;
}
builder += content[i];
if (content[i] === "\n"||content[i] === ";") {
result += "<span style=\"color:" + color + "\">" + builder.substring(0,builder.length-1) + "</span>";
result += "<span style=\"color:white\">"+content[i]+"</span>";
color = "gray";
state = 0;
builder = "";
}
if (content[i] === "(") {
result += "<span style=\"color:#018ea0\">" + builder.substring(0,builder.length-1) + "</span>";
result += "<span style=\"color:white\">(</span>";
builder = "";
}
if (content[i] === ")") {
result += "<span style=\"color:white\">" + builder + "</span>";
builder = "";
}
if (state == 1) {
if (content[i] === "=") {
result += "<span style=\"color:#018ea0\">" + builder.substring(0, builder.length - 1) + "</span>";
result += "<span style=\"color:white\">\=</span>";
builder = "";
color = "white";
state = 2;
}
continue;
}
if (state == 2) {
if (content[i] === " ") {
result += "<span style=\"color:#018ea0\">" + builder + "</span>";
builder = "";
color = "#0f770f";
state = 0;
}
continue;
}
if (builder === "function " || builder === "return "||builder==="var "||builder==="let ") {
result += "<span style=\"color:#ea716a\">" + builder + "</span>";
if (builder==="var "||builder==="let ") {
color = "#018ea0";
state = 1;
}
builder = "";
}
if (content[i] == "\t") {
result += "\t";
builder = "";
}
}
result += "<span color=\"" + color + "\">" + builder + "</span>";
codes[j].innerHTML = result;
}

calchash();
});

var prevelem;
function calchash() {
if (prevelem) {
Expand All @@ -176,11 +308,11 @@ function calchash() {
}
if (window.location.hash) {
var elem = document.getElementById(window.location.hash.substring(1));
window.scrollTo({ top: elem.offsetTop-110});
elem.style.background = "#202020";
elem.style.filter = "invert(100%)";
prevelem = elem;
}
}

addEventListener("hashchange", (event) => {});
onhashchange = (event) => { calchash(); };
4 changes: 3 additions & 1 deletion wiki/home.html → wiki/howto.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<!DOCTYPE html>
<head>
<title>Hudder wiki - home</title>
<title>Hudder wiki - Basic Tutorial</title>
<script src="base.js"></script>
<meta charset="UTF-8">
</head>
<body>
<h1 style="margin-top: 0px;margin-bottom: 0px;">How to make your own hud</h1>
<hr><br/>

Expand Down
16 changes: 6 additions & 10 deletions wiki/index.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<!DOCTYPE html>
<head>
<title>Hudder wiki</title>
<title>Hudder wiki - Home</title>
<script src="base.js"></script>
<meta charset="UTF-8">
</head>
<body>
<h1>Welcome to the hudder wiki!</h1>

Hudder is a minecraft mod which allows you to create your own, highly
customizable hud without prior programming knowledge.<br>
Hudder also allows more technical people the ability to use complex
Expand All @@ -16,14 +15,11 @@ <h1>Welcome to the hudder wiki!</h1>
your own hud as well as give you the ability to make as many huds as
you may wish for.
<br><br>

Want to start simple? <a href="/home.html">Full tutorial here.</a><br>
Want to start simple? <a href="/wiki/howto.html">Full tutorial here.</a><br>
Want to do something with JavaScript?
<a href="/home.html">This might be the place to start.</a><br>
A full variable list can be found <a href="/varlist.html">here.</a><br>
A full list of methods can be found <a href="/varlist.html">here.</a><br>


<a href="/wiki/javascript.html">This might be the place to start.</a><br>
A full variable list can be found <a href="/wiki/varlist.html">here.</a><br>
A full list of methods can be found <a href="/wiki/methodlist.html">here.</a><br>
<br>
<a href="russian.html">Русский</a>
<a href="/wiki/russian.html">Русский</a>
</body>
Loading

0 comments on commit 0b2a587

Please sign in to comment.