1
0

Initial commit

This commit is contained in:
2022-03-30 00:01:25 +01:00
commit e09e453071
34 changed files with 323 additions and 0 deletions

21
js/script.js Normal file
View File

@@ -0,0 +1,21 @@
window.addEventListener('load', () => {
const funkoTemplate = document.querySelector('#funkoTemplate');
const funkoContainer = document.querySelector('#funkos');
funkos.forEach(funko => {
const elem = funkoTemplate.content.cloneNode(true);
const special = ['img', 'href'];
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);
});
});