/* Add custom Js styles below */ //---------------------للنجوم------------------- document.addEventListener('DOMContentLoaded', function() { var containers = document.getElementsByClassName('flex items-center justify-between mb-5'); var container = containers[0]; var productRating = document.createElement('div'); productRating.classList.add('product-rating'); var stars = document.createElement('div'); stars.classList.add('stars'); var rating = 5; // تقييم المنتج من 5 for (var i = 1; i <= 5; i++) { var star = document.createElement('span'); star.classList.add('star'); star.innerHTML = (i <= rating) ? '★' : '☆'; if (i > rating) { star.classList.add('empty'); } stars.appendChild(star); } productRating.appendChild(stars); var ratingCount = document.createElement('div'); ratingCount.classList.add('rating-count'); ratingCount.innerHTML = '(6932 تقييمات)'; // عدد المقييمين productRating.appendChild(ratingCount); container.insertBefore(productRating, container.firstChild); }); //----------- توضيح النص للملاحظات function waitForElement(selector, callback) { let element = document.querySelector(selector); if (element) { callback(element); } else { let observer = new MutationObserver(function(mutations, observer) { let element = document.querySelector(selector); if (element) { observer.disconnect(); callback(element); } }); observer.observe(document.body, { childList: true, subtree: true }); } } document.addEventListener("DOMContentLoaded", function() { waitForElement("b.block", function(label) { if (label.textContent.includes("المرفقات")) { label.innerHTML += ' ( اكتب نص الإهداء هنا )'; } }); }); //-- الزر الثابت والنافذة المنبثقة ---------- // إنشاء الزر الثابت let fixedButton = document.createElement("div"); fixedButton.className = "fixed-button"; fixedButton.innerText = "تبي بطاقة اهداء؟"; fixedButton.onclick = function () { document.querySelector(".popup-overlay").style.display = "block"; }; document.body.appendChild(fixedButton); // إنشاء النافذة المنبثقة let popupOverlay = document.createElement("div"); popupOverlay.className = "popup-overlay"; popupOverlay.onclick = function (event) { if (event.target === popupOverlay) { popupOverlay.style.display = "none"; } }; popupOverlay.innerHTML = ` `; document.body.appendChild(popupOverlay);