-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from NKkrisz/Remake
Make Portfolio Work Again
- Loading branch information
Showing
17 changed files
with
233 additions
and
259 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,12 @@ | ||
<div id="introduction"> | ||
<header id="introduction"> | ||
<h1>Hello, I'm NKkrisz</h1> | ||
<p>a web developer, self host/open source enthusiast and gamer</p> | ||
</div> | ||
<hr> | ||
<h2>My Projects</h2> | ||
<div id="projects"> | ||
<div> | ||
<label for="web_projects">Web Projects:</label> | ||
<ul id="web_projects"></ul> | ||
</div> | ||
<div> | ||
<label for="other_projects">Other Projects:</label> | ||
<ul id="other_projects"></ul> | ||
</div> | ||
<div id="previewDiv"> | ||
<img id="preview" src="" alt=""> | ||
<label id="previewLabel" for="preview"></label> | ||
</div> | ||
</div> | ||
<hr> | ||
<div id="learning"> | ||
<h2>I'm currently learning:</h2> | ||
<p>I am currently interested in how networks work, devops-like stuff and fundamentals of web development. | ||
I also have a server rack at home which I will probably make a blog/project website about. | ||
</p> | ||
</div> | ||
<p>an 18 year old who <i>eats and breathes</i> tech</p> | ||
</header> | ||
<section id="bestProjects"> | ||
<h2>My Best Projects</h2> | ||
<div></div> | ||
</section> | ||
<section id="interests"> | ||
<h2>Current Interests</h2> | ||
<div id="things">Work in progress...</div> | ||
</section> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const bestProjects = ["HomeLab", "Etch-a-Sketch", "google-homepage"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { requestRepos } from "./projects.js"; | ||
import { bestProjects } from "./home.js"; | ||
|
||
async function changePage(page) { | ||
// This abomination is necessary because of the way GitHub Pages handles File Structure/Paths | ||
// It doesn't work when developing with Live Server | ||
page = page.toLowerCase(); | ||
const URL = window.location.href; | ||
const response = await fetch(URL.includes("github") ? `/portfolio/pages/${page}.html` : `pages/${page}.html`); | ||
|
||
const content = await response.text(); | ||
document.querySelector("#container").innerHTML = content; | ||
|
||
if(page == "home"){ | ||
requestRepos(bestProjects); | ||
} | ||
} | ||
|
||
export { changePage }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
async function requestRepos(bestProjects = false) { | ||
const response = await fetch(`https://api.github.com/users/nkkrisz/repos`); | ||
const repos = await response.json(); | ||
if(bestProjects){ | ||
bestProjects = bestProjects.map(project => project.toLowerCase()); | ||
for (let repo of repos) { | ||
if(bestProjects.includes(repo.name.toLowerCase())){ | ||
console.log(repo.name); | ||
const figure = document.createElement("figure"); | ||
const h3 = document.createElement("h3"); | ||
const image = document.createElement("img"); | ||
const figcaption = document.createElement("figcaption"); | ||
|
||
h3.innerText = repo.name; | ||
image.src = `img/projects/${repo.name}.png`; | ||
image.alt = repo.name; | ||
figcaption.innerText = repo.description ? repo.description : "No description available"; | ||
|
||
figure.appendChild(h3); | ||
figure.appendChild(image); | ||
figure.appendChild(figcaption); | ||
figure.classList.add("project"); | ||
|
||
document.querySelector("#bestProjects div").appendChild(figure); | ||
} | ||
} | ||
} else { | ||
for (let repo of repos) { | ||
//Skip forks for now... | ||
if(repo.fork == true) continue; | ||
|
||
const li = document.createElement('li'); | ||
const a = document.createElement('a'); | ||
|
||
if(repo.has_pages == true){ | ||
a.href = `https://nkkrisz.github.io/${repo.name}/`; | ||
a.innerText = repo.name; | ||
a.target = "_blank" | ||
li.appendChild(a); | ||
document.querySelector("#web_projects").appendChild(li); | ||
|
||
web_projects[repo.name] = repo; | ||
|
||
li.addEventListener("mouseover", () => { | ||
(repo.name !== "portfolio") ? document.querySelector("#preview").src = `img/projects/${repo.name}.png` : document.querySelector("#preview").src = null; | ||
document.querySelector("#previewLabel").innerText = repo.description ? repo.description : "No description available"; | ||
}); | ||
|
||
} else { | ||
a.href = repo.html_url; | ||
a.innerText = repo.name; | ||
a.target = "_blank" | ||
li.appendChild(a); | ||
document.querySelector("#other_projects").appendChild(li); | ||
|
||
other_projects[repo.name] = repo; | ||
} | ||
|
||
}; | ||
} | ||
}; | ||
|
||
export { requestRepos }; |
Oops, something went wrong.