|
|

楼主 |
发表于 2024-3-7 23:10
|
显示全部楼层
代码有些问题,严重的问题是 图片按钮没有id,下面是修改后的代码,仔细瞧下:
- <style>
- #papa {
- margin: 0 0 0 calc(50% - 593px);
- width: 1024px;
- height: 640px;
- background: url('https://638183.freep.cn/638183/t24/1/19u.jpeg') no-repeat center/cover;
- box-shadow: 3px 3px 20px #000;
- position: relative;
- display: grid;
- place-items: center;
- z-index: 1;
- }
- #lrc {
- position: absolute;
- top: 10px;
- font: bold 2.4em sans-serif;
- color: lightgreen;
- text-shadow: 1px 1px 1px rgba(0,0,0,.45);
- --ani: lrcGo1;
- --duration: 1s;
- }
- #lrc::before {
- position: absolute;
- content: attr(data-lrc);
- width: 100%;
- height: 100%;
- color: transparent;
- background: repeating-radial-gradient(lightgreen, red, lightgreen 24px);
- background-clip: text;
- -webkit-background-clip: text;
- clip-path: inset(0 100% 0 0);
- animation: var(--ani) var(--duration) linear forwards var(--state);
-
- }
- #btnplay {
- position: absolute;
- bottom: 10px;
- width: 50px;
- height: 50px;
- animation: rotating 6s linear infinite var(--state);
- cursor: pointer;
- }
- @keyframes rotating { to { transform: rotate(360deg); } }
- @keyframes lrcGo0 { to { clip-path: inset(0 0 0 0); } }
- @keyframes lrcGo1 { to { clip-path: inset(0 0 0 0); } }
- </style>
- <div id="papa">
- <audio src="https://music.163.com/song/media/outer/url?id=496815031 " autoplay loop></audio>
- <div id="lrc" data-lrc="HUACHAO LRC">HUACHAO LRC</div>
- <img id="btnplay" src=" https://638183.freep.cn/638183/t23/btn/y5j.png " alt="" />
- </div>
- <script>
- var geci = [ [1.71,"空心",2.7], [6,"……",3], [266.02,"把我当成一棵树吧",5.2] ];
- var sF = document.createElement('script');
- sF.charset = 'utf-8';
- sF.src = 'https://638183.freep.cn/638183/web/js/btnlrc.js';
- document.querySelector('body').appendChild(sF);
- </script>
复制代码
|
|