马黑黑 发表于 2024-9-3 20:35

花飞飞 发表于 2024-9-3 20:34
这个凭记忆整出来的,比一容易一丢丢

让这些小玩意成为自己的技能就是好事

马黑黑 发表于 2024-9-3 20:36

花飞飞 发表于 2024-9-3 20:35
最大的感受就是两天不看就回生。。

那是一回生二回熟三回你是我我是你

花飞飞 发表于 2024-9-3 20:43

马黑黑 发表于 2024-9-3 20:35
让这些小玩意成为自己的技能就是好事

关键它好用啊。。变个色,整个大小啥的。。好用的就受欢迎

花飞飞 发表于 2024-9-3 20:45

马黑黑 发表于 2024-9-3 20:36
那是一回生二回熟三回你是我我是你

这得三步一回头的多瞧几眼{:4_170:}

马黑黑 发表于 2024-9-3 20:57

花飞飞 发表于 2024-9-3 20:45
这得三步一回头的多瞧几眼

这个和敲三次黑板一样效果

马黑黑 发表于 2024-9-3 20:57

花飞飞 发表于 2024-9-3 20:43
关键它好用啊。。变个色,整个大小啥的。。好用的就受欢迎

是的

花飞飞 发表于 2024-9-4 15:25

马黑黑 发表于 2024-9-3 20:57
这个和敲三次黑板一样效果

敲黑板效果好,支持多敲敲。。{:4_173:}

花飞飞 发表于 2024-9-4 15:26

马黑黑 发表于 2024-9-3 20:57
是的

{:4_181:}

马黑黑 发表于 2024-9-4 17:54

花飞飞 发表于 2024-9-4 15:25
敲黑板效果好,支持多敲敲。。

三次合适了

花飞飞 发表于 2024-9-4 19:52

马黑黑 发表于 2024-9-4 17:54
三次合适了

三次就三次,不多不少刚刚好。。我写个二十六讲的作业去。。

马黑黑 发表于 2024-9-4 20:39

花飞飞 发表于 2024-9-4 19:52
三次就三次,不多不少刚刚好。。我写个二十六讲的作业去。。

{:4_190:}

花飞飞 发表于 2024-9-4 20:51

本帖最后由 花飞飞 于 2024-9-4 20:52 编辑 <br /><br /><style>
#mhh {
        --state: running;
       margin: 30px 0 30px calc(50% - 593px);
        width: 1024px;
        height: 640px;
        background: url('https://642303.freep.cn/642303/tu/sadf.webp') no-repeat center/cover;
        border: 1px solid gray;
        pointer-events: none;
        overflow: hidden;
        position: relative;
}
#mhh::before {
        content: '';
        position: absolute;
        right: 430px;
        top: 190px;
        width: 130px;
        height: 130px;
        border-radius: 50%;
        background: url('https://pic.imgdb.cn/item/66d85314d9c307b7e93e339b.png') no-repeat center/cover;
        cursor: pointer;
        pointer-events: auto;
        animation: rot 6s linear infinite var(--state);
}
#mhh::after {
        content: '';
        position: absolute;
        left: 100px;
        top: 130px;
        width: 100px;
        height: 100px;
        border-radius: 50%;
        background: url('https://pic.imgdb.cn/item/66d8530dd9c307b7e93e2d40.png') no-repeat center/cover;
        cursor: pointer;
        pointer-events: auto;
        animation: rot 6s linear infinite var(--state);
}
#vid1 {
        position: absolute;
        width: 640px;
        height:640px;
        left:220px;
-   top:-500px;
        opacity: .99;
        object-fit: cover;
        border-radius: 50%;
        mix-blend-mode: screen;
        pointer-events: none;
}
#vid2 {
        position: absolute;
        width: 100%;
        height:100%;
        opacity: .59;
        object-fit: cover;
        mix-blend-mode:lighten;
        pointer-events: none;
        transform: rotateX(180deg);
        -webkit-mask: linear-gradient(to top, red 58%, transparent 63.5%,transparent 0 );
}
@keyframes rot { to { transform: rotate(360deg); } }
</style>

<div id="mhh" title="播放/暂停">
<video id="vid1" src="https://bpic.588ku.com/video_listen/588ku_preview/23/02/08/12/12/14/video63e3211ee939e.mp4" autoplay loop muted></video>
<video id="vid2" src="https://bpic.588ku.com/video_listen/588ku_preview/24/07/01/11/35/57/video6682241d43f12.mp4" autoplay loop muted></video>
        <audio id="aud" src="https://music.163.com/song/media/outer/url?id=304937" autoplay loop></audio>
</div>

<script>

mState = () => {
        mhh.style.setProperty('--state', aud.paused ? 'paused' : 'running');
        mhh.title = ['暂停','播放'][+aud.paused];
        aud.paused ? vid1.pause() : vid1.play();
        aud.paused ? vid2.pause() : vid2.play();
};

