月影湖光
本帖最后由 绿叶清舟 于 2022-9-5 20:22 编辑 <br /><br /><style>#papa { left: -250px; width: 1100px; height: 700px; background: #333 url('https://pic.imgdb.cn/item/6315e97f16f2c2beb19d3900.jpg') no-repeat center/cover; box-shadow: 4px 4px 24px #000; position: relative; }
#papa input { border: none; outline: none; opacity: .75; cursor: pointer; }
#papa p { margin: 0; padding: 0; }
#circle { left: 450px; top: 50px; width: 240px; height: 240px; border-radius: 50%; position: absolute; }
.star { position: absolute; width: 2px; height: 2px; background: #fff; }
@keyframes flash { to { opacity: 0; } }
</style>
<div id="papa">
<div id="circle"></div>
</p>
</div>
</div>
<audio id="aud" src="http://music.163.com/song/media/outer/url?id=214567.mp3" autoplay="autoplay" loop="loop"></audio>
<script>
let slip = 0, idx = 0, total = 500, gap = 100;
let add = setInterval(addDot, gap), del;
let num = (min, max) => Math.floor(Math.random() * (max-min+1)) + min;
slider.onmousedown = () => aud.pause();
slider.onchange = () => { aud.currentTime = slider.value * aud.duration / 100; aud.play(); }
btnplay.onclick = () => aud.paused ? aud.play() : aud.pause();
aud.addEventListener('playing', () => btnplay.value = '||');
aud.addEventListener('pause', () => btnplay.value = '>');
aud.addEventListener('timeupdate', () => {
let prog = 100 * aud.currentTime / aud.duration;
slider.value = prog;
per.innerText = toMin(aud.currentTime) + ' | ' + toMin(aud.duration);
for(j=0; j<lrcAr.length; j++){
if(aud.currentTime >= lrcAr - slip){
geci.innerHTML = lrcAr;
}
}
});
let toMin = (val) => {
if(!val) return '0:0';
val = Math.floor(val);
return parseInt(val / 60) + ':' +parseFloat(val % 60);
}
function addDot() {
let ele = document.createElement('span');
let ww = circle.offsetWidth / 2;
ele.className = 'star';
ele.style.animation = 'flash ' + 0.1 * num(10,50) + 's infinite';
let pos = calcCirclePos({x: ww, y: ww, r: num(0,ww - 2), a: num(0,360)});
ele.style.left = pos.xx + 'px';
ele.style.top = pos.yy + 'px';
circle.appendChild(ele);
idx ++;
if(idx >= total){
clearInterval(add);
idx = 0;
del = setInterval(delDot, gap);
}
}
function delDot() {
let ele = document.querySelector('.star');
if(ele) {
circle.removeChild(ele);
} else {
clearInterval(del);
add = setInterval(addDot,gap);
}
}
function calcCirclePos({x,y,r,a}) {
let xx = x + r * Math.cos((a * Math.PI) / 180);
let yy = y + r * Math.sin((a * Math.PI) / 180);
return {xx,yy};
}
</script>
清舟这个星光点点效果配的图太美了{:4_178:} 标题字也是漂亮{:4_199:} 厉害的清舟,把月光搞得这么美丽。真漂亮。{:4_199:} 小辣椒 发表于 2022-9-5 20:55
清舟这个星光点点效果配的图太美了
谢谢辣椒,整理贴子时正好看到这效果就拿来用的 加林森 发表于 2022-9-5 20:58
厉害的清舟,把月光搞得这么美丽。真漂亮。
谢谢队长,还没够三好标准的了{:4_189:} 月影湖光,相映成趣,字体漂亮,里面的文字也好美。清舟真棒{:4_187:} 绿叶清舟 发表于 2022-9-5 21:04
谢谢队长,还没够三好标准的了
那就继续努力!{:5_154:} 红影 发表于 2022-9-5 21:04
月影湖光,相映成趣,字体漂亮,里面的文字也好美。清舟真棒
分别抠来的二个字了 加林森 发表于 2022-9-5 21:10
那就继续努力!
行,争取二好了{:4_189:} 绿叶清舟 发表于 2022-9-5 21:23
行,争取二好了
要得要得。 星光点点效果配的图很漂亮,欣赏问好! 梦缘 发表于 2022-9-5 21:43
星光点点效果配的图很漂亮,欣赏问好!
谢谢梦缘,晚上好 绿叶清舟 发表于 2022-9-5 21:15
分别抠来的二个字了
直接用抠的字也挺不错,会遇到更合心意的{:4_173:} 醉美水芙蓉 发表于 2022-9-5 22:16
图图做得好美!清舟美女厉害啊!
谢谢芙蓉支持 红影 发表于 2022-9-5 22:29
直接用抠的字也挺不错,会遇到更合心意的
是啊,有些热门的标题可以直接抠,象这种冷门的只能一个字一个字的去找了 绿叶清舟 发表于 2022-9-7 16:56
是啊,有些热门的标题可以直接抠,象这种冷门的只能一个字一个字的去找了
找到漂亮的字儿也挺花功夫的。 红影 发表于 2022-9-7 21:25
找到漂亮的字儿也挺花功夫的。
单个字的好找些
页:
[1]