2023-11-25 01:53:10 +00:00
|
|
|
const data_get = document.getElementById("data_get");
|
|
|
|
fetch("./public/projects.json")
|
|
|
|
.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>`,
|
|
|
|
""
|
|
|
|
)}
|
|
|
|
<p>
|
|
|
|
<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>
|
|
|
|
</p>`,
|
2023-12-07 16:34:09 +00:00
|
|
|
""
|
|
|
|
);
|
2023-12-21 06:59:22 +00:00
|
|
|
});
|