Angel Warrior
<style>#dbox { margin: 30px 0 30px calc(50% - 593px); width: 1024px; height: 640px; background: radial-gradient(transparent 70%,transparent,rgba(0,0,128,.6)), url('https://638183.freep.cn/638183/t24/webp2/angelwarrior.webp') no-repeat center/cover; box-shadow: 4px 4px 16px #00000080; z-index: 1; position: relative; }
#msvg { position: absolute; right: 100px; bottom: 100px; }
#cpath { cursor: pointer; filter: drop-shadow(0 0 4px #000); transform-origin: 50%; animation: rot 6s linear infinite var(--state), chgcolor 12s linear infinite alternate var(--state); }
#vid { position: absolute; width: 100%; height: 100%; object-fit: cover; -webkit-mask: radial-gradient(green, transparent, transparent); }
@keyframes rot { to { transform: rotate(360deg); stroke-dashoffset: -160; } }
@keyframes chgcolor { to { fill: rgba(65,105,225,.5); } }
</style>
<div id="dbox">
<audio id="aud" src="https://music.163.com/song/media/outer/url?id=36871349" autoplay loop></audio>
<video id="vid" src="https://img.tukuppt.com/video_show/2629112/00/02/34/5b5921021d972.mp4" autoplay loop muted></video>
<svg id="msvg" width="200" height="200">
<defs>
<g id="cpath"fill="rgba(65,105,225,.1)" stroke="rgba(255,255,255,.7)" stroke-width="4" stroke-dasharray="4">
<path d='M100 120 C10 -30,190 -30,100 120'/>
</g>
</defs>
</svg>
</div>
<script>
mState = () => {
dbox.style.setProperty('--state', aud.paused ? 'paused' : 'running');
aud.paused ? (msvg.pauseAnimations(), vid.pause()) : (msvg.unpauseAnimations(), vid.play());
}
mkLeaves = (total) => {
let str = '';
Array(total).fill().forEach((_,idx) => {
str += `<use href="#cpath" transform="rotate(${360 / total * idx} 100 100)"/>`;
});
return str;
};
msvg.innerHTML += mkLeaves(5);
aud.onplaying = aud.onpause = () => mState();
msvg.onclick = () => aud.paused ? aud.play() : aud.pause();
</script>
<p>帖子代码</p>
<div class="hE"><pre>
<style>
#dbox { margin: 30px 0 30px calc(50% - 593px); width: 1024px; height: 640px; background: radial-gradient(transparent 70%,transparent,rgba(0,0,128,.6)), url('https://638183.freep.cn/638183/t24/webp2/angelwarrior.webp') no-repeat center/cover; box-shadow: 4px 4px 16px #00000080; z-index: 1; position: relative; }
#msvg { position: absolute; right: 100px; bottom: 100px; }
#cpath { cursor: pointer; filter: drop-shadow(0 0 4px #000); transform-origin: 50%; animation: rot 6s linear infinite var(--state), chgcolor 12s linear infinite alternate var(--state); }
#vid { position: absolute; width: 100%; height: 100%; object-fit: cover; -webkit-mask: radial-gradient(green, transparent, transparent); }
@keyframes rot { to { transform: rotate(360deg); stroke-dashoffset: -160; } }
@keyframes chgcolor { to { fill: rgba(65,105,225,.5); } }
</style>
<div id="dbox">
<audio id="aud" src="https://music.163.com/song/media/outer/url?id=36871349" autoplay loop></audio>
<video id="vid" src="https://img.tukuppt.com/video_show/2629112/00/02/34/5b5921021d972.mp4" autoplay loop muted></video>
<svg id="msvg" width="200" height="200">
<defs>
<g id="cpath"fill="rgba(65,105,225,.1)" stroke="rgba(255,255,255,.7)" stroke-width="4" stroke-dasharray="4">
<path d='M100 120 C10 -30,190 -30,100 120'/>
</g>
</defs>
</svg>
</div>
<script>
mState = () => {
dbox.style.setProperty('--state', aud.paused ? 'paused' : 'running');
aud.paused ? (msvg.pauseAnimations(), vid.pause()) : (msvg.unpauseAnimations(), vid.play());
}
mkLeaves = (total) => {
let str = '';
Array(total).fill().forEach((_,idx) => {
str += `<use href="#cpath" transform="rotate(${360 / total * idx} 100 100)"/>`;
});
return str;
};
msvg.innerHTML += mkLeaves(5);
aud.onplaying = aud.onpause = () => mState();
msvg.onclick = () => aud.paused ? aud.play() : aud.pause();
</script>
</pre></div>
<script>
var sc = document.createElement('script');
sc.chartset = 'utf-8';
sc.src = 'https://638183.freep.cn/638183/web/js2024/helight.js';
document.body.appendChild(sc);
</script> 黑黑老师早上好! 这个厉害了,对小播用了2个动画3个动作:旋转、边框流动、变色,让昨天讲解的那个多叶草的小播变得更漂亮了{:4_199:} 三次贝塞尔曲线也做了微调,看着更顺眼了,那些圆心旁的小尖角弱化不见了,看着流动更加像每个叶瓣都相互连接的,流动线彼此成全{:4_199:}
黑黑太仔细了,这个漂亮{:4_187:} 又犯了先看代码不先看画面效果的错,哈哈,这战斗天使的画面也很燃,那柄巨剑比天使的胳膊都粗,仍然被天使挥洒自如,这就是法术的力量吧{:4_199:} 从线条设计到成品,研发速度超一流的。。。
花飞飞 发表于 2024-10-3 11:47
从线条设计到成品,研发速度超一流的。。。
{:4_191:} 红影 发表于 2024-10-3 09:24
又犯了先看代码不先看画面效果的错,哈哈,这战斗天使的画面也很燃,那柄巨剑比天使的胳膊都粗,仍然被天使 ...
{:4_180:} 马黑黑 发表于 2024-10-3 11:52
谢清茶{:4_187:} 马黑黑 发表于 2024-10-3 11:48
神速,代码基建狂魔。。。 花飞飞 发表于 2024-10-3 17:34
神速,代码基建狂魔。。。
{:4_170:} 马黑黑 发表于 2024-10-3 17:34
{:5_104:}妙得很 花飞飞 发表于 2024-10-3 17:43
妙得很
妙不可言 马黑黑 发表于 2024-10-3 19:57
妙不可言
不可言的境界高 花飞飞 发表于 2024-10-5 09:05
不可言的境界高
高到九重天 马黑黑 发表于 2024-10-5 11:24
高到九重天
九重天上有南天门
页:
[1]