歌唱祖国--热烈庆祝建国73周年
<style>
#papa { left:-414px; width: 1440px; height: 840px; top:150px; background: #000 url('https://pic1.imgdb.cn/item/6336c3fe16f2c2beb19564d7.gif') no-repeat center/cover; box-shadow: 3px 3px 20px #000; position: relative; }
#canv { position: absolute; left: 0px; top: 0px; }
#disc { position: absolute; width:60px; height: 60px; left: 50px; top:720px; 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; }
#tit { position: absolute; left: 150px; top: 730px;font: bold 30px / 40px sans-serif; color: snow; text-shadow: 2px 2px 4px black; }
#dt1{ position: absolute; width: 540px; height: 150px; top: 50px; left: 800px; }
@keyframes rot { to { transform: rotate(360deg); } }
</style>
<div id="papa">
<img id="dt1" src="https://pic1.imgdb.cn/item/6336a25e16f2c2beb1715ee8.gif" alt="" />
<span id="tit">歌唱祖国</span>
<canvas id="canv"></canvas>
<span id="disc"></span>
</div>
<script>
(function() {
let ctx = canv.getContext('2d');
let w = canv.width = 1440, h = canv.height = 840; // 自定义画布尺寸
let particles = [], idx = 0, aud = new Audio();
aud.src = 'https://music.163.com/song/media/outer/url?id=5234256.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;
let y = event.offsetY || event.layerY;
createParticle(x, y);
}
function createParticle(x, y) {
let count = 100;
let radius = 10;
let hue = Math.floor(Math.random() * 51) + 0;
let change = 30;
for (let j = 0; j < count; j ++) {
let p = {};
let angle = 360 / count * j;
let radian = Math.PI / 180 * angle;
p.radius = radius;
p.startX = x;
p.startY = y;
p.radian = radian;
p.hue = Math.floor(Math.random() * (change * 0)) + (hue - change);
p.lightness = Math.floor(Math.random() * 100);
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 i = 0; i < particles.length; i++) {
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(i, 1);
continue;
}
ctx.beginPath();
ctx.arc(p.startX, p.startY, 2, 0, 360, false);
ctx.closePath();
ctx.fillStyle = "hsla( " + p.hue + " , 100% ," + p.lightness + "% , " + p.alpha + ")";
ctx.fill();
}
}
function fade() {
ctx.globalCompositeOperation = "destination-out";
ctx.fillStyle = "rgba(0 , 0 , 0, " + 0.1 + ")";
ctx.fillRect(0, 0, w, h);
ctx.globalCompositeOperation = "lighter";
}
function render() {
idx ++;
fade();
drawParticle();
if(idx > 50) {
createParticle(Math.random() * w, Math.random() * h);
idx = 0;
}
requestAnimationFrame(render);
}
render();
})();
</script>
<br><br><br><br><br><br><br><br><br><br> 热烈庆祝中华人民共和国建国73周年华诞{:4_178:} 点击画面烟火出来----感谢黑黑的烟花代码效果{:4_187:} 祝福祖国繁荣昌盛! 小辣椒国庆节快乐!{:4_187:} 小九 发表于 2022-9-30 20:27
祝福祖国繁荣昌盛! 小辣椒国庆节快乐!
小九晚上好,一起祝福祖国{:4_204:} 同祝福!{:4_199:} 亲爱的这个做得真漂亮,歌唱伟大的祖国,热烈祝贺祖国73周年华诞{:4_178:}{:4_187:} 歌唱伟大的祖国,热烈庆祝中华人民共和国建国73周年华诞!
{:4_374:}{:4_374:} 醉美水芙蓉 发表于 2022-9-30 20:39
辣椒做得漂亮!祝国庆节快乐!
谢谢水芙蓉欣赏{:4_171:} 加林森 发表于 2022-9-30 20:55
同祝福!
队长晚上好~~~{:4_187:} 红影 发表于 2022-9-30 20:56
亲爱的这个做得真漂亮,歌唱伟大的祖国,热烈祝贺祖国73周年华诞
亲爱的~~~一起祝福祖国,共贺见国73周年华诞 大猫咪 发表于 2022-9-30 21:06
歌唱伟大的祖国,热烈庆祝中华人民共和国建国73周年华诞!
猫猫晚上好~~~一起祝福祖国共贺建国73周年华诞{:4_187:} 小辣椒 发表于 2022-9-30 21:15
猫猫晚上好~~~一起祝福祖国共贺建国73周年华诞
{:4_179:}嗯嗯 必须的。辣椒晚上好!节日快乐{:4_204:}{:4_190:}{:4_179:} 小辣椒 发表于 2022-9-30 21:13
队长晚上好~~~
小辣椒晚上好!国庆节快乐!我没有精神做帖。 大猫咪 发表于 2022-9-30 21:17
嗯嗯 必须的。辣椒晚上好!节日快乐
猫猫国庆节快乐!{:4_179:} 加林森 发表于 2022-9-30 21:18
小辣椒晚上好!国庆节快乐!我没有精神做帖。
队长,没关系的,好好养身体,国庆节快乐! 小辣椒 发表于 2022-9-30 21:13
亲爱的~~~一起祝福祖国,共贺见国73周年华诞
这个烟花效果用在这个帖子里很适合,亲爱的真棒{:4_187:} 熟悉的旋律,不变的情怀,在精美音画里,祝福祖国,万寿无疆 光盘又用上了{:5_117:}
帖子用色厚实,设计精巧,协调性非常理想。修饰元素多而不乱,共同烘托帖子喜庆、庄严而欢快的主题,是优质作品,加10分。
页:
[1]
2