|
|

楼主 |
发表于 2022-11-1 22:39
|
显示全部楼层
不过,频谱的尺寸要改的地方不多:
一、CSS:
① 总高度
#btnplay { grid-area: btnplay; display: grid; grid-auto-flow: column; place-items: end center; gap: 4px; height: 60px; cursor: pointer; }
② 单个频谱宽度(频谱的总宽度取决单个宽度)
#btnplay > span { background: red; width: 4px; transition: .6s; opacity: .95; }
二、JS 50 是频谱总高度减去 10 得出的数字,要配套上面CSS的设定
for(j=0; j<20; j++) {let pinpu = document.createElement('span');pinpu.className = 'pinpu';pinpu.style.cssText += `height: ${Math.floor(Math.random()*50) + 10}px; background: #${Math.random().toString(16).substr(-6)};`;btnplay.appendChild(pinpu);}
此外,调整播放器的长度,只需调整CSS中的下面这个:
#prog { --ww: 0px; grid-area: prog; width: 300px; height: 12px; ... } |
|