梦江南 发表于 2025-3-14 09:24

梅花引 宋祖英唱

本帖最后由 梦江南 于 2025-3-14 09:22 编辑 <br /><br /><style type="text/css">
@import url(https://file.uhsea.com/2403/f45f79bba93cd62f8603eae6fa88eb78YS.css);
:root        {--w:800px;--h:590px;}
                /**        不满意一般设置也可以调整下                */
        .lrcShow {
                        font: normal 2em 微软雅黑;
                        pointer-events:none;
                        filter: drop-shadow(1px 0px 0px white) drop-shadow(-1px 0px 0px white) drop-shadow(0px 1px 0px white) drop-shadow(0px -1px 0px white);
                        z-index:99;left:20%;bottom:1%;color:hsla(240,60%, 90%, 0.7);
        }
        .lrcShow::before {
                        color: transparent;
        }
        #oBlk        {
                width:var(--w);height:var(--h); position: relative; margin:20px 0 32px -60px;
                background: hsla(203, 25%, 86%, 0.7);
                padding:16px;
                overflow:hidden;
                border-radius:36px;
                box-shadow:3px 3px 6px darkgray;
        }
        #showSVG        {position:absolute; left:0px;top:0px;width:100%;height:100%;}
#processMeter        {position: absolute; right:2%; bottom:5px; width: 120px; height:60px; cursor: pointer; z-index:99;}
#mCtrl{transform-origin:50%;animation:rot 5s linear infinite var(--rState);}
@keyframes        rot{to{transform: rotate(1turn)}}
      #feather {position: absolute; left: 0; top: 0; width: 50px;offset-distance: 0;offset-path: path("M500 -60 Q 300 80, 600 200 T 1000 840");animation: move 8s linear infinite;z-index:100;}
      @keyframes move { to { offset-distance: 100%;} }
</style>
<div id="oBlk">
        <div id="showSVG"></div>
                <div id="processMeter">
                        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 100" id="svgObj">
                        <defs>
                    <clipPath id="clip">
                            <circle cx="100" cy="50" r="35" />
                    </clilpPath>
            </defs>
                        <image xlink:href="https://pic1.imgdb.cn/item/67d3771988c538a9b5bc93e5.jpg" width="100" height='100' x="50" y="0" id="mCtrl" clip-path="url(#clip)" preserveAspectRatio="none" />
                        <g fill='none' stroke-width='8'>
                                <path d="M 40 97 C -120 -25,330 -25, 150 97 Z" stroke="lightgray" id="bgc"></path>
                                <path d="M 40 97 C -120 -25,330 -25, 150 97 Z" stroke="pink" id="fgc"></path>
                        </g>
                          <g text-anchor="middle" dominant-baseline="middle" fill="red" style="font-size:16px;">
                                <text x="82%" y="55%" id="durTime">00:00</text>
                                <text x="18%" y="55%" id="curTime">00:00</text>
                          </g>
                        </svg>
                </div>
        <divclass="lrcShow" data-lrc=梅花引'></div>
</div>
<script type="text/javascript">
var sf0 = document.createElement('script');
sf0.type = 'text/javascript';
sf0.src = "https://file.uhsea.com/2410/739c572b5176f670f350463cf9ade957QB.js";
sf0.charset = "utf-8";
document.body.appendChild(sf0);

