小辣椒 发表于 2025-12-23 21:43

连环画 --- 西游记(上) 转帖

<meta charset="utf-8">
<meta name="referrer" content="never" />
<style type="text/css">
:root        {--w:540px; --h:760px;}
#oBlk        {
        width:840px;height:900px;
        background-image: url(https://z3.ax1x.com/2021/09/16/4nMjJA.gif);
        display: grid;
        place-items:center;position:relative;
        grid-template-rows: 700px 192px;
        grid-template-columns:100%;
        box-shadow:3px 3px 8px darkgray;
        overflow:hidden;border-radius:24px;
        font-size:12px;padding:10px;
        margin:80px auto 40px calc(50% - 501px);
}
#cataFrame        {width:810px;height:192px;border:6px white groove;overflow:hidden;border-radius:24px;position:relative;}
/***************************************************************************************************/
#imgHold img        {width:var(--w);height:var(--h);transform-origin:0 0; transform:rotate(-90deg) translateX(calc(-1 * var(--w)));position:absolute;top:0px;}
#imgHold        {height:var(--w);position:absolute;left:0px;}
#storyBookBlk        {
        width:var(--h);
        height:var(--w);
        overflow:hidden;
        border-radius:24px;
        box-shadow:4px 4px 10px black;
        position:relative;
}       
#targetD        {width:820px;height:620px;border:6px white groove;place-items:center;overflow:hidden;border-radius:24px;}
#gName        {font:bold 2.5em 隶书;color:brown;margin:12px;}
#pichold        {height:192px;position:absolute;left:0px;top:0px;animation: mleft 54.8s linear infinite paused;}
#pichold img        {width:270px;height:192px;margin-right:4px;cursor:pointer;float:left;}
#pichold:hover        {animation-play-state: running;}
@keyframes        mleft        {to {left:-5480px;}}
</style>
<div id="oBlk">
        <div id="targetD">
                <div id="gName">《岳飞出世》</div>
                <div id="storyBookBlk">
                        <div id="imgHold">
                        <!--

                        -->
                        </div>
                </div>
        </div>
        <div id="cataFrame"><div id="pichold"></div></div>
</div>
<script>
let hVal = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--h'));

var sf1 = document.createElement('script');
sf1.type = 'text/javascript';
sf1.src = "https://cccimg.com/down.php/22e3a67532645aa6c008a22db22a617e.js";
//sf1.src='./西游记V(上)pic.js';

sf1.charset = "utf-8";
document.body.appendChild(sf1);
sf1.onload = () => {
gName.innerHTML = gsName;
imgs.forEach((pic,idx) => {
        let imgObj = document.createElement('img');
        imgObj.src = pic;
        imgObj.dataset.idx = idx % gsName.length;
        pichold.appendChild(imgObj);
});
let imgObj = pichold.querySelector('img');
let imgObjWidth = imgObj.clientWidth + parseInt(getComputedStyle(imgObj).marginLeft) + parseInt(getComputedStyle(imgObj).marginRight);

pichold.style.width = imgs.length *imgObjWidth + 'px';
//        点击封面图片的动作
pichold.querySelectorAll('img').forEach( imgObj => {
        imgObj.onclick = () => {
                let selIdx = imgObj.dataset.idx;
                gName.innerHTML = gsName;
                loadStory(selIdx);
        }
});
        let loadStory = (idx) =>        {
                imgHold.innerHTML = '';
                imgHold.style.left = '0px';
                imgHold.style.width = pics.length * hVal + 'px';;
                pics.forEach((pic, idx) => {
                        let imgObj = document.createElement('img');
                        imgObj.src = pic;pic.alt='';
                        imgObj.style.left = hVal * idx + 'px';
                        imgHold.appendChild(imgObj);
                });
                       
                let numPic = imgHold.querySelectorAll('img');

                imgHold.onmousedown = (ev) => {
                        let styleLeft = parseInt(imgHold.style.left);
                        let sbOffsetWidth = parseInt(storyBookBlk.offsetWidth);
                        let imgOffsetLeft = parseInt(imgHold.offsetLeft);
                        if(ev.button === 0)        {
                                if(styleLeft > ((1 - numPic.length) * sbOffsetWidth))        imgHold.style.left = (imgOffsetLeft -= sbOffsetWidth) + 'px';
                                else imgHold.style.left = '0px';
                        }
                        else if(ev.button === 2)        {
                                if(imgOffsetLeft === 0)imgHold.style.left = (1 - numPic.length) * sbOffsetWidth + 'px';
                                else imgHold.style.left = (imgOffsetLeft += sbOffsetWidth) + 'px';
                        }

                }
               
                oBlk.addEventListener('contextmenu', function(event) {
                        event.preventDefault();
                });
        }
        loadStory(0);
}
</script>

小辣椒 发表于 2025-12-23 21:44

一起欣赏

liumang 发表于 2025-12-24 20:44

这个好,上班没有事情的时候可以看看{:5_118:}

liumang 发表于 2025-12-24 20:44

转贴也精彩

liumang 发表于 2025-12-24 20:44

就是没有听到音乐?
页: [1]
查看完整版本: 连环画 --- 西游记(上) 转帖