亚伦影音工作室 发表于 7 天前

真心英雄(女版)-允上

本帖最后由 亚伦影音工作室 于 2026-11-29 20:28 编辑 <br /><br /><style>
@import url("https://fonts.googleapis.com/css2?family=Ma+Shan+Zheng&display=swap");
#papa {
margin: 0px -250px;
width: 1186px;
height: 1280px;
background:#000;
position: relative;
z-index: 1;
overflow: hidden;
font-family: "Ma Shan Zheng","SimHei", "Arial", "sans-serif";
}
#pa {
width: 100%;
height: 100%;
overflow: hidden;background:#000;
position: absolute;
}
#tu{
width: 105%;
margin-left: -2.5%;
height: 55%;
object-fit: cover;
}
#reflect {
width: 105%;
margin-left: -2.5%;
margin-top: -10px;
height: 55%;
object-fit: cover;
transform: rotateX(180deg);
filter: url(#water);
opacity: 1;
}

#wrap {z-index: 100;
      margin: 600px 870px;
      width: 240px;
      height: 240px;
      border: 0px solid gray;
      cursor: pointer;
       position:absolute;
}
#arm {
      position: absolute;
      right: 10px;
      top: 34px;
      width: 90px;
      transform-origin: 84.6% 13.7%;
      transform: rotate(var(--needle, -12deg));
      z-index: 10;
}
#arm .armimg {
      width: 100%;
      height: auto;
      display: block;
}
#arm .needle {
      position: absolute;
      left: 20.2%;
      top: 92.1%;
      width: 2px;
      height: 2px;
}
#time {
      position: absolute;
      left: 30px;
      top: -20px;
      z-index: 11;
      font-size: 11px;
      font-family: monospace;
      color: #e8c79a;
      padding: 0px 0px;
      border-radius: 0px;
      white-space: nowrap;
      pointer-events: none;
}
#pan {
      width: 200px;
      height: 200px;
      border-radius: 50%;
      background: linear-gradient(30deg, transparent 40%, rgba(42, 41, 40, .85) 40%) no-repeat 100% 0, linear-gradient(60deg, rgba(42, 41, 40, .85) 60%, transparent 60%) no-repeat 0 100%, repeating-radial-gradient(#2a2928, #2a2928 4px, #ada9a0 5px, #2a2928 6px);
      background-size: 50% 100%, 100% 50%, 100% 100%;
      bottom: 0;
      position: absolute;
      animation: spin 8s linear infinite;
      animation-play-state: paused;
}
#pan::before {
      position: absolute;
      content: '';
      top: 50%; left: 50%;
      margin: -35px;
      border: solid 1px #d9a388;
      width: 68px; height: 68px;
      border-radius: 50%;
      box-shadow: 0 0 0 4px #da5b33, inset 0 0 0 27px #da5b33;
      background: #b5ac9a;
}
@keyframes spin { to { transform: rotate(4turn); } }

#lrcWrap{position:relative;width:800px;height:80%;margin:436px -100px;overflow:hidden;pointer-events:none;}
#lrcUl {
    position: relative;
    width: 100%;height: 100%;
    list-style: none;text-shadow: 1px 1px 1px #000;
    list-style-type: none;
    list-style-image: none;
    padding: 0;
    margin: 0;
}
#lrcUl li {
    list-style: none;
    list-style-type: none;
    list-style-image: none;
    font-size: 24px;
    color: #ffffff;
    line-height: 1.8;
    margin: 0;
    padding: 0;
    pointer-events: auto;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color .25s ease, font-size .25s ease, opacity .18s ease;
    text-align: center;
}
#lrcUl li.group-out{opacity:0;pointer-events:none;}
#lrcUl li.group-in{opacity:1;}
#lrcUl li.active{font-size:28px;}

</style>

