可爱老人网

 找回密码
 注册会员
搜索
楼主: 潇湘翁

试帖 克隆(换背景)

[复制链接]
发表于 2022-4-15 13:30 | 显示全部楼层
提取的时间信息是这样的
  1. lineLyric:"可可托海的牧羊人 - 王琪",time:"0.0"},{lineLyric:"词:王琪",time:"2.79"},{lineLyric:"曲:王琪",time:"3.21"},{lineLyric:"编曲:达吾然",time:"3.7"},{lineLyric:"缩混:文克津",time:"4.48"},{lineLyric:"那夜的雨也没能留住你",time:"18.18"},{lineLyric:"山谷的风它陪着我哭泣",time:"25.36"},{lineLyric:"你的驼铃声仿佛还在我耳边响起",time:"33.13"},{lineLyric:"告诉我你曾来过这里",time:"40.36"},{lineLyric:r,time:"47.54"},{lineLyric:s,time:"54.9"},{lineLyric:t,time:"62.45"},{lineLyric:u,time:"69.99"},{lineLyric:f,time:"76.88"},{lineLyric:g,time:"84.32"},{lineLyric:h,time:"92.31"},{lineLyric:i,time:"99.44"},{lineLyric:j,time:"101.57"},{lineLyric:k,time:"106.53"},{lineLyric:l,time:"113.69"},{lineLyric:m,time:"121.95"},{lineLyric:n,time:"129.22"},{lineLyric:r,time:"165.93"},{lineLyric:s,time:"173.09"},{lineLyric:t,time:"180.95"},{lineLyric:u,time:"188.19"},{lineLyric:f,time:"194.91"},{lineLyric:g,time:"202.33"},{lineLyric:h,time:"210.34"},{lineLyric:i,time:"217.55"},{lineLyric:j,time:"219.68"},{lineLyric:k,time:"224.39"},{lineLyric:l,time:"231.89"},{lineLyric:m,time:"240.05"},{lineLyric:n,time:"247.4"},{lineLyric:f,time:"254.08"},{lineLyric:g,time:"261.29"},{lineLyric:h,time:"269.62"},{lineLyric:i,time:"276.63"},{lineLyric:j,time:"278.71"},{lineLyric:k,time:"283.45"},{lineLyric:l,time:"290.86"},{lineLyric:m,time:"299.14"},{lineLyric:n,time:"306.25"}]
复制代码
发表于 2022-4-15 13:37 | 显示全部楼层
本帖最后由 湛蓝 于 2022-4-15 13:47 编辑

光盘移动到左侧了,现在可以了
 楼主| 发表于 2022-4-15 14:05 | 显示全部楼层
本帖最后由 潇湘翁 于 2022-4-15 14:19 编辑
湛蓝 发表于 2022-4-15 12:36
本帖最后由 湛蓝 于 2022-4-15 13:42 编辑 潇湘老师的代码:不知道老师的代码为何偏移,有点不解!用我的代 ...

老师:在我这里看,22楼的图片还是很偏左的,我用的代码是老师给我的。我自己认为我的制作过程是按照老师教的规范条款进行的。至于在真实的制作过程中有什么纰漏,那我就不知道了!要不老师再发一次代码,我再认真的做一次!老师:我补充一点,就是我以前每次发的作品,都有偏左的情况,那是用老师告诉我纠偏的方法调整了的,这次做这款作品我不知道怎么调整了。
发表于 2022-4-15 14:22 | 显示全部楼层
本帖最后由 湛蓝 于 2022-4-15 14:25 编辑
潇湘翁 发表于 2022-4-15 14:05
老师:在我这里看,22楼的图片还是很偏左的,我用的代码是老师给我的。我自己认为我的制作过程是按照老师 ...

