//--------------------------------------------------------------------// //----- 💻 EDIT THE CODE ONLY IN THIS SECTION TO CUSTOMIZE YOUR PLUGIN 💻 -----// //--------------------------------------------------------------------// // Reference the element ID from Carrd, under Element's Settings. Replace icons09 with your own const ICONS_LIST_ID = "icons02" // This gets the third icon in the Icon group element. Change this to get the correct Icon element in order. // If you want to change the 3rd Icon to a custom one, replace 3 with the position number const ICON_INDEX = 3 // Paste the direct link to the icon. On browser, right click over the icon, select Copy Image Address const IMAGE_SRC = "https://www.svgrepo.com/show/488297/mushroom.svg" // This adjusts the icon width and height in px const IMAGE_WIDTH = 65 const IMAGE_HEIGHT = 65 //--------------------------------------------------------------------// //----- 🚨 DO NOT EDIT THE CODE FROM HERE ONWARDS BELOW! 🚨 -----// //--------------------------------------------------------------------// // Get the list of icons const iconsList = document.getElementById(ICONS_LIST_ID) // Check if the element exists if (iconsList) { // Get all list items const listItems = iconsList.getElementsByTagName("li") // Check if there are at least two list items if (listItems.length > 1) { // Get the list item to get the correct icon in order. The 1st item is indexed as 0 const listItem = listItems[ICON_INDEX - 1] // Get the SVG element within the second list item const svgElement = listItem.querySelector("svg") // Check if the SVG element exists if (svgElement) { // Create a new image element const newImage = document.createElement("img") // Set the source of the new image newImage.src = IMAGE_SRC // Set the width and height of the new image newImage.width = IMAGE_WIDTH newImage.height = IMAGE_HEIGHT // Replace the SVG element with the new image svgElement.parentNode.replaceChild(newImage, svgElement) } } }