More website loading speed and code improvements

This commit is contained in:
Keavon Chambers
2025-01-08 20:49:42 -08:00
parent 68e6bec9b5
commit ae2637e08e
44 changed files with 833 additions and 898 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
window.addEventListener("DOMContentLoaded", () => {
document.querySelectorAll("[data-video-embed]").forEach((placeholder) => {
document.querySelectorAll("[data-youtube-embed]").forEach((placeholder) => {
placeholder.addEventListener("click", () => {
const videoId = placeholder.attributes["data-video-embed"].value;
const videoId = placeholder.attributes["data-youtube-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>`;
});
});