我再发一次,调整方法我再试一次,不行的话,等看看老师来了一定有办法
发表于 2022-4-15 14:23 | 显示全部楼层
  1. <div style="background: url("http://chuangshicdn.data.mvbox.cn/album/22/03/14/22031417263445440463.gif") 0px 0px / 30% 30%, linear-gradient(80deg, rgb(0, 0, 128), rgb(0, 51, 0), rgb(255, 0, 0), rgb(0, 240, 0)); width: 1000px; height: 600px; text-align: center; overflow: hidden; margin-top: 30px; margin-left: -230px; z-index: 127; box-shadow: 0px 0px 0px 2px #cccccc, 0px 0px 0px 15px #880000; transform: rotate(0deg);">

  2. <img class="photo" alt="" src="http://tuku.link/imgs/2022/04/f13793dec95eeac0.jpg">

  3. <img class="photo" alt="" src="http://tuku.link/imgs/2022/04/ace30c9c93024f01.jpg">

  4. <img class="photo" alt="" src="https://s1.ax1x.com/2022/04/14/LQWSBR.jpg">


  5. <img class="photo" alt="" src="https://s1.ax1x.com/2022/04/14/LQWbqA.jpg">



  6. <img class="photo" alt="" src="https://s1.ax1x.com/2022/04/14/LQWdU0.jpg">

  7. <img class="photo" alt="" src="http://tuku.link/imgs/2022/04/dac57df257cde97e.jpg">

  8. <img class="photo" alt="" src="http://tuku.link/imgs/2022/04/8ce83e7797e06271.jpg">

  9. <img class="photo" alt="" src="http://tuku.link/imgs/2022/04/501daa3f5e737022.jpg">


  10. <div class="container">
  11. <audio class="audio" id="MusicPlayer" style="width: 1%; height: 1%; z-index: 1;" src="http://music.lanyes.org/content/plugins/lymusic_tool/play.php?type=kw&id=215880440&.mp3" autoplay="" loop="" controls=""></audio>
  12.       <div class="btn">
  13.         <span id="bf" style="left: 80px; top: -70px; width: 980px; height: 120px; position: absolute; z-index: 300;" onclick="bf();"></span>
  14.         <span id="bf" onclick="rbf();"></span>
  15.       </div>
  16. <div class="img_border"><img id="aplay" style="background: url("http://pan.yinhuabbs.cn/view.php/7139d981f5e411051b77852e1a5e41ae.png") 0px 0px / 100% 100%, url("https://s1.ax1x.com/2022/04/13/LKXhC9.jpg") -20px 0px / 180% 100%; width: 100%; height: 100%; z-index: 110;"></div>
  17.      <div class="items">
  18. <div class="lrc">
  19.         <ul id="ullrc">
  20.          </ul>
  21. </div></div></div>
  22. </div>
  23. <style type="text/css">
  24. .photo {width: 1000px;
  25.   height: 600px;
  26.   position: absolute;top:0px; left:0px;
  27. filter:contrast(130%)brightness(100%);
  28.   animation: round 46s infinite;
  29.   opacity: 0;}
  30. @keyframes round {1% {opacity: 1;clip-path:circle(0% at 130% 50%);
  31. -webkit-transform:translate(0%,0%)scale(1);}
  32. 9% {opacity: 1;clip-path:  circle(100% at 50%  50%);
  33. -webkit-transform:translate(0%,0%)scale(1);}
  34. 18% {opacity: 0.6;clip-path: circle(100% at 50% 50%);
  35. -webkit-transform:translate(0%,0%)scale(1.5);}
  36. 20% {opacity: 0;clip-path: circle(100% at 50% 50%);
  37. -webkit-transform:translate(0%,0%)scale(2);}
  38. }
  39. img:nth-child(8) {animation-delay: 40s;}
  40. img:nth-child(7) {animation-delay: 34s;}
  41. img:nth-child(6) {animation-delay: 28s;}
  42. img:nth-child(5) {animation-delay: 22s;}
  43. img:nth-child(4) {animation-delay: 16s;}
  44. img:nth-child(3) {animation-delay: 12s;}
  45. img:nth-child(2) {animation-delay: 6s;}
  46. </style>

  47. <style type="text/css">
  48. .container{width: 1px;height: 1px;
  49.     margin: 0;position: absolute;top:500px; left:0px;z-index: 100;}
  50. .container #MusicPlayer{
  51.     width: 250px;
  52.     display: block;
  53.     margin: 0 auto;}
  54. .container .btn{
  55.     display: block;z-index: 300;
  56.     margin: 0;}
  57. .container .lrc{
  58.     width: 960px;
  59.     height: 120px;z-index: 1;
  60.     overflow: hidden;filter:drop-shadow(#ffffff 1px 0 0)drop-shadow(#ffffff 0 1px 0)drop-shadow(#ffffff -1px 0 0) drop-shadow(#ffffff 0 -1px  0);
  61.     display: block;position: absolute;top:-10px; left:0px;
  62.     margin: 0 auto;}
  63. .container .lrc #ullrc{
  64.     width: 100%;
  65.     padding: 0;
  66.     list-style: none;
  67.     transition: 0.3s all ease;
  68.     margin: 0;}
  69. /*歌词普通样式*/
  70. .container .lrc #ullrc li{
  71.     height: 70px;
  72.     line-height: 70px;
  73. font-family:悟空大字库;
  74.     font-size: 0px;
  75.     color: #000078;
  76.     font-weight: normal;
  77.     transition: .3s all ease;/*一定要加上不然看着突兀*/
  78.     list-style-type: none;
  79.     text-align: center;
  80.     display: block;
  81.     width: 100%;
  82.     margin: 0 auto;}
  83. /*动态歌词样式*/
  84. .container .lrc #ullrc li.active{
  85.     font-size: 40px;
  86.     color: #ff0000;
  87.     font-weight: bold}
  88. /*光碟动画*/
  89. .container .img_border{display:inline-block;width:200px;height:200px;margin:0px ;position: absolute;top:-140px;left:26px;transform: scale(1,1);transform: rotateX(0deg) rotateY

  90. (0deg) rotateZ(0deg);border-radius:50%;}
  91. .container .img_border #aplay{display:block;border:2px solid #cccccc;border-radius:50%; }
  92. .container .z360z{-webkit-animation:rotating 10s linear infinite;}@-webkit-keyframes rotating{to {transform: rotate(360deg);}}
  93. .audio{
  94.     z-index: 1;
  95.     bottom: 0;
  96.     opacity: 0;
  97. transition: all 2s;
  98. width: 1px;
  99. height: 1px;
  100. position: absolute;top:0px; left:0px;
  101. }
  102. .audio:hover{
  103.     opacity: 0;
  104. }
  105. </style>
  106. <style type="text/css">.items  { z-index: 1540;animation: slider 0.26s linear infinite ;}
  107. @keyframes slider {from {opacity: 1;filter:hue-rotate(360deg)contrast(180%)brightness(200%);}
  108. 50% {opacity: 1;}to {opacity: 1;filter:hue-rotate(0deg)contrast(140%)brightness(100%);}}
  109. </style>
  110. <script>var lrc = `[00:04]心中最美的风景线
  111. [00:06]作词:轻云望月
  112. [00:09]作曲:轻云望月
  113. [00:11]DJ:月之歌音乐室
  114. [00:13]混音:烟圈蔓延
  115. [00:15]出品:亚伦影音
  116. [00:19]“未经授权禁止翻唱和商业使用”
  117. [00:22]男:
  118. [00:23]我不知道远方究竟有多远
  119. [00:28]有你的地方就是我的终点
  120. [00:33]哪怕趟万水 哪怕越千山
  121. [00:38]也愿意奔向你和你手相牵
  122. [00:42]女:
  123. [00:43]我不知道红尘有多少爱恋
  124. [00:48]自从第一眼就把你爱心间
  125. [00:53]人为你相思 心为你牵绊
  126. [00:58]再多曲折都难把我的爱阻断
  127. [01:03]男:
  128. [01:03]你是我心中最美的风景线
  129. [01:08]感谢你出现把我人生温暖
  130. [01:13]女:
  131. [01:13]这一段情爱 这一场尘缘
  132. [01:18]就算到天荒地老都不会厌倦
  133. [01:23]男:
  134. [01:23]你是我心中最美的风景线
  135. [01:28]谢谢你出现把我流年惊艳
  136. [01:33]女:
  137. [01:34]爱着你所爱 念着你所念
  138. [01:38]这辈子你就是我永远的永远
  139. [02:03]男:
  140. [02:04]我不知道红尘有多少爱恋
  141. [02:09]自从第一眼就把你爱心间
  142. [02:13]女:
  143. [02:14]人为你相思 心为你牵绊
  144. [02:19]再多曲折都难把我的爱阻断
  145. [02:23]男:
  146. [02:24]你是我心中最美的风景线
  147. [02:29]感谢你出现把我人生温暖
  148. [02:34]女:
  149. [02:34]这一段情爱 这一场尘缘
  150. [02:39]就算到天荒地老都不会厌倦
  151. [02:44]男:
  152. [02:44]你是我心中最美的风景线
  153. [02:49]谢谢你出现把我流年惊艳
  154. [02:53]女:
  155. [02:54]爱着你所爱 念着你所念
  156. [02:59]这辈子你就是我永远的永远
  157. [03:04]男:
  158. [03:04]你是我心中最美的风景线
  159. [03:10]谢谢你出现把我流年惊艳
  160. [03:14]女:
  161. [03:15]爱着你所爱 念着你所念
  162. [03:20]这辈子你就是我永远的永远
  163. [03:24]合:
  164. [03:25]这辈子你就是我永远的永远`;
  165. function $(id) {return document.getElementById(id);
  166. }//这样写以后getid方便
  167. function getLrcArray() {
  168.     var parts = lrc.split("\n");
  169.     for (let index = 0; index < parts.length; index++) {
  170.         parts[index] = getLrcObj(parts[index]);
  171.     }
  172.     return parts;

  173.     function getLrcObj(content) {
  174.         var twoParts = content.split("]");
  175.         var time = twoParts[0].substr(1);
  176.         var timeParts = time.split(":");
  177.         var seconds = +timeParts[1];
  178.         var min = +timeParts[0];
  179.         seconds = min * 60 + seconds;
  180.         var words = twoParts[1];
  181.         return{
  182.             seconds: seconds,
  183.             words: words,
  184.         };
  185.     }
  186. }
  187. var lrcArray = getLrcArray();
  188. function inputLrc() {
  189.     for (let index = 0; index < lrcArray.length; index++) {
  190.         var li = document.createElement("li");
  191.         li.innerText = lrcArray[index].words;
  192.         $("ullrc").appendChild(li);
  193.     }
  194. }
  195. inputLrc();
  196. function setPosition() {
  197.     var index = getLrcIndex();
  198.     if (index == -1) {
  199.         return;
  200.     }
  201.     var lrc_li_height = 70, lrc_ul_height = 50;
  202.     var top = index * lrc_li_height + lrc_li_height / 2 - lrc_ul_height / 2;
  203.     if (top < 0) {
  204.         top = 0;
  205.     }
  206.     $("ullrc").style.marginTop = -top + "px";
  207.     var activeLi = $("ullrc").querySelector(".active");
  208.     if(activeLi){
  209.         activeLi.classList.remove("active");
  210.     }
  211.     $("ullrc").children[index].classList.add("active");
  212. }
  213. var turn = 0;
  214. function getLrcIndex(){
  215.     var time = $("MusicPlayer").currentTime + turn;
  216.     for (var index = 0; index < lrcArray.length; index++) {
  217.         if (lrcArray[index].seconds > time) {
  218.             return index - 1;
  219.         }
  220.     }
  221. }
  222. $("MusicPlayer").ontimeupdate = setPosition;
  223. </script>
  224. <script>
  225.         function rbf() {
  226.             var audio = document.getElementById('MusicPlayer');
  227.             var bf=document.getElementById("bf");
  228.             audio.currentTime = 0;
  229.             audio.play();
  230.             bf.innerText="";
  231.         }

  232.         function bf() {
  233.             var audio = document.getElementById('MusicPlayer');
  234.             var bf=document.getElementById("bf");
  235.             if (audio !== null) {
  236.                 if (audio.paused) {
  237.                     audio.play(); //audio.play();// 这个就是播放  
  238.                     bf.innerText="";
  239.                 } else {
  240.                     audio.pause(); // 这个就是暂停
  241.                     bf.innerText="";
  242.                 }
  243.             }
  244.         }
  245. </script>
  246. <script type="text/javascript">
  247. var my_audio =document.getElementById("MusicPlayer");my_audio.onended = function(){document.getElementById("aplay").className="";};my_audio.onplaying = function()

  248. {document.getElementById("aplay").className="z360z";};my_audio.onpause = function(){document.getElementById("aplay").className="";};var lyric = parseLyric(songkrc);

  249. my_audio.ontimeupdate = function () { for (var i = 0; i < lyric.length; i++) { if(this.currentTime > lyric[i][0]){ document.getElementById("ullrc").innerHTML = lyric[i][1]; if(i

  250. +1==lyric.length){ document.getElementById("").innerHTML = ""; }else{ document.getElementById("").innerHTML = lyric[i + 1][1];};};};}; my_audio.play();</script>

  251. <div style="height:170px;"></div>
复制代码


发表于 2022-4-15 14:30 | 显示全部楼层
你调一下这数值试试(最上面)


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
发表于 2022-4-15 14:50 | 显示全部楼层
35楼代码好像又没框了
发表于 2022-4-15 15:23 | 显示全部楼层
我就来看看 发表于 2022-4-15 14:50
35楼代码好像又没框了

有边框吧,我试试
发表于 2022-4-15 15:27 | 显示全部楼层
我就来看看 发表于 2022-4-15 14:50
35楼代码好像又没框了

35楼的代码是我记事本里复制粘贴的,35楼的的确没显示

但是直接复制记事本的正常显示,不知道哪里出了问题
发表于 2022-4-15 15:33 | 显示全部楼层
本帖最后由 我就来看看 于 2022-4-15 15:45 编辑

湛蓝 发表于 2022-4-15 15:27 35楼的代码是我记事本里复制粘贴的,35楼的的确没显示 但是直接复制记事本的正常显示,不知道哪里出了 ...
把问题简化,光看框能不能显示
        
下一页 发布主题 快速回复

手机版|公众号|小黑屋|可爱老人网

GMT+8, 2025-2-7 20:14

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表