|
|

楼主 |
发表于 2022-3-21 21:00
|
显示全部楼层
<style type="text/css">
/* 父框盒子 */
#xq { position: relative; left:-304px; top:120px; width: 1200px; height: 675px; background-image: url('https://pic.imgdb.cn/item/6236c6645baa1a80ab099613.jpg'); box-shadow: 4px 4px 5px #888; background-size: 1200px 675px; border-radius:12px; background-position: 1200px 0;animation: mv 28s linear infinite; }
@keyframes mv { from { background-position: 1200px 0; } to { background-position: 0 0; } }
/* 摇摆字 */
body { overflow-x: hidden; } /*禁用横向滚动条 */
#baiBox {
margin: auto;
width: 400px;
text-align: center;
font-size: 5.2rem;
font-weight: bold;
color: #E0EEE0;
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: 100px;
border: none;
outline: none;
border-radius: 8px;
background: transparent url('http://image.hnol.net/c/2022-02/24/15/202202241559481151-5087368.gif') no-repeat;
cursor: pointer;
}
/* 轱辘诗 */
.hxBox { position: absolute; left:220px; top:150px; width: 160px; height: 160px; font-family: '楷体','微软雅黑'; font-size: 24px;transform-origin: 50 50; animation: go 24s linear infinite;}
@keyframes go { to { transform: rotate(-360deg); } }
.hxBox path { fill: none; }
.hxBox svg { display: block; overflow: visible; }
</style>
<div id="xq" >
<div id="baiBox" style="position: absolute; left:680px; top: 80px; ">纵横天下</div>
<div class="hxBox">
<svg viewBox="0 0 100 100">
<path d="M 0, 50 a 50, 50 0 1, 1 0, 1 z" id="yuan" />
<text stroke="#D1EEEE">
<textPath xlink:href="#yuan">
巡碧宇黑龙腾跃马尘轻黑夜行
</textPath>
</text>
</svg>
</div>
<div style="position: absolute; left:800px; top: 450px; width:180px;">
<img alt="" src="https://pic.imgdb.cn/item/6232bd295baa1a80ab793f4a.gif"/>
</div>
<div style="position: absolute; left:360px; top: 20px; width:382px; opacity: .15;">
<img alt="" src="https://pic.imgdb.cn/item/6232dd4c5baa1a80abb8792d.gif"/>
</div>
<!-- 控制按钮应是父盒子的第一代子元素 -->
<div style="position:absolute; width:120px; left: 240px; top:calc(100% - 496px); text-align:center;">
<button id="picBtn" class="picBtn"></button>
</div>
</div>
<!-- 因为播放器不要界面,无需放在帖子父盒子内 -->
<audio id="music" autoplay="autoplay" loop="loop" src="http://music.163.com/song/media/outer/url?id=36019510.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('http://image.hnol.net/c/2022-02/24/15/202202241559481151-5087368.gif')") : (mu.pause(), btn.style.background="url('http://image.hnol.net/c/2022-02/24/16/20220224160408591-5087368.gif')");
}
mu.addEventListener("ended", function(){
btn.style.background="url('http://image.hnol.net/c/2022-02/24/16/20220224160408591-5087368.gif')";
});
</script>
<br><br><br><br><br><br><br><br> |
|