From d46b69703c5bb898246402be2629c7d5663cc713 Mon Sep 17 00:00:00 2001 From: Julian Lechner Date: Fri, 20 Sep 2024 20:54:22 +0200 Subject: [PATCH] Delete js directory --- js/dynamic.js | 60 ------------------------------------ js/github.js | 84 --------------------------------------------------- 2 files changed, 144 deletions(-) delete mode 100644 js/dynamic.js delete mode 100644 js/github.js 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.name} - -
- 📕 ${project.language}
- ⭐ ${project.stargazers_count} -
-
-

${project.description}

-
- `; - fetch(`https://raw.githubusercontent.com/${project.full_name}/master/README.md`) - .then(response => response.text()) - .then(text => { - let converter = new showdown.Converter(); - let html = converter.makeHtml(text); - let projectModal = document.createElement("div"); - projectModal.classList = "modal github-modal hidden"; - projectModal.innerHTML = ` -
- - Visit on GitHub -
-
- ${html} -
- `; - - projectDiv.onclick = function () { - projectModal.classList.remove("hidden"); - document.body.scrollTop = 0; // Safari - document.documentElement.scrollTop = 0; // Chrome Firefox IE Opera - document.body.style.opacity = 0.2; - }; - - projectModal.onclick = function (evt) { - if (evt.target == projectModal) { - projectModal.classList.add("hidden"); - document.body.style.opacity = 1; - } - }; - document.getElementsByTagName("html")[0].appendChild(projectModal); - }); - projectsDiv.appendChild(projectDiv); - } - } - }); - }; \ No newline at end of file