古着屋JAMは、古着初心者の方からヴィンテージマニアまで誰もが楽しめる日本最大級のインポート古着&アンティーク雑貨専門店です。
document.addEventListener("DOMContentLoaded", function () {
if (!location.href.includes("icon_test")) return;
const intervalId = setInterval(() => {
const articles = document.querySelectorAll(".result-container article.list-article");
if (!articles.length) return;
clearInterval(intervalId);
articles.forEach(article => {
const link = article.querySelector(".list-article-a");
if (!link) return;
const href = link.getAttribute("href");
const match = href.match(/\/fs\/c\/([a-zA-Z0-9]+)/);
if (!match) return;
const code = match[1];
fetch(`https://api.jamtrading.info/items/${code}`)
.then(res => res.text())
.then(text => {
const json = JSON.parse(text);
if (!json || !json.item || !json.item.shop_group) return;
const group = json.item.shop_group;
const imgArea = article.querySelector(".list-article-image-area");
if (!imgArea) return;
if (group === "ELULU") {
imgArea.classList.add("icon_elulu_active");
} else if (group === "ADEL") {
imgArea.classList.add("icon_adel_active");
}
})
.catch(err => console.error("APIエラー:", err));
});
}, 300);
});