Reduce website static content file size by a lot

This commit is contained in:
Keavon Chambers
2023-08-23 15:36:55 -07:00
parent 2d99d4bee1
commit 89b269cf55
12 changed files with 49 additions and 37 deletions
+8
View File
@@ -0,0 +1,8 @@
window.addEventListener("DOMContentLoaded", () => {
document.querySelectorAll("[data-video-embed]").forEach((placeholder) => {
placeholder.addEventListener("click", () => {
const videoId = placeholder.attributes["data-video-embed"].value;
placeholder.outerHTML = `<iframe width="1280" height="720" src="https://www.youtube.com/embed/${videoId}?autoplay=1" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>`;
});
});
});