都厉害
谢谢老黑支持啊!{:4_190:}
<style type="text/css">
/* 帖子容器 */
#tzDiv {
position: relative;
left: -214px;
width: 1024px;
height: 563px;
top: 80px;
background: #eee url('https://pic.imgdb.cn/item/6290a2c10947543129d2d7ee.jpg') no-repeat center/cover;
opacity: 0.8;
}
/* 音乐控制按钮 */
.picBtn {
position: absolute;
width: 100px;
height: 100px;
left: 160px;
bottom: 60px;
border: none;
outline: none;
border-radius: 8px;
background: transparent url('https://pic.imgdb.cn/item/6243df5b27f86abb2a5598f1.gif') no-repeat;
cursor: pointer;
}
/* 文本时钟 */
#textClock {
position: absolute;
top: 60px;
right: 200px;
width: 300px;
height: 30px;
font: 20px / 30px #70f3ff;
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/2021/03/11/9ae80e78b6e5e313ddc3582952746d04.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/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')";
});
//创建走马灯
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>
<br><br><br><br><br>
马黑黑 发表于 2022-3-31 23:06
都厉害
谢谢你啦{:4_190:} 加林森 发表于 2022-3-31 21:05
是啊。过完春节就去了。
那会还有点冷,江南的冷还是挺不舒服的呢。 红影 发表于 2022-4-1 22:57
那会还有点冷,江南的冷还是挺不舒服的呢。
与我们这里差不多啊。 加林森 发表于 2022-4-1 23:17
与我们这里差不多啊。
3、4月份去是最好的。 红影 发表于 2022-4-2 12:29
3、4月份去是最好的。
是的,很舒服的时间去的。 加林森 发表于 2022-4-2 12:44
是的,很舒服的时间去的。
你不是说春国刚过去的么? 红影 发表于 2022-4-2 13:33
你不是说春国刚过去的么?
那年就是2月底过完春节就去了啊。 加林森 发表于 2022-4-2 13:34
那年就是2月底过完春节就去了啊。
嗯,那会还有点早,再晚半个月就更缤纷了。 红影 发表于 2022-4-2 14:38
嗯,那会还有点早,再晚半个月就更缤纷了。
待了三个月足矣了。 加林森 发表于 2022-4-2 16:52
待了三个月足矣了。
哦哦,待那么长时间,那还真的是赶上了最美的春呢{:4_187:} 红影 发表于 2022-4-2 20:51
哦哦,待那么长时间,那还真的是赶上了最美的春呢
就是就是。
页:
1
[2]