Generalise img
|
Before Width: | Height: | Size: 1.4 MiB |
|
Before Width: | Height: | Size: 5.1 MiB |
|
Before Width: | Height: | Size: 1.2 MiB |
|
Before Width: | Height: | Size: 1.4 MiB |
|
Before Width: | Height: | Size: 1.3 MiB |
|
Before Width: | Height: | Size: 1.4 MiB |
|
Before Width: | Height: | Size: 1.4 MiB |
|
Before Width: | Height: | Size: 1.3 MiB |
@@ -6,16 +6,16 @@ window.addEventListener('load', () => {
|
||||
const elem = funkoTemplate.content.cloneNode(true);
|
||||
const special = ['img', 'href'];
|
||||
|
||||
elem.querySelector('.funko__img').setAttribute('src', `img/${funko.img}.jpg`);
|
||||
elem.querySelector('.funko__img').setAttribute('src', `../img/${funko.img}.jpg`);
|
||||
elem.querySelector('.funko__readmore').setAttribute('href', `/${funko.href}.html`);
|
||||
|
||||
for (const [k, v] of Object.entries(funko)) {
|
||||
if (special.includes(k))
|
||||
continue;
|
||||
|
||||
|
||||
elem.querySelector(`.funko__${k}`).innerHTML = v;
|
||||
}
|
||||
|
||||
|
||||
funkoContainer.appendChild(elem);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||