diff --git a/js/dynamic.js b/js/dynamic.js deleted file mode 100644 index 5c2e8f3..0000000 --- a/js/dynamic.js +++ /dev/null @@ -1,60 +0,0 @@ -let bioBtn = document.getElementById('short-desc'); -let bioModel = document.getElementsByClassName('bio-text')[0]; -let leftArrow = document.getElementById("left-arrow"); -let rightArrow = document.getElementById("right-arrow"); -let hidden = true; -bioBtn.onclick = function () { - if (hidden) { - bioModel.classList.remove("hidden"); - leftArrow.classList.remove("fa-arrow-right"); - leftArrow.classList.add("fa-arrow-down"); - rightArrow.classList.remove("fa-arrow-left"); - rightArrow.classList.add("fa-arrow-down"); - leftArrow.style.position = "relative"; - rightArrow.style.position = "relative"; - unfade(bioModel); - } else { - bioModel.classList.add("hidden"); - leftArrow.classList.remove("fa-arrow-down"); - leftArrow.classList.add("fa-arrow-right"); - rightArrow.classList.remove("fa-arrow-down"); - rightArrow.classList.add("fa-arrow-left"); - leftArrow.style.position = "relative"; - rightArrow.style.position = "relative"; - fade(bioModel); - } - hidden = !hidden; -}; - -bioModel.onclick = function (evt) { - if (evt.target == bioModel) { - bioModel.classList.add("hidden"); - document.body.style.opacity = 1; - } -}; - -function fade(element) { - var op = 1; - var timer = setInterval(function () { - if (op <= 0.1) { - clearInterval(timer); - element.style.display = 'none'; - } - element.style.opacity = op; - element.style.filter = 'alpha(opacity=' + op * 100 + ")"; - op -= op * 0.1; - }, 5); -} - -function unfade(element) { - var op = 0.1; - element.style.display = 'block'; - var timer = setInterval(function () { - if (op >= 1) { - clearInterval(timer); - } - element.style.opacity = op; - element.style.filter = 'alpha(opacity=' + op * 100 + ")"; - op += op * 0.1; - }, 5); -} diff --git a/js/github.js b/js/github.js deleted file mode 100644 index 503d4a0..0000000 --- a/js/github.js +++ /dev/null @@ -1,84 +0,0 @@ - window.onload = function () { - let script = document.createElement("script"); - script.src = "https://cdnjs.cloudflare.com/ajax/libs/showdown/2.1.0/showdown.min.js"; - document.body.appendChild(script); - - const sortOnKey = (key, desc) => { - return (a, b) => { - a = a[key]; - b = b[key]; - return desc ? b - a : a - b; - } - }; - - 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=999") - .then(response => response.json()) - .then(projects => { - projects = projects.sort(sortOnKey("stargazers_count", true)); - let projectsDiv = document.getElementById("github_projects"); - projectsDiv.innerHTML = ""; - projectsDiv.classList = ""; - for (let i = 0; i < 16; i++) { - let projectDiv = document.createElement("div"); - projectDiv.classList = "card hoverable"; - let project = projects[i]; - if (project != undefined) { - if (project.description == null) - project.description = "This project has no description"; - if (project.language == null) - project.language = "No language stored!"; - project.name = project.name.replaceAll('_', ' ').replaceAll('-', ' '); - projectDiv.innerHTML = ` -
${project.description}
-