<div id="papa">
<div id="pa">
    <video id="tu" src="https://img-baofun.zhhainiao.com/pcwallpaper_ugc/preview/0d5ac94982912dde72a32d88fdacd290_preview.mp4" loop muted autoplay></video>
    <video id="reflect" src="https://img-baofun.zhhainiao.com/pcwallpaper_ugc/preview/0d5ac94982912dde72a32d88fdacd290_preview.mp4" loop muted autoplay></video>

    <!-- 滤镜放到页面外层,不要塞在 video 里面 -->
    <svg width="0" height="0" xmlns="http://www.w3.org/2000/svg" id="sb">
      <defs>
      <filter id="water" x="0%" y="0%" width="100%" height="100%">
          <feTurbulence type="fractalNoise" baseFrequency="0.008 0.03" numOctaves="2" result="noise1">
            <!-- 直接驱动噪点 seed 流动,波纹才会动 -->
            <animate attributeName="seed" from="0" to="120" dur="36s" repeatCount="indefinite" />
          </feTurbulence>
          <feDisplacementMap xChannelSelector="R" yChannelSelector="G" scale="30" in="SourceGraphic" in2="noise1"/>
      </filter>
      </defs>
    </svg>
</div>
<div id="wrap" title="点击播放/暂停">
      <div id="pan"></div>
      <div id="arm">
                <img class="armimg" src="https://aka.doubaocdn.com/s/PWGN4P8KcE" alt="唱臂">
                <div class="needle"></div>
      </div>
      <div id="time"><span id="cur">0:00</span>|<span id="dur">0:00</span></div>
</div>
<div id="lrcWrap"><ul id="lrcUl"></ul></div>

</div>
<audio id="myplayer" src="http://antiserver.kuwo.cn/anti.s?rid=MUSIC_544279320&response=res&format=mp3|aac&type=convert_url&br=128kmp3&agent=iPhone&callback=getlink&jpcallback=getlink.mp3" autoplay></audio>

<script>
(function () {
var audio = document.getElementById("myplayer");
var wrap = document.getElementById("wrap");
var pan = document.getElementById("pan");
var head = document.querySelector("#arm .needle");
var time = document.getElementById("time");
var cur = document.getElementById("cur");
var dur = document.getElementById("dur");

var START_DEG = -5;
var END_DEG = 15;
var IDLE_DEG = -15;
var slideDuration = 1800;

var armReady = false;
var sliding = false;
var slideStart = 0;
var rafId = null;

function fmt(s) {
    if (!isFinite(s) || s == null) return "0:00";
    var m = Math.floor(s / 60);
    var ss = Math.floor(s % 60);
    return m + ":" + (ss < 10 ? "0" : "") + ss;
}

function placeTime() {
    var h = head.getBoundingClientRect();
    var w = wrap.getBoundingClientRect();
    var x = h.left - w.left - 4;
    var y = h.top - w.top - 18;
    time.style.left = x + "px";
    time.style.top = y + "px";
}

function setNeedle(deg) {
    wrap.style.setProperty("--needle", deg + "deg");
}

function updateArmByProgress(p) {
    if (p < 0) p = 0;
    if (p > 1) p = 1;
    var deg = START_DEG + (END_DEG - START_DEG) * p;
    setNeedle(deg);
}

function easeInOutQuad(t) {
    return t < 0.5 ? 2 * t * t : 1 - Math.pow(-2 * t + 2, 2) / 2;
}

function slideToStart() {
    if (sliding) return;
    sliding = true;
    armReady = false;
    slideStart = performance.now();

    function tick(now) {
      var t = Math.min(1, (now - slideStart) / slideDuration);
      var eased = easeInOutQuad(t);
      var currentDeg = IDLE_DEG + (START_DEG - IDLE_DEG) * eased;
      setNeedle(currentDeg);
      placeTime();

      if (t < 1) {
      rafId = requestAnimationFrame(tick);
      } else {
      sliding = false;
      armReady = true;
      audio.play().then(function () {
          pan.style.animationPlayState = "running";
      }).catch(function () {
          pan.style.animationPlayState = "paused";
      });
      }
    }

    if (rafId) cancelAnimationFrame(rafId);
    rafId = requestAnimationFrame(tick);
}

audio.addEventListener("timeupdate", function () {
    if (audio.duration && isFinite(audio.duration)) {
      if (armReady && !sliding) {
      updateArmByProgress(audio.currentTime / audio.duration);
      }
      cur.textContent = fmt(audio.currentTime);
      dur.textContent = fmt(audio.duration);
      placeTime();
    }
});

audio.addEventListener("loadedmetadata", function () {
    dur.textContent = fmt(audio.duration);
    placeTime();
});

audio.addEventListener("play", function () {
    if (armReady && !sliding) {
      pan.style.animationPlayState = "running";
    }
});

audio.addEventListener("pause", function () {
    pan.style.animationPlayState = "paused";
});

audio.addEventListener("ended", function () {
    updateArmByProgress(1);
    pan.style.animationPlayState = "paused";
});

wrap.onclick = function () {
    if (sliding) return;

    if (!armReady) {
      slideToStart();
      return;
    }

    if (audio.paused) {
      audio.play();tu.play();reflect.play();sb.unpauseAnimations();
    } else {
      audio.pause();tu.pause();reflect.pause();sb.pauseAnimations();
    }
};

setNeedle(IDLE_DEG);
placeTime();
setTimeout(slideToStart, 300);
})();
</script>

