|
@@ -14,7 +14,7 @@ import GitHubGraph from "../components/githubgraph.astro";
|
|
|
// Projects
|
|
// Projects
|
|
|
import Summize from "../components/projects/summize.astro";
|
|
import Summize from "../components/projects/summize.astro";
|
|
|
import Notion from "../components/projects/notion.astro";
|
|
import Notion from "../components/projects/notion.astro";
|
|
|
-import Imdb from "../components/projects/imdb.astro";
|
|
|
|
|
|
|
+// import Imdb from "../components/projects/imdb.astro";
|
|
|
|
|
|
|
|
import "../styles/global.css";
|
|
import "../styles/global.css";
|
|
|
|
|
|
|
@@ -25,6 +25,7 @@ import projects from "../assets/apps/projects.png";
|
|
|
import blog from "../assets/apps/blog.png";
|
|
import blog from "../assets/apps/blog.png";
|
|
|
import contact from "../assets/apps/contact.png";
|
|
import contact from "../assets/apps/contact.png";
|
|
|
import pgp from "../assets/apps/pgp.png";
|
|
import pgp from "../assets/apps/pgp.png";
|
|
|
|
|
+import Glance from "../components/projects/glance.astro";
|
|
|
|
|
|
|
|
function dragElement(elmnt) {
|
|
function dragElement(elmnt) {
|
|
|
var pos1 = 0,
|
|
var pos1 = 0,
|
|
@@ -32,11 +33,6 @@ function dragElement(elmnt) {
|
|
|
pos3 = 0,
|
|
pos3 = 0,
|
|
|
pos4 = 0;
|
|
pos4 = 0;
|
|
|
|
|
|
|
|
- // Skip dragging for fullscreen PGP window
|
|
|
|
|
- if (elmnt.id === "PGP Key" || elmnt.classList.contains("pgp-fullscreen")) {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
if (document.getElementById(elmnt.id + "header")) {
|
|
if (document.getElementById(elmnt.id + "header")) {
|
|
|
// If present, the header is where you move the DIV from:
|
|
// If present, the header is where you move the DIV from:
|
|
|
document.getElementById(elmnt.id + "header").onmousedown = dragMouseDown;
|
|
document.getElementById(elmnt.id + "header").onmousedown = dragMouseDown;
|
|
@@ -95,25 +91,23 @@ function dragElement(elmnt) {
|
|
|
|
|
|
|
|
/** Raise up window with given ID */
|
|
/** Raise up window with given ID */
|
|
|
function raiseUpSpec(id: string) {
|
|
function raiseUpSpec(id: string) {
|
|
|
|
|
+ console.log("raising ", id);
|
|
|
let els = document.getElementsByClassName("window");
|
|
let els = document.getElementsByClassName("window");
|
|
|
|
|
+
|
|
|
let elArray = Array.from(els as HTMLCollectionOf<HTMLElement>);
|
|
let elArray = Array.from(els as HTMLCollectionOf<HTMLElement>);
|
|
|
|
|
|
|
|
// find the highest z-index
|
|
// find the highest z-index
|
|
|
let highestIndex = 0;
|
|
let highestIndex = 0;
|
|
|
|
|
|
|
|
for (let element in elArray) {
|
|
for (let element in elArray) {
|
|
|
- let zindexStr = elArray[element].style.zIndex;
|
|
|
|
|
- let zindex = parseInt(zindexStr) || 0;
|
|
|
|
|
|
|
+ let zindex = parseInt(elArray[element].style.zIndex);
|
|
|
if (zindex > highestIndex) {
|
|
if (zindex > highestIndex) {
|
|
|
highestIndex = zindex;
|
|
highestIndex = zindex;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // set the highest z-index plus one using ID
|
|
|
|
|
- const windowEl = document.getElementById(id) as HTMLElement | null;
|
|
|
|
|
- if (windowEl) {
|
|
|
|
|
- windowEl.style.zIndex = (highestIndex + 1).toString();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // set the highest z-index plus one
|
|
|
|
|
+ document.getElementById(id).style.zIndex = (highestIndex + 1).toString();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function updateRedirectMessage() {
|
|
function updateRedirectMessage() {
|
|
@@ -140,30 +134,28 @@ let apps: app[] = [
|
|
|
logo: me.src,
|
|
logo: me.src,
|
|
|
onclick: () => {
|
|
onclick: () => {
|
|
|
raiseUpSpec("About Me");
|
|
raiseUpSpec("About Me");
|
|
|
- const windowEl = document.getElementById("About Me") as HTMLElement | null;
|
|
|
|
|
- if (windowEl) windowEl.style.display = "block";
|
|
|
|
|
- },
|
|
|
|
|
- row: 1,
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: "Blog",
|
|
|
|
|
- logo: blog.src,
|
|
|
|
|
- onclick: () => {
|
|
|
|
|
- raiseUpSpec("Redirect");
|
|
|
|
|
- const windowEl = document.getElementById("Redirect") as HTMLElement | null;
|
|
|
|
|
- if (windowEl) windowEl.style.display = "block";
|
|
|
|
|
- if (windowEl) (windowEl as any).dataset.redirecturl = "https://blog.simo.ng/";
|
|
|
|
|
- updateRedirectMessage();
|
|
|
|
|
|
|
+ document.getElementById("About Me").style.display = "block";
|
|
|
},
|
|
},
|
|
|
row: 1,
|
|
row: 1,
|
|
|
},
|
|
},
|
|
|
|
|
+ // {
|
|
|
|
|
+ // name: "Blog",
|
|
|
|
|
+ // logo: blog.src,
|
|
|
|
|
+ // onclick: () => {
|
|
|
|
|
+ // raiseUpSpec("Redirect");
|
|
|
|
|
+ // document.getElementById("Redirect").style.display = "block";
|
|
|
|
|
+ // document.getElementById("Redirect").dataset.redirecturl =
|
|
|
|
|
+ // "https://blog.simo.ng/";
|
|
|
|
|
+ // updateRedirectMessage();
|
|
|
|
|
+ // },
|
|
|
|
|
+ // row: 1,
|
|
|
|
|
+ // },
|
|
|
{
|
|
{
|
|
|
name: "Projects",
|
|
name: "Projects",
|
|
|
logo: projects.src,
|
|
logo: projects.src,
|
|
|
onclick: () => {
|
|
onclick: () => {
|
|
|
raiseUpSpec("Projects ");
|
|
raiseUpSpec("Projects ");
|
|
|
- const windowEl = document.getElementById("Projects ") as HTMLElement | null;
|
|
|
|
|
- if (windowEl) windowEl.style.display = "block";
|
|
|
|
|
|
|
+ document.getElementById("Projects ").style.display = "block";
|
|
|
},
|
|
},
|
|
|
row: 1,
|
|
row: 1,
|
|
|
},
|
|
},
|
|
@@ -173,14 +165,14 @@ let apps: app[] = [
|
|
|
// row: 1,
|
|
// row: 1,
|
|
|
// },
|
|
// },
|
|
|
{
|
|
{
|
|
|
- name: "Github",
|
|
|
|
|
|
|
+ name: "Git",
|
|
|
logo: github.src,
|
|
logo: github.src,
|
|
|
onclick: () => {
|
|
onclick: () => {
|
|
|
// ignore
|
|
// ignore
|
|
|
raiseUpSpec("Redirect");
|
|
raiseUpSpec("Redirect");
|
|
|
- const windowEl = document.getElementById("Redirect") as HTMLElement | null;
|
|
|
|
|
- if (windowEl) windowEl.style.display = "block";
|
|
|
|
|
- if (windowEl) (windowEl as any).dataset.redirecturl = "https://github.com/s1monlol/";
|
|
|
|
|
|
|
+ document.getElementById("Redirect").style.display = "block";
|
|
|
|
|
+ document.getElementById("Redirect").dataset.redirecturl =
|
|
|
|
|
+ "https://git.simo.ng/simo";
|
|
|
updateRedirectMessage();
|
|
updateRedirectMessage();
|
|
|
},
|
|
},
|
|
|
row: 2,
|
|
row: 2,
|
|
@@ -190,27 +182,27 @@ let apps: app[] = [
|
|
|
logo: contact.src,
|
|
logo: contact.src,
|
|
|
row: 2,
|
|
row: 2,
|
|
|
onclick: () => {
|
|
onclick: () => {
|
|
|
- raiseUpSpec("Contact");
|
|
|
|
|
- const windowEl = document.getElementById("Contact") as HTMLElement | null;
|
|
|
|
|
- if (windowEl) windowEl.style.display = "block";
|
|
|
|
|
|
|
+ raiseUpSpec("contact");
|
|
|
|
|
+ document.getElementById("contact").style.display = "block";
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
name: "PGP Key",
|
|
name: "PGP Key",
|
|
|
logo: pgp.src,
|
|
logo: pgp.src,
|
|
|
- row: 2,
|
|
|
|
|
|
|
+ row: 1,
|
|
|
onclick: () => {
|
|
onclick: () => {
|
|
|
- raiseUpSpec("PGP Key");
|
|
|
|
|
- const windowEl = document.getElementById("PGP Key") as HTMLElement | null;
|
|
|
|
|
- if (windowEl) {
|
|
|
|
|
- windowEl.classList.add("fullscreen");
|
|
|
|
|
- windowEl.style.display = "block";
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ raiseUpSpec("pgp");
|
|
|
|
|
+ document.getElementById("pgp").classList.add("fullscreen");
|
|
|
|
|
+ document.getElementById("pgp").style.display = "block";
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
let projectsArr: project[] = [
|
|
let projectsArr: project[] = [
|
|
|
|
|
+ {
|
|
|
|
|
+ title: "Glance",
|
|
|
|
|
+ id: "glance",
|
|
|
|
|
+ },
|
|
|
{
|
|
{
|
|
|
title: "Summize",
|
|
title: "Summize",
|
|
|
id: "summize",
|
|
id: "summize",
|
|
@@ -219,14 +211,6 @@ let projectsArr: project[] = [
|
|
|
title: "Notion2Canvas",
|
|
title: "Notion2Canvas",
|
|
|
id: "notion",
|
|
id: "notion",
|
|
|
},
|
|
},
|
|
|
- {
|
|
|
|
|
- title: "PGPCord",
|
|
|
|
|
- id: "pgpcord",
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- title: "IMDB Frontend",
|
|
|
|
|
- id: "imdb",
|
|
|
|
|
- },
|
|
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
const row1Items = apps.filter((item) => item.row === 1);
|
|
const row1Items = apps.filter((item) => item.row === 1);
|
|
@@ -272,7 +256,7 @@ apps = apps.map((item) => {
|
|
|
<Projects projects={projectsArr} />
|
|
<Projects projects={projectsArr} />
|
|
|
<Summize />
|
|
<Summize />
|
|
|
<Notion />
|
|
<Notion />
|
|
|
- <Imdb />
|
|
|
|
|
|
|
+ <Glance />
|
|
|
<Duolingo />
|
|
<Duolingo />
|
|
|
<GitHubGraph />
|
|
<GitHubGraph />
|
|
|
</div>
|
|
</div>
|
|
@@ -319,12 +303,11 @@ apps = apps.map((item) => {
|
|
|
if (id == "pgpcord") {
|
|
if (id == "pgpcord") {
|
|
|
project.onclick = () => {
|
|
project.onclick = () => {
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
- raiseUpSpec("Redirect");
|
|
|
|
|
- const windowEl = document.getElementById("Redirect");
|
|
|
|
|
- if (windowEl) {
|
|
|
|
|
- windowEl.style.display = "block";
|
|
|
|
|
- windowEl.dataset.redirecturl = "https://blog.simo.ng/articles/WIP/pgpcord";
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ raiseUpSpec("redirect");
|
|
|
|
|
+ document.getElementById("redirect").style.display = "block";
|
|
|
|
|
+ document.getElementById("redirect").dataset.redirecturl =
|
|
|
|
|
+ "https://blog.simo.ng/articles/WIP/pgpcord";
|
|
|
|
|
+
|
|
|
updateRedirectMessage();
|
|
updateRedirectMessage();
|
|
|
}, 1);
|
|
}, 1);
|
|
|
};
|
|
};
|
|
@@ -333,11 +316,9 @@ apps = apps.map((item) => {
|
|
|
}
|
|
}
|
|
|
project.onclick = () => {
|
|
project.onclick = () => {
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
- const projectWindow = document.getElementById(id);
|
|
|
|
|
- if (projectWindow) {
|
|
|
|
|
- projectWindow.style.display = "block";
|
|
|
|
|
- raiseUpSpec(projectWindow.id);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ console.log(id)
|
|
|
|
|
+ document.getElementsByClassName(id)[0].style.display = "block";
|
|
|
|
|
+ raiseUpSpec(document.getElementsByClassName(id)[0].id);
|
|
|
}, 1);
|
|
}, 1);
|
|
|
};
|
|
};
|
|
|
});
|
|
});
|
|
@@ -359,7 +340,7 @@ apps = apps.map((item) => {
|
|
|
e.preventDefault();
|
|
e.preventDefault();
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
- raiseUpSpec("Redirect");
|
|
|
|
|
|
|
+ raiseUpSpec("redirect");
|
|
|
}, 1);
|
|
}, 1);
|
|
|
|
|
|
|
|
return false;
|
|
return false;
|
|
@@ -555,20 +536,30 @@ apps = apps.map((item) => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // Function to show Duolingo with animation
|
|
|
|
|
+ function showDuolingo() {
|
|
|
|
|
+ const duolingoWindow = document.getElementById("duolingo");
|
|
|
|
|
+ duolingoWindow.style.display = "block";
|
|
|
|
|
+ duolingoWindow.classList.add("show");
|
|
|
|
|
+ raiseUpSpec("duolingo");
|
|
|
|
|
+
|
|
|
|
|
+ // Remove animation class after it completes
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ duolingoWindow.classList.remove("show");
|
|
|
|
|
+ }, 400);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
// Function to show GitHub graph with animation
|
|
// Function to show GitHub graph with animation
|
|
|
function showGitHubGraph() {
|
|
function showGitHubGraph() {
|
|
|
- const githubWindow = document.getElementById("Top Languages");
|
|
|
|
|
- if (githubWindow) {
|
|
|
|
|
- githubWindow.style.display = "block";
|
|
|
|
|
- githubWindow.classList.add("show");
|
|
|
|
|
- raiseUpSpec("Top Languages");
|
|
|
|
|
|
|
+ const githubWindow = document.getElementById("github-graph");
|
|
|
|
|
+ githubWindow.style.display = "block";
|
|
|
|
|
+ githubWindow.classList.add("show");
|
|
|
|
|
+ raiseUpSpec("github-graph");
|
|
|
|
|
|
|
|
- // Remove animation class after it completes
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
- githubWindow.classList.remove("show");
|
|
|
|
|
- }, 400);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // Remove animation class after it completes
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ githubWindow.classList.remove("show");
|
|
|
|
|
+ }, 400);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Track start button clicks
|
|
// Track start button clicks
|
|
@@ -580,6 +571,8 @@ apps = apps.map((item) => {
|
|
|
if (startButtonClicks === 1) {
|
|
if (startButtonClicks === 1) {
|
|
|
showGitHubGraph();
|
|
showGitHubGraph();
|
|
|
|
|
|
|
|
|
|
+ } else if (startButtonClicks === 2) {
|
|
|
|
|
+ showDuolingo();
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|