fix: grammar and things

This commit is contained in:
Didier Slof 2024-03-29 17:54:45 +01:00
parent a117d2e09d
commit 818d78413b
2 changed files with 7 additions and 9 deletions

View file

@ -1,5 +1,5 @@
class Case {
constructor (name = "Project", description = "This is a project.", url = undefined) {
constructor(name = "Project", description = "This is a project.", url = undefined) {
this.name = name;
this.description = description;
this.url = url;
@ -11,7 +11,7 @@ const CASES = [
const casesButton = document.querySelector("button#cases-button");
const casesDiv = document.querySelector("div#cases");
if (casesButton && CASES.length > 0) casesButton.hidden = false;
if (casesButton && CASES.length > 0) casesButton.hidden = false;
function showCases() {
if (!casesButton) return console.log("k");
@ -22,7 +22,7 @@ function showCases() {
CASES.forEach(c => {
console.log(c);
// a dirty hack :p
list.innerHTML += `<li><${c.url ? 'a' : 'span'}><strong>${c.name}<strong> - ${c.description}</${c.url ? 'a' : 'span'}></li>`;
list.innerHTML += `<li><${c.url ? 'a' : 'span'} ${c.url ? 'href="' + c.url + '"' : ''}><strong>${c.name}<strong> - ${c.description}</${c.url ? 'a' : 'span'}></li>`;
});
casesDiv.appendChild(list);
}