sf0.onload = () => {
let pics = [
"https://img1.oldkids.cn/upload/2025/03/13/blog_260798238_20250313084718691.jpg",
"https://img1.oldkids.cn/upload/2025/03/13/blog_260798238_20250313084759941.jpg",
"https://img1.oldkids.cn/upload/2025/03/13/blog_260798238_20250313084839441.jpg",
"https://img2.oldkids.cn/upload/2025/03/13/blog_260798238_20250313084911710.jpg",
"https://img1.oldkids.cn/upload/2025/03/13/blog_260798238_20250313085024142.jpg",
"https://img3.oldkids.cn/upload/2025/03/13/blog_260798238_20250313085158562.jpg",
"https://img2.oldkids.cn/upload/2025/03/13/blog_260798238_20250313085837205.jpg",
];
function genTagObj(parentNode,jsonData){let sObj=document.createElementNS("http://www.w3.org/2000/svg",jsonData.tag);for(let key in jsonData){if(key==='tag'){continue}else if(jsonData.hasOwnProperty(key)){sObj.setAttribute(key,jsonData)}};if(parentNode)parentNode.appendChild(sObj);return sObj};
let mysvg = genTagObj(null ,{'tag':'svg', 'id':'sObj', 'xmlns:xlink':"http://www.w3.org/1999/xlink" ,'xmlns':"http://www.w3.org/2000/svg", 'viewBox':`0 0 800 600`});
pics.forEach((pic, idx) => {
        let beginStr = idx == 0 ? `0;ep${pics.length-1}.end-5` : `ep${idx-1}.end-5`;
        let imgObj = genTagObj(mysvg,{'tag':'image','id':`p${idx}`, 'xlink:href':pic, 'width':0, 'height':0, 'x':384, 'y':512, 'opacity':0, 'preserveAspectRatio':'none'});
        let aniObj = genTagObj(imgObj,{'tag':'animate','id':`bp${idx}`, 'attributeName':'opacity', 'from':0, 'to':1, 'dur':3, 'begin':beginStr, 'fill':'freeze'});
        aniObj = genTagObj(imgObj,{'tag':'animate', 'attributeName':'x', 'from':384, 'to':0, 'dur':3, 'begin':`bp${idx}.begin`, 'fill':'freeze'});
        aniObj = genTagObj(imgObj,{'tag':'animate', 'attributeName':'y', 'from':512, 'to':0, 'dur':3, 'begin':`bp${idx}.begin`, 'fill':'freeze'});
        aniObj = genTagObj(imgObj,{'tag':'animate', 'attributeName':'width', 'from':0, 'to':800, 'dur':3, 'begin':`bp${idx}.begin`, 'fill':'freeze'});
        aniObj = genTagObj(imgObj,{'tag':'animate', 'attributeName':'height', 'from':0, 'to':610, 'dur':3, 'begin':`bp${idx}.begin`, 'fill':'freeze'});
        //aniObj = genTagObj(imgObj,{'tag':'animateTransform', 'attributeName':'transform', 'type':'rotate','from':'0 384 512', 'to':'360 384 512', 'dur':3, 'begin':`bp${idx}.begin`, 'fill':'freeze'});
       
        //aniObj = genTagObj(imgObj,{'tag':'animateTransform', 'attributeName':'transform', 'type':'rotate','from':'0 384 512', 'to':'-360 384 512', 'dur':3, 'begin':`bp${idx}.begin+10`, 'fill':'freeze'});
        aniObj = genTagObj(imgObj,{'tag':'animate', 'attributeName':'x', 'to':384, 'from':0, 'dur':3, 'begin':`bp${idx}.begin+10`, 'fill':'freeze'});
        aniObj = genTagObj(imgObj,{'tag':'animate', 'attributeName':'y', 'to':512, 'from':0, 'dur':3, 'begin':`bp${idx}.begin+10`, 'fill':'freeze'});
        aniObj = genTagObj(imgObj,{'tag':'animate', 'attributeName':'width', 'to':0, 'from':800, 'dur':3, 'begin':`bp${idx}.begin+10`, 'fill':'freeze'});
        aniObj = genTagObj(imgObj,{'tag':'animate', 'attributeName':'height', 'to':0, 'from':610, 'dur':3, 'begin':`bp${idx}.begin+10`, 'fill':'freeze'});
        aniObj = genTagObj(imgObj,{'tag':'animate','id':`ep${idx}`, 'attributeName':'opacity', 'from':1, 'to':0, 'dur':3, 'begin':`bp${idx}.begin+10`, 'fill':'freeze'});
});
showSVG.innerHTML = mysvg.outerHTML;

const lrc =`
梅花引 - 宋祖英 (Song Zu Ying)
        歌词由 www.33VE.com
        提供词:韩静霆
        曲:徐沛东
        LRC:梦江南
        一枝梅花踏雪来
        悬崖上独自开
        一枝梅花踏雪来
        悬崖上独自开
        回眸一望
        遍地芳菲都消尽
        红颜寂寞空守天地一片白
        谁是我知音
        谁解我情怀
        谁是我知音
        谁解我情怀
        疏影横斜
        一树梅花
        一断魂
        一片冰心等君来
        **********
        一枝梅花踏雪来
        悬崖上独自开
        一枝梅花踏雪来
        悬崖上独自开
        临风一笑化作春泥
        飘零去
        孤芳无痕
        难留清香
        透天外
        谁听我吟唱
        谁为我徘徊
        谁听我吟唱
        谁为我徘徊
        拨开风雪
        赠君东风
        第一枝万朵霞衣任君采
`;
var opts = {
        lrcTxt:lrc,
//        audioCtrl:'mDisk',
        //        歌曲MP3链接放这里
        audioURL:'https://img2.oldkids.cn/upload/2025/03/13/blog_260798238_20250313085609991.mp3'
        //audioURL:'https://cccimg.com/view.php/aa761e148027a311dfb213e0976bb941.aac'
};
let lrcPlayer = new lrcPlayerY(opts);
        //        格式化时间数据
        let formatTime = (time) => {
                let min = ('' + parseInt(time / 60)).padStart(2,'0');
                let sec = ('' + parseInt(time % 60)).padStart(2,'0');
                return (`${min}:${sec}`);
        };
        //        计算/设置控制路径有关的数据
        let circlePoints = [];
        let bgcLen = bgc.getTotalLength();
        fgc.style.strokeDasharray = bgc.style.strokeDasharray = bgcLen;
       
        for(let i = 0; i < bgcLen; i++)        {
                circlePoints.push(bgc.getPointAtLength(i));
        }
        //        在 timeupdate 事件处理中添加与控制路径有关的处理
        lrcPlayer.mObj.addEventListener('timeupdate', function() {
                let processValue = lrcPlayer.mObj.currentTime / lrcPlayer.mObj.duration;
                fgc.style.strokeDashoffset = bgcLen * (1 - processValue);
                durTime.textContent = formatTime(lrcPlayer.mObj.duration);
                curTime.textContent = formatTime(lrcPlayer.mObj.currentTime);
        });
        //        动态元素监测
        let runState = () => {
                lrcPlayer.mObj.paused
                        ? (mCtrl.style.setProperty('--rState','paused'),sObj.pauseAnimations())
                        : (mCtrl.style.setProperty('--rState','running'),sObj.unpauseAnimations());
        }
        //        SVG viewBox 与 实际尺寸的比值
        let factorX = svgObj.viewBox.baseVal.width / svgObj.clientWidth;
        let factorY = svgObj.viewBox.baseVal.height / svgObj.clientHeight;
        //console.log(factorX, factorY);
        //        歌曲进度条鼠标移动处理
        let seeking = false;
        let moveEventProc = (event)        =>        {
                if(!seeking)        return;
                let thePoint = 0, minV = 100;
                circlePoints.forEach((point, idx ) => {
                        let mx = (point.x - event.offsetX * factorX), my = (point.y - event.offsetY * factorY);
                        let mv = mx*mx + my*my;
                        if(mv < minV)        {
                                minV = mv; thePoint = idx;
                        }
                })
                let chkVal = thePoint / bgcLen;
                let chkTime = lrcPlayer.mObj.duration * chkVal;
                fgc.style.strokeDashoffset = bgcLen * (1 - chkVal);

                let fIdx = false;
                lrcPlayer.lrcVec.forEach((lrc,idx) => {
                        if(!fIdx && lrc.seconds >= chkTime )        {
                                fIdx = !fIdx; lrcPlayer.idx = idx;
                                lrcPlayer.mObj.currentTime = chkTime;
                                return fIdx;
                        }
                });
        };
       
        fgc.addEventListener("mousemove", (event) => moveEventProc(event));
        bgc.addEventListener("mousemove", (event) => moveEventProc(event));
        fgc.onclick = bgc.onclick = (event) => seeking = !seeking;                

        //        歌曲、歌词 及 动态元素 启/停控制
        mCtrl.onclick = () => {
                lrcPlayer.mObj.paused ? (lrcPlayer.mObj.play()) : (lrcPlayer.mObj.pause());
        }
        lrcPlayer.mObj.addEventListener('play', () => runState());
        lrcPlayer.mObj.addEventListener('pause', () => runState());
        lrcPlayer.mObj.play().catch(_ = () => runState());

}
</script>

