2023-11-25 01:53:10 +00:00
|
|
|
const data_get = document.getElementById("data_get");
|
2024-01-22 16:06:54 +00:00
|
|
|
|
2024-01-19 16:28:16 +00:00
|
|
|
fetch_ask("./public/projects.json")
|
2023-11-25 01:53:10 +00:00
|
|
|
.then((x) => x.json())
|
|
|
|
.then((projects) => {
|
2023-12-07 16:34:09 +00:00
|
|
|
data_get.innerHTML = projects.items
|
|
|
|
.sort((a, b) => b.date - a.date)
|
|
|
|
.reduce(
|
|
|
|
(html, project) =>
|
|
|
|
html +
|
2023-12-22 00:32:20 +00:00
|
|
|
`<h1><a href="${project.url}">${project.name}${
|
2023-12-07 16:34:09 +00:00
|
|
|
/*<span style="vertical-align: middle;
|
|
|
|
font-size: 0.5em;">${project.tags.reduce(
|
|
|
|
(html, tag) =>
|
|
|
|
html +
|
|
|
|
`<button style="
|
|
|
|
--accent-color: ${projects.tags[tag]};
|
|
|
|
--accent-color-fg: #fff;
|
|
|
|
border-color: #fff;
|
|
|
|
margin: 0.25em;
|
|
|
|
">${tag}</button>`,
|
|
|
|
""
|
|
|
|
)}</span>*/ ""
|
2023-12-22 00:32:20 +00:00
|
|
|
}</a></h1>
|
2023-11-25 01:53:10 +00:00
|
|
|
<p><b>${new Date(project.date).toLocaleDateString()}</b></p>
|
|
|
|
${project.description.reduce(
|
|
|
|
(html, descfragment) => html + `<p>${descfragment}</p>`,
|
|
|
|
""
|
|
|
|
)}
|
2024-02-29 06:25:03 +00:00
|
|
|
${project.hotlink ? `` : `<p>
|
2023-11-25 01:53:10 +00:00
|
|
|
<button
|
2023-11-26 06:39:30 +00:00
|
|
|
onclick="window.manager.createWindow('${project.url}', false${
|
2023-12-07 16:34:09 +00:00
|
|
|
project.size?.[0] ? ", " + project.size[0] : ""
|
|
|
|
}${project.size?.[1] ? ", " + project.size[1] : ""})"
|
2023-11-25 01:53:10 +00:00
|
|
|
>
|
|
|
|
Open Window
|
|
|
|
</button>
|
2024-02-29 06:25:03 +00:00
|
|
|
</p>`}`,
|
2023-12-07 16:34:09 +00:00
|
|
|
""
|
|
|
|
);
|
2024-01-19 16:28:16 +00:00
|
|
|
});
|