加林森 发表于 2022-4-2 13:55

《回家》 -- 腾格尔


<style type="text/css">
/* 外框盒子 */
#ces { position: relative; left:-205px; top:150px; width: 1024px; height: 600px;background:#333 url('https://pic.imgdb.cn/item/6247e01127f86abb2a4fde46.jpg') no-repeat center/cover;
      opacity: 0.8; box-shadow: 4px 4px 5px #888;border-radius:12px;}
body { overflow-x: hidden; } /*禁用横向滚动条 */
#baiBox {
      margin: auto;
      width: 360px;
      text-align: center;
      font-size: 3.8rem;
      font-weight: bold;
      color: #FFFFFF;
      transform-origin: top;
      animation: yao 0.8s linear infinite alternate;
}
/* 动画 */
@keyframes yao {
      from{transform: perspective(800px) rotatex(30deg); }
      to { transform: perspective(800px) rotatex(-30deg); }
}
/* 播放按钮 */
.picBtn {
      width: 100px;
      height: 89px;
      border: none;
      outline: none;
      border-radius: 8px;
      background: transparent url('https://pic.imgdb.cn/item/6243df5b27f86abb2a5598f1.gif') no-repeat;
      cursor: pointer;
}
</style>

<div id="ces" >
      <div id="baiBox" style="position: absolute; left:100px; top: 50px; ">回家</div>
      <div style="position: absolute; left:20px; top: 350px; width:600px;text-align:center;">
                <img alt="" src="https://pic.imgdb.cn/item/6247e3c027f86abb2a56f17a.gif"/>
                  
<p ><font color="#ffffff" size="4" >
         
                <div style="position:absolute; width:260px; left:160px; top: 160px; text-align:center;padding:5px;font-size:1.em;font-family:'微软雅黑';text-shadow:1px 1px 1px #000;">
                        <marqueescrollamount="4" direction="left" > 《回家》 -- 腾格尔
</marquee>
                </div>
      </div>
      <!-- 控制按钮应是父盒子的第一代子元素 -->
      <div style="position:absolute; width:120px; left: 110px; top:calc(100% - 140px); text-align:center;">
                <button id="picBtn" class="picBtn"></button>
      </div>
</div>
<!-- 播放器不要界面,无需放在帖子父盒子内 -->
<audio id="music" autoplay="autoplay" loop="loop" src="https://www.joy127.com/url/464.mp3" ></audio>

<script language="javascript">
var mu = document.getElementById('music');
var btn = document.getElementById('picBtn');
btn.onclick = function(){
      mu.paused ? (mu.play(), btn.style.background="url('https://pic.imgdb.cn/item/6243df5b27f86abb2a5598f1.gif')") : (mu.pause(), btn.style.background="url('https://pic.imgdb.cn/item/6243df9527f86abb2a5660b9.png')");
}
mu.addEventListener("ended", function(){
      btn.style.background="url('https://pic.imgdb.cn/item/6243df9527f86abb2a5660b9.png')";
});

</script>

<br><br><br><br><br><br><br><br><br><br>

红影 发表于 2022-4-2 14:30

两只鹰,一只做动图,一只做按钮,这个思路很不错。欣赏队长好帖{:4_187:}

马黑黑 发表于 2022-4-2 16:39

队长这鹰玩的溜

加林森 发表于 2022-4-2 16:47

红影 发表于 2022-4-2 14:30
两只鹰,一只做动图,一只做按钮,这个思路很不错。欣赏队长好帖

这样看起来好像都在动了。{:4_189:}

加林森 发表于 2022-4-2 16:48

马黑黑 发表于 2022-4-2 16:39
队长这鹰玩的溜

还不错吧。{:4_190:}

马黑黑 发表于 2022-4-2 16:59

加林森 发表于 2022-4-2 16:48
还不错吧。

高手了

加林森 发表于 2022-4-2 17:03

马黑黑 发表于 2022-4-2 16:59
高手了

还不行的,继续努力。

红影 发表于 2022-4-2 20:42

加林森 发表于 2022-4-2 16:47
这样看起来好像都在动了。

而且跟图图的已经很吻合,非常漂亮{:4_187:}

加林森 发表于 2022-4-2 20:45

红影 发表于 2022-4-2 20:42
而且跟图图的已经很吻合,非常漂亮

是的。
页: [1]
查看完整版本: 《回家》 -- 腾格尔