加林森 发表于 2022-1-28 23:10

本帖最后由 加林森 于 2022-5-16 14:54 编辑 <br /><br /><div class="quote"><blockquote><font size="2"><a href="forum.php?mod=redirect&amp;goto=findpost&amp;pid=1433498&amp;ptid=56308" target="_blank"><font color="#999999">杨柳青 发表于 2022-1-28 23:01</font></a></font><br>黑马学生不少哦~~</blockquote></div><br>你不服?<div><br></div><div><div>&lt;style&gt;</div><div>.mBox {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; --w: 120px;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; margin: auto;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; margin-top: 100px;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; display: flex;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; justify-content: center;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; align-items: center;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; width: var(--w);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; height: var(--w);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; cursor: pointer;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; position: relative;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; animation: rot 2s linear infinite;</div><div>}</div><div>.zBox {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; position: absolute;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; display: block;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; border-style: solid;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; border-width: 1px;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; border-color: transparent #fff729 transparent transparent;</div><div>}</div><div>@keyframes rot { to { transform: rotate(1turn); } }</div><div>&lt;/style&gt;</div><div><br></div><div><br></div><div>&lt;DIV align=center color=#ff0000 &gt;</div><div>&lt;table&nbsp; style="position: relative; LEFT: -214px; width:1024px;TOP: 250px"&nbsp; border="0" cellspacing="0" cellpadding="0"&gt;</div><div>&lt;TBODY&gt;&lt;TR&gt;&lt;TD height=562 background=https://pic.imgdb.cn/item/6281f30c09475431295245cb.jpg&gt;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;div style="position:absolute; LEFT: 600px; TOP: 320px;"&gt;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div class="mBox"&gt;&lt;/div&gt;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &lt;/div&gt;</div><div>&lt;/TD&gt;&lt;/TR&gt;</div><div>&lt;/table&gt;&lt;/div&gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;</div><div><br></div><div>&lt;script&gt;</div><div>let flag = true;</div><div>let ele = document.querySelector(".mBox");</div><div>let len = ele.clientWidth;</div><div>let zStr = "";</div><div>let all = 100;</div><div>let angle = Math.floor(360 / all);</div><div><br></div><div>for(j=0; j&lt; all; j++){</div><div>&nbsp; &nbsp; &nbsp; &nbsp; let wh = Math.floor(len- j * (len / all));</div><div>&nbsp; &nbsp; &nbsp; &nbsp; zStr += `&lt;span class="zBox" style="transform: rotate(${j*angle}deg);width: ${wh}px; height: ${wh}px"&gt;&lt;/span&gt;\n`;</div><div>}</div><div>ele.innerHTML += zStr;</div><div><br></div><div>let au = document.createElement("audio");</div><div>au.src= "<span style="color: rgb(0, 0, 0); font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;PingFang SC&quot;, Tahoma, Arial, sans-serif;">http://www.kumeiwp.com/sub/filestores/2022/03/07/f430f2d5d636b3cdf5529cd5076f731e.mp3</span>";</div><div>au.loop = true;</div><div>au.autoplay = flag;</div><div>au.style.display = "none";</div><div>ele.appendChild(au);</div><div><br></div><div>if(!flag) ele.style.animationPlayState = "paused";</div><div><br></div><div>ele.onclick = function(){</div><div>&nbsp; &nbsp; &nbsp; &nbsp; flag ? (au.pause(),this.style.animationPlayState = "paused",flag = false) : (au.play(),this.style.animationPlayState = "running",flag = true);</div><div>}</div><div>&lt;/script&gt;</div></div>

加林森 发表于 2022-1-28 23:11

本帖最后由 加林森 于 2022-5-16 17:24 编辑 <br /><br />杨柳青 发表于 2022-1-28 22:57
手机上听不清楚~~
破手机{:5_117:}

<style>
.mBox {
      --w: 120px;
      margin: auto;
      margin-top: 100px;
      display: flex;
      justify-content: center;
      align-items: center;
      width: var(--w);
      height: var(--w);
      cursor: pointer;
      position: relative;
      animation: rot 2s linear infinite;
}
.zBox {
      position: absolute;
      display: block;
      border-style: solid;
      border-width: 1px;
      border-color: transparent #fff729 transparent transparent;
}
@keyframes rot { to { transform: rotate(1turn); } }
</style>


<DIV align=center color=#ff0000 >
<tablestyle="position: relative; LEFT: -214px; width:1024px;TOP: 250px"border="0" cellspacing="0" cellpadding="0">
<TBODY><TR><TD height=562 background=https://pic.imgdb.cn/item/6281f30c09475431295245cb.jpg>
               <div style="position:absolute; LEFT: 600px; TOP: 320px;">
                <div class="mBox"></div>
      </div>
</TD></TR>
</table></div><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>

<script>
let flag = true;
let ele = document.querySelector(".mBox");
let len = ele.clientWidth;
let zStr = "";
let all = 100;
let angle = Math.floor(360 / all);

for(j=0; j< all; j++){
      let wh = Math.floor(len- j * (len / all));
      zStr += `<span class="zBox" style="transform: rotate(${j*angle}deg);width: ${wh}px; height: ${wh}px"></span>\n`;
}
ele.innerHTML += zStr;

let au = document.createElement("audio");
au.src= "http://www.kumeiwp.com/sub/filestores/2022/03/07/f430f2d5d636b3cdf5529cd5076f731e.mp3";
au.loop = true;
au.autoplay = flag;
au.style.display = "none";
ele.appendChild(au);

if(!flag) ele.style.animationPlayState = "paused";

ele.onclick = function(){
      flag ? (au.pause(),this.style.animationPlayState = "paused",flag = false) : (au.play(),this.style.animationPlayState = "running",flag = true);
}
</script>
页: 1 2 [3]
查看完整版本: 《水星记》 郭顶