H H WA /* ステッチカラー箱 */ ステッチ BK G G WT F F F WA E E E WT D D GF C C WA B B GF A A GF // すべてのpath要素を取得 const paths = document.querySelectorAll('path'); // 各path要素のd属性を変更して、y座標を100上げる paths.forEach(path => { let d = path.getAttribute('d'); d = d.replace(/([MLCSTV])(-?\d*\.?\d+),(-?\d*\.?\d+)/g, (match, command, x, y) => { return `${command}${x},${parseFloat(y) + 100}`; }); path.setAttribute('d', d); // 新しいd属性を設定 });