commit 2e5155380b17b135c8813ad1535adb42a87ea494 Author: tenkuma Date: Fri Mar 28 16:29:59 2025 -0300 First commit. diff --git a/1.gif b/1.gif new file mode 100644 index 0000000..d36a960 Binary files /dev/null and b/1.gif differ diff --git a/MinecraftColorCodes.3.7.js b/MinecraftColorCodes.3.7.js new file mode 100644 index 0000000..554c210 --- /dev/null +++ b/MinecraftColorCodes.3.7.js @@ -0,0 +1,130 @@ + +var obfuscators = []; +var styleMap = { + '§4': 'font-weight:normal;text-decoration:none;color:#be0000', + '§c': 'font-weight:normal;text-decoration:none;color:#fe3f3f', + '§6': 'font-weight:normal;text-decoration:none;color:#d9a334', + '§e': 'font-weight:normal;text-decoration:none;color:#fefe3f', + '§2': 'font-weight:normal;text-decoration:none;color:#00be00', + '§a': 'font-weight:normal;text-decoration:none;color:#3ffe3f', + '§b': 'font-weight:normal;text-decoration:none;color:#3ffefe', + '§3': 'font-weight:normal;text-decoration:none;color:#00bebe', + '§1': 'font-weight:normal;text-decoration:none;color:#0000be', + '§9': 'font-weight:normal;text-decoration:none;color:#3f3ffe', + '§d': 'font-weight:normal;text-decoration:none;color:#fe3ffe', + '§5': 'font-weight:normal;text-decoration:none;color:#be00be', + '§f': 'font-weight:normal;text-decoration:none;color:#ffffff', + '§7': 'font-weight:normal;text-decoration:none;color:#bebebe', + '§8': 'font-weight:normal;text-decoration:none;color:#3f3f3f', + '§0': 'font-weight:normal;text-decoration:none;color:#000000', + '§l': 'font-weight:bold', + '§n': 'text-decoration:underline;text-decoration-skip:spaces', + '§o': 'font-style:italic', + '§m': 'text-decoration:line-through;text-decoration-skip:spaces', +}; +function obfuscate(string, elem) { + var magicSpan, + currNode, + len = elem.childNodes.length; + if(string.indexOf('
') > -1) { + elem.innerHTML = string; + for(var j = 0; j < len; j++) { + currNode = elem.childNodes[j]; + if(currNode.nodeType === 3) { + magicSpan = document.createElement('span'); + magicSpan.innerHTML = currNode.nodeValue; + elem.replaceChild(magicSpan, currNode); + init(magicSpan); + } + } + } else { + init(elem, string); + } + function init(el, str) { + var i = 0, + obsStr = str || el.innerHTML, + len = obsStr.length; + obfuscators.push( window.setInterval(function () { + if(i >= len) i = 0; + obsStr = replaceRand(obsStr, i); + el.innerHTML = obsStr; + i++; + }, 0) ); + } + function randInt(min, max) { + return Math.floor( Math.random() * (max - min + 1) ) + min; + } + function replaceRand(string, i) { + var randChar = String.fromCharCode( randInt(64,90) ); /*Numbers: 48-57 Al:64-90*/ + return string.substr(0, i) + randChar + string.substr(i + 1, string.length); + } +} +function applyCode(string, codes) { + var len = codes.length; + var elem = document.createElement('span'), + obfuscated = false; + for(var i = 0; i < len; i++) { + elem.style.cssText += styleMap[codes[i]] + ';'; + if(codes[i] === '§k') { + obfuscate(string, elem); + obfuscated = true; + } + } + if(!obfuscated) elem.innerHTML = string; + return elem; +} +function parseStyle(string) { + var codes = string.match(/§.{1}/g) || [], + indexes = [], + apply = [], + tmpStr, + indexDelta, + noCode, + final = document.createDocumentFragment(), + len = codes.length, + string = string.replace(/\n|\\n/g, '
'); + + for(var i = 0; i < len; i++) { + indexes.push( string.indexOf(codes[i]) ); + string = string.replace(codes[i], '\x00\x00'); + } + if(indexes[0] !== 0) { + final.appendChild( applyCode( string.substring(0, indexes[0]), [] ) ); + } + for(var i = 0; i < len; i++) { + indexDelta = indexes[i + 1] - indexes[i]; + if(indexDelta === 2) { + while(indexDelta === 2) { + apply.push ( codes[i] ); + i++; + indexDelta = indexes[i + 1] - indexes[i]; + } + apply.push ( codes[i] ); + } else { + apply.push( codes[i] ); + } + if( apply.lastIndexOf('§r') > -1) { + apply = apply.slice( apply.lastIndexOf('§r') + 1 ); + } + tmpStr = string.substring( indexes[i], indexes[i + 1] ); + final.appendChild( applyCode(tmpStr, apply) ); + } + return final; +} +function clearObfuscators() { + var i = obfuscators.length; + for(;i--;) { + clearInterval(obfuscators[i]); + } + obfuscators = []; +} +String.prototype.replaceColorCodes = function() { + clearObfuscators(); + var outputString = parseStyle(String(this)); + return outputString; +}; + +///////////////////////////////////////////////// +function cutString(str, cutStart, cutEnd){ + return str.substr(0,cutStart) + str.substr(cutEnd+1); +} \ No newline at end of file diff --git a/MinecraftRegular-Bmg3.otf b/MinecraftRegular-Bmg3.otf new file mode 100644 index 0000000..54f08ad Binary files /dev/null and b/MinecraftRegular-Bmg3.otf differ diff --git a/images/ghostsandstuff.png b/images/ghostsandstuff.png new file mode 100644 index 0000000..88dbaf5 Binary files /dev/null and b/images/ghostsandstuff.png differ diff --git a/images/hats.png b/images/hats.png new file mode 100644 index 0000000..88731f6 Binary files /dev/null and b/images/hats.png differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..5a7bfb0 --- /dev/null +++ b/index.html @@ -0,0 +1,50 @@ + + + + + + + NBeta + + +
+
+ +
+
+

Welcome.

+

This is a project that aims to preserve Minecraft Beta mods and plugins through archives of documentation and JARs and showcase new plugins for beta.

+ +
+
+ + \ No newline at end of file diff --git a/project.html b/project.html new file mode 100644 index 0000000..902c9a9 --- /dev/null +++ b/project.html @@ -0,0 +1,36 @@ + + + + + + + NBeta + + + + + +
+
+ +
+
+ +
+

Loading project...

+

...

+
+ +
+
+
+
+ + \ No newline at end of file diff --git a/project.js b/project.js new file mode 100644 index 0000000..2e624a3 --- /dev/null +++ b/project.js @@ -0,0 +1,42 @@ +const downloadButton = document.querySelector("#projectHeader button"); +const header = document.querySelector("#projectHeader"); +const headerTitle = document.querySelector("#projectHeader h1"); +const subtitle = document.querySelector("#projectHeader p"); +const main = document.querySelector("main"); +const logo = document.querySelector("#projectHeader img"); + +const queryString = window.location.search; +const urlParams = new URLSearchParams(queryString); +const projectID = urlParams.get('id'); + +function loadProject() { +var jsonXhr = new XMLHttpRequest(); +jsonXhr.open("GET", "projects/" + projectID + "/project.json", true); + +jsonXhr.onreadystatechange = function () { + if (jsonXhr.readyState === 4 && jsonXhr.status === 200) { + var jsonData = JSON.parse(jsonXhr.responseText); + headerTitle.innerText = jsonData.project.title; + subtitle.innerText = jsonData.project.subtitle; + console.log(jsonData); + } +}; + +var mdXhr = new XMLHttpRequest(); +mdXhr.open("GET", "projects/" + projectID + "/description.md", true); + +mdXhr.onreadystatechange = function () { + if (mdXhr.readyState === 4 && mdXhr.status === 200) { + const html = marked.parse( + mdXhr.responseText.replace(/^[\u200B\u200C\u200D\u200E\u200F\uFEFF]/,"") + ) + main.appendChild(html.replaceColorCodes()); + console.log(html.replaceColorCodes()); + } + }; + jsonXhr.send(); + mdXhr.send(); + logo.src = "projects/" + projectID + "/logo.png"; +} + +loadProject(); \ No newline at end of file diff --git a/projects/aboukkit/description.md b/projects/aboukkit/description.md new file mode 100644 index 0000000..446a8da --- /dev/null +++ b/projects/aboukkit/description.md @@ -0,0 +1,19 @@ +## Custom commands with predefined responses! +This plugin adds a simple way to add custom commands that will respond users with predefined messages from config.yml. It supports Minecraft's color coding (use & instead of §) and placeholders for player/server info (TODO). + +### Default Commands + - About + - Aboukkit +These default commands §aneed§r to be configured. + +### Adding new commands +First of all: run the server with the plugin for the first time, so config.yml is generated. + +Follow the structure that the template shows in your config.yml. Then use a file explorer to open the plugin's JAR file and edit plugin.yml, you can copy a command entry and fill all the fields (be careful with indentation, YML does not support TAB). + +### Why? +I made this plugin because I have a server for version b1.7.3 and I wanted to add a /about command to give credit to the server founders and link to our website. So I made this that I will use every time I need a simple 'wall of text' command. + +Newer versions +I don't see why I would build this for latest versions, I guess there are already better solutions. I made this just because of the lack of plugins for Minecraft beta. + diff --git a/projects/aboukkit/logo.png b/projects/aboukkit/logo.png new file mode 100644 index 0000000..afb395b Binary files /dev/null and b/projects/aboukkit/logo.png differ diff --git a/projects/aboukkit/project.json b/projects/aboukkit/project.json new file mode 100644 index 0000000..07bf50e --- /dev/null +++ b/projects/aboukkit/project.json @@ -0,0 +1,23 @@ +{ + "project": { + "title": "Aboukkit", + "subtitle": "A Brief Subtitle for the Project", + "description": "This is a placeholder description for the project. You can add details about the project's objectives, features, and goals here.", + "logo": "", + "images": [ + { + "src": "images/image1.jpg", + "alt": "Image 1 description" + }, + { + "src": "images/image2.jpg", + "alt": "Image 2 description" + }, + { + "src": "images/image3.jpg", + "alt": "Image 3 description" + } + ] + } + } + \ No newline at end of file diff --git a/styles.css b/styles.css new file mode 100644 index 0000000..4247de8 --- /dev/null +++ b/styles.css @@ -0,0 +1,171 @@ +* { + margin: 0; + padding: 0; + +} + +@font-face { + font-family: Minecraft; + src: url("MinecraftRegular-Bmg3.otf") format("opentype"); +} + +body { + font-family: Minecraft, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; + background-color: black; + color:white; +} + +header { + display: flex; +} + +a { + text-decoration: none; + color:greenyellow; +} + +main { + outline: 2px solid gray; + margin-top: 20px; + padding: 10px; +} + +button { + transition: .2s; + background-color: black; + color: white; + padding: 10px; + border: 1px solid white; +} + +button:hover { + color: gray; + border: 1px solid gray; +} + +/* #titleBox { + background-color: brown; + width: 100px; + height: 100px; + color: white; + text-align: center; + background: url("1.gif"); + background-size: contain; + outline: 2px solid white; + margin-right: 12px; +} */ + +/* #titleBox:hover ~ #linksBox { + outline: 2px solid white; + height: auto; +} */ + +#linksBox { + padding: 10px; + display: flex; + width: 100%; + background-color: black; + outline: 2px solid gray; + height: fit-content; +} + +#headerLinks a { + margin-top: auto; + margin-bottom: auto; + padding: 0; + padding-left: 0; +} + +#everythingHelper { + max-width: 60%; + margin: auto; +} + +#headerLinks { + padding: 0; + margin-left: 10px; +} + +#title { + margin-top: auto; + margin-bottom: auto; +} + +#featured { + margin-top: 20px; + border: 2px solid greenyellow; + padding: 10px; + display: flex; + flex-direction: column; +} + +#featuredHelper { + display: flex; + flex-direction: row; +} + + +.featuredProject { + transition: .2s; + height: auto; + width: 15%; + font-size: smaller; + padding: 4px; + overflow: hidden; +} + +.featuredProject:hover { + transition: .2s; + outline: 4px solid gray; +} + +.featuredProject img { + width: 100%; +} + +.featuredProject p { + margin-right: auto; + margin-left: auto; + text-overflow: ellipsis; +} + +#featured h2 { + font-size: medium; + font-weight: 100; + margin-bottom: 10px; +} + +#featuredHelper { + gap: 10px; +} + +#projectTitleSubtitle { + +} + +#projectHeader { + padding-top: 20px; + gap: 20px; + display: flex; +} + +#projectHeader button { + height: fit-content; + margin-top: auto; + margin-bottom: auto; + margin-left: auto; + margin-right: 20px; +} + +#projectHeader button:hover { + cursor: pointer; +} + +#projectDescription li { + margin-left: 20px; + list-style-type: "> "; +} + +#projectDescription h1, h2 { + margin-bottom: 8px; +} \ No newline at end of file