/* global React, ReactDOM, Header, Hero, Supervisor, Ranking, AboutFactoring, TwoVsThree, RecommendByNeed, WhyUs, Testimonials, SelectionCriteria, FAQ, Glossary, FinalCTA, Footer, FloatingCTA, useTweaks, TweaksPanel, TweakSection, TweakRadio */
const TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{
"heroLayout": "split",
"tableDensity": "detailed"
}/*EDITMODE-END*/;
function App() {
const [tweaks, setTweak] = useTweaks(TWEAK_DEFAULTS);
React.useEffect(() => {
// 画像なしのテキストリンクにオレンジボタン用クラスを自動付与
document.querySelectorAll('.btn-row-wrap a, .solo-btn-wrap a').forEach(a => {
const hasVisibleImg = a.querySelector('img:not([width="1"])');
if (!hasVisibleImg) a.classList.add('text-btn');
});
// 全アフィリエイトリンクを別ウィンドウで開く
const selectors = '.company-name-link a, .btn-row-wrap a, .solo-name a, .solo-btn-wrap a, .need-affiliate-btn a';
document.querySelectorAll(selectors).forEach(a => {
a.setAttribute('target', '_blank');
a.setAttribute('rel', 'nofollow noopener noreferrer');
});
}, []);
return (
setTweak("heroLayout", v)}
options={[
{ value: "split", label: "分割(写真あり)" },
{ value: "centered", label: "中央寄せ" },
]}
/>
{
setTweak("tableDensity", v);
// also flip the in-section toggle
const btn = document.querySelector(`.density-toggle button:${v === "compact" ? "last-child" : "first-child"}`);
btn && btn.click();
}}
options={[
{ value: "detailed", label: "詳細" },
{ value: "compact", label: "コンパクト" },
]}
/>
);
}
ReactDOM.createRoot(document.getElementById("root")).render();