This commit is contained in:
github-actions[bot]
2022-04-21 07:06:44 +00:00
parent e8f79874dc
commit d5ed4734f9
307 changed files with 982 additions and 949 deletions

View File

@@ -95,4 +95,16 @@ document.addEventListener("DOMContentLoaded", () => {
link.parentNode.parentNode.classList.add('expanded')
})
})
// Video
document.querySelectorAll('.ytEmbed').forEach(video => {
video.addEventListener('click', e => {
e.preventDefault()
const lazyAttr = 'data-src'
const iframe = e.target.querySelector(`iframe[${lazyAttr}]`)
if (iframe) {
const src = iframe.setAttribute('src', iframe.getAttribute(lazyAttr))
}
})
})
})