歌唱祖国 -- 贺祖国74岁华诞
<style>#papa { left:-424px; width: 1440px; height: 826px; top:150px; background: #000 url('https://xlaj.cn/assets/file/zp/20231001204206.gif') no-repeat center/cover; box-shadow: 3px 3px 20px #000; position: relative; }
#canv { position: absolute; left: 0px; top: 10px; }
#disc { position: absolute; width:60px; height: 60px; left: 50px; top:700px; 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: 710px;font: bold 30px / 40px sans-serif; color: snow; text-shadow: 2px 2px 4px black; }
@keyframes move { to { offset-distance: 100%; } }
#mpic1 {position: absolute; transform: rotateY(180deg); left: 0; top: 0; width: 100px; offset-distance: 0; offset-path: path("M 0 0 Q 300 90, 512 100 T 1394 30"); animation: move 18s linear infinite;}
#dt1{ position: absolute; width: 540px; height: 150px; top: 50px; left: 800px; }
#dt2{ position: absolute; width: 664px; height: 293px; top: 537px; left: 436px; }
</style>
<div id="papa">
<img id="mpic1" alt="" src="https://xlaj.cn/assets/file/zp/20231001204314.gif " />
<img id="mpic" alt="" src="4233383649728593242.gif" />
<img id="dt1" src="https://xlaj.cn/assets/file/zp/20231001204336.gif" alt="" />
<img id="dt2" src="https://xlaj.cn/assets/file/zp/20231001204239.png" 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 = 700; // 自定义画布尺寸
let particles = [], idx = 0, aud = new Audio();
aud.src = 'https://xlaj.cn/assets/file/zp/20231001204400.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> 点击画面烟花出来 今天是10月1日,是我们伟大祖国74周年生日,祝福伟大祖国生日快乐!{:4_177:}{:4_177:} 祝福祖国更加繁荣昌盛 人民安康幸福!{:4_204:}{:4_204:} 好热烈的画面啊,看!飞机来了还不断地放气球呢。这烟花点哪儿,哪儿有。 梦油 发表于 2023-10-1 21:05
好热烈的画面啊,看!飞机来了还不断地放气球呢。这烟花点哪儿,哪儿有。
梦油也是好眼力的{:4_178:}
热烈的场面出来了,为祖国庆生,必须热烈啊 好绚丽的烟花,还有小飞机和鸽子以及跳动的文字和频谱,亲爱的这个贺帖真华丽{:4_199:} 热烈祝贺伟大祖国74周年华诞{:4_177:} 红影 发表于 2023-10-1 21:20
好绚丽的烟花,还有小飞机和鸽子以及跳动的文字和频谱,亲爱的这个贺帖真华丽
这个是我求速度做出来的{:4_170:} 红影 发表于 2023-10-1 21:21
热烈祝贺伟大祖国74周年华诞
一起祝福伟大祖国更加繁荣昌盛{:4_374:} 醉美水芙蓉 发表于 2023-10-1 21:25
欣赏辣椒好制作!祝福祖国繁荣昌盛!
谢谢水芙蓉,我们一起祝福祖国生日快乐! 欣赏佳作!{:4_187:} 制作精美!画面宏大,喜庆热烈!欣赏学习了!祝福祖国繁荣昌盛!{:4_187:}{:4_204:} 焱鑫磊 发表于 2023-10-1 21:40
欣赏佳作!
谢谢焱鑫磊欣赏~~
国庆节快乐! 亦是金 发表于 2023-10-1 21:49
制作精美!画面宏大,喜庆热烈!欣赏学习了!祝福祖国繁荣昌盛!
谢谢前辈,这个我是求速度做出来的,都是以前学过的效果,套用自己前面做过的{:4_173:} 辣椒的动图很棒👍🏻👍🏻👍🏻👍🏻👍🏻👍🏻👍🏻👍🏻👍🏻👍🏻👍🏻 {:4_199:} 小辣椒 发表于 2023-10-1 21:22
这个是我求速度做出来的
那烟花尤其漂亮,我一下子点出许多{:4_173:} 小辣椒 发表于 2023-10-1 21:23
一起祝福伟大祖国更加繁荣昌盛
跟亲爱的一起祝福{:4_187:}
页:
[1]
2