/* Add custom Js code below */ document.addEventListener("DOMContentLoaded", function () { const videoData = [ { selector: ".order-2.md\\:-order-1", src: "https://github.com/wpAzzrk/Engy/raw/refs/heads/main/ezgif.mp4", }, { selector: ".flex.gap-3.items-center .relative:nth-child(1)", src: "https://github.com/wpAzzrk/Engy/raw/refs/heads/main/honey2.mp4", }, { selector: ".flex.gap-3.items-center .relative:nth-child(2)", src: "https://github.com/wpAzzrk/Engy/raw/refs/heads/main/honey3.mp4", } ]; videoData.forEach(video => { const container = document.querySelector(video.selector); if (container) { const videoElement = document.createElement("video"); videoElement.setAttribute("width", "100%"); videoElement.setAttribute("autoplay", ""); videoElement.setAttribute("loop", ""); videoElement.setAttribute("muted", ""); videoElement.setAttribute("playsinline", ""); const sourceElement = document.createElement("source"); sourceElement.setAttribute("src", video.src); sourceElement.setAttribute("type", "video/mp4"); videoElement.appendChild(sourceElement); container.innerHTML = ""; // Clear previous content container.appendChild(videoElement); } }); }); document.addEventListener("DOMContentLoaded", function () { document.querySelectorAll("video").forEach(video => { video.play().catch(error => { console.error("Autoplay failed:", error); video.muted = true; // Ensure muted to allow autoplay video.play(); }); }); document.querySelectorAll(".relative, .order-2").forEach(container => { container.addEventListener("click", function () { const video = this.querySelector("video"); if (video) { video.play(); } }); }); }); let esm = "ورقة"; let link = "https://warrqa.com"; document.addEventListener("DOMContentLoaded", function () { document.querySelector("footer p.text-gray-400").innerHTML = ` صنع بإتقان على ${esm} | 2025 `; });