always updated plugin project list

This commit is contained in:
2022-03-06 16:06:23 +01:00
parent 5cb6d1330c
commit 134ff1d4a8
3 changed files with 72 additions and 37 deletions
+16 -37
View File
@@ -4,7 +4,7 @@
<link rel="stylesheet" href="/style/main.css"> <link rel="stylesheet" href="/style/main.css">
<link rel="stylesheet" href="/style/projects.css"> <link rel="stylesheet" href="/style/projects.css">
<meta charset="UTF-8"> <meta charset="UTF-8">
<script src="https://kit.fontawesome.com/5e96beba0c.js" crossorigin="anonymous"></script> <script src="https://kit.fontawesome.com/5e96beba0c.js" crossorigin="anonymous" defer></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head> </head>
<body> <body>
@@ -21,44 +21,23 @@
</fieldset> </fieldset>
</div> </div>
<div class="linewrapper"> <div class="linewrapper">
<fieldset class="project-window"> <fieldset id="minecraft-plugins" class="project-window">
<legend><h2>Minecraft plugins</h2></legend> <legend><h2>Minecraft plugins</h2></legend>
<h4>CommandWhitelist</h4> <p>This section is dynamically set by javascript, therefore you need to enable javascript to see it :<</p>
<h5> </fieldset>
<a href="https://github.com/YouHaveTrouble/CommandWhitelist"><i class="fas fa-github fa"></i> Source code</a> </div>
<span> | </span>
<a href="https://www.spigotmc.org/resources/commandwhitelist.81326/"><i class="fas fa-plug fa"></i> SpigotMC page</a>
</h5>
<p>Bukkit plugin that allows server owners control over which commands players can see and execute.</p>
<h4>PreventStabby (TogglePvP)</h4>
<h5>
<a href="https://github.com/YouHaveTrouble/PreventStabby"><i class="fas fa-github fa"></i> Source code</a>
<span> | </span>
<a href="https://www.spigotmc.org/resources/togglepvp.89376/"><i class="fas fa-plug fa"></i> SpigotMC page</a>
</h5>
<p>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.</p>
<h4>Censura</h4>
<h5>
<a href="https://github.com/YouHaveTrouble/Censura"><i class="fas fa-github fa"></i> Source code</a>
<span> | </span>
<a href="https://www.spigotmc.org/resources/censura.84123/"><i class="fas fa-plug fa"></i> SpigotMC page</a>
</h5>
<p>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.</p>
</fieldset>
</div>
<div class="linewrapper">
<fieldset class="project-window">
<legend><h2>APIs</h2></legend>
<h4>Server Pinger</h4>
<h5>
<a href="https://rapidapi.com/YouHaveTrouble/api/serverpinger/"><i class="fas fa-file-invoice fa"></i> RapidAPI page</a>
</h5>
<p>An API allowing you to ping Minecraft java or bedrock servers and source engine games.</p>
</fieldset>
</div>
<p class="footer">© Paweł "YouHaveTrouble" Michalewski 2021</p> <p class="footer">© Paweł "YouHaveTrouble" Michalewski 2021</p>
</div> </div>
</body> <script type="application/javascript" src="projects.js" defer></script>
</body>
<template id="project-entry">
<div class="project-entry">
<h4 class="project-title"></h4>
<h5>
<a class="project-source" target="_blank"><span class="fas fa-github fa"></span> Source code</a><a class="project-downloads" target="_blank"><span class="fas fa-download"></span> Download</a>
</h5>
<p class="project-description"></p>
</div>
</template>
+41
View File
@@ -0,0 +1,41 @@
const projectEntry = document.getElementById('project-entry');
const mcPluginsSection = document.getElementById('minecraft-plugins');
mcPluginsSection.innerHTML = '<legend><h2>Minecraft plugins</h2></legend>'
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 = '<legend><h2>Minecraft plugins</h2></legend><p>An error occured while getting data from github. Please refresh the page.</p>'
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);
}
+15
View File
@@ -37,6 +37,21 @@ h5 {
list-style-type:none; 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 @media only screen
and (max-width: 1000px) { and (max-width: 1000px) {
.wrapper { .wrapper {