aud.oncanplay = aud.onplaying = aud.onpause = () => mState();
mhh.onclick = () => aud.paused ? aud.play() : aud.pause();
</script>

花飞飞 发表于 2024-9-4 20:53


<style>
.mum { position: relative; margin: 0; padding: 10px; font: normal 16px/20px Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; color: black; background: rgba(240, 240, 240,.95); box-shadow: 2px 2px 4px gray; border: thick groove lightblue; border-radius: 6px; }
.mum ::selection { background-color: rgba(0,100,100,.35); }
.mum div { margin: 0; padding: 0; }
.mum cl-cd { display: block; position: relative; margin: 0 0 0 50px; padding: 0 0 0 10px; white-space: pre-wrap; overflow-wrap: break-word; border-left: 1px solid silver; }
.mum cl-cd::before { position: absolute; content: attr(data-idx); width: 50px; color: gray; text-align: right; transform: translate(-70px); }
.tRed { color: red; }
.tBlue { color: blue; }
.tGreen { color: green; }
.tDarkRed { color: darkred; }
.tMagenta { color: magenta; }
</style>
<div class='mum'>
<cl-cd data-idx="1">&lt;<span class="tDarkRed">style</span>&gt;</cl-cd>
<cl-cd data-idx="2">#mhh {</cl-cd>
<cl-cd data-idx="3">&nbsp; &nbsp; <span class="tBlue">--state:</span> running;</cl-cd>
<cl-cd data-idx="4">&nbsp; &nbsp;<span class="tBlue">margin:</span> 30px 0 30px calc(50% - 593px);</cl-cd>
<cl-cd data-idx="5">&nbsp; &nbsp; <span class="tBlue">width:</span> 1024px;</cl-cd>
<cl-cd data-idx="6">&nbsp; &nbsp; <span class="tBlue">height:</span> 640px;</cl-cd>
<cl-cd data-idx="7">&nbsp; &nbsp; <span class="tBlue">background:</span> url(<span class="tMagenta">'https://642303.freep.cn/642303/tu/sadf.webp'</span>) no-repeat center/cover;</cl-cd>
<cl-cd data-idx="8">&nbsp; &nbsp; <span class="tBlue">border:</span> 1px solid gray;</cl-cd>
<cl-cd data-idx="9">&nbsp; &nbsp; <span class="tBlue">pointer-events:</span> none; </cl-cd>
<cl-cd data-idx="10">&nbsp; &nbsp; <span class="tBlue">overflow:</span> hidden;</cl-cd>
<cl-cd data-idx="11">&nbsp; &nbsp; <span class="tBlue">position:</span> relative;</cl-cd>
<cl-cd data-idx="12">}</cl-cd>
<cl-cd data-idx="13">#mhh::before {</cl-cd>
<cl-cd data-idx="14">&nbsp; &nbsp; <span class="tBlue">content:</span> <span class="tMagenta">''</span>;</cl-cd>
<cl-cd data-idx="15">&nbsp; &nbsp; <span class="tBlue">position:</span> absolute;</cl-cd>
<cl-cd data-idx="16">&nbsp; &nbsp; <span class="tBlue">right:</span> 430px;</cl-cd>
<cl-cd data-idx="17">&nbsp; &nbsp; <span class="tBlue">top:</span> 190px;</cl-cd>
<cl-cd data-idx="18">&nbsp; &nbsp; <span class="tBlue">width:</span> 130px;</cl-cd>
<cl-cd data-idx="19">&nbsp; &nbsp; <span class="tBlue">height:</span> 130px;</cl-cd>
<cl-cd data-idx="20">&nbsp; &nbsp; <span class="tBlue">border-radius:</span> 50%;</cl-cd>
<cl-cd data-idx="21">&nbsp; &nbsp; <span class="tBlue">background:</span> url(<span class="tMagenta">'https://pic.imgdb.cn/item/66d85314d9c307b7e93e339b.png'</span>) no-repeat center/cover;</cl-cd>
<cl-cd data-idx="22">&nbsp; &nbsp; <span class="tBlue">cursor:</span> pointer;</cl-cd>
<cl-cd data-idx="23">&nbsp; &nbsp; <span class="tBlue">pointer-events:</span> auto; </cl-cd>
<cl-cd data-idx="24">&nbsp; &nbsp; <span class="tBlue">animation:</span> rot 6s linear infinite <span class="tBlue">var</span>(--state);</cl-cd>
<cl-cd data-idx="25">}</cl-cd>
<cl-cd data-idx="26">#mhh::after {</cl-cd>
<cl-cd data-idx="27">&nbsp; &nbsp; <span class="tBlue">content:</span> <span class="tMagenta">''</span>;</cl-cd>
<cl-cd data-idx="28">&nbsp; &nbsp; <span class="tBlue">position:</span> absolute;</cl-cd>
<cl-cd data-idx="29">&nbsp; &nbsp; <span class="tBlue">left:</span> 100px;</cl-cd>
<cl-cd data-idx="30">&nbsp; &nbsp; <span class="tBlue">top:</span> 130px;</cl-cd>
<cl-cd data-idx="31">&nbsp; &nbsp; <span class="tBlue">width:</span> 100px;</cl-cd>
<cl-cd data-idx="32">&nbsp; &nbsp; <span class="tBlue">height:</span> 100px;</cl-cd>
<cl-cd data-idx="33">&nbsp; &nbsp; <span class="tBlue">border-radius:</span> 50%;</cl-cd>
<cl-cd data-idx="34">&nbsp; &nbsp; <span class="tBlue">background:</span> url(<span class="tMagenta">'https://pic.imgdb.cn/item/66d8530dd9c307b7e93e2d40.png'</span>) no-repeat center/cover;</cl-cd>
<cl-cd data-idx="35">&nbsp; &nbsp; <span class="tBlue">cursor:</span> pointer;</cl-cd>
<cl-cd data-idx="36">&nbsp; &nbsp; <span class="tBlue">pointer-events:</span> auto; </cl-cd>
<cl-cd data-idx="37">&nbsp; &nbsp; <span class="tBlue">animation:</span> rot 6s linear infinite <span class="tBlue">var</span>(--state);</cl-cd>
<cl-cd data-idx="38">}</cl-cd>
<cl-cd data-idx="39">#vid1 {</cl-cd>
<cl-cd data-idx="40">&nbsp; &nbsp; <span class="tBlue">position:</span> absolute;</cl-cd>
<cl-cd data-idx="41">&nbsp; &nbsp; <span class="tBlue">width:</span> 640px;</cl-cd>
<cl-cd data-idx="42">&nbsp; &nbsp; <span class="tBlue">height:</span>640px;</cl-cd>
<cl-cd data-idx="43">&nbsp; &nbsp; <span class="tBlue">left:</span>220px;</cl-cd>
<cl-cd data-idx="44">-   <span class="tBlue">top:</span>-500px;</cl-cd>
<cl-cd data-idx="45">&nbsp; &nbsp; <span class="tBlue">opacity:</span> .99;</cl-cd>
<cl-cd data-idx="46">&nbsp; &nbsp; <span class="tBlue">object-fit:</span> cover;</cl-cd>
<cl-cd data-idx="47">&nbsp; &nbsp; <span class="tBlue">border-radius:</span> 50%;</cl-cd>
<cl-cd data-idx="48">&nbsp; &nbsp; <span class="tBlue">mix-blend-mode:</span> screen;</cl-cd>
<cl-cd data-idx="49">&nbsp; &nbsp; <span class="tBlue">pointer-events:</span> none;</cl-cd>
<cl-cd data-idx="50">}</cl-cd>
<cl-cd data-idx="51">#vid2 {</cl-cd>
<cl-cd data-idx="52">&nbsp; &nbsp; <span class="tBlue">position:</span> absolute;</cl-cd>
<cl-cd data-idx="53">&nbsp; &nbsp; <span class="tBlue">width:</span> 100%;</cl-cd>
<cl-cd data-idx="54">&nbsp; &nbsp; <span class="tBlue">height:</span>100%;</cl-cd>
<cl-cd data-idx="55">&nbsp; &nbsp; <span class="tBlue">opacity:</span> .59;</cl-cd>
<cl-cd data-idx="56">&nbsp; &nbsp; <span class="tBlue">object-fit:</span> cover;</cl-cd>
<cl-cd data-idx="57">&nbsp; &nbsp; <span class="tBlue">mix-blend-mode:</span>lighten;</cl-cd>
<cl-cd data-idx="58">&nbsp; &nbsp; <span class="tBlue">pointer-events:</span> none;</cl-cd>
<cl-cd data-idx="59">&nbsp; &nbsp; <span class="tBlue">transform:</span> rotateX(180deg);</cl-cd>
<cl-cd data-idx="60">&nbsp; &nbsp; <span class="tBlue">-webkit-mask:</span> linear-gradient(to top, red 58%, transparent 63.5%,transparent 0 );</cl-cd>
<cl-cd data-idx="61">}</cl-cd>
<cl-cd data-idx="62">@keyframes rot { to { <span class="tBlue">transform:</span> rotate(360deg); } }</cl-cd>
<cl-cd data-idx="63">&lt;<span class="tDarkRed">/style</span>&gt;</cl-cd>
<cl-cd data-idx="64">&nbsp;</cl-cd>
<cl-cd data-idx="65">&lt;<span class="tDarkRed">div</span> <span class="tRed">id</span>=<span class="tMagenta">"mhh"</span> title=<span class="tMagenta">"播放/暂停"</span>&gt;</cl-cd>
<cl-cd data-idx="66">&lt;<span class="tDarkRed">video</span> <span class="tRed">id</span>=<span class="tMagenta">"vid1"</span> src=<span class="tMagenta">"https://bpic.588ku.com/video_listen/588ku_preview/23/02/08/12/12/14/video63e3211ee939e.mp4"</span> autoplay loop muted&gt;&lt;<span class="tDarkRed">/video</span>&gt;</cl-cd>
<cl-cd data-idx="67">&lt;<span class="tDarkRed">video</span> <span class="tRed">id</span>=<span class="tMagenta">"vid2"</span> src=<span class="tMagenta">"https://bpic.588ku.com/video_listen/588ku_preview/24/07/01/11/35/57/video6682241d43f12.mp4"</span> autoplay loop muted&gt;&lt;<span class="tDarkRed">/video</span>&gt;</cl-cd>
<cl-cd data-idx="68">&nbsp; &nbsp; &lt;<span class="tDarkRed">audio</span> <span class="tRed">id</span>=<span class="tMagenta">"aud"</span> src=<span class="tMagenta">"https://music.163.com/song/media/outer/url?<span class="tRed">id</span>=304937"</span> autoplay loop&gt;&lt;<span class="tDarkRed">/audio</span>&gt;</cl-cd>
<cl-cd data-idx="69">&lt;<span class="tDarkRed">/div</span>&gt;</cl-cd>
<cl-cd data-idx="70">&nbsp;</cl-cd>
<cl-cd data-idx="71">&lt;<span class="tDarkRed">script</span>&gt;</cl-cd>
<cl-cd data-idx="72">&nbsp;</cl-cd>
<cl-cd data-idx="73">mState = () =&gt; {</cl-cd>
<cl-cd data-idx="74">&nbsp; &nbsp; mhh.style.setProperty(<span class="tMagenta">'--state'</span>, aud.paused ? <span class="tMagenta">'paused'</span> : <span class="tMagenta">'running'</span>);</cl-cd>
<cl-cd data-idx="75">&nbsp; &nbsp; mhh.title = [<span class="tMagenta">'暂停'</span>,<span class="tMagenta">'播放'</span>][+aud.paused];</cl-cd>
<cl-cd data-idx="76">&nbsp; &nbsp; aud.paused ? vid1.pause() : vid1.play();</cl-cd>
<cl-cd data-idx="77">&nbsp; &nbsp; aud.paused ? vid2.pause() : vid2.play();</cl-cd>
<cl-cd data-idx="78">};</cl-cd>
<cl-cd data-idx="79">&nbsp;</cl-cd>
<cl-cd data-idx="80">aud.oncanplay = aud.onplaying = aud.onpause = () =&gt; mState();</cl-cd>
<cl-cd data-idx="81">mhh.onclick = () =&gt; aud.paused ? aud.play() : aud.pause();</cl-cd>
<cl-cd data-idx="82">&lt;<span class="tDarkRed">/script</span>&gt;</cl-cd>
</div>

