如果你不喜歡程式碼,想要快速使用,可以參考以下的服務平台,有些是免費的,有些要付費,不妨嘗試看看:
如果你願意看一點點程式碼,也開始研究 HTML,你可能會找到這樣的工具:
那……可以接受一點程式碼,且不想要有廣告,想要有屬於自己的客製化,重點是無限量製作,那你可以參考以下的作法,只需要準備好你的 GitHub 即可。
1.1:登入 GitHub ,點擊右上方的 "+”,選擇 "New repository”。
1.2:幫儲存庫取一個名字,之後點擊下方的 "Create repository”。
<!-- original : <https://codepen.io/SeanNorton/pen/LWBXQL> -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
/*CSS RESETS*/
body{
background-color: #fff;
line-height: 1.6;
}
h1 {
margin-top: 0;
}
/*CSS START*/
.full-table {
display: table;
height: 100%;
width: 100%;
}
.table-cell {
display: table-cell;
vertical-align: middle;
text-align: center;
}
.card {
padding: 10px 25px 10px 25px;
border-radius: 10px;
background: #009688;
color: #fff;
display: inline-block;
box-shadow: 2px 2px 1px 0px #295C7B;
}
.card:hover {
margin-top: 2px;
box-shadow: none;
}
.clock {
display: inline-block;
font-family: 'Roboto', sans-serif;
font-weight: bold;
font-size: 1.2em;
/* padding-left: 20px; */
}
.time {
display: inline-block;
min-width: 37px;
}
.colon {
font-size: 1.1em;
display: inline-block;
}
.date {
display: block;
min-width: 162px;
/* padding-right: 30px; */
/* border-right: 2px solid #295C7B; */
font-family: 'Roboto', sans-serif;
font-size: 1.2em;
}
.greet{
min-width: 162px;
/* padding-right: 30px; */
font-family: 'Roboto', sans-serif;
font-size: 1.2em;
}
</style>
</head>
<body>
<link href="<https://fonts.googleapis.com/css?family=Lobster|Roboto:400,700>" rel="stylesheet">
<div class="full-table">
<div class="table-cell">
<div class="card">
<div class="greet" id="greet"></div>
<div class="date" id="date"></div>
<div class="clock">
<div class="time" id="hour"></div>
<div class="colon">:</div>
<div class="time" id="min"></div>
<div class="colon">:</div>
<div class="time" id="sec"></div>
</div>
</div>
</div>
</div>
<script>
function date() {
var today = new Date();
document.getElementById('date').innerHTML = today.toDateString();
}
function clock() {
var today = new Date();
var hour = zeros(twelveHour(today.getHours()));
var minutes = zeros(today.getMinutes());
var seconds = zeros(today.getSeconds());
if(today.getHours() >=12){
seconds+=" pm"
}
else{
seconds+=" am"
}
hrs = today.getHours();
if (hrs < 12)
greet = 'Good Morning ';
else if (hrs >= 12 && hrs <= 17)
greet = 'Good Afternoon ';
else if (hrs >= 17 && hrs <= 24)
greet = 'Good Evening ';
// console.log(today.toLocaleTimeString());
document.getElementById('greet').innerHTML = greet;
document.getElementById('hour').innerHTML = hour;
document.getElementById('min').innerHTML = minutes;
document.getElementById('sec').innerHTML = seconds;
}
function twelveHour(hour) {
if (hour > 12) {
return hour -= 12
} else if (hour === 0) {
return hour = 12;
} else {
return hour
}
}
// adds zero infront of single digit number
function zeros(num) {
if (num < 10) {
num = '0' + num
};
return num;
}
function dateTime() {
date();
clock();
setTimeout(dateTime, 500);
}
dateTime()
// END
</script>
</body>
</html>