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);
	});
});