梦油 发表于 2025-3-14 09:43

宋祖英的歌声很甜美,听起来让人感心动耳。

梦江南 发表于 2025-3-14 10:30

梦油 发表于 2025-3-14 09:43
宋祖英的歌声很甜美,听起来让人感心动耳。

是的,宋祖英的歌声甜美,所以选择了她的这首歌曲。谢谢梦油老师沙发支持。

梦油 发表于 2025-3-14 11:05

梦江南 发表于 2025-3-14 10:30
是的,宋祖英的歌声甜美,所以选择了她的这首歌曲。谢谢梦油老师沙发支持。

这些老歌有着很强的生命力。

梦江南 发表于 2025-3-14 11:20

老歌是老一代人的记忆。

红影 发表于 2025-3-14 13:34

很漂亮的图片轮播,江南找了这么多梅花图,辛苦了{:4_187:}

红影 发表于 2025-3-14 13:36

歌曲好听,播放器也漂亮,同步歌词的颜色设置也好看。
欣赏江南好帖{:4_199:}

梦江南 发表于 2025-3-14 15:13

红影 发表于 2025-3-14 13:34
很漂亮的图片轮播,江南找了这么多梅花图,辛苦了

回影子,这梅花是我用手机拍的,后期用PS处理过了。拍得不太好呢。{:4_187:}