<script type="text/plain" id="lrcData">
真心英雄(女版)-允上
词:李宗盛
曲:李宗盛
出品:好柿花生
【未经著作权人许可不得翻唱翻录或使用】
在我心中
曾经有一个梦
要用歌声让你忘了所有的痛
灿烂星空
谁是真的英雄
平凡的人们给我最多感动
再没有恨
也没有了痛
但愿人间处处都有爱的影踪
用我们的歌
换你真心笑容
祝福你的人生从此与众不同
把握生命里的每一分钟
全力以赴我们心中的梦
不经历风雨
怎么见彩虹
没有人能随随便便成功
把握生命里每一次感动
和心爱的朋友热情相拥
让真心的话
和开心的泪
在你我的心里流动
在我心中
曾经有一个梦
要用歌声让你忘了所有的痛
灿烂星空
谁是真的英雄
平凡的人们给我最多感动
再没有恨
也没有了痛
但愿人间处处都有爱的影踪
用我们的歌
换你真心笑容
祝福你的人生从此与众不同
把握生命里的每一分钟
全力以赴我们心中的梦
不经历风雨
怎么见彩虹
没有人能随随便便成功
把握生命里每一次感动
和心爱的朋友热情相拥
让真心的话
和开心的泪
在你我的心里流动
把握生命里的每一分钟
全力以赴我们心中的梦
不经历风雨
怎么见彩虹
没有人能随随便便成功
把握生命里每一次感动
和心爱的朋友热情相拥
让真心的话
和开心的泪
在你我的心里流动
让真心的话
和开心的泪
在你我的心里流动

</script>