花飞飞 发表于 2024-9-4 20:58

《小白音画教程》第二十六讲作业:
参照本讲最后一个示例,制作一个简单的帖子。
要求:
① 帖子有背景图、有视频,其中视频设置为圆形、不覆盖整个帖子;
② 用伪元素 ::before 和 ::after 做两个音频播放控制器,各自有自己的背景图案,点击任意一个都可以联动控制音乐、CSS动画和视频。




完成情况:
① 第一个视频用了圆形。。没有覆盖整个贴子,第二个视频用了全屏,星空遮罩一部分只显示天空。
②伪元素音频控制器,一个用了星球,另一个用了水样的花朵。均可控制音频动画和视频。




花飞飞 发表于 2024-9-4 20:59

{:4_170:}纯粹是重新学了一遍又做的。。

马黑黑 发表于 2024-9-4 21:11

花飞飞 发表于 2024-9-4 20:59
纯粹是重新学了一遍又做的。。

{:4_203:}

花飞飞 发表于 2024-9-4 21:24

马黑黑 发表于 2024-9-4 21:11


这流程没问题吧,先看教程再写作业。{:4_170:}

马黑黑 发表于 2024-9-4 21:28

花飞飞 发表于 2024-9-4 21:24
这流程没问题吧,先看教程再写作业。

{:4_190:}

花飞飞 发表于 2024-9-4 21:29

马黑黑 发表于 2024-9-4 21:28


咖啡时间到了。。

花飞飞 发表于 2024-9-4 21:29

{:4_173:}再回一贴翻个页
页: 16 17 18 19 20 21 22 23 24 25 [26] 27 28 29 30 31 32 33
查看完整版本: 小白音画帖教程(完结)