【偶然翻唱】谁知我心
本帖最后由 偶然~ 于 2022-9-14 13:39 编辑 <br /><br /><style>#papa { left: -384px; width: 1346px; height: 772px; top: 150px;background: darkred url('http://wx.ttt.dj/data/nfs/img/or.gif') no-repeat center/cover; display: grid; place-items: center; box-shadow: 3px 3px 20px #000; user-select: none; position: relative; z-index: 1;}
#mplayer { position: absolute;top: 230px; width: 120px; height: 120px; left: 180px;border-radius: 50%; overflow: hidden; z-index: 3; }
#track { stroke: url(#gradient); }
#lrc { position: absolute; top: 80px;left: -50px;display: block; }
#lrctxt { text-anchor: middle; dominant-baseline: text-after-edge; fill: url(#gradient); font: bold 2.2em sans-serif; text-shadow: -2px -2px 0px #fff, 2px 2px 3px #000; letter-spacing: 3px; }
#tmsg { fill: RoyalBlue; font: bold 1em sans-serif; }
#btnwrap { display: block; fill: RoyalBlue; cursor: pointer; }
#btnwrap:hover { fill: orange; }
</style>
<div id="papa">
<!-- 播放器 -->
<svg id="mplayer" width="120" height="120" shape-rendering="geometricPrecision">
<g id="mama" transform="rotate(-90, 60, 60)" style="cursor: pointer;">
<circle id="track" cx="60" cy="60" r="50" fill="none" stroke-width="10" stroke="rgba(0,0,0,0.35)" />
<circle id="prog" cx="60" cy="60" r="50" fill="none" stroke-width="4" stroke="rgba(255,255,255,0.55)" />
</g>
<path id="curPath" d="M 20 70 Q 60 0 100 70" fill="none" stroke="none"/>
<path id="durPath" d="M 20 55 Q 60 110 100 55" fill="none" stroke="none"/>
<g id="tmsg">
<text x="34" y="0"><textPath id="curMsg" xlink:href="#curPath" dominant-baseline="text-after-edge">00:00</textPath></text>
<text x="29" y="0"><textPath id="durMsg" xlink:href="#durPath" dominant-baseline="text-before-edge">00:00</textPath></text>
</g>
<g id="btnwrap">
<path id="btnplay" d="M 50 50,50 70,70, 60 z"></path>
<path id="btnpause" d="M 52 50,52 70,57 70,57 50,52 50 z M 60 50,60 70,65 70,65 50,60 50 z"></path>
</g>
</svg>
<!-- lrc歌词 -->
<svg id="lrc" width="560" height="150">
<defs><path id="lrcPath" fill="none" stroke="red" d="M 10 150 Q 305 -10,560 150" /></defs>
<defs>
<linearGradient id="gradient" x1="0" y1="0" x2="0" y2="1">
<stop offset="0%" stop-color="blue"/>
<stop offset="35%" stop-color="yellow"/>
<stop offset="65%" stop-color="gray"/>
<stop offset="100%" stop-color="red"/>
</linearGradient>
</defs>
<textx="54%" y="0"><textPath id="lrctxt" xlink:href="#lrcPath">偶然演唱作品</textPath></text>
</svg>
</div>
<script>
let lrcAr = [
['0.00','《谁知我心》'],
['4.09','演唱:偶然'],
['9.84','制作:偶然'],
['21.91','随风远飘'],
['27.00','前面远望路遥遥'],
['34.10','人生必须奋斗'],
['39.50','烦恼怎会少'],
['45.53','同苦与甘'],
['51.82','谁管甘苦知多少'],
['57.94','如今身边有你'],
['63.42','谁理会前路'],
['67.91','无尽恶兆'],
['77.74',' 最凄楚是世间把我错认'],
['81.26',' 最凄楚是世间把我错认'],
['87.20','唯独你真正明白我'],
['93.05','黑暗尽头是天晓'],
['98.92','谁知我心'],
['104.80','难道我仲未明了'],
['111.63','难得此生有你'],
['117.59','同勉赴危难'],
['121.88','仍共照料'],
['132.01','最凄楚是世间把我错认'],
['141.72','唯独你真正明白我'],
['147.34','黑暗尽头是天晓'],
['152.39','谁知我心'],
['159.89','难道我仲未明了'],
['165.61','难得此生有你'],
['171.44','同勉赴危难'],
['176.17','仍共照料'],
['183.91','谢谢欣赏!'],
['195.33','谢谢欣赏!']
];
let cc = { //圆环对象
x: 1*track.getAttribute('cx'),
y: 1*track.getAttribute('cy'),
r: 1*track.getAttribute('r'),
sw: 1*track.getAttribute('stroke-width'),
len: track.getTotalLength(),
};
let aud = new Audio();
aud.src = 'http://wx.ttt.dj/data/nfs/mp3/or.mp3';
aud.autoplay = true;
aud.loop = true;
prog.style.strokeDasharray = prog.style.strokeDashoffset = cc.len; //进度偏移
btnwrap.onclick = () => aud.paused ? aud.play() : aud.pause(); //按钮单击
mama.onclick = (e) => { //环单击
let deg = Math.atan2(e.offsetY - cc.y, e.offsetX - cc.x) * 180 / Math.PI;
deg += (e.offsetX < cc.x && e.offsetY < cc.y) ? 450 : 90;
aud.currentTime = aud.duration * deg / 360;
};
//audio空间各类监听
aud.addEventListener('pause', () => btnstate());
aud.addEventListener('play',() => btnstate());
aud.addEventListener('timeupdate', () => {
prog.style.strokeDashoffset = cc.len - cc.len * aud.currentTime / aud.duration + 'px';
curMsg.textContent = toMin(aud.currentTime);
durMsg.textContent = toMin(aud.duration);
for(j=0; j<lrcAr.length; j++) {
if(aud.currentTime >= lrcAr) lrctxt.textContent = lrcAr;
}
});
//按钮状态
let btnstate = () => aud.paused ? (btnplay.style.display = 'block', btnpause.style.display = 'none') : (btnplay.style.display = 'none', btnpause.style.display = 'block');
//分秒格式化
let toMin = (val)=> {
if (!val) return '00:00';
val = Math.floor(val);
let min = parseInt(val / 60), sec = parseFloat(val % 60);
if(min < 10) min = '0' + min;
if(sec < 10) sec = '0' + sec;
return min + ':' + sec;
}
</script>
<br><br><br><br><br><br><br><br><br><br><br> 这演唱真好听,非常专业,偶然君太精彩了{:4_199:}好久不见,欢迎归来{:4_204:}
还是黑黑的最新播放器呢,帖子做得真漂亮{:4_187:} 偶然君的粤语歌也算是一绝了,非常赞{:4_187:} 偶然你最棒。。。{:4_178:} 粤语歌曲特别好听,现在是难得听到偶然的歌曲了,知道偶然忙,以后有空来发翻唱,我们期待好声音{:4_187:} 又见到偶然~老师! 上茶~~{:4_190:} 红影 发表于 2022-9-14 09:24
这演唱真好听,非常专业,偶然君太精彩了好久不见,欢迎归来
谢谢美女{:4_187:} 红影 发表于 2022-9-14 09:26
还是黑黑的最新播放器呢,帖子做得真漂亮
谢谢欣赏 小辣椒 发表于 2022-9-14 18:56
偶然你最棒。。。
谢谢美女{:4_187:} 小辣椒 发表于 2022-9-14 18:58
粤语歌曲特别好听,现在是难得听到偶然的歌曲了,知道偶然忙,以后有空来发翻唱,我们期待好声音
好的,最近实在忙 阙歌 发表于 2022-9-27 23:01
又见到偶然~老师! 上茶~~
谢谢阙歌,喝茶{:4_180:} 老歌经典,唱的真棒!赞!!
{:4_204:}{:4_199:} 唱的真棒{:4_187:} 蜻蜓 发表于 2022-11-16 21:33
唱的真棒
谢谢欣赏{:4_187:} 大猫咪 发表于 2022-10-28 15:07
老歌经典,唱的真棒!赞!!
谢谢欣赏{:4_187:}
页:
[1]