|
|
- <style>
- #papa {
- margin: 0 0 0 calc(50% - 593px);
- width: 1024px;
- height: 640px;
- background: lightblue url('https://img-baofun.zhhainiao.com/pcwallpaper_ugc/live/185360624d54f427ea1b20fed751c483.mp4.jpg') no-repeat center / cover;
- box-shadow: 3px 3px 20px #000;
- position: relative;
- z-index: 1;
- --state: paused;
- }
- #mplayer {
- position: relative;
- left: 50px;
- top: 250px;
- animation: rot 6s infinite linear var(--state);
- }
- @keyframes rot { to { transform: rotate(1turn); } }
- </style>
- <div id="papa">
- <css-doodle grid="3" id="mplayer">
- :doodle {
- @size: 160px;
- background: radial-gradient(darkgreen,transparent 70%,transparent 0);
- cursor: pointer;
- }
- @shape: clover 3;
- @place: center;
- background: green;
- transform: rotate(calc(@i * 40deg)) translate(60px);
- </css-doodle>
- <css-doodle id="lrc">
- :doodle {
- @size: auto 4em;
- z-index:5;
- bottom: 0px;
- --geci: "css-doodle player";
- --motion: cover2;
- --tt: 1s;
- }
- /* 单元格两个伪元素显示lrc歌词 */
- display: grid;
- place-items: center start;
- :before, :after {
- content: var(--geci);
- color: Honeydew;
- /* 歌词底色 */
- font: bold 2em sans-serif;
- text-shadow: 1px 1px 2px #000;
- white-space: pre;
- }
- :after {
- position: absolute;
- width: 0;
- color:Teal;
- /* 同步歌词颜色 */
- overflow: hidden;
- animation: var(--motion) var(--tt) linear forwards var(--state);
- }
- @keyframes cover1 { from { width: 0; } to { width: 100%; } }
- @keyframes cover2 { from { width: 0; } to { width: 100%; } }
- </css-doodle>
- <audio id="aud" src="https://www.qqmc.com/mp3/music170783213.mp3" autoplay="" loop=""></audio>
- </div>
-
- <script>
- let slip = 0.5, mFlag = true, mKey = 0, clickIdx = 0, progChg = 0, cursors = ['default','pointer','pointer'];
- let lrcAr = [
- [0,"YOURE MY LOVE YOURE MY LIFE",6.0],
- [6.02,"Lyrics by:Gerd Rochel/Cindy Hire",6.0],
- [12.05,"Composed by:Gerd Rochel",6.0],
- [18.07,"Seems you're an angel from the sky",3.0],
- [21.09,"LRC编辑:醉美水芙蓉",1.0],
- [22.06,"You fill my fantasy",3.0],
- [25.01,"",1.1],
- [26.07,"The way you look takes me so high",3.0],
- [29.09,"",1.0],
- [30.06,"You're everything to me",2.0],
- [32.1,"",1.0],
- [33.08,"And all I want is your photograph",4.0],
- [37.09,"How I'm longing for your smile",3.9],
- [41.01,"",0.1],
- [41.07,"So come and touch me",3.0],
- [44.05,"Come and feel me",2.0],
- [46.04,"Hear me cry",3.0],
- [49.06,"You're my love you're my love",2.0],
- [51.06,"You're my life you're my life",2.0],
- [53.06,"Everyday everyday",2.0],
- [55.07,"Every night every night",2.0],
- [57.07,"Is it right is it right",2.0],
- [59.06,"What I feel what I feel",2.0],
- [61.07,"How I wish you were for real",3.0],
- [64.1,"",1.0],
- [65.06,"You're my love you're my love",2.0],
- [67.06,"You're my life you're my life",2.0],
- [69.07,"Everyday everyday",2.0],
- [71.07,"Every night every night",2.0],
- [73.07,"In my dreams in my dreams",2.0],
- [75.07,"I'm with you I'm with you",2.0],
- [77.07,"Will you make my dreams come true",3.9],
- [81.01,"",15.1],
- [96.09,"I'm all alone the night has come",3.9],
- [100.02,"",0.1],
- [100.09,"You're in my radio",3.0],
- [103.04,"",1.0],
- [104.09,"It's when you sing I feel the sun",3.9],
- [108.01,"",0.1],
- [108.09,"Now I can feel the show",3.9],
- [112,"Since forever more you're my destiny",3.1],
- [115.09,"Take my loneliness away",4.0],
- [119.04,"",0.0],
- [119.09,"So come and touch me",3.0],
- [122.07,"Come and feel me",2.0],
- [124.06,"Hear me say",3.0],
- [127.09,"You're my love you're my love",2.0],
- [129.09,"You're my life you're my life",2.9],
- [132,"Everyday everyday",2.0],
- [134.01,"Every night every night",1.1],
- [135.09,"Is it right is it right",2.0],
- [137.1,"What I feel what I feel",2.0],
- [139.09,"How I wish you were for real",3.9],
- [143.03,"",1.0],
- [144,"You're my love you're my love",1.1],
- [145.1,"You're my life you're my life",2.9],
- [148.02,"Everyday everyday",2.0],
- [150,"Every night every night",2.0],
- [152,"In my dreams in my dreams",2.0],
- [154.01,"I'm with you I'm with you",2.0],
- [156.01,"Will you make my dreams come true",3.1],
- [159.06,"",1.0],
- [160.02,"Since forever more you're my destiny",4.0],
- [164.02,"Take my loneliness away",3.0],
- [167.06,"",1.0],
- [168.02,"So come and touch me",2.1],
- [170.09,"Come and feel me",2.9],
- [173,"Hear me say",3.1],
- [176.06,"",36.0],
- [212.05,"You're my love you're my love",2.0],
- [214.03,"You're my life you're my life",2.0],
- [216.03,"Everyday everyday",2.0],
- [218.03,"Every night every night",2.0],
- [220.03,"Is it right is it right",2.0],
- [222.03,"What I feel what I feel",2.0],
- [224.04,"How I wish you were for real",3.0],
- [227.07,"",1.0],
- [228.04,"You're my love you're my love",2.0],
- [230.04,"You're my life you're my life",2.0],
- [232.04,"Everyday everyday",2.0],
- [234.04,"Every night every night",2.0],
- [236.04,"In my dreams in my dreams",2.0],
- [238.04,"I'm with you I'm with you",2.0],
- [240.04,"Will you make my dreams come true",3.0],
- [243.08,"",44.0],
- [287.04,"Hear me say",3.0],
- [290.07,"You're my love you're my love",2.0],
- [292.07,"You're my life you're my life",2.0],
- [294.07,"Everyday everyday",2.0],
- [296.07,"Every night every night",2.0],
- [298.08,"Is it right is it right",2.0],
- [300.07,"What I feel what I feel",2.0],
- [302.07,"How I wish you were for real",3.9],
- [306.01,"",0.1],
- [306.07,"You're my love you're my love",2.0],
- [308.08,"You're my life you're my life",2.0],
- [310.08,"Everyday everyday",2.0],
- [312.08,"Every night every night",2.0],
- [314.08,"In my dreams in my dreams",2.0],
- [316.08,"I'm with you I'm with you",2.0],
- [318.09,"Will you make my dreams come true",3.9],
- [322.02,"",58.0],
- [380,"You're my love you're my love",1.1],
- [381.09,"You're my life you're my life",2.0],
- [383.09,"Everyday everyday",2.0],
- [385.09,"Every night every night",2.0],
- [387.09,"Is it right is it right",2.0],
- [389.1,"What I feel what I feel",2.0],
- [391.09,"How I wish you were for real",3.9],
- [395.01,"",0.1],
- [395.09,"You're my love you're my love",2.0],
- [397.09,"You're my life you're my life",2.0],
- [399.1,"Everyday everyday",2.0],
- [401.1,"Every night every night",2.0],
- [403.1,"In my dreams in my dreams",2.0],
- [405.1,"I'm with you I'm with you",2.9],
- [408.01,"Will you make my dreams come true",3.0],
- [411.02,"",1.0],
- [412.01,"You're my love you're my love",2.0],
- [414,"You're my life you're my life",2.0],
- [416,"Everyday everyday",2.0],
- [418.01,"Every night every night",2.0],
- [420,"Is it right is it right",2.0],
- [422.01,"What I feel what I feel",2.0],
- [424.01,"How I wish you were for real",6.0],
- [430.04,"谢谢欣赏!",6]
- ];
- let calcKey = () => {for (j = 0;j < lrcAr.length;j++) {if (aud.currentTime <= lrcAr[j][0]) {mKey = j - 1;break;}}if (mKey < 0) mKey = 0;if (mKey > lrcAr.length - 1) mKey = lrcAr.length - 1;let time = lrcAr[mKey][2] - (aud.currentTime - lrcAr[mKey][0]);showLrc(time);};
- let script = document.createElement('script');
- script.src = 'https://638183.freep.cn/638183/web/api/css-doodle.js';
- document.body.appendChild(script);
- let mState = () => papa.style.setProperty('--state', aud.paused ? 'paused' : 'running');
- let showLrc = (time) => {lrc.style.setProperty('--motion', mFlag ? 'cover1' : 'cover2');lrc.style.setProperty('--geci', '"' + lrcAr[mKey][1] + '"');lrc.style.setProperty('--tt', time + 's');mKey += 1;mFlag = !mFlag;};
- aud.addEventListener('play', mState, false);
- aud.addEventListener('pause', mState, false);
- aud.addEventListener('timeupdate', () => {for (j = 0; j < lrcAr.length; j++) {if (aud.currentTime - slip >= lrcAr[j][0]) {cKey = j;if (mKey === j) showLrc(lrcAr[j][2]);else continue;}}mplayer.style.setProperty('--ttmsg1', `'${toMin(aud.currentTime)}'`);mplayer.style.setProperty('--ttmsg2', `'${toMin(aud.duration)}'`);mplayer.style.setProperty('--prog',`${100 * aud.currentTime / aud.duration}%`);});
- mplayer.onclick = () => aud.paused ? aud.play() : aud.pause();
- </script>
复制代码
|
|