可爱老人网

 找回密码
 注册会员
搜索
查看: 1436|回复: 22

土鲁番的葡萄熟了(克隆,学习代码)

[复制链接]
发表于 2022-8-4 16:46 | 显示全部楼层 |阅读模式
[i=s] 本帖最后由 一师 于 2022-8-4 21:22 编辑 [/i]

评分

参与人数 6人气值 +21 收起 理由
廖若晨星 + 4 赞一个!
沧海笑 + 3 赞一个!
老梦缘 + 3 赞一个!
海儿心 + 3 大赞!
九品莲花 + 3 大赞!

查看全部评分

 楼主| 发表于 2022-8-4 16:46 | 显示全部楼层
  1. <div style="z-index: 127;width: 950px; height: 620px; margin-top:30px; margin-left:-150px;  box-shadow: 0px 0px 0px 2px #cccccc, 0px 0px 0px 15px #880000; overflow: hidden;transform:  rotate(0deg);background:url(http://chuangshicdn.data.mvbox.cn/album/22/03/12/22031213462674835656.gif)0 0/40% 100%,url(https://pic.imgdb.cn/item/62e0f214f54cd3f93789e785.jpg)0 0/100% 100%;text-align: center;">
  2. <img class='photo'  src="https://pic.imgdb.cn/item/62e0f6a2f54cd3f937a3a1da.jpg" alt="" />
  3.   <img class='photo'  src="https://pic.imgdb.cn/item/62e0f6a2f54cd3f937a3a1e6.jpg" alt="" />
  4.   <img class='photo'  src="https://pic.imgdb.cn/item/62e0f6bff54cd3f937a44b29.jpg" alt="" />
  5.   <img class='photo'  src="https://pic.imgdb.cn/item/62e0f6bff54cd3f937a44b14.jpg" alt="" />
  6.   <img class='photo'  src="https://pic.imgdb.cn/item/62e0f6bef54cd3f937a44a99.jpg" alt="" />
  7.   <img class='photo'  src="https://pic.imgdb.cn/item/62e0f6a2f54cd3f937a3a243.jpg" alt="" />
  8.   <img class='photo'  src="https://pic.imgdb.cn/item/62e0f6a2f54cd3f937a3a22c.jpg" alt="" />
  9.   <img class='photo'  src="https://pic.imgdb.cn/item/62e0f6a2f54cd3f937a3a1ac.jpg" alt="" />
  10. <div class="container">
  11. <audio autoplay="" class="audio" id="MusicPlayer" src="http://link.hhtjim.com/kw/6857244.mp3" controls loop style="width: 0%; height: 0%;z-index: 1;"></audio>
  12.       <div class="btn">
  13.          <img src="http://image.hnol.net/c/2022-05/16/14/2022051614143711-5769293.png" id="playpause"style="position:absolute;top:-35px;left:35px;width:150px;height:150px;z-index: 600;"/>
  14.         </div>
  15. <div class="img_border" id="aplay"></div>
  16.      <div class="items " style="width: 980px; height: 120px;z-index: 500;position: absolute;top:0px; left:0px;">
  17. <div  class="lrc">
  18.         <ul id="ullrc">
  19.          </ul>
  20. </div></div></div>
  21. </div>
  22. <style type="text/css">
  23. .photo {width: 50%;
  24.   height: 50%;box-shadow: 0px 0px 0px 2px #cccccc, 0px 0px 0px 5px #880000;
  25.   position: absolute;top:30px; left:250px;
  26. filter:contrast(120%)brightness(100%);
  27.   animation: round 48s infinite;
  28.   opacity: 1;}
  29. @keyframes round {0% {opacity:1;transform:perspective(700px) translate(-150%,-10%)scale(1)rotateX(0deg)rotateY(0deg);filter:hue-rotate(0deg)contrast(140%)brightness(100%);}

  30. 100% { opacity: 1;transform:perspective(700px) translate(200%,70%)scale(1)rotateX(0deg)rotateY(40deg);filter:hue-rotate(0deg)contrast(100%)brightness(100%);}
  31. }

  32. img:nth-child(1) {animation-delay: 42s;}
  33. img:nth-child(2) {animation-delay: 36s;}
  34. img:nth-child(3) {animation-delay: 30s;}
  35. img:nth-child(4) {animation-delay: 24s;}
  36. img:nth-child(5) {animation-delay: 18s;}
  37. img:nth-child(6) {animation-delay: 12s;}
  38. img:nth-child(7) {animation-delay: 6s;}
  39. img:nth-child(8) {animation-delay: 0s;}
  40. </style >

  41. <style type="text/css">
  42. .container{width: 1px;height: 1px;
  43.     margin: 0;position: absolute;top:500px; left:0px;z-index: 100;}
  44. .container #MusicPlayer{
  45.     width: 250px;
  46.     display: block;
  47.     margin: 0 auto;}
  48. .container .btn{
  49.     display: block;z-index: 300;
  50.     margin: 0;}
  51. .container .lrc{
  52.     width: 960px;
  53.     height: 120px;z-index: 1;
  54.     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);
  55.     display: block;position: absolute;top:-10px; left:80px;
  56.     margin: 0 auto;}
  57. .container .lrc #ullrc{
  58.     width: 100%;
  59.     padding: 0;
  60.     list-style: none;
  61.     transition: 0.3s all ease;
  62.     margin: 0;}
  63. /*歌词普通样式*/
  64. .container .lrc #ullrc li{
  65.     height: 70px;
  66.     line-height: 70px;
  67. font-family:悟空大字库;
  68.     font-size: 0px;
  69.     color: #000078;
  70.     font-weight: normal;
  71.     transition: .3s all ease;/*一定要加上不然看着突兀*/
  72.     list-style-type: none;
  73.     text-align: center;
  74.     display: block;
  75.     width: 100%;
  76.     margin: 0 auto;}
  77. /*动态歌词样式*/
  78. .container .lrc #ullrc li.active{
  79.     font-size: 40px;
  80.     color: #ff0000;
  81.     font-weight: bold}
  82. /*光碟动画*/
  83. .container .img_border{display:inline-block;width:1100px;height:620px;margin:0px ;position: absolute;top:0px;left:00px;}
  84. .container .img_border #aplay{display:block; }
  85. .container .z360z{width: 1100px; height: 620px;
  86.     z-index: 13;position: absolute;
  87.    top:-500px;
  88.     left: 0px;
  89. animation: rotating 0.05s linear infinite;}
  90. @keyframes rotating {
  91. 0%{opacity: 1;background: linear-gradient(6deg, rgba(251, 81, 81, 0.33) 13%,rgba(106, 80, 240, 0.07) 47%,rgba(65, 185, 41, 0.42) 85%);}
  92. 50% {opacity: 1;background: linear-gradient(6deg, rgba(114, 251, 81, 0.33) 13%,rgba(240, 184, 80, 0.05) 47%,rgba(185, 41, 45, 0.42) 87%);}
  93. 100%{opacity: 1;background: linear-gradient(6deg, rgba(251, 81, 81, 0.33) 13%,rgba(80, 240, 215, 0.11) 47%,rgba(26, 77, 251, 0.42) 87%);}
  94. }
  95. </style>
  96. <style type="text/css">.items  { animation: slider 0.26s linear infinite ;}
  97. @keyframes slider {from {opacity: 1;filter:hue-rotate(360deg)contrast(180%)brightness(200%);}
  98. to {opacity: 1;filter:hue-rotate(0deg)contrast(140%)brightness(100%);}}
  99. </style>
  100. <script >var lrc = `[00:00.83]吐鲁番的葡萄熟了 - 降央卓玛
  101. [00:04.92]词:瞿琮
  102. [00:06.11]曲:施光南
  103. [00:08.11]LRC:老谟深虑
  104. [00:10.39]克里木参军去到边哨
  105. [00:17.55]临行时种下了一颗葡萄
  106. [00:24.68]果园的姑娘啊
  107. [00:27.85]阿娜尔罕呦
  108. [00:31.23]精心培育这绿色的小苗
  109. [00:40.71]啊
  110. [00:44.78]姑娘啊遥望着雪山哨卡
  111. [00:52.08]捎去了一串串
  112. [00:54.95]甜美的葡萄
  113. [00:59.33]吐鲁番的葡萄熟了
  114. [01:02.91]阿娜尔罕的心儿碎了
  115. [01:06.57]阿娜尔罕的心儿碎了
  116. [01:23.56]吐鲁番的葡萄熟了
  117. [01:27.12]阿娜尔罕的心儿碎了
  118. [01:30.73]阿娜尔罕的心儿碎了
  119. [01:52.75]
  120. [01:55.77]`;
  121. function $(id) {return document.getElementById(id);
  122. }//这样写以后getid方便
  123. function getLrcArray() {
  124.     var parts = lrc.split("\n");
  125.     for (let index = 0; index < parts.length; index++) {
  126.         parts[index] = getLrcObj(parts[index]);
  127.     }
  128.     return parts;

  129.     function getLrcObj(content) {
  130.         var twoParts = content.split("]");
  131.         var time = twoParts[0].substr(1);
  132.         var timeParts = time.split(":");
  133.         var seconds = +timeParts[1];
  134.         var min = +timeParts[0];
  135.         seconds = min * 60 + seconds;
  136.         var words = twoParts[1];
  137.         return{
  138.             seconds: seconds,
  139.             words: words,
  140.         };
  141.     }
  142. }
  143. var lrcArray = getLrcArray();
  144. function inputLrc() {
  145.     for (let index = 0; index < lrcArray.length; index++) {
  146.         var li = document.createElement("li");
  147.         li.innerText = lrcArray[index].words;
  148.         $("ullrc").appendChild(li);
  149.     }
  150. }
  151. inputLrc();
  152. function setPosition() {
  153.     var index = getLrcIndex();
  154.     if (index == -1) {
  155.         return;
  156.     }
  157.     var lrc_li_height = 70, lrc_ul_height = 50;
  158.     var top = index * lrc_li_height + lrc_li_height / 2 - lrc_ul_height / 2;
  159.     if (top < 0) {
  160.         top = 0;
  161.     }
  162.     $("ullrc").style.marginTop = -top + "px";
  163.     var activeLi = $("ullrc").querySelector(".active");
  164.     if(activeLi){
  165.         activeLi.classList.remove("active");
  166.     }
  167.     $("ullrc").children[index].classList.add("active");
  168. }
  169. var turn = 0;
  170. function getLrcIndex(){
  171.     var time = $("MusicPlayer").currentTime + turn;
  172.     for (var index = 0; index < lrcArray.length; index++) {
  173.         if (lrcArray[index].seconds > time) {
  174.             return index - 1;
  175.         }
  176.     }
  177. }
  178. $("MusicPlayer").ontimeupdate = setPosition;
  179. </script>
  180. <script>
  181.          var aud = document.getElementById("MusicPlayer");
  182. var img = document.getElementById("playpause");
  183. img.onclick = function() {
  184.         if (aud.paused) {
  185.                 aud.play();
  186.         } else {
  187.                 aud.pause();
  188.         }
  189. }
  190. aud.addEventListener("play", function (e) {
  191. img.src="http://image.hnol.net/c/2022-05/16/14/20220516140228811-5769293.gif";
  192. }, false);
  193. aud.addEventListener("pause", function (e) {
  194. img.src="http://image.hnol.net/c/2022-05/16/14/2022051614143711-5769293.png";
  195. }, false);
  196. </script>
  197. <script type="text/javascript">
  198. var my_audio =document.getElementById("MusicPlayer");my_audio.onended = function(){document.getElementById("aplay").className="items";};my_audio.onplaying = function()
  199. {document.getElementById("aplay").className="z360z";};my_audio.onpause = function(){document.getElementById("aplay").className="";};var lyric = parseLyric(songkrc);
  200. </script>
复制代码
发表于 2022-8-4 16:53 | 显示全部楼层
欣赏老师佳作!赞!
发表于 2022-8-4 17:37 | 显示全部楼层
欣赏老师精美佳作,新疆歌好听。
发表于 2022-8-4 17:44 | 显示全部楼层
欣赏佳作 - 赞!
发表于 2022-8-4 18:47 | 显示全部楼层
欣赏老师的音画佳作!点赞!
发表于 2022-8-4 20:22 | 显示全部楼层

本帖子中包含更多资源

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

x
发表于 2022-8-4 21:04 | 显示全部楼层
欣赏老师的精彩分享,问好!
发表于 2022-8-5 08:08 | 显示全部楼层
欣赏老师佳作!
        
下一页 发布主题 快速回复

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

GMT+8, 2025-2-6 10:08

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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