by tenkuma
- +
Ghosts 'n Stuff
diff --git a/project.html b/project.html index ca89c82..59ba1a7 100644 --- a/project.html +++ b/project.html @@ -4,7 +4,7 @@ -Adrian Victor, 2025 (Unlicense)
diff --git a/1.gif b/1.gif
deleted file mode 100644
index d36a960..0000000
Binary files a/1.gif and /dev/null differ
diff --git a/MinecraftColorCodes.3.7.js b/MinecraftColorCodes.3.7.js
deleted file mode 100644
index 554c210..0000000
--- a/MinecraftColorCodes.3.7.js
+++ /dev/null
@@ -1,130 +0,0 @@
-
-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/featured.js b/featured.js
new file mode 100644
index 0000000..9af1994
--- /dev/null
+++ b/featured.js
@@ -0,0 +1,30 @@
+const featuredHelper = document.querySelector("#featuredHelper");
+
+async function getFeaturedJSON() {
+ const response = await fetch(`featured.json`);
+ if (!response.ok) {
+ featuredHelper.innerHTML = `
+
;( Oopsie! Could not load featured projects...
+ ` + throw new Error("Failed to fetch featured projects JSON"); + } + + const data = await response.json(); + + data.forEach(project => { + const featuredDiv = document.createElement("div"); + featuredDiv.classList.add("featuredProject"); + featuredDiv.id = `featured-${project}`; + featuredDiv.innerHTML = ` + +
+ :${project}
+ + `; + featuredHelper.appendChild(featuredDiv); + + loadProject(project, document.querySelector(`featured-${project} p`), undefined, undefined, undefined, document.querySelector(`featured-${project} img`)) + }); +} + +getFeaturedJSON(); \ No newline at end of file diff --git a/featured.json b/featured.json index 1f8ceaa..5aa081b 100644 --- a/featured.json +++ b/featured.json @@ -1 +1 @@ -["aboukkit"] \ No newline at end of file +["aboukkit", "ghostsandstuff"] \ No newline at end of file diff --git a/images/hats.png b/images/hats.png deleted file mode 100644 index 88731f6..0000000 Binary files a/images/hats.png and /dev/null differ diff --git a/index.html b/index.html index 3d8d054..d158c57 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,7 @@ -by tenkuma
- +
Ghosts 'n Stuff
diff --git a/project.html b/project.html index ca89c82..59ba1a7 100644 --- a/project.html +++ b/project.html @@ -4,7 +4,7 @@ -Adrian Victor, 2025 (Unlicense)