fix samples

pull/356/head
Vladimir Mandic 2021-12-28 07:03:02 -05:00
parent da48dcb449
commit ae05c7d2b2
1 changed files with 6 additions and 2 deletions

View File

@ -63,9 +63,13 @@
for (const sample of samples) { for (const sample of samples) {
const el = document.createElement('img'); const el = document.createElement('img');
el.className = 'thumb'; el.className = 'thumb';
el.src = el.title = el.alt = `/samples/in/${sample}`; el.src = `./in/${sample}`;
el.title = el.src;
el.alt = el.src;
el.addEventListener('click', (evt) => { el.addEventListener('click', (evt) => {
image.src = image.alt = image.title = el.src.replace('/in/', '/out/'); image.src = el.src.replace('/in/', '/out/');
image.alt = image.src;
image.title = image.src;
strip.scrollLeft = evt.target.offsetLeft - window.innerWidth / 2 + evt.target.offsetWidth / 2; strip.scrollLeft = evt.target.offsetLeft - window.innerWidth / 2 + evt.target.offsetWidth / 2;
}); });
strip.appendChild(el); strip.appendChild(el);