diff --git a/index.html b/index.html index 6c3bb55..edbacae 100644 --- a/index.html +++ b/index.html @@ -72,68 +72,15 @@

-
-

-

-
    -
  • C++
  • -
  • Lua
  • -
- -
-
-

-

-
    -
  • HTML
  • -
  • CSS
  • -
  • JavaScript
  • -
  • Hosting
  • -
- -
-
-

-

-
    -
  • HTML
  • -
  • CSS
  • -
  • JavaScript
  • -
  • Hosting
  • -
- -
-
-

-

-
    -
  • Lua
  • -
- -
-
-

-

-
    -
  • JavaScript
  • -
- -
+

-
diff --git a/languages/en.json b/languages/en.json index 3b036a3..e3c8cde 100644 --- a/languages/en.json +++ b/languages/en.json @@ -8,7 +8,7 @@ "home_greeting": "Hey 👋 I'm Tarion.", "home_subtitle": "Game Programmer", - "home_description": "Currently developing a game using the Unity Engine.", + "home_description": "Currently working on adding new features to this website.", "projects_title": "Projects", diff --git a/projects.json b/projects.json new file mode 100644 index 0000000..2250e03 --- /dev/null +++ b/projects.json @@ -0,0 +1,50 @@ +{ + "project_game_engine_title": { + "description": "project_game_engine_description", + "skills":[ + "C++", + "OpenGL", + "Lua" + ], + "link": "https://git.tarion.org/tarion/Game-Engine", + "linkIcon": "fa-brands fa-git-alt" + }, + "project_schwarzer_title": { + "description": "project_schwarzer_description", + "skills":[ + "HTML", + "CSS", + "JavaScript", + "Hosting" + ], + "link": "https://schwarzer-energie.de/", + "linkIcon": "fa-solid fa-globe" + }, + "project_tarion_org_title": { + "description": "project_tarion_org_description", + "skills":[ + "HTML", + "CSS", + "JavaScript", + "Hosting" + ], + "link": "https://tarion.org/", + "linkIcon": "fa-solid fa-globe" + }, + "project_lov8_title": { + "description": "project_lov8_description", + "skills":[ + "Lua" + ], + "link": "https://git.tarion.org/tarion/LOV-8", + "linkIcon": "fa-brands fa-git-alt" + }, + "project_remove_shorts_title": { + "description": "project_remove_shorts_description", + "skills":[ + "JavaScript" + ], + "link": "https://git.tarion.org/tarion/remove-youtube-shorts", + "linkIcon": "fa-brands fa-git-alt" + } +} \ No newline at end of file diff --git a/script.js b/script.js index 5f29c86..7299385 100644 --- a/script.js +++ b/script.js @@ -83,10 +83,67 @@ async function getLanguageData(lang){ return response.json(); } + +async function getProjectsData(){ + const response = await fetch(`projects.json`); + return response.json(); +} +async function getSkillsData(){ + const response = await fetch(`skills.json`); + return response.json(); +} + document.addEventListener("DOMContentLoaded", async () => { const userLang = (navigator.language || navigator.userLanguage).split('-')[0]; const langData = await getLanguageData(userLang); + // Load Projects from projects.json + const projects = await getProjectsData(); + if (projects != null){ + for (var key in projects){ + var project = projects[key]; + + var newProject = document.createElement("div"); + newProject.setAttribute("class", "project"); + + var title = document.createElement("h1"); + title.setAttribute("data-i18n", key); + newProject.appendChild(title); + + var description = document.createElement("p"); + description.setAttribute("data-i18n", project.description); + newProject.appendChild(description); + + var projectSkills = document.createElement("ul"); + for (var skillKey in project.skills){ + var newSkill = document.createElement("li"); + newSkill.innerHTML = project.skills[skillKey]; + projectSkills.appendChild(newSkill); + } + newProject.appendChild(projectSkills); + + var button = document.createElement("a"); + button.setAttribute("href", project.link); + button.innerHTML = "" + newProject.appendChild(button); + + document.getElementsByClassName("projects")[0].appendChild(newProject); + } + } + + const skills = await getSkillsData(); + if (skills != null){ + var skillsList = document.getElementById("skills-list"); + + for (var key in skills){ + var skillName = skills[key]; + + var newSkill = document.createElement("li"); + newSkill.innerHTML = skillName; + skillsList.appendChild(newSkill); + } + } + document.querySelectorAll("[data-i18n]").forEach((element) => { const key = element.getAttribute("data-i18n"); element.innerHTML = langData[key]; diff --git a/skills.json b/skills.json new file mode 100644 index 0000000..80fe6f0 --- /dev/null +++ b/skills.json @@ -0,0 +1,10 @@ +[ + "C#", + "C++", + "Lua", + "Python", + "HTML", + "CSS", + "JavaScript", + "Git" +] \ No newline at end of file