醉美水芙蓉 发表于 2023-6-3 21:50
@马黑黑 老师播放器歌词变成旋转的了,不会改了!
css里,以下这一句,是我针对唯一一个 css-doodle 做的,现在你有两个 css-doodle 标签,是它让 歌词也转动了:
css-doodle {
position: relative;
left: 50px;
top: 250px;
animation: rot 6s infinite linear var(--state);
}
解决方法:把 css-doodle { ... } 中的 css-doodle 改为 id 标签:
#mplayer {
position: relative;
left: 50px;
top: 250px;
animation: rot 6s infinite linear var(--state);
}
醉美水芙蓉 发表于 2023-6-4 19:46
问候黑黑老师晚上好!感谢老师百忙之中光临指导!
你在看另一个回复
醉美水芙蓉 发表于 2023-6-4 19:59
无意制作使歌词翻转了,不过可以转慢点,快了看不清歌词!
你按我的建议去改改
醉美水芙蓉 发表于 2023-6-3 21:47
啊呀!月儿播放器出问题了呢?不知道怎么解决呢?
我今天也用这个小播做了一个贴子,把小播单独整出来了。发给你瞧瞧
<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;
}
css-doodle { position: absolute; }
</style>
<div id="papa">
<css-doodlegrid="1" id="mplayer" >
:doodle {@size: 190px;
position: relative;
cursor: pointer;
left: 50px;
top: 120px;
z-index: 10;
}
background: @doodle(
:doodle { @grid: 3 ;
@size: 190px;
background: radial-gradient(DarkCyan,transparent 70%,transparent 0);
cursor: pointer;
}
@shape: clover 3;
@place: center;
background: Peru;
transform: rotate(calc(@i * 40deg)) translate(60px);
);
animation: rot 6s infinite linear var(--state);
@keyframes rot { to { transform: rotate(1turn); } }
</css-doodle>
<css-doodle id="lrc">
:doodle {
@size: auto 4em;
bottom: 10px;
--geci: "css-doodle player"; --motion: cover2; --tt: 1s; } /* 单元格两个伪元素显示lrc歌词 */
display: grid;
place-items: center start;
:before, :after {
content: var(--geci);
color:AntiqueWhite; /* 歌词底色 */
font: bold 2em sans-serif;
text-shadow: 1px 1px 2px #000;
white-space: pre;
}
:after {
position: absolute;
width: 0;
color: Tan; /* 同步歌词颜色 */
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>
<div class="panda">
<img src="" alt="" /></div> <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 = [
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
];
let calcKey = () => {for (j = 0;j < lrcAr.length;j++) {if (aud.currentTime <= lrcAr) {mKey = j - 1;break;}}if (mKey < 0) mKey = 0;if (mKey > lrcAr.length - 1) mKey = lrcAr.length - 1;let time = lrcAr - (aud.currentTime - lrcAr);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 + '"');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) {cKey = j;if (mKey === j) showLrc(lrcAr);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>
<css-doodlegrid="1" id="mplayer" >
:doodle {@size: 190px;
position: relative;
cursor: pointer;
left: 410px;
top: 120px;
z-index: 10;
}
background: @doodle(
:doodle { @grid: 3 ;
@size: 190px;
background: radial-gradient(DarkCyan,transparent 70%,transparent 0);
cursor: pointer;
}
@shape: clover 3;
@place: center;
background: Peru;
transform: rotate(calc(@i * 40deg)) translate(60px);
);
animation: rot 6s infinite linear var(--state);
@keyframes rot { to { transform: rotate(1turn); } }
</css-doodle>
颜色是我用的颜色,歌词位置自己改哈。。
<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 = [
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
];
let calcKey = () => {for (j = 0;j < lrcAr.length;j++) {if (aud.currentTime <= lrcAr) {mKey = j - 1;break;}}if (mKey < 0) mKey = 0;if (mKey > lrcAr.length - 1) mKey = lrcAr.length - 1;let time = lrcAr - (aud.currentTime - lrcAr);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 + '"');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) {cKey = j;if (mKey === j) showLrc(lrcAr);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>
马黑黑 发表于 2023-6-4 22:02
学习老师的标准答案{:4_187:}
南无月 发表于 2023-6-4 22:11
学习老师的标准答案
也许也不是标准的,只是简单梳理一下
醉美水芙蓉 发表于 2023-6-5 07:13
学习黑黑老师的标准答案!
{:4_190:}
马黑黑 发表于 2023-6-4 22:16
也许也不是标准的,只是简单梳理一下
我这里不存在也许,必须是标准的。{:4_173:}
醉美水芙蓉 发表于 2023-6-5 07:14
月儿就是厉害!
其实很一般,整出来都凑巧,不知其所以然的乱整
本帖最后由 亚伦影音工作室 于 2023-6-5 20:48 编辑
不要轻易制作这些动效歌词,没有美感!如果非要制作最好起点和终点要合适停留在哪里!