本帖最后由 加林森 于 2022-2-23 14:49 编辑 <br /><br />马黑黑 发表于 2021-11-28 12:43
蟹吃多了,或是太忙与伐木了
头有点晕乎乎的
<style tpye="text/css">
#lrcUl { width: 500px; list-style-type: none; column-count: 3; column-gap: 4px; }
#lrcUl li { font-size:14px; color: black;list-style-type: none; }
#myplayer { outline: none; list-style-type: none; }
</style>
<audio id="myplayer"
src="https://www.joy127.com/url/88714.mp3" controls="controls"></audio>
<ul id="lrcUl">
</ul>
<script language="javascript">
var lrcAr=[
["00:00.00","周启生-天长地久"],
["00:05.45"],
["00:22.19","孤单的手 紧抱着你的腰"],
["00:28.30","像昨日正相爱的时候"],
["00:35.69","你说今天以后 不必再见也不必问候"],
["00:42.37","曾经拥有不要泪流"],
["00:49.16","温馨的手终放下我的手"],
["00:55.81","默默合上双眼难忍受"],
["01:02.57","你已轻轻吻别"],
["01:04.96","心中只想这一刻停留"],
,
["01:15.16","如果真心不可接受"],
["01:18.37","或者不方便拥有"],
["01:21.72","为何又等今天最后"],
["01:25.08","趁早一点分手"],
["01:28.38","如果是你真的贪心厌旧"],
["01:31.87","伪装悲哭梦湿透"],
["01:35.21","为何你想讲的情话"],
["01:38.42","藏于落寞眼光背后"],
["01:44.83"],
["01:56.31","依依不舍的看着你的走"],
["02:02.93","木立在这失意的时候"],
["02:08.85","一生今天最后"],
["02:11.86","不讲再见也不肯回头"],
["02:16.49","曾经拥有不要泪流"],
["02:22.23","如果真心不可接受"],
["02:25.48","或者不方便拥有"],
["02:28.99","为何又等今天最后"],
["02:32.18","趁早一点分手"],
["02:35.65","如果是你真的贪心厌旧"],
["02:38.97","伪装悲哭梦湿透"],
["02:42.37","为何你想讲的情话"],
["02:45.49","藏于落寞眼光背后"],
["02:51.65","道尽你苦与忧"],
["02:54.77","落寞眼光背后"],
["02:58.30","道尽你苦与忧"],
["03:01.64","落寞眼光背后"],
["03:05.12","道尽你苦与忧"],
["03:08.46","落寞眼光背后"],
["03:11.96","道尽你苦与忧"]
];
var offset = 0; //偏移量
var myaud = document.getElementById('myplayer'); //播放器标识
var lrcUl = document.getElementById('lrcUl'); //歌词显示元素标识
//处理lrc歌词数组:时间转换成秒、歌词放入li标签
for(j=0; j<lrcAr.length; j++){
lrcAr = toSec(lrcAr);
lrcUl.innerHTML += "<li id='li" + lrcAr + "'>" + lrcAr + "</li>";
}
//lrc时间信息转为秒
function toSec(lrcTime) {
let tmpAr = lrcTime.split(':');
lrcTime = tmpAr * 60 + parseInt(tmpAr);
return lrcTime;
}
//同步高亮歌词
myaud.ontimeupdate = function() {
let tt = this.currentTime + offset;
for(j=0; j<lrcAr.length; j++){
if(tt > lrcAr){
if(j > 0){
let idxLast = lrcAr;
document.getElementById("li" + idxLast).style.color = "black";
}
let idx = lrcAr;
document.getElementById("li" + idx).style.color = "red";
}
}
}
// 播放结束取消最后一行红色、重新播放
myaud.onended = function() {
document.getElementById("li" + lrcAr).style.color = "black";
this.play();
}
</script>
加林森 发表于 2021-11-28 12:57
头有点晕乎乎的
正常正常
本帖最后由 加林森 于 2022-4-1 23:12 编辑 <br /><br />马黑黑 发表于 2021-11-28 13:06
正常正常
嗯嗯
<style type="text/css">
/* 帖子容器 */
#tzDiv {
position: relative;
left: -214px;
width: 1024px;
height: 700px;
top: 80px;
background: #eee url('https://pic.imgdb.cn/item/6247140727f86abb2a3ee440.jpg') no-repeat center/cover;
opacity: 0.8;
}
/* 音乐控制按钮 */
.picBtn {
position: absolute;
width: 100px;
height: 100px;
left: 180px;
bottom: 60px;
border: none;
outline: none;
border-radius: 8px;
background: transparent url('https://pic.imgdb.cn/item/622a00ea5baa1a80ab412ada.gif') no-repeat;
cursor: pointer;
}
/* 文本时钟 */
#textClock {
position: absolute;
top: 180px;
right: 200px;
width: 300px;
height: 30px;
font: 20px / 30px Sans-Serif;
text-align: center;
}
/* 走马灯父框 */
.txtFly {
position: absolute;
width: 260px;
height: 30px;
right: 100px;
bottom: 100px;
overflow: hidden;
}
/* 走马灯文本 */
.txtFly div {
position: absolute;
left: 260px;
font: normal 18px /20px Sans-Serif;
word-break: keep-all;
white-space:nowrap;
}
/* 变色文本 */
.txtBg {
position: absolute;
top: 80px;
right: 100px;
font-size: 4rem;
color: transparent;
width: 500px;
height: 100px;
line-height: 100px;
text-align: center;
background-image: linear-gradient(90deg, green, olive, transparent, tomato, green);
background-size: 500px 100px;
background-position: 500px 0;
border: 1px solid;
background-clip: text;
-webkit-background-clip: text;
animation: chgc 2s linear infinite;
}
/* 文本变色动画 */
@keyframes chgc {
from { background-position: -500px 0; }
to { background-position: 0 0; }
}
</style>
<div id="tzDiv">
<div class="txtBg">绿叶对根的情意</div>
<div id="textClock"></div>
<div class="txtFly">
<div id="ziFly">绿叶对根的情意- 刘欢 不要问我到哪里去 我的心依着你
不要问我到哪里去 我的情牵着你
我是你的一片绿叶,
我的根在你的土地
春风中告别了你,
今天这方明天那里。。。。。。</div>
</div>
<button id="picBtn" class="picBtn"></button>
<audio id="music" src="http://www.kumeiwp.com/sub/filestores/2022/04/01/77aa24a067fd965753b1b7cc278c8f8c.mp3" loop="loop" autoplay="autoplay" ></audio>
</div>
<script language="javascript">
fly(); //运行走马灯
showTime(); //显示时间
setInterval(showTime, 1000); //运行时钟
//文本时钟函数
function showTime(){
var now = new Date();
var year = now.getFullYear();
var month = now.getMonth() + 1;
var date = now.getDate();
var day = now.getDay();
var hour = now.getHours();
if(hour < 10) hour = "0" + hour;
var minute = now.getMinutes();
if(minute < 10) minute = "0" + minute;
var second = now.getSeconds();
if(second < 10) second = "0" + second;
document.getElementById("textClock").innerHTML = year + "年" + month + "月" + date + "日 星期" + toHz(day) + "" + hour + ":" + minute + ":" + second;
}
function toHz(num) { var hz = "日一二三四五六九"; return(hz.charAt(num)); }
//音乐控制代码
var mu = document.getElementById('music');
var btn = document.getElementById('picBtn');
btn.onclick = function(){
mu.paused ? (mu.play(), btn.style.background="url('https://pic.imgdb.cn/item/622a00ea5baa1a80ab412ada.gif')") : (mu.pause(), btn.style.background="url('https://pic.imgdb.cn/item/622a01115baa1a80ab414665.png')");
}
mu.addEventListener("ended", function(){
btn.style.background="url('https://pic.imgdb.cn/item/622a01115baa1a80ab414665.png')";
});
//创建走马灯
function fly() {
var ziFly = document.getElementById('ziFly');
var width = ziFly.clientWidth;
var style = document.createElement('style');
style.type = 'text/css';
var flyStr = '@keyframes fly {to { left: -' + width + 'px; } }';
style.innerHTML = flyStr;
ziFly.appendChild(style);
ziFly.style.animation = 'fly 40s linear infinite';
}
</script>
{:4_174:}
马黑黑 发表于 2021-11-28 16:16
今天没有出去玩啊?
加林森 发表于 2021-11-28 16:28
今天没有出去玩啊?
出门不方便,没腿
马黑黑 发表于 2021-11-28 16:28
出门不方便,没腿
马腿跑哪里去了?
加林森 发表于 2021-11-28 16:29
马腿跑哪里去了?
蟹不够,将军砍下来烤了
马黑黑 发表于 2021-11-28 16:34
蟹不够,将军砍下来烤了
哦呵,就这样成了半节人了?
加林森 发表于 2021-11-28 17:07
哦呵,就这样成了半节人了?
奇怪么
马黑黑 发表于 2021-11-28 17:08
奇怪么
不奇怪了,是将军干的就没有什么好奇怪的了。
加林森 发表于 2021-11-28 17:16
不奇怪了,是将军干的就没有什么好奇怪的了。
这不就结了
马黑黑 发表于 2021-11-28 17:24
这不就结了
嗯嗯,就这样了。
加林森 发表于 2021-11-28 17:56
嗯嗯,就这样了。
甚好甚好
马黑黑 发表于 2021-11-28 18:53
甚好甚好
必须好啊
加林森 发表于 2021-11-28 19:29
必须好啊
知道知道
马黑黑 发表于 2021-11-28 20:04
知道知道
知道了还说?
加林森 发表于 2021-11-28 20:15
知道了还说?
咱话唠
马黑黑 发表于 2021-11-28 20:17
咱话唠
屁话真多。{:4_170:}