<script>
(function () {
var offset = 0.5;
var groupRowCount = 10;
var myaud = document.getElementById("myplayer");
var lrcUl = document.getElementById("lrcUl");
var lrcText = document.getElementById("lrcData").textContent;

function parseLrc(text) {
    var arr = [];
    var lines = text.split("\n");
    var reg = /\[(\d{1,}:\d{1,}(?:\.\d{1,})?)\](.*)/g;
    var m;
    for (var i = 0; i < lines.length; i++) {
      reg.lastIndex = 0;
      while ((m = reg.exec(lines)) !== null) {
      var t = m.split(":");
      var sec = Number(t) * 60 + parseFloat(t);
      var word = m.replace(/["'“”‘’]/g, "").trim();
      arr.push();
      }
    }
    arr.sort(function (a, b) { return a - b; });
    return arr;
}

var lrcAr = parseLrc(lrcText);

var html = "";
for (var j = 0; j < lrcAr.length; j++) {
    var chars = lrcAr.split("");
    var sp = "";
    for (var c = 0; c < chars.length; c++) {
      sp += "<span class='k'>" + chars + "</span>";
    }
    html += "<li id='li" + j + "'>" + sp + "</li>";
}
lrcUl.innerHTML = html;

var lastGroupIndex = -1;

function showGroup(groupIndex) {
    var start = groupIndex * groupRowCount;
    var end = start + groupRowCount;
    var olds = [];
    var news = [];
    for (var k = 0; k < lrcAr.length; k++) {
      var li = document.getElementById("li" + k);
      if (!li) continue;
      li.classList.remove("group-in", "group-out", "active");
      if (k >= start && k < end) {
      li.style.display = "none";
      news.push(li);
      } else {
      olds.push(li);
      }
    }
    for (var o = 0; o < olds.length; o++) {
      olds.classList.add("group-out");
    }
    setTimeout(function () {
      for (var i = 0; i < olds.length; i++) olds.style.display = "none";
      for (var n = 0; n < news.length; n++) {
      var el = news;
      el.style.display = "block";
      el.classList.add("group-out");
      (function (e2) {
          setTimeout(function () {
            e2.classList.remove("group-out");
            e2.classList.add("group-in");
          }, 20);
      })(el);
      }
    }, 180);
}

function clearLine(idx) {
    var li = document.getElementById("li" + idx);
    if (!li) return;
    var spans = li.children;
    for (var s = 0; s < spans.length; s++) spans.style.color = "";
}

function paintLine(idx) {
    var li = document.getElementById("li" + idx);
    if (!li) return;
    var t0 = lrcAr;
    var t1 = (idx + 1 < lrcAr.length) ? lrcAr : t0 + 4;
    var dur = t1 - t0;
    if (dur <= 0) dur = 4;
    var p = (myaud.currentTime + offset - t0) / dur;
    if (p < 0) p = 0;
    if (p > 1) p = 1;
    var spans = li.children;
    var n = spans.length;
    for (var s = 0; s < n; s++) {
      spans.style.color = p >= s / n ? "#ff3b3b" : "";
    }
}

function updateActive() {
    var tt = myaud.currentTime + offset;
    var idx = -1;
    for (var i = 0; i < lrcAr.length; i++) {
      if (tt >= lrcAr) idx = i;
    }
    if (idx < 0) idx = 0;
    var currentGroup = Math.floor(idx / groupRowCount);
    var start = currentGroup * groupRowCount;
    if (lastGroupIndex !== currentGroup) {
      showGroup(currentGroup);
      lastGroupIndex = currentGroup;
    }
    for (var k = start; k < start + groupRowCount; k++) {
      var li = document.getElementById("li" + k);
      if (!li) continue;
      li.classList.toggle("active", k === idx);
      if (k === idx) paintLine(k); else clearLine(k);
    }
}

myaud.addEventListener("timeupdate", updateActive);
myaud.addEventListener("seeked", updateActive);

lrcUl.onclick = function (e) {
    var ev = e || window.event;
    var t = ev.target || ev.srcElement;
    var li = t;
    while (li && li.tagName !== 'LI') { li = li.parentNode; }
    if (!li) return;
    var idx = parseInt((li.id || '').replace('li', ''), 10);
    if (isNaN(idx) || !lrcAr) return;
    var target = lrcAr - offset;
    myaud.currentTime = target < 0 ? 0 : target;
    if (myaud.paused) myaud.play();
};

myaud.addEventListener("ended", function () {
    var lastIdx = lrcAr.length - 1;
    var last = document.getElementById("li" + lastIdx);
    if (last) last.classList.remove("active");
    clearLine(lastIdx);
    this.play();
});

updateActive();
})();
</script>

<div style="height: 1280px;"></div>

klxf 发表于 7 天前

本帖最后由 klxf 于 2026-11-29 22:52 编辑

好听好看,谢谢亚伦老师精彩分享

醉美水芙蓉 发表于 6 天前

欣赏亚伦老师精彩播放器!
页: [1]
查看完整版本: 真心英雄(女版)-允上