Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
Signed-off-by: parencode <[email protected]>
  • Loading branch information
parencode authored Feb 15, 2024
1 parent a72e75a commit f814581
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion guitarvideopull/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@


<script>
var urlString=window.location.href,match=urlString.match(/\?(\d+)/),numero=match?match[1]:null,scriptElement=document.createElement("script");scriptElement.src=null!=numero?`./data/list${numero}.js`:"./data/list.js",scriptElement.addEventListener("load",()=>{$('#staticBackdrop').modal('show');e=0;const c=function(t){0===e&&(e=1,window.addEventListener("message",function(e){if("https://www.youtube.com"===e.origin&&void 0!==e.data)try{var t=JSON.parse(e.data);"onStateChange"===t.event&&n(t)}catch(e){}})),t.addEventListener("load",function(){var e=JSON.stringify({event:"listening",id:t.id+"",channel:"widget"});t.contentWindow.postMessage(e,"https://www.youtube.com"),e=JSON.stringify({event:"command",func:"addEventListener",args:["onStateChange"],id:t.id+"",channel:"widget"}),t.contentWindow.postMessage(e,"https://www.youtube.com")})};var e;const n=e=>{switch(e.info){case 1:break;case 0:w.to(Number.parseInt(e.id)+1)}},m=document.getElementById("videoPanel");new bootstrap.Modal(document.getElementById("videoModal"));const u=document.getElementById("carouselInner");let v;const o="?autohide=2&border=0&wmode=opaque&enablejsapi=1&rel=0&controls=1&showinfo=0&start=0&origin=https://parencode.github.io";function p(e){e=new URL(e);return e.searchParams.get("v")||e.pathname.split("/").pop()}function g(e,t,n){var a=document.createElement("iframe");return a.className="videoFrame",a.frameborder="0",a.src=`https://www.youtube.com/embed/${p(e)}${o}&autoplay=`+t,a.allow="autoplay; encrypted-media; allowfullscreen; mozallowfullscreen; msallowfullscreen; oallowfullscreen; ebkitallowfullscreen;",a.id=n,a}var t=document.getElementById("videoCarousel");t.addEventListener("slide.bs.carousel",e=>{var t=e.to,n=videosJSON.videos[t],a=("left"==e.direction?e.relatedTarget.previousElementSibling:e.relatedTarget.nextElementSibling).querySelector(".videoFrame"),a=(a.parentNode.removeChild(a),g(videosJSON.videos[t].enlace,1,t));c(a),e.relatedTarget.querySelector(".videoContainer").appendChild(a),v="",a=e.relatedTarget.querySelector(".videoFrame"),h=t,v!==a&&(v&&void 0!==v.contentWindow&&v.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*"),(v=a).contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}',"*")),document.getElementById("videoModalLabel").innerHTML=1+t+" - "+n.titulo});const w=new bootstrap.Carousel(t);let h=-1;function a(){let t=1;async function e(){var e=9*(t-1),n=9+e;for(let t=e;t<n&&t<videosJSON.videos.length;t++){var a=videosJSON.videos[t],o=document.createElement("div"),d=(o.className="col-md-3 col-lg-3 videoItem",document.createElement("div")),i=(d.className="videoTitle",d.textContent=a.titulo,document.createElement("div")),l=(i.className="videoArtist",i.textContent=a.artista,document.createElement("a")),r=(l.className="videoLink",l.href=a.enlace,l.target="_blank",l.textContent="Ver video en YouTube",document.createElement("div")),s=(r.className="videoContainer",r.dataset.bsTarget="#videoModal",r.dataset.bsToggle="modal",r.addEventListener("click",()=>{var d,e;d=t,e=videosJSON.videos,h!=d&&((u.innerHTML="")==u.innerHTML&&e.forEach((e,t)=>{var n,a=document.createElement("div"),o=(a.className="carousel-item "+(t===d?"active":""),document.createElement("div"));o.className="videoContainer",t===d&&(n=g(e.enlace,1,d),c(n),o.appendChild(n),v=n,document.getElementById("videoModalLabel").innerHTML=1+d+" - "+e.titulo,h=t),a.appendChild(o),u.appendChild(a)}),w.to(d))}),document.createElement("img"));s.className="videoFrame",s.id="l"+t,s.dataset.videoSrc=a.enlace,s.src=`https://i.ytimg.com/vi/${p(a.enlace)}/hqdefault.jpg`,r.appendChild(s),o.appendChild(r),o.appendChild(d),o.appendChild(i),o.appendChild(l),m.appendChild(o)}t++}e(),window.addEventListener("scroll",()=>{window.innerHeight+window.scrollY>=document.body.offsetHeight/5&&e()})}document.getElementById("textareaModal").addEventListener("hide.bs.modal",e=>{var t=document.getElementById("floatingTextarea").value.split("\n").map((e,t)=>({titulo:"",artista:"",enlace:e.trim()}));videosJSON={videos:t},document.getElementById("videoPanel").innerHTML="",document.getElementById("carouselInner").innerHTML="",paginaActual=0,a()}),a()}),document.body.appendChild(scriptElement);</script>
var urlString=window.location.href,match=urlString.match(/\?(\d+)/),numero=match?match[1]:null,scriptElement=document.createElement("script");scriptElement.src=null!=numero?`./data/list${numero}.js`:"./data/list.js",scriptElement.addEventListener("load",()=>{$('#staticBackdrop').modal('show');e=0;const c=function(t){0===e&&(e=1,window.addEventListener("message",function(e){if("https://www.youtube.com"===e.origin&&void 0!==e.data)try{var t=JSON.parse(e.data);"onStateChange"===t.event&&n(t)}catch(e){}})),t.addEventListener("load",function(){var e=JSON.stringify({event:"listening",id:t.id+"",channel:"widget"});t.contentWindow.postMessage(e,"https://www.youtube.com"),e=JSON.stringify({event:"command",func:"addEventListener",args:["onStateChange"],id:t.id+"",channel:"widget"}),t.contentWindow.postMessage(e,"https://www.youtube.com")})};var e;const n=e=>{switch(e.info){case 1:break;case 0:w.to(Number.parseInt(e.id)+1)}},m=document.getElementById("videoPanel");new bootstrap.Modal(document.getElementById("videoModal"));const u=document.getElementById("carouselInner");let v;const o="?autohide=2&border=0&wmode=opaque&enablejsapi=1&rel=0&controls=1&showinfo=0&start=0&origin=https://parencode.github.io";function p(e){e=new URL(e);return e.searchParams.get("v")||e.pathname.split("/").pop()}function g(e,t,n){var a=document.createElement("iframe");return a.className="videoFrame",a.frameborder="0",a.src=`https://www.youtube.com/embed/${p(e)}${o}&autoplay=`+t,a.allow="autoplay; encrypted-media; allowfullscreen; mozallowfullscreen; msallowfullscreen; oallowfullscreen; ebkitallowfullscreen;",a.id=n,a}var t=document.getElementById("videoCarousel");t.addEventListener("slide.bs.carousel",e=>{var t=e.to,n=videosJSON.videos[t],a=("left"==e.direction?e.relatedTarget.previousElementSibling:e.relatedTarget.nextElementSibling).querySelector(".videoFrame"),a=(a.parentNode.removeChild(a),g(videosJSON.videos[t].enlace,1,t));c(a),e.relatedTarget.querySelector(".videoContainer").appendChild(a),v="",a=e.relatedTarget.querySelector(".videoFrame"),h=t,v!==a&&(v&&void 0!==v.contentWindow&&v.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*"),(v=a).contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}',"*")),document.getElementById("videoModalLabel").innerHTML=1+t+" - "+n.titulo});const w=new bootstrap.Carousel(t);let h=-1;function a(){let t=1;async function e(){var e=9*(t-1),n=9+e;for(let t=e;t<n&&t<videosJSON.videos.length;t++){var a=videosJSON.videos[t],o=document.createElement("div"),d=(o.className="col-md-3 col-lg-3 videoItem",document.createElement("div")),i=(d.className="videoTitle",d.textContent=a.titulo,document.createElement("div")),l=(i.className="videoArtist",i.textContent=a.artista,document.createElement("a")),r=(l.className="videoLink",l.href=a.enlace,l.target="_blank",l.textContent="Ver video en YouTube",document.createElement("div")),s=(r.className="videoContainer",r.dataset.bsTarget="#videoModal",r.dataset.bsToggle="modal",r.addEventListener("click",()=>{var d,e;d=t,e=videosJSON.videos,h!=d&&((u.innerHTML="")==u.innerHTML&&e.forEach((e,t)=>{var n,a=document.createElement("div"),o=(a.className="carousel-item "+(t===d?"active":""),document.createElement("div"));o.className="videoContainer",t===d&&(n=g(e.enlace,1,d),c(n),o.appendChild(n),v=n,document.getElementById("videoModalLabel").innerHTML=1+d+" - "+e.titulo,h=t),a.appendChild(o),u.appendChild(a)}),w.to(d))}),document.createElement("img"));s.className="videoFrame",s.id="l"+t,s.dataset.videoSrc=a.enlace,s.src=`https://i.ytimg.com/vi/${p(a.enlace)}/hqdefault.jpg`,r.appendChild(s),o.appendChild(r),o.appendChild(d),o.appendChild(i),o.appendChild(l),m.appendChild(o)}t++}e(),window.addEventListener("scroll",()=>{window.innerHeight+window.scrollY>=document.body.offsetHeight/5&&e()})}document.getElementById("textareaModal").addEventListener("hide.bs.modal",e=>{var t=document.getElementById("floatingTextarea").value.trim().split("\n").map((e,t)=>({titulo:"",artista:"",enlace:e.trim()}));videosJSON={videos:t},document.getElementById("videoPanel").innerHTML="",document.getElementById("carouselInner").innerHTML="",paginaActual=0,a()}),a()}),document.body.appendChild(scriptElement);</script>
</body>
</html>

0 comments on commit f814581

Please sign in to comment.