-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHome.html
More file actions
160 lines (137 loc) · 4.55 KB
/
Home.html
File metadata and controls
160 lines (137 loc) · 4.55 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<!DOCTYPE html>
<html lang="en">
<head>
<title>AC Milan</title>
<link rel="stylesheet" href="css/CSS_1.css">
</head>
<body>
<!-- Start Header-->
<div class="header">
<div class="header_top">
<div class="logo">
<a href="Home.html"><img src="images/logo.png"/></a>
</div>
<div class="contact_info">
<ul>
<li><a href=""><img src="images/mail_icon.png"/><span>hossam.amer666@gmail.com</span></a></li>
<li><a href=""><img src="images/phone_icon.png"/><span>01152534352</span></a></li>
<li><a class="join" href="sign.html">Join us</a></li>
</ul>
</div>
</div>
<div class="header_bottom">
<div class="pages">
<div class="left">. </div>
<div class="right">
<ul class="pages_option">
<li><a class="home" href="Home.html">Home</a></li>
<li><a class="about" href="about.html" target="_blank">About</a></li>
<li><a class="exchange" href="fall_game.html" target="_blank">Play</a></li>
<li><a class="services" href="quiz.html" target="_blank">Quiz</a></li>
<li><a class="new.html" href="galary.html" target="_blank">Galary</a></li>
<li><a class="contact" href="sign.html" target="_blank">Sign up</a></li>
</ul>
</div>
</div>
</div>
<!-- End Header-->
<div style="height: 300px; width: 500px; margin: auto;margin-top: 20px;margin-bottom: 20px;">
<img src="images/b1.png" id = "data">
</div>
<div style="text-align: center;">
<h1 id="hi"></h1>
<h1></h1>
<h1 id="clock"></h1>
</div>
<div style="margin-left: 40%; ">
<div id="_red" onclick="red()">
Change BackGround color to red
</div>
<div id="_blue" onclick="blue()">
Change BackGround color to blue
</div>
<div id="random" onclick="random()">
Change BackGround color to Random
</div>
</div>
<script type="text/javascript">
function red()
{
document.body.style.backgroundColor = "red";
}
function blue()
{
document.body.style.backgroundColor = "blue";
}
function random()
{
document.body.style.backgroundColor = "blue";
}
function random()
{
var red = Math.floor(Math.random() * 255);
var green = Math.floor(Math.random() * 255);
var blue = Math.floor(Math.random() * 255);
var c = 'rgb('+red+','+green+','+blue+')';
document.body.style.backgroundColor = c;
}
Hi();
showTime();
function Hi()
{
var name = prompt("Enter your name");
var welcome = document.getElementById("hi")
var myDate = new Date();
var h = myDate.getHours();
if(h >=6 && h < 12)
{
welcome.innerHTML = "Good Morning, " + name;
}
else if(h >= 12 && h < 18)
{
welcome.innerHTML = "Good afternoon, " + name;
}
else if(h >= 18 && h < 24)
{
welcome.innerHTML = "Good Evening, " + name;
}
else if(h >= 0 && h < 6)
{
welcome.innerHTML = "Good Night, " + name;
}
}
setInterval(showTime, 1000);
function showTime() {
let time = new Date();
let hour = time.getHours();
let min = time.getMinutes();
let sec = time.getSeconds();
am_pm = "AM";
if (hour > 12) {
hour -= 12;
am_pm = "PM";
}
if (hour == 0) {
hr = 12;
am_pm = "AM";
}
hour = hour < 10 ? "0" + hour : hour;
min = min < 10 ? "0" + min : min;
sec = sec < 10 ? "0" + sec : sec;
let currentTime = hour + ":"
+ min + ":" + sec +" "+ am_pm;
document.getElementById("clock")
.innerHTML = currentTime;
}
showTime();
var imgArray = ['images/b1.png','images/b2.png','images/b3.png','images/b4.png','images/b5.png'];
image_show();
function image_show()
{
var random = Math.floor(Math.random()*5);
document.getElementById("data").src=imgArray[random];
setTimeout(image_show,3000);
}
</script>
</body>
</html>