-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
114 lines (96 loc) · 2.95 KB
/
index.html
File metadata and controls
114 lines (96 loc) · 2.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type = "text/css" href = "style.css"/>
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Architects+Daughter' rel='stylesheet' type='text/css'>
<link rel = "icon" type = "icon" href = "clock.png">
<meta name="viewport" content="width=device-width"/>
<meta charset="UTF-8">
<title> 10 Past Blue </title>
</head>
<body>
<div class = "clock">
<div class = "header">
<p id = "name">Hex Color Clock</p>
</div>
<div class = "number">
<p class = "time"></p>
<p class = "color"></p>
</div>
<div class = "footer">
<a href = "https://www.linkedin.com/pub/mehtab-chithiwala/84/759/253">
<img id = "l" src = "linkedin-w.png">
</a>
© Mehtab Chithiwala
<a href = "https://www.facebook.com/mehtab.chithiwala">
<img id = "f" src = "fb-w.png">
</a>
<div class = "temp">
<audio id = "audio" src = "clock-tick.wav" type = "audio/mpeg" loop autoplay></audio>
<img id = "play" src = "speaker.png">
</div>
</div>
</div>
</body>
<script src = "jquery.js"></script>
<script>
function getColor() {
var date = new Date();
var hours = date.getHours();
var minutes = date.getMinutes();
var seconds = date.getSeconds();
if (hours < 10)
{
hours = "0" + hours
};
if (minutes < 10)
{
minutes = "0" + minutes
};
if (seconds < 10)
{
seconds = "0" + seconds
};
var time = "#" + hours + minutes + seconds;
var aOrP = "am";
if (hours === 12)
{
aOrP = "pm";
}
if (hours > 12)
{
aOrP = "pm";
hours = hours - 12;
if (hours < 10)
{
hours = "0" + hours;
}
}
$(function() {
$(".clock").css("background-color", time);
$(".time").text(hours + " : " + minutes + " : " + seconds + " " + aOrP);
$(".color").text(time);
// $("#name").click(function() {
// $(this).hide();
//});
});
setTimeout(getColor, 1000);
}
var sound = document.getElementById("audio");
var control = document.getElementById("play");
control.onclick = function() {
if (sound.paused === true)
{
control.src = "speaker.png";
sound.play();
}
else
{
control.src = "mute.png";
sound.pause();
}
};
getColor();
</script>
</html>