查看: 917|回复: 57

[特效] Entropy

[复制链接]
发表于 2024-10-1 08:21 | 显示全部楼层 |阅读模式
播放/暂停

评分

6

查看全部评分

点评
回复

使用道具

 楼主| 发表于 2024-10-1 08:28 | 显示全部楼层

帖子代码
<style>
#tz {
	margin: 20px 0 30px calc(50% - 730px);
	width: 1280px;
	height: 600px;
	background: url('https://638183.freep.cn/638183/t24/webp2/entropy.webp') no-repeat center/cover;
	box-shadow: 3px 3px 6px rgba(0,0,0,.6);
	overflow: hidden;
	z-index: 1;
	position: relative;
}
#vid {
	position: absolute;
	width: 100%;
	height: calc(100% + 60px);
	top: -60px;
	object-fit: cover;
	mix-blend-mode: screen;
	pointer-events: none;
}
#player {
	position: absolute;
	left: calc(50% - 100px);
	top: calc(50% - 85px);
	cursor: pointer;
	animation: rot 10s linear infinite var(--state);
}
use:nth-child(odd) { --bg: snow; }
use:nth-child(even) { --bg: palevioletred; }
@keyframes rot {
	to { transform: rotate(360deg); }
}
</style>

<div id="tz">
	<audio id="aud" src="https://music.163.com/song/media/outer/url?id=29751208" autoplay loop></audio>
	<video id="vid" src="https://img.tukuppt.com/video_show/2269348/00/14/66/5e5a31a0b980d.mp4" autoplay loop muted></video>
	<svg id="player" width="200" height="200" viewBox="0 0 200 200">
		<title id="tt">播放/暂停</title>
		<defs>
			<g id="p1" fill="none" stroke="var(--bg)" stroke-width="4" stroke-linecap="round" stroke-dasharray="4 6">
				<path id="p1" d="M10 100 Q50 270,100 100 T 190 100">
					<animate attributeName="stroke-dashoffset" from="80" to="0" dur="2s" repeatCount="indefinite" />
				</path>
			</g>
		</defs>
		<use href="#p1" transform="rotate(0 100 100)"></use>
		<use href="#p1" transform="rotate(30 100 100)"></use>
		<use href="#p1" transform="rotate(60 100 100)"></use>
		<use href="#p1" transform="rotate(90 100 100)"></use>
		<use href="#p1" transform="rotate(120 100 100)"></use>
		<use href="#p1" transform="rotate(150 100 100)"></use>
	</svg>
</div>

<script>
mState = () => {
	tz.style.setProperty('--state', aud.paused ? 'paused' : 'running');
	aud.paused ? (player.pauseAnimations(), vid.pause()) : (player.unpauseAnimations(), vid.play());
	tt.textContent = aud.paused ? '点击播放' : '点击暂停';
};
aud.onplaying = aud.onpause = () => mState();
player.onclick = () => aud.paused ? aud.play() : aud.pause();
</script>

评分

3

查看全部评分

点评
回复

使用道具

发表于 2024-10-1 09:28 | 显示全部楼层
科技风,好看
点评
回复

使用道具

发表于 2024-10-1 09:34 | 显示全部楼层
看着很高级,欣赏凡哥带来的精彩,节日快乐~
点评
回复

使用道具

发表于 2024-10-1 10:08 | 显示全部楼层
缠绕的动态虚线条,形成一个圆形,每根线是小点走路径完成的。。这个技术含量太高了。
点评
回复

使用道具

发表于 2024-10-1 10:10 | 显示全部楼层
背景几何形状,层层排列。。。。
色彩与小播形成对比。。。
静态线条与动态视频形成对比。。
完美协调
点评
回复

使用道具

发表于 2024-10-1 10:11 | 显示全部楼层
音乐有神秘之感,好听。。老师国庆节快乐。。
点评
回复

使用道具

发表于 2024-10-1 11:03 | 显示全部楼层
欣赏凡哥老师带来的精彩!
点评
回复

使用道具

发表于 2024-10-1 11:03 | 显示全部楼层
问好凡哥老师,祝节日快乐!
点评
回复

使用道具

发表于 2024-10-1 11:05 | 显示全部楼层
75周年盛世华诞,我衷心地祝福祖国生日快乐!繁荣昌盛!
点评
回复

使用道具

您需要登录后才可以回帖 登录 | 中文注册

本版积分规则

手机版|千山论坛 ( 冀ICP备2024055714号 )

GMT+8, 2025-6-9 17:41

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表