/* Add custom Js code below */
/* Up Btn */
const scrollBtn = document.createElement("button");
scrollBtn.textContent = "↑";
scrollBtn.className = "scrollBtn";
scrollBtn.style.cssText = `
position: fixed;
left: 0;
transform: translateX(-40px);
bottom: 25px;
background-color: #61c2a6;
color: #fff;
width: 35px; height: 35px;
border-radius: 3px;
display: grid;
place-items: center;
box-shadow: 0 0 4px 1px #fff;
border: none;
transition: 0.3s ease-out;
font-weight: bolder;
cursor: pointer;
z-index: 100;
`;
document.body.appendChild(scrollBtn);
window.addEventListener("scroll", function () {
if (window.scrollY >= 200) {
scrollBtn.classList.add("active");
} else {
scrollBtn.classList.remove("active");
}
});
scrollBtn.addEventListener("click", () => {
window.scrollTo({
top: 0,
behavior: "smooth",
});
});
//
//
//
// //
//
//
//
//
// Assuming the store logo URL is available in a variable called 'storeLogoUrl'
const storeLogoUrl = 'https://cdn.salla.sa/cdn-cgi/image/fit=scale-down,width=400,height=400,onerror=redirect,format=auto/KwwBD/Mj3RKkTJ3gP6GsFWHVn1oAeIeLPf21ZiLKX8BbJO.png'; // Replace with the actual store logo URL
const imgElement = document.createElement('img');
imgElement.src = storeLogoUrl;
imgElement.alt = 'Store Logo';
// Get the footer element
const footerElement = document.querySelector('.store-footer'); // Replace with your footer selector
// Append the logo to the footer
footerElement.appendChild(imgElement);
//-----------------------
const anchorElement = document.querySelector('a.flex.items-center.m-0.ai-style-change-1'); // Select the anchor element
const imageUrl = 'https://cdn.salla.sa/cdn-cgi/image/fit=scale-down,width=400,height=400,onerror=redirect,format=auto/KwwBD/Mj3RKkTJ3gP6GsFWHVn1oAeIeLPf21ZiLKX8BbJO.png'; // Image URL
// Create an image element
const imageElement = document.createElement('img');
imageElement.src = imageUrl;
imageElement.alt = 'Replaced Image'; // Add an alt attribute for accessibility
// Clear the anchor's content
while (anchorElement.firstChild) {
anchorElement.removeChild(anchorElement.firstChild);
}
// Append the image to the anchor
anchorElement.appendChild(imageElement);