本帖最后由 加林森 于 2022-4-4 17:50 编辑 <br /><br />小辣椒 发表于 2021-10-26 21:28
队长心态很年轻
好玩就行啊!{:4_189:}
<style type="text/css">
/* 帖子容器 */
#tzDiv {
position: relative;
left: -214px;
width: 1024px;
height: 600px;
top: 80px;
background: #eee url('https://pic.imgdb.cn/item/624ab93b239250f7c54752b5.jpg') no-repeat center/cover;
opacity: 0.8;
}
/* 音乐控制按钮 */
.picBtn {
position: absolute;
width: 100px;
height: 100px;
left: 180px;
bottom: 60px;
border: none;
outline: none;
border-radius: 8px;
background: transparent url('https://pic.imgdb.cn/item/622a00ea5baa1a80ab412ada.gif') no-repeat;
cursor: pointer;
}
/* 文本时钟 */
#textClock {
position: absolute;
top: 160px;
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="https://www.joy127.com/url/25696.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('https://pic.imgdb.cn/item/622a00ea5baa1a80ab412ada.gif')") : (mu.pause(), btn.style.background="url('https://pic.imgdb.cn/item/622a01115baa1a80ab414665.png')");
}
mu.addEventListener("ended", function(){
btn.style.background="url('https://pic.imgdb.cn/item/622a01115baa1a80ab414665.png')";
});
//创建走马灯
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-26 20:31
嗯嗯,晚上好!
队长晚上好{:4_204:}
红影 发表于 2021-10-26 21:37
队长晚上好
晚上好{:4_204:}
加林森 发表于 2021-10-26 22:05
晚上好
队长中午好{:4_204:}
红影 发表于 2021-10-27 12:13
队长中午好
红影中午好{:4_171:}
加林森 发表于 2021-10-27 12:29
红影中午好
谢谢问候{:4_204:}
红影 发表于 2021-10-27 12:33
谢谢问候
下午好!
加林森 发表于 2021-10-27 16:55
下午好!
晚上好。
红影 发表于 2021-10-27 19:57
晚上好。
晚上好,红影!{:4_187:}
加林森 发表于 2021-10-27 19:59
晚上好,红影!
晚上好,队长{:4_204:}
红影 发表于 2021-10-27 20:34
晚上好,队长
我又出去锻炼了
加林森 发表于 2021-10-27 20:46
我又出去锻炼了
晚上锻炼啊{:4_173:}
红影 发表于 2021-10-28 10:18
晚上锻炼啊
不分时间啊,只是出去散步,每天走16000步就行了。
好听,谢谢!{:4_204:}
加林森 发表于 2021-10-28 10:22
不分时间啊,只是出去散步,每天走16000步就行了。
队长很注意锻炼身体,自律的生活更美好{:4_204:}
红影 发表于 2021-10-28 11:03
队长很注意锻炼身体,自律的生活更美好
是啊,退休了就得更加注意身体的锻炼了。
子梦 发表于 2021-10-28 10:37
好听,谢谢!
谢谢子梦支持!{:4_171:}
加林森 发表于 2021-10-28 11:05
是啊,退休了就得更加注意身体的锻炼了。
队长都太多了,我觉得只要多注意活动活动身体,不用那么大的运动量吧{:4_173:}
红影 发表于 2021-10-28 20:23
队长都太多了,我觉得只要多注意活动活动身体,不用那么大的运动量吧
我上午陪夫人购买菜,中午休息一会,下午又出去锻炼,晚上夫人跳舞我就开始散步去了。
加林森 发表于 2021-10-28 20:42
我上午陪夫人购买菜,中午休息一会,下午又出去锻炼,晚上夫人跳舞我就开始散步去了。
很有规律的生活。