网络编程 发布日期:2025/10/30 浏览次数:1
本文实例讲述了vue.js实现带日期星期的数字时钟功能。分享给大家供大家参考,具体如下:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>www.jb51.net vue.js带日期星期数字时钟</title>
<style type="text/css">
html, body {
height: 100%;
}
body {
background: #0f3854;
background: -webkit-radial-gradient(center ellipse, #0a2e38 0%, #000000 70%);
background: radial-gradient(ellipse at center, #0a2e38 0%, #000000 70%);
background-size: 100%;
}
p {
margin: 0;
padding: 0;
}
#clock {
font-family: 'Microsoft YaHei','Lantinghei SC','Open Sans',Arial,'Hiragino Sans GB','STHeiti','WenQuanYi Micro Hei','SimSun',sans-serif;
color: #ffffff;
text-align: center;
position: absolute;
left: 50%;
top: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
color: #daf6ff;
text-shadow: 0 0 20px #0aafe6, 0 0 20px rgba(10, 175, 230, 0);
}
#clock .time {
letter-spacing: 0.05em;
font-size: 80px;
padding: 5px 0;
}
#clock .date {
letter-spacing: 0.1em;
font-size: 24px;
}
#clock .text {
letter-spacing: 0.1em;
font-size: 12px;
padding: 20px 0 0;
}
</style>
</head>
<body>
<script src="/UploadFiles/2021-04-02/vue.min.js">
这里使用在线HTML/CSS/JavaScript代码运行工具:http://tools.jb51.net/code/HtmlJsRun,可得到如下运行效果:
PS:这里再为大家推荐几款时间及日期相关工具供大家参考使用:
在线日期/天数计算器:
http://tools.jb51.net/jisuanqi/date_jisuanqi
在线日期计算器/相差天数计算器:
http://tools.jb51.net/jisuanqi/datecalc
在线日期天数差计算器:
http://tools.jb51.net/jisuanqi/onlinedatejsq
Unix时间戳(timestamp)转换工具:
http://tools.jb51.net/code/unixtime
希望本文所述对大家vue.js程序设计有所帮助。