/** * ViewImage.min.js 2.0.0 * MIT License - http://www.opensource.org/licenses/mit-license.php * https://tokinx.github.io/ViewImage/ */ function _toConsumableArray(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b\n \n
\n
\n
\n
\n
\n
\n
\n '+(d+1)+'/'+b.length+'\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n \n
\n
\n \n ','text/html').body.firstChild,g=function keyFn(j){var k={Escape:'close',ArrowLeft:'tools__flip-prev',ArrowRight:'tools__flip-next'};k[j.key]&&f.querySelector('.view-image-'+k[j.key]).click()},h=function loadImage(j){var k=new Image,l=f.querySelector('.view-image-lead');l.className='view-image-lead view-image-lead__out',setTimeout(function(){l.innerHTML='',k.onload=function(){setTimeout(function(){l.innerHTML='ViewImage',l.className='view-image-lead view-image-lead__in'},100)},k.src=j},300)};document.body.appendChild(f),h(c),window.addEventListener('keydown',g),f.onclick=function(j){j.target.closest('.view-image-close')?(window.removeEventListener('keydown',g),f.onclick=null,f.classList.add('view-image__out'),setTimeout(function(){return f.remove()},290)):j.target.closest('.view-image-tools__flip')&&(d=j.target.closest('.view-image-tools__flip-prev')?0===d?b.length-1:d-1:d===b.length-1?0:d+1,h(b[d]),f.querySelector('.view-image-index').innerHTML=d+1)}}}})();