diff --git a/projects/index.html b/projects/index.html index 384aad6..4210dfa 100644 --- a/projects/index.html +++ b/projects/index.html @@ -4,7 +4,7 @@ - + @@ -21,44 +21,23 @@
-
+

Minecraft plugins

-

CommandWhitelist

-
- Source code - | - SpigotMC page -
-

Bukkit plugin that allows server owners control over which commands players can see and execute.

+

This section is dynamically set by javascript, therefore you need to enable javascript to see it :<

+
+
-

PreventStabby (TogglePvP)

-
- Source code - | - SpigotMC page -
-

Bukkit plugin allowing players to choose if they want to partake in PvP combat. Also protects player pets and accounts for huge amount of combat situations to effectively protect player.

- -

Censura

-
- Source code - | - SpigotMC page -
-

Advanced censorship bukkit plugin that lets server owners completely eliminate the usage of selected words on the server. Works with basically any user text input.

- - -
-
-

APIs

-

Server Pinger

-
- RapidAPI page -
-

An API allowing you to ping Minecraft java or bedrock servers and source engine games.

-
-
- \ No newline at end of file + + + \ No newline at end of file diff --git a/projects/projects.js b/projects/projects.js new file mode 100644 index 0000000..77915d5 --- /dev/null +++ b/projects/projects.js @@ -0,0 +1,41 @@ +const projectEntry = document.getElementById('project-entry'); +const mcPluginsSection = document.getElementById('minecraft-plugins'); +mcPluginsSection.innerHTML = '

Minecraft plugins

' +getRepos(); + +function getRepos() { + const xhr = new XMLHttpRequest(); + xhr.open('GET', 'https://api.github.com/users/youhavetrouble/repos?per_page=200'); + xhr.send(); + xhr.onload = function() { + if (xhr.status !== 200) { + mcPluginsSection.innerHTML = '

Minecraft plugins

An error occured while getting data from github. Please refresh the page.

' + return; + } + let json = JSON.parse(xhr.response); + + for (const repoId in json) { + const repo = json[repoId]; + if (repo['topics'].includes('minecraft-plugin')) { + addMinecraftPlugin(repo); + } + } + }; + + xhr.onprogress = function (event) { + if (event.lengthComputable) { + console.log(`Received ${event.loaded} of ${event.total} bytes`); + } else { + console.log(`Received ${event.loaded} bytes`); // no Content-Length + } + } +} + +function addMinecraftPlugin(pluginData) { + let newEntry = projectEntry.content.querySelector('.project-entry').cloneNode(true); + newEntry.querySelector('.project-title').innerText = pluginData['name']; + newEntry.querySelector('.project-source').href = pluginData['html_url']; + newEntry.querySelector('.project-description').innerText = pluginData['description'] + newEntry.querySelector('.project-downloads').href = `https://github.com/YouHaveTrouble/${pluginData['name']}/releases/latest` + mcPluginsSection.append(newEntry); +} \ No newline at end of file diff --git a/style/projects.css b/style/projects.css index 064cb2a..dff8756 100644 --- a/style/projects.css +++ b/style/projects.css @@ -37,6 +37,21 @@ h5 { list-style-type:none; } +.project-entry { + padding: 0.5rem 0; + opacity: 0; + animation: fadein 1s forwards; +} + +@keyframes fadein { + from {opacity: 0;} + to {opacity: 1;} +} + +.project-entry h5 a { + margin: 0.3rem; +} + @media only screen and (max-width: 1000px) { .wrapper {