FILE / ScuroNeko/scuroneko.dev

js/data.js

Исходный файл и его история в репозитории.
FILE 724f16b589eae33b2f40d6693bae6bb788a90f83
Files
scuroneko.dev/js/data.js
T
2026-04-14 16:20:22 +03:00

30 lines
622 B
JavaScript

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);
});