import { useEffect, useState } from "react";
import "./index.less"
function Ai() {
    const [url,setUrl]=useState("https://ibiling.cn/novel/detail/zdyscq?pageid=01jacqn2j8tf9ecfwps9nzebnz")
    useEffect(()=>{
        let name = location.hash
        switch (name) {
            case "#/ai/custom":
                setUrl("https://ibiling.cn/novel/detail/zdyscq?pageid=01jacqn2j8tf9ecfwps9nzebnz")
                break;
            case "#/ai/expand":
                setUrl("https://ibiling.cn/novel/detail/2xskx?pageid=01jn5k01a8hqd1ggapbzpk5m4r")
               break;
            case "#/ai/mainPlot":
                setUrl("https://ibiling.cn/novel/detail/2gszxjq?pageid=01jac7q1d6an5rnx2hwv76zt5k")
               break;
            case "#/ai/branchPlot":
                setUrl("https://ibiling.cn/novel/detail/2zxjqfj?pageid=01j55h3cme81d0bkkn7se51z1a")
               break;
            case "#/ai/outline":
                setUrl("https://ibiling.cn/novel/detail/2xsdgscq?pageid=01jn5ntqvh5s0hgz64gf05tzzw")
               break;
            case "#/ai/chapterOutline":
                setUrl("https://ibiling.cn/novel/detail/2xg?pageid=01j9zw229vdyfv7t3a8ct77025")
               break;
            case "#/ai/reversePlot":
                setUrl("https://ibiling.cn/novel/detail/2xsjqfz?pageid=01j9x8jymezp5ms1hhzgem1m0a")
               break;
            case "#/ai/plot":
                setUrl("https://ibiling.cn/novel/detail/2jqlg?pageid=01jn5pyv03z9twb5qds3rz4h4b")
               break;
            case "#/ai/character":
                setUrl("https://ibiling.cn/novel/detail/2xsrwsd?pageid=01j4re8c7qmmyn3ws2wr3etr6r")
               break;
        }
    },[])
    return <div>
        <div style={{ height: "calc(100vh - 63px)", width: "100%", overflow: "hidden", position: "relative", background: "#fff" }}>
            <iframe
                id="ai-iframe"
                width={"100%"}
                height={"100%"}
                frameBorder={0}
                style={{ position: "absolute", top: -63,left:"-20%",width:"110%",}}
                src={url}
            >
            </iframe>
            <div style={{width:"28%",height:"100%",background:"#fff",zIndex:99,position:"absolute",right:0,top:0}}></div>
            <div style={{width:"15%",height:"100%",background:"#fff",zIndex:99,position:"absolute",left:0,top:0}}></div>
            {/* <div style={{width:"50%",height:"10%",background:"#fff",zIndex:99,position:"absolute",left:"15%",top:0}}></div> */}
        </div>
    </div>
}

export default Ai;