31 lines
828 B
JavaScript
31 lines
828 B
JavaScript
const data_get = document.getElementById("data_get");
|
|
fetch("./public/projects.json")
|
|
.then((x) => x.json())
|
|
.then((projects) => {
|
|
data_get.innerHTML = projects.reduce(
|
|
(html, project) =>
|
|
html +
|
|
`<h1>${project.name}</h1>
|
|
<p><b>${new Date(project.date).toLocaleDateString()}</b></p>
|
|
${project.description.reduce(
|
|
(html, descfragment) => html + `<p>${descfragment}</p>`,
|
|
""
|
|
)}
|
|
<p>
|
|
<button
|
|
onclick="window.open('${project.url}')"
|
|
>
|
|
Open
|
|
</button>
|
|
or
|
|
<button
|
|
onclick="window.manager.createWindow('${project.url}', false${
|
|
project.size?.[0] ? ", " + project.size[0] : ""
|
|
}${project.size?.[1] ? ", " + project.size[1] : ""})"
|
|
>
|
|
Open Window
|
|
</button>
|
|
</p>`,
|
|
""
|
|
);
|
|
});
|