#papa { left: -214px; width: 1024px; height: 640px; background: gray url('https://pic.imgdb.cn/item/63ef8e35f144a010071bb983.jpg') no-repeat center/cover; box-shadow: 3px 3px 20px #000; position: relative; }
#canv { position: absolute; }
#disc { position: absolute; width: 40px; height: 40px; left: 10px; bottom: 10px; background: conic-gradient(red,orange,yellow,green,teal,blue,purple); mask: radial-gradient(transparent 4px,red 0); -webkit-mask: radial-gradient(transparent 4px,red 0); border-radius: 50%; cursor: pointer; animation: rot 2s linear infinite; }
#lrcbox { position: absolute; left: 60px; bottom: 10px;font: bold 22px / 40px sans-serif; color: #859670; text-shadow: 2px 2px 4px #222; }
@keyframes rot { to { transform: rotate(360deg); } }
</style>
<div id="papa">
<span id="lrcbox">鱼儿 生日快乐</span>
<canvas id="canv"></canvas>
<span id="disc"></span>
</div>
<script>
(function() {
let num = (min, max) => Math.floor(Math.random() * (max-min+1)) + min;
let ctx = canv.getContext('2d');
let w = canv.width = papa.offsetWidth, h = canv.height = papa.offsetHeight, particles = [], idx = 0, aud = new Audio();
aud.src = 'https://music.163.com/song/media/outer/url?id=1433496995.mp3';
aud.loop = true;
aud.autoplay = true;
disc.style.animationPlayState = aud.paused ? 'paused' : 'running';
disc.onclick = () => aud.paused ? aud.play() : aud.pause();
aud.addEventListener('playing',()=> disc.style.animationPlayState = 'running');
aud.addEventListener('pause',()=> disc.style.animationPlayState = 'paused');
canv.onclick = function(event) {
let x = event.offsetX || event.layerX, y = event.offsetY || event.layerY;
createParticle(x, y);
}
function createParticle(x, y) {
let count = 100, radius = 10;
for (let j = 0; j < count; j ++) {
let p = {};
let angle = 360 / count * j, radian = Math.PI / 180 * angle;
p.radius = radius;
p.startX = x;
p.startY = y;
p.radian = radian;
p.rgb = `${num(0,255)},${num(0,255)},${num(0,255)},`;
p.alpha = (Math.floor(Math.random() * 101)) / 100;
p.speed = (Math.random() * 5) + 0.4;
p.radius = p.speed;
particles.push(p);
}
}
function drawParticle() {
ctx.fillStyle = 'transparent';
ctx.fillRect(0, 0, w, h);
for (let j = 0; j < particles.length; j++) {
let p = particles;
let resultX = Math.cos(p.radian) * p.radius;
let resultY = Math.sin(p.radian) * p.radius + 0.4;
p.startX += resultX;
p.startY += resultY;
p.radius *= 1 - p.speed / 100;
p.alpha -= 0.005;
if (p.alpha <= 0) {
particles.splice(j, 1);
continue;
}
ctx.beginPath();
ctx.arc(p.startX, p.startY, 2, 0, 360, false);
ctx.closePath();
ctx.fillStyle = 'rgba(' + p.rgb + p.alpha + ')';
ctx.fill();
}
}
function fade() {
ctx.globalCompositeOperation = 'destination-out';
ctx.fillStyle = 'rgba(0, 0, 0, .1)';
ctx.fillRect(0, 0, w, h);
ctx.globalCompositeOperation = 'lighter';
}
function render() {
idx ++;
fade();
drawParticle();
if(idx > 20) {
createParticle(Math.random() * w, Math.random() * h/2);
idx = 0;
}
requestAnimationFrame(render);
}
render();
})();
</script>
马黑黑 发表于 2023-1-15 18:07
二次元勉强可认,你都平方了
我能说老师教得好,青出于蓝那啥啥不能。 小九 发表于 2023-1-15 18:50
那就多灌一下
这不,疯狂开灌{:4_173:} 小九 发表于 2023-1-15 18:50
我觉得关系不大哟
上传个东东真不容易啊。压成糊糊。。。各位大神那么大的音画图是怎么整出来的。太不容易了。 雨中悄然 发表于 2023-1-15 19:10
我能说老师教得好,青出于蓝那啥啥不能。
{:4_203:} 雨中悄然 发表于 2023-1-15 17:33
到底换头像跟积分有没有关系呀。我在设置里根本点不开头像那栏。以为级别不够,积分不够
没关系呢,不是点不开,而是需要等的时间比较长。等待的时候能看到网址的地方一直在转圈,等到停下来,那栏才会跳出来。具体什么原因造成我也不知道,我不懂论坛程序。 欢迎小盆友{:4_199:} 红影 发表于 2023-1-15 21:54
没关系呢,不是点不开,而是需要等的时间比较长。等待的时候能看到网址的地方一直在转圈,等到停下来,那 ...
原来如此啊 雨中悄然 发表于 2023-1-16 20:39
原来如此啊
悄然下回自己试试,就可以随时换自己喜欢的头像了呢。 雨中悄然 发表于 2023-1-15 17:32
没有那么不可思议,很好认的
我看过原图{:5_117:} 红影 发表于 2023-1-16 21:24
悄然下回自己试试,就可以随时换自己喜欢的头像了呢。
好的{:4_204:} 鱼儿 发表于 2023-1-17 09:31
我看过原图
眼神真好,一看就是追星的{:4_189:} 雨中悄然 发表于 2023-1-15 16:59
缺水,灌够150积分才能更换。360浏览器
应该与积分无关的,一来就能换头的 雨中悄然 发表于 2023-1-15 19:12
上传个东东真不容易啊。压成糊糊。。。各位大神那么大的音画图是怎么整出来的。太不容易了。
https://www.superbed.cn/signup上传到这里了,注册很方便的 绿叶清舟 发表于 2023-1-19 20:34
https://www.superbed.cn/signup上传到这里了,注册很方便的
{:5_150:}抱个,我去瞅瞅 第一贴啊,有意义
页:
1
[2]