本帖最后由 绿叶清舟 于 2022-8-2 21:53 编辑 <br /><br /><div style="position:relative; left:-350px; top:100px; border-radius:6px; box-shadow:3px 3px 3px 2px gray; width:1300px; height: 700px;background:rgba(0,0,0,0.6) url('https://pic.imgdb.cn/item/62e92b5e16f2c2beb13f7dd3.jpg'); ">
</div>
<audio class="aud" src="音乐" autoplay="autoplay" loop="loop"></audio>
本帖最后由 绿叶清舟 于 2022-8-13 10:22 编辑 <br /><br /><style>
#papa1 { left: -210px; width: 1100px; height: 700px; background: #336699 url('https://pic.imgdb.cn/item/62f47c3116f2c2beb1e04ba0.jpg') no-repeat center/cover; box-shadow: 3px 3px 30px #000; position: relative; overflow: hidden; }
.mpic { position: absolute; width: 124px; height: 221px; right: -124px; top: -700px; }
#disc { position: absolute; width: 60px; height: 60px; right: 20px; bottom: 20px; background: conic-gradient(red,orange,yellow,green,teal,blue,purple); border-radius: 50%; mask: radial-gradient(transparent 4px,red 0); -webkit-mask: radial-gradient(transparent 4px,red 0); animation: rot 2s linear infinite; cursor: pointer; z-index: 100; }
@keyframes rot { to { transform: rotate(360deg); } }
@keyframes shot { from {transform: translate(1100px, 0px) rotate(45deg); } to { transform: translate(-1100px, 800px) rotate(45deg); }}
</style>
<div id="papa1"><span id="disc"></span></div>
<script>
let arr = , aud = new Audio();
aud.src = '音乐';
aud.loop = true;
aud.autoplay = true;
disc.style.animationPlayState = aud.paused ? 'paused' : 'running';
for(x of arr) {
let ele = document.createElement('img');
ele.className = 'mpic';
ele.src = 'https://pic.imgdb.cn/item/62f47c8316f2c2beb1e11b4b.gif';
ele.alt = '';
ele.style.animation = 'shot 6s linear ' + x * .6 + 's infinite';
papa.appendChild(ele);
}
disc.onclick = () => aud.paused ? aud.play() : aud.pause();
aud.addEventListener('playing',()=> disc.style.animationPlayState = 'running');
aud.addEventListener('pause',()=> disc.style.animationPlayState = 'paused');
</script>
本帖最后由 绿叶清舟 于 2022-8-13 10:26 编辑 <br /><br /><style>
#papa1 { margin: auto; left: -250px; top: 80px;width: 1100px; height: 700px; background: #985b0a url('https://pic.imgdb.cn/item/62f65f0116f2c2beb111f4c7.jpg') no-repeat; box-shadow: 3px 3px 20px -3px #000; position: relative; }
#disc { position: absolute; width: 40px; height: 40px; left: 10px; top: 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; }
#tit { position: absolute; left: 60px; top: 10px;font: bold 22px / 40px sans-serif; color: #D0EBEB; text-shadow: 1px 1px 2px black; }
@keyframes rot { to { transform: rotate(360deg); } }
@keyframes circle { from { transform: rotate(0) translate(50px); } to { transform: rotate(360deg) translate(50px); } }
</style>
<div id="papa1">
<div id="tit">钱夫人 - 谭维维</div>
<div id="disc"></div>
</div>
<BR><BR><BR><BR><BR><BR>
<script>
let stepX = 1, stepY = 1, moveX= 0, moveY = 0;
let aud = new Audio();
aud.src = 'http://music.163.com/song/media/outer/url?id=1501952242.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');
motion();
function motion() {
moveX += stepX;
moveY += stepY;
mama.style.left = moveX + 'px';
mama.style.top = moveY + 'px';
requestAnimationFrame(motion);
if(moveX < 0 || moveX >= papa.offsetWidth - mama.offsetWidth) stepX = -stepX;
if(moveY < 0 || moveY >= papa.offsetHeight - mama.offsetHeight) stepY = -stepY;
}
</script>
本帖最后由 绿叶清舟 于 2022-8-13 10:25 编辑
<style>
#papa { margin: auto;left: -250px; top: 80px;width: 1100px; height: 700px; box-shadow: 3px 3px 20px #000; position: relative; }
#canv { position: absolute; width: 100%; height: 100%; background: #000; }
#bgImg { display: none; }
#disc { position: absolute; width: 40px; height: 40px; left: 10px; top: 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; }
#tit { position: absolute; left: 60px; top: 10px;font: bold 22px / 40px sans-serif; color: #D0EBEB; text-shadow: 2px 2px 4px black; }
@keyframes rot { to { transform: rotate(360deg); } }
</style>
<div id="papa">
<canvas id="canv"></canvas>
<img id="bgImg" src="https://pic.imgdb.cn/item/62f65f0116f2c2beb111f4c7.jpg" alt="" />
<span id="disc"></span>
<span id="tit">钱夫人 - 谭维维</span>
</div>
<script>
let ctx = canv.getContext('2d');
let w = papa.clientWidth, h = papa.clientHeight, aud = new Audio();
let dotAr = Array.from({length: 200}, (item,key) => { return { x: Math.random()*w, y: Math.random()*h, r: Math.random()*5, }; });
canv.width = w;
canv.height = h;
aud.src = 'http://music.163.com/song/media/outer/url?id=1486503370.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');
function draw() {
ctx.clearRect(0,0,w,h);
ctx.drawImage(bgImg, 0, 0, w, h);
ctx.beginPath();
for(item of dotAr) {
ctx.fillStyle = 'rgba(255,215,0,.35)';
ctx.moveTo(item.x, item.y);
ctx.arc(item.x, item.y, item.r, 0, Math.PI * 2);
}
ctx.fill();
update();
}
function update() {
for (key in dotAr) {
dotAr.y -= (7 - dotAr.r) / 10;
if(dotAr.y < 0) {
dotAr = {
x: Math.random() * w,
y: h,
r: Math.random()*5,
}
}
}
}
draw();
setInterval(draw,10);
</script>
本帖最后由 绿叶清舟 于 2022-8-19 10:57 编辑
<style>
#papa { left: -214px; width: 1024px; height: 640px; background: gray url('https://pic.imgdb.cn/item/62fefbdf16f2c2beb1de3ace.jpg') no-repeat center/cover; box-shadow: 3px 3px 20px #000; overflow: hidden; position: relative; }
#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: lightblue; text-shadow: 2px 2px 4px #222; }
.meteor { position: absolute; width: 3px; height: 3px; left: 100px; top: 100px; border-radius: 50px; background: #02ff21; }
@keyframes flow { from { transform: translate(var(--startX), var(--startY));opacity: 1;} to { transform: translate(var(--endX), var(--endY)); opacity: 0; } }
@keyframes rot { to { transform: rotate(360deg); } }
</style>
<div id="papa">
<span id="lrcbox">Loading ...</span>
<span id="disc"></span>
</div>
<script>
let stars = new Array(100), aud = new Audio();
let w = papa.offsetWidth, h = papa.offsetHeight;
let num = (min, max) => Math.floor(Math.random() * (max-min+1)) + min;
let lrcAr = [
['0.06','萤火虫 - 单依纯'],
];
aud.loop = true;
aud.autoplay = true;
aud.src = 'http://music.163.com/song/media/outer/url?id=1969325553.mp3';
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');
for(j = 0; j < stars.length; j ++) {
let star = document.createElement('span');
star.className = 'meteor';
let x1 = num(0, w-5);
let y1 = num(0, h/4);
let x2 = x1 + num(50, 100);
let y2 = y1 + num(20, 50);
star.style.cssText += `width: ${num(1,4)}px; height: ${num(1,4)}px; left: ${x1}px; top: ${y1}px; --startX: ${x1}px; --startY: ${y1}px; --endX: ${x2}px; --endY: ${y2}px; animation: flow linear 1s ${j*.1}s infinite`;
papa.appendChild(star);
stars = star;
}
aud.addEventListener('timeupdate',function(){
let tt = aud.currentTime;
for(j=0; j<lrcAr.length; j++){
if(tt >= lrcAr){
lrcbox.innerHTML = lrcAr;
}
}
})
</script>
本帖最后由 绿叶清舟 于 2022-9-7 20:52 编辑 <br /><br /><style>
.vid { position: absolute;LEFT: 50px; width: 680px; height: 520px; object-fit: cover; opacity: 0.5; mix-blend-mode: screen;}
</style>
<DIV align=center color=#ff0000 >
<tablestyle="position: relative; LEFT: -250px; width:1100px;TOP: 180px"border="0" cellspacing="0" cellpadding="0">
<TBODY><TR><TD height=1000 background=https://pic.imgdb.cn/item/6318882816f2c2beb1240e3e.jpg>
</TD></TR><TR><TD height=1000 background=https://pic.imgdb.cn/item/6318883e16f2c2beb1242d15.jpg>
</TD></TR><TR><TD height=1000 background=https://pic.imgdb.cn/item/6318885316f2c2beb1247f0d.jpg border="0">
<video class="vid" style="position: relative; LEFT: 20px; TOP: -2050px" src="https://img.tukuppt.com/video_show/15653652/01/22/70/620f1032eee1f.mp4" autoplay="autoplay" loop="loop" muted="muted"></video>
</TD></TR>
</table></div><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
<audio style="width:600px; height:64px;"controls="controls" autoplay="autoplay" loop="loop" src="http://music.163.com/song/media/outer/url?id=214571.mp3" type="audio/mpeg" hidden="true"></audio>
本帖最后由 绿叶清舟 于 2022-9-13 18:08 编辑 <br /><br /><style>
.mama33 { position: relative; left: -250px; width: 1100px; height: 700px; background: #ccc url('https://pic.imgdb.cn/item/632053fe16f2c2beb18785a0.jpg') no-repeat; box-shadow: 2px 2px 2px #444; overflow: hidden; }
.vid33 { position: absolute; width: 1200px; height: 758px; object-fit: cover; opacity: 1; clip-path: circle(100% at bottom) ;mix-blend-mode: screen;}
</style>
<div class="mama33">
<video class="vid33" src="https://img.tukuppt.com/video_show/2269348/00/17/44/5ec496c9a706d.mp4" autoplay="autoplay" loop="loop" muted="muted">
</video>
</div>
<audio class="aud" src="音乐" autoplay="autoplay" loop="loop"></audio>
本帖最后由 小九 于 2022-11-15 10:50 编辑 <br /><br /><style>
.mama33 { position: relative; left: -250px; width: 1100px; height: 700px; background: #ccc url('https://pic1.imgdb.cn/item/636bab3216f2c2beb180c208.jpg') no-repeat; box-shadow: 2px 2px 2px #444; overflow: hidden; }
.vid33 { position: absolute; width: 1200px; height: 758px; object-fit: cover; opacity: 1; clip-path: circle(100% at bottom) ;mix-blend-mode: screen;}
</style>
<div class="mama33">
<video class="vid33" src="https://img.tukuppt.com/video_show/7165162/00/17/52/5ec746f5eec22.mp4" autoplay="autoplay" loop="loop" muted="muted">
</video>
</div>
<audio class="aud" src="音乐" autoplay="autoplay" loop="loop"></audio>
<style>
.mama33 { position: relative; left: -250px; width: 1100px; height: 700px; background: #ccc url('https://pic1.imgdb.cn/item/636bab3216f2c2beb180c208.jpg') no-repeat; box-shadow: 2px 2px 2px #444; overflow: hidden; }
.vid33 { position: absolute; width: 1200px; height: 758px; object-fit: cover; opacity: 1; clip-path: circle(100% at bottom) ;mix-blend-mode: screen;}
</style>
<div class="mama33">
<video class="vid33" src="https://img.tukuppt.com/video_show/7165162/00/17/52/5ec746f5eec22.mp4" autoplay="autoplay" loop="loop" muted="muted">
</video>
</div>
<audio class="aud" src="音乐" autoplay="autoplay" loop="loop"></audio>
2023
<style>
#papa { margin: 0 0 0 calc(50% - 593px); display: grid; place-items: center; width: 1024px; height: 670px; background: gray url('https://pic.imgdb.cn/item/63cfe780588a5d166cde2399.jpg') no-repeat center/cover; background-blend-mode: normal, color; box-shadow: 3px 3px 20px #000; overflow: hidden; user-select: none; position: relative; perspective: 3000px; z-index: 1; }
#papa::before, #papa::after { position: absolute; content: ''; pointer-events: none; }
#papa::after { content: '2023'; font: bold 2.6em / 2.6em sans-serif; color: orange; text-shadow: 2px 2px 4px black; left: 720px; top: 20px;; }
</style>
<div id="papa"></div>
<script >
(function() {
(function(mkPlayer) {let defaults = {player_css: 'bottom: 0; left: 50%; transform: translateX(-50%);',mlist_css: 'top: 0; left: 0;',fs_btn: 'left: 0; top: 0;',playerCode: `
<style>#mplayer {position: absolute;display: grid;grid-template-areas: 'cur btnplay dur''prog prog prog';gap: 8px 2px;place-items: end center;color: var(--color);font: normal 16px sans-serif;padding-bottom: 20px;z-index: 999;--ww: 900px;--color: Crimson;--track: Crimson;--prog: linear-gradient(90deg,hsla(348,91%,86%,.55),hsla(280,40%,50%,.75),Crimson);}#cur { grid-area: cur; color: var(--color); }#dur { grid-area: dur; color: var(--color); }#btnplay {--state: paused;grid-area: btnplay;background: conic-gradient(#000000,#969696,#000000,#969696,#000000);mask: radial-gradient(transparent 3px,red 0);-webkit-mask: radial-gradient(transparent 3px,red 0);border-radius: 50%;width: 45px;height: 45px;cursor: pointer;animation: rot linear 3s infinite;animation-play-state: var(--state); position: relative; left: -480px; bottom: -6px;}#prog {--xx: 0px;grid-area: prog;width: var(--ww);height: 4px;background: var(--track);position: relative;display: grid;place-items: center;border-radius: 4px;}
#prog::before, #prog::after { position: absolute; content: ''; }#prog::before {left: 0;width: var(--xx);height: 100%;border-radius: 6px;background: var(--prog);border-radius: 4px;}#prog::after {left: calc(var(--xx) - 12px);opacity: .85;width: 16px;height: 16px;background: radial-gradient(transparent 2px, teal 0, black);border-radius: 50%;cursor: pointer;}#mlist { --color1: lightgreen; --color2: pink;position: absolute; padding: 20px; }#mlist > a { color: var(--color1); cursor: pointer; text-shadow: 1px 1px 2px black; text-decoration: none; }#mlist >a:hover { color: var(--color2); }.sColor { color: var(--color2); }#btnMsg {position: absolute;color: snow;background: black;opacity: 0;border: 2px solid snow;border-radius: 8px;padding: 4px;transition: all .75s;cursor: pointer;z-index: 1000;}@keyframes rot { to { transform: rotate(1turn); } }</style>
<div id="mlist"></div><div id="mplayer"><span id="btnplay"></span><span id="prog"></span><span id="cur">00:00</span><span id="dur">00:00</span></div>
<span id="btnMsg">全屏观赏</span>`,};let playCode = (user_config) => {let data = Object.assign({}, defaults, user_config);papa.innerHTML += data.playerCode;mplayer.style.cssText += data.player_css;mlist.style.cssText += data.mlist_css;btnMsg.style.cssText += data.fs_btn;let mDrag = false, timerId, fs = false;let aud = document.createElement('audio');papa.appendChild(aud);(function addList() {let str = '';data.m_ar.forEach( (item,key) => {str += `<a>${key+1} ${data.m_ar}</a><br>`;});mlist.innerHTML = str;})();btnplay.onclick = () => aud.paused ? aud.play() : aud.pause();btnMsg.onclick = () => fs ? document.exitFullscreen() : papa.requestFullscreen();papa.onmousemove = (e) => {clearTimeout(timerId);btnMsg.style.opacity = '.95';timerId = setTimeout('btnMsg.style.opacity = "0"', 3000);};aud.addEventListener('timeupdate', () => {cur.innerText = toMin(aud.currentTime);dur.innerText = toMin(aud.duration);if(mDrag===false) prog.style.setProperty('--xx', aud.currentTime * prog.offsetWidth / aud.duration + 'px');});aud.addEventListener('pause', () => mState());aud.addEventListener('play', () => mState());aud.addEventListener('ended', () => mplay());aud.onerror = () => mplay();prog.onmousedown = () => mDrag = true;document.onmouseup = () => mDrag = false;mplayer.onmouseup = (e) => { if(mDrag) aud.currentTime = aud.duration * e.offsetX / prog.offsetWidth; };mplayer.onmousemove = (e) => { if(mDrag) moveBar(e.offsetX); };let mState = () => aud.paused ? btnplay.style.setProperty('--state', 'paused'): btnplay.style.setProperty('--state', 'running');mplay = (idx=-1) => {if (idx < 0) idx = Math.floor(Math.random() * data.m_ar.length);aud.src = data.m_ar;aud.play();setRed(idx);};document.addEventListener("fullscreenchange", () => {if (document.fullscreenElement !== null) {fs = true;btnMsg.innerText = '退出全屏';} else {fs = false;btnMsg.innerText = '全屏观赏';}});let setRed= (idx) => {let str = mlist.innerHTML;str = str.replace(/<\/?span[^\>]*\>/g,'');str = str.replace(`${idx+1} ${m_ar}`, `${idx+1} <span class="sColor">${m_ar}</span>`);mlist.innerHTML = str;};let moveBar = (x) => {if(x < 0) x = 0;if(x > prog.offsetWidth - 5) x = prog.offsetWidth - 5;prog.style.setProperty('--xx', x + 'px');};let toMin = (val) => {if (!val) return '00:00';val = Math.floor(val);let min = parseInt(val / 60), sec = parseFloat(val % 60);if (min < 10) min = '0' + min;if (sec < 10) sec = '0' + sec;return min + ':' + sec;};mplay();};mkPlayer.HCPlayer = playCode;})(this);
let m_ar = [
['http://music.163.com/song/media/outer/url?id=2015293816.mp3','春天2023 - 田震'],
['http://music.163.com/song/media/outer/url?id=2013420830.mp3','百战成诗2023 '],
['http://music.163.com/song/media/outer/url?id=2016385347.mp3','你好,陌生人 '],
['http://music.163.com/song/media/outer/url?id=2016388051.mp3','百鸟归巢 - 谭维维'],
['http://music.163.com/song/media/outer/url?id=2016385428.mp3','未来我来'],
['http://music.163.com/song/media/outer/url?id=2016388224.mp3','花开忘忧'],
];
HCPlayer({
m_ar: m_ar,
mlist_css: '--color1: Crimson; --color2: orange; top: 100px; right: 180px;',
fs_btn: 'left: 20px; top: 80px; background: #222;',
});
})();
</script>
未来我来
<style>
#papa { margin: 0 0 0 calc(50% - 633px); display: grid; place-items: center; width: 1100px; height: 700px; background: url('https://pic.imgdb.cn/item/63cf961d588a5d166c2f134e.jpg') no-repeat center/cover; background-blend-mode: normal, color; box-shadow: 3px 3px 20px #000; user-select: none; position: relative; perspective: 3000px; z-index: 1;overflow: hidden; }
.vid33 { position: absolute; width: 1100px; height: 820px; object-fit: cover; opacity: 1; clip-path: circle(100% at bottom) ;mix-blend-mode: overlay;}
</style>
<div id="papa"><video class="vid33" src="https://img.tukuppt.com/video_show/2475824/00/08/27/5d1c2875eb656.mp4" autoplay="autoplay" loop="loop" muted="muted">
</video> </div>
<audio id="aud" src="http://music.163.com/song/media/outer/url?id=2016385428.mp3" loop autoplay></audio>
<script >
(function() {
(function(mkPlayer) {let defaults = {lrcAr: [ ],lrc_css: 'top: 20px; left: 50%; transform: translateX(-50%);',player_css: 'bottom: 20px; left: calc(50% - var(--ww) / 2);', total: 20,playerCode: `<style>#mplayer {--ww: 200px;--bg: linear-gradient(180deg,gold,lightblue,yellow);--bc: #000;position: absolute;width: var(--ww);height: var(--ww);display: grid;place-items: center;transform: rotateZ(15deg);transform-style: preserve-3d;animation: rot 10s infinite linear;cursor: pointer;}.mline {width: var(--ww);height: var(--ww);border-radius: 50%;border: 1px dotted var(--bc);background: var(--bg);position: absolute;opacity: .75;}#btnMsg { position: absolute; color: snow; background: black; opacity: 0; border: 2px solid snow; border-radius: 8px; padding: 4px; transition: all .75s; cursor: pointer; z-index: 901; }#lrc { --motion: cover2; --tt: 1s; --state: running; --bg: linear-gradient(180deg,hsla(100,10%,50%,.75),hsla(100,100%,20%,.65)); position: absolute; font: bold 2.4em sans-serif; color: hsl(100, 100%, 90%); white-space: pre; -webkit-background-clip: text; filter: drop-shadow(1px 1px 2px hsla(0, 100%, 0%, .85)); z-index: 900; }#lrc::before { position: absolute; content: attr(data-lrc); width: 20%; height: 100%; color: transparent; overflow: hidden; white-space: pre; background: var(--bg); filter: inherit; -webkit-background-clip: text; animation: var(--motion) var(--tt) linear forwards; animation-play-state: var(--state); }@keyframes cover1 { from { width: 0; }to { width: 100%; } }@keyframes cover2 { from { width: 0; } to { width: 100%; } }@keyframes rot { to { transform: rotateZ(15deg) rotateY(1turn); } }</style><div id="lrc" data-lrc=""></div><div id="mplayer"></div>`,};let playCode = (user_config) => {let data = Object.assign({}, defaults, user_config);papa.innerHTML += data.playerCode;mplayer.style.cssText += data.player_css;lrc.style.cssText += data.lrc_css;let mKey = 0, mFlag = true, fs = false, msize = mplayer.offsetWidth, tnow = Date.now(), timerId;;[...Array(data.total).keys()].forEach( (item,key) => {item = document.createElement('span');item.className = 'mline';item.style.transform= `rotateX(${360/data.total*key}deg) rotateY(${360/data.total*key}deg)`;mplayer.appendChild(item);});mplayer.onclick = () => aud.paused ? aud.play() : aud.pause();btnMsg.onclick = () => fs ? document.exitFullscreen() : papa.requestFullscreen();papa.onmousemove = (e) => {clearTimeout(timerId);btnMsg.style.opacity = '.95';timerId = setTimeout('btnMsg.style.opacity = "0"', 3000);};document.addEventListener("fullscreenchange", () => {if (document.fullscreenElement !== null) {fs = true;mplayer.style.setProperty('--ww', msize*1.5 + 'px');btnMsg.innerText = '退出全屏';} else {fs = false;mplayer.style.setProperty('--ww', msize + 'px');btnMsg.innerText = '全屏观赏';}});aud.addEventListener('pause', () => mState());aud.addEventListener('play', () => mState());aud.addEventListener('seeked', () => calcKey());let mState = () => aud.paused ? (lrc.style.setProperty('--state','paused'), mplayer.style.animationPlayState='paused') : (lrc.style.setProperty('--state','running'), mplayer.style.animationPlayState='running');aud.addEventListener('timeupdate', () => {for (j = 0; j < data.lrcAr.length; j++) {if (aud.currentTime >= data.lrcAr) {if (mKey === j) showLrc(data.lrcAr);else continue;}}});let showLrc = (time) => {let name = mFlag ? 'cover1' : 'cover2';lrc.innerHTML = data.lrcAr;lrc.dataset.lrc = data.lrcAr.replace(/<br>/, '\n');lrc.style.setProperty('--motion', name);lrc.style.setProperty('--tt', time + 's');lrc.style.setProperty('--state', 'running');mKey += 1;mFlag = !mFlag;};let calcKey = () => {for (j = 0; j < data.lrcAr.length; j++) {if (aud.currentTime <= data.lrcAr) {mKey = j - 1;break;}}if (mKey < 0) mKey = 0;if (mKey > data.lrcAr.length - 1) mKey = data.lrcAr.length - 1;let time = data.lrcAr - (aud.currentTime - data.lrcAr);showLrc(time);};};mkPlayer.HCPlayer = playCode;})(this);
let lrcAr = [,];
HCPlayer({
lrcAr: lrcAr,
lrc_css: '--bg: linear-gradient(blue,lightblue); top: 15px; left: 20px;',
player_css: '--ww: 110px; --bg: linear-gradient(45deg,orange,MediumBlue,snow,DeepSkyBlue); --bc: blue; top: 280px; right: 480px;',
total: 20,
});
})();
</script>
美好的一天
<style>
#papa { left: -250px; width: 1100px; height: 700px; background: #ccc url('https://pic1.imgdb.cn/item/63380a9716f2c2beb1c4a6f6.jpg') no-repeat center/cover; box-shadow: 3px 3px 20px #000; display: grid; place-items: center; position: relative; z-index: 1; }
#mplayer { position: absolute; bottom: 0; width: 300px; height: 80px; user-select: none; display: grid; place-items: center; cursor: pointer; }
#mplayer:hover #btnwrap, #mplayer:hover #prog { transform: translateY(var(--yy)); }
#mplayer:hover #btnwrap { background: linear-gradient(to top right, purple, orange); border-radius: 50%; opacity: .75; }
#btnwrap, #prog { position: absolute; display: grid; place-items: center; transition: .5s; }
#btnwrap { --yy: -15px; width: 40px; height: 40px; transform: rotate(45deg); border: 1px solid tan; border-radius: 6px; opacity: 0; }
#btnplay { width: 20px; height: 20px; transform: translateX(3px); background: #eee; clip-path: polygon(0 0, 0% 100%, 100% 50%); }
#btnpause { width: 2px; height: 20px; border-style: solid; border-width: 0px 4px; border-color: transparent #eee; display: none; }
#prog { --yy: 20px; width: 300px; height: 16px; border-radius: 10px; background: linear-gradient(90deg, orange, purple 100%, transparent 0); border: 1px solid tan; font: normal 14px / 16px sans-serif; color: #fff; text-shadow: 1px 1px 0 #000; opacity: .8; }
.star5 { position: absolute; background: transparent; top: -130px; left: -90px; font: normal 18px /18px sans-serif; offset-distance: 0%; offset-path: path("m418.5,540c0,0 -23,-20 -23.5,-20c0.5,0 -29.5,-10 -30.5,-11c-1,-1 -32,-14 -32.5,-14c0.5,0 -26.5,-17 -27,-17c0.5,0 -27.5,-35 -28,-35c0.5,0 -10.5,-23 -11,-23c0.5,0 5.5,-26 5,-26c0.5,0 7.5,-13 7,-13c0.5,0 9.5,-12 9,-12c0.5,0 14.5,-9 14,-9c0.5,0 22.5,-3 22,-3c0.5,0 13.5,3 13,3c0.5,0 20.5,8 20,8c0.5,0 18.5,19 18,19c0.5,0 10.5,20 10,20c0.5,0 13.5,32 13,32c0.5,0 11.5,42 11,42c0.5,0 -0.5,-53 -1,-53c0.5,0 9.5,-52 9,-52c0.5,0 9.5,-22 9,-22c0.5,0 7.5,-20 7,-20c0.5,0 18.5,-8 18,-8c0.5,0 14.5,-3 14,-3c0.5,0 15.5,-1 15,-1c0.5,0 20.5,9 20,9c0.5,0 12.5,20 12,20c0.5,0 7.5,18 7,18c0.5,0 2.5,20 2,20c0.5,0 -0.5,25 -1,25c0.5,0 -12.5,19 -13,19c0.5,0 -5.5,17 -6,17c0.5,0 -24.5,25 -25,25c0.5,0 -19.5,24 -20,24c0.5,0 -36.5,41 -36.5,41z"); text-shadow: 0 0 12px rgba(199,245,122,.75); animation: move 12s var(--ss) linear infinite; }
@keyframes move{to{offset-distance:100%}}
</style>
<div id="papa">
<div id="mplayer">
<div id="btnwrap"><span id="btnplay"></span><span id="btnpause"></span></div>
<div id="prog">00:00 | 00:00</div>
</div>
</div>
<script>
let mKey = 0, mFlag = true, aud = new Audio();
let setColor = () => Math.random().toString(16).substr(-6);
Array.from({length: 40}).forEach((ele,key) => {
ele = document.createElement('span');
ele.className = 'star5';
ele.innerText = '\u2764';
ele.style.cssText += `--ss: ${key * 0.5}s; color: #F70938;`;
papa.appendChild(ele);
});
aud.src = 'http://music.163.com/song/media/outer/url?id=5177963.mp3';
aud.autoplay = true;
aud.loop = true;
btnwrap.onclick = () => aud.paused ? aud.play() : aud.pause();
prog.onclick = (e) => aud.currentTime = aud.duration * e.offsetX / prog.offsetWidth;
aud.addEventListener('pause', () => mState());
aud.addEventListener('play', () => mState());
aud.addEventListener('timeupdate', () => {
prog.style.background = 'linear-gradient(90deg, orange, purple ' + aud.currentTime / aud.duration * 100 + '%, snow 0)';
prog.innerText = toMin(aud.currentTime) + ' | ' + toMin(aud.duration);
});
let mState = () => aud.paused ? (btnplay.style.display = 'block', btnpause.style.display = 'none') : (btnplay.style.display = 'none', btnpause.style.display = 'block');
let toMin = (val) => {
if (!val) return '00:00';
val = Math.floor(val);
let min = parseInt(val / 60),
sec = parseFloat(val % 60);
if (min < 10) min = '0' + min;
if (sec < 10) sec = '0' + sec;
return min + ':' + sec;
};
</script>
画面简洁效果很好。
寂寞烟火
<style>
#papa { left: -250px; width: 1100px; height: 700px; background: gray url('https://pic.imgdb.cn/item/63cd43ffbe43e0d30e2dac2e.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(#000000,#969696,#000000,#969696,#000000); 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: #CCCCCC; text-shadow: 2px 2px 4px #222; }
@keyframes rot { to { transform: rotate(360deg); } }
</style>
<div id="papa">
<span id="lrcbox">寂寞烟火·2023</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 = 'http://music.163.com/song/media/outer/url?id=2015018957.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, 1, 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 > 280) {
createParticle(Math.random() * w, Math.random() * h/2);
idx = 0;
}
requestAnimationFrame(render);
}
render();
})();
</script>
梦油 发表于 2023-1-25 21:19
画面简洁效果很好。
都是胡弄的了
绿叶清舟 发表于 2023-1-26 19:18
都是胡弄的了
太棒了,太棒了。
生日快乐TO东篱
<style>
.mama33 { position: relative; left: -250px; width: 1100px; height: 700px; background: #ccc url('https://pic.imgdb.cn/item/63d4e137face21e9efe36935.jpg') no-repeat; box-shadow: 2px 2px 2px #444; overflow: hidden; }
.wrapper {
left: 80px;
top: 500px;
width: 35px;
height: 200px;
position: relative;
cursor: pointer;
}
.candle {
position: absolute;
width: inherit;
height: inherit;
box-shadow: inset 0 0 1px 0 rgba(0,0,0,.35), 1px 1px 10px gray;
background: linear-gradient(to right,#eee 1%,#fd8589,#eee 99%);
bottom: 0;
}
.candle::before ,.candle::after { position: absolute; content: ''; }
.candle::before {
width: 40px;
height: 40px;
border-radius: 0 80%;
background: linear-gradient(to left bottom, red 30%, #FFF, red 70%);
box-shadow: inset 2px 2px 4px yellow, inset 2px 2px 4px gold;
top: -45px;
left: -3px;
transform: rotate(45deg);
filter: blur(1px);
animation: burn .5s ease-in-out infinite alternate;
}
.candle::after {
width: 100%;
height: 15px;
background: inherit;
}
@keyframes burn { to { height: 50px; } }
</style>
<div class="mama33">
<div class="wrapper">
<div class="candle"></div>
</div>
</div>
<audio id="myaud" src="http://music.163.com/song/media/outer/url?id=501077551.mp3" autoplay="autoplay" loop="loop"></audio>
<script>
let controler = document.querySelector('.candle');
let aud = document.querySelector('#myaud');
let task = aud.duration, current;
controler.onclick = () =>{
aud.paused ? aud.play() : aud.pause();
}
aud.addEventListener('timeupdate', function(){
task = aud.duration;
current = aud.currentTime;
setProgress(task,current);
});
function setProgress(tt,cc) {
if(tt <= 0 || cc <= 0) return false;
let prog = 100 - 100 * cc / tt;
controler.style.height = prog + '%';
}
</script>
发现了大宝库