在下雨。今天下午出去锻炼结果淋成落汤鸡了。
哦,那你们哪里凉快了 本帖最后由 加林森 于 2022-3-23 23:31 编辑 <br /><br />红影 发表于 2021-10-4 21:03
韩红的歌好听,队长帖子做得漂亮
谢谢红影!{:4_171:}
<style type="text/css">
/* 帖子容器 */
#tzDiv {
position: relative;
left: -214px;
width: 1024px;
height: 600px;
top: 80px;
background: #eee url('https://pic.imgdb.cn/item/623b249f27f86abb2a935a58.jpg') no-repeat center/cover;
opacity: 0.8;
}
/* 音乐控制按钮 */
.picBtn {
position: absolute;
width: 80px;
height: 129px;
left: 180px;
bottom: 60px;
border: none;
outline: none;
border-radius: 8px;
background: transparent url('http://image.hnol.net/c/2022-03/12/19/20220312194526771-5087368.gif') no-repeat;
cursor: pointer;
}
/* 文本时钟 */
#textClock {
position: absolute;
top: 180px;
right: 200px;
width: 300px;
height: 30px;
font: 20px / 30px Sans-Serif;
text-align: center;
}
/* 走马灯父框 */
.txtFly {
position: absolute;
width: 260px;
height: 30px;
right: 100px;
bottom: 100px;
overflow: hidden;
}
/* 走马灯文本 */
.txtFly div {
position: absolute;
left: 260px;
font: normal 18px /20px Sans-Serif;
word-break: keep-all;
white-space:nowrap;
}
/* 变色文本 */
.txtBg {
position: absolute;
top: 80px;
right: 100px;
font-size: 4rem;
color: transparent;
width: 500px;
height: 100px;
line-height: 100px;
text-align: center;
background-image: linear-gradient(90deg, green, olive, transparent, tomato, green);
background-size: 500px 100px;
background-position: 500px 0;
border: 1px solid;
background-clip: text;
-webkit-background-clip: text;
animation: chgc 2s linear infinite;
}
/* 文本变色动画 */
@keyframes chgc {
from { background-position: -500px 0; }
to { background-position: 0 0; }
}
</style>
<div id="tzDiv">
<div class="txtBg">微山湖</div>
<div id="textClock"></div>
<div class="txtFly">
<div id="ziFly">微山湖--群星 </div>
</div>
<button id="picBtn" class="picBtn"></button>
<audio id="music" src="http://www.kumeiwp.com/sub/filestores/2022/03/23/a8c7874796a2cca2c02649956fdf7920.mp3" loop="loop" autoplay="autoplay" ></audio>
</div>
<script language="javascript">
fly(); //运行走马灯
showTime(); //显示时间
setInterval(showTime, 1000); //运行时钟
//文本时钟函数
function showTime(){
var now = new Date();
var year = now.getFullYear();
var month = now.getMonth() + 1;
var date = now.getDate();
var day = now.getDay();
var hour = now.getHours();
if(hour < 10) hour = "0" + hour;
var minute = now.getMinutes();
if(minute < 10) minute = "0" + minute;
var second = now.getSeconds();
if(second < 10) second = "0" + second;
document.getElementById("textClock").innerHTML = year + "年" + month + "月" + date + "日 星期" + toHz(day) + "" + hour + ":" + minute + ":" + second;
}
function toHz(num) { var hz = "日一二三四五六九"; return(hz.charAt(num)); }
//音乐控制代码
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-03/12/19/20220312194526771-5087368.gif')") : (mu.pause(), btn.style.background="url('http://image.hnol.net/c/2022-03/12/19/20220312194526771-5087368.gif')");
}
mu.addEventListener("ended", function(){
btn.style.background="url('http://image.hnol.net/c/2022-03/12/19/20220312194526771-5087368.gif')";
});
//创建走马灯
function fly() {
var ziFly = document.getElementById('ziFly');
var width = ziFly.clientWidth;
var style = document.createElement('style');
style.type = 'text/css';
var flyStr = '@keyframes fly {to { left: -' + width + 'px; } }';
style.innerHTML = flyStr;
ziFly.appendChild(style);
ziFly.style.animation = 'fly 40s linear infinite';
}
</script>
磁性的声音 好开心 发表于 2021-10-4 21:15
磁性的声音
谢谢好开心支持!{:4_187:} 小辣椒 发表于 2021-10-4 21:04
哦,那你们哪里凉快了
还好,最高温度22度。 加林森 发表于 2021-10-4 21:19
还好,最高温度22度。
舒适温度 马黑黑 发表于 2021-10-5 08:03
舒适温度
今天继续在下雨 下雨巴适 马黑黑 发表于 2021-10-5 09:02
下雨巴适
今天下午我又要去给老母亲送吃的了。 加林森 发表于 2021-10-5 09:19
今天下午我又要去给老母亲送吃的了。
孝子队长 马黑黑 发表于 2021-10-5 10:26
孝子队长
应该的 加林森 发表于 2021-10-5 10:26
应该的
支持 加林森 发表于 2021-10-4 21:09
谢谢红影!
不客气,队长晚上好{:4_204:} 红影 发表于 2021-10-5 20:58
不客气,队长晚上好
红影晚上好!{:4_204:}
页:
1
[2]