梦江南 发表于 2025-3-14 15:17

红影 发表于 2025-3-14 13:36
歌曲好听,播放器也漂亮,同步歌词的颜色设置也好看。
欣赏江南好帖

这首歌曲我在手机上听了后复制到电脑上,用录音后再做成的。觉得宋祖英唱得很好听。

代码是难难老师的,我修改了大小。

流水光阴 发表于 2025-3-14 16:26

问好老师,欣赏了

流水光阴 发表于 2025-3-14 16:27

好听好看,{:4_199:}

流水光阴 发表于 2025-3-14 16:27

感谢分享

梦江南 发表于 2025-3-14 17:27

流水光阴 发表于 2025-3-14 16:26
问好老师,欣赏了

谢谢老师欣赏支持,问好!{:4_190:}

梦江南 发表于 2025-3-14 17:28

流水光阴 发表于 2025-3-14 16:27
好听好看,

谢谢老师再次支持!

梦江南 发表于 2025-3-14 17:29

流水光阴 发表于 2025-3-14 16:27
感谢分享

问好老师谢谢分享。祝分享快乐!

红影 发表于 2025-3-14 20:05

梦江南 发表于 2025-3-14 15:13
回影子,这梅花是我用手机拍的,后期用PS处理过了。拍得不太好呢。

很多的近景,拍得很漂亮啊,还以为找来的图图呢{:4_173:}

红影 发表于 2025-3-14 20:06

梦江南 发表于 2025-3-14 15:17
这首歌曲我在手机上听了后复制到电脑上,用录音后再做成的。觉得宋祖英唱得很好听。

代码是难难老师的 ...

做成这个还挺不容易的呢,江南辛苦了{:4_187:}

梦江南 发表于 2025-3-15 09:36

红影 发表于 2025-3-14 20:05
很多的近景,拍得很漂亮啊,还以为找来的图图呢

早上问好,要拍好梅花只能用微距,拍特写镜头。否则有点乱了。

梦江南 发表于 2025-3-15 09:38

红影 发表于 2025-3-14 20:06
做成这个还挺不容易的呢,江南辛苦了

不辛苦,只是多费点时间,能得到您的鼓励,我很开心呢。{:4_187:}

红影 发表于 2025-3-15 11:16

梦江南 发表于 2025-3-15 09:36
早上问好,要拍好梅花只能用微距,拍特写镜头。否则有点乱了。

你那的梅花还开得挺好呢,江南拍得也好{:4_187:}
页: [1] 2
查看完整版本: 梅花引 宋祖英唱