initial commit
This commit is contained in:
+29
@@ -0,0 +1,29 @@
|
||||
let stackList = [];
|
||||
let projectsList = [];
|
||||
let linksList = [];
|
||||
|
||||
const fetchJson = async (path) => {
|
||||
const response = await fetch(path);
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(`Failed to load ${path}: ${response.status}`);
|
||||
}
|
||||
|
||||
return response.json();
|
||||
};
|
||||
|
||||
const loadIcon = async (key) => {
|
||||
const response = await fetch(`./icons/${key}.svg`);
|
||||
|
||||
if (!response.ok) {
|
||||
return key;
|
||||
}
|
||||
|
||||
return response.text();
|
||||
};
|
||||
|
||||
const formatIndex = (index) => String(index + 1).padStart(2, "0");
|
||||
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
loadStack().then(loadProjects).then(loadLinks).catch(console.error);
|
||||
});
|
||||
Reference in New Issue
Block a user