Updated my Website
- other (better) Theme - added more Features - changed Text - added more animations
This commit is contained in:
+9
-8
@@ -1,6 +1,6 @@
|
||||
window.onload = function () {
|
||||
let script = document.createElement("script");
|
||||
script.src = "https://cdnjs.cloudflare.com/ajax/libs/showdown/1.9.1/showdown.min.js";
|
||||
script.src = "https://cdnjs.cloudflare.com/ajax/libs/showdown/2.1.0/showdown.min.js";
|
||||
document.body.appendChild(script);
|
||||
|
||||
const sortOnKey = (key, desc) => {
|
||||
@@ -14,7 +14,7 @@
|
||||
String.prototype.replaceAt = function (index, replacement) {
|
||||
return this.substr(0, index) + replacement + this.substr(index + replacement.length);
|
||||
}
|
||||
fetch("https://api.github.com/users/fraujulian/repos?per_page=100")
|
||||
fetch("https://api.github.com/users/fraujulian/repos?per_page=999")
|
||||
.then(response => response.json())
|
||||
.then(projects => {
|
||||
projects = projects.sort(sortOnKey("stargazers_count", true));
|
||||
@@ -27,7 +27,9 @@
|
||||
let project = projects[i];
|
||||
if (project != undefined) {
|
||||
if (project.description == null)
|
||||
project.description = "No description.";
|
||||
project.description = "This project has no description";
|
||||
if (project.language == null)
|
||||
project.language = "No language stored!";
|
||||
project.name = project.name.replaceAll('_', ' ').replaceAll('-', ' ');
|
||||
projectDiv.innerHTML = `
|
||||
<div class="media">
|
||||
@@ -36,8 +38,8 @@
|
||||
<strong class="d-block text-gray-dark">${project.name}</strong>
|
||||
</a>
|
||||
<div class="stars" style="float:right;">
|
||||
📕 ${project.language}
|
||||
<i class="far fa-star stargazers"></i>⭐ ${project.stargazers_count}
|
||||
📕 ${project.language} <br>
|
||||
⭐ ${project.stargazers_count}
|
||||
</div>
|
||||
</div>
|
||||
<p>${project.description}</p>
|
||||
@@ -46,7 +48,6 @@
|
||||
fetch(`https://raw.githubusercontent.com/${project.full_name}/master/README.md`)
|
||||
.then(response => response.text())
|
||||
.then(text => {
|
||||
// Convert markdown to html
|
||||
let converter = new showdown.Converter();
|
||||
let html = converter.makeHtml(text);
|
||||
let projectModal = document.createElement("div");
|
||||
@@ -62,8 +63,8 @@
|
||||
|
||||
projectDiv.onclick = function () {
|
||||
projectModal.classList.remove("hidden");
|
||||
document.body.scrollTop = 0; // For Safari
|
||||
document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera
|
||||
document.body.scrollTop = 0; // Safari
|
||||
document.documentElement.scrollTop = 0; // Chrome Firefox IE Opera
|
||||
document.body.style.opacity = 0.2;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user