Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 45729dd

Browse files
digitalClock
1 parent 04d2b92 commit 45729dd

File tree

7 files changed

+169
-6
lines changed

7 files changed

+169
-6
lines changed

‎DigitalClock/DigitalClock.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<html>
2+
<head>
3+
<title>Digital Clock</title>
4+
<link rel="stylesheet" href="styles.css" />
5+
</head>
6+
<body>
7+
<div class="mainHeading">
8+
<p>Digital Clock</p>
9+
</div>
10+
<div class="showDate">
11+
<p id="showDate"></p>
12+
<p id="day" style="margin-left: 30px;"></p>
13+
</div>
14+
<div class="btns">
15+
<button onclick="onTimeStamp()" class="timeBtn">Time Stamp</button>
16+
<button onclick="onResetTimeStamp()" class="timeBtn">Reset Time Stamp</button>
17+
</div>
18+
<div style="text-align: center;">
19+
<p id="allTime"></p>
20+
<p id="showTimeStamps"></p>
21+
</div>
22+
<script src="main.js"></script>
23+
</body>
24+
</html>

‎DigitalClock/main.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
let currentTiming;
2+
let currentDay;
3+
let array=localStorage.getItem('array')?(JSON.parse(localStorage.getItem('array'))):[];
4+
document.getElementById('showTimeStamps').innerHTML=array;
5+
document.getElementById('allTime').innerHTML=(array.length===0)?'':'Your TimeStamps';
6+
7+
function getTodayDay(){
8+
const date=new Date();
9+
const allDays=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
10+
const todayDay=date.getDay();
11+
return allDays[todayDay];
12+
}
13+
14+
function getTodayTime(){
15+
const date=new Date();
16+
let hours=date.getHours();
17+
let mins=date.getMinutes();
18+
let seconds=date.getSeconds();
19+
if(hours<12) hours='0'+hours;
20+
if(mins<10) mins='0'+(+mins);
21+
if(seconds<10) seconds='0'+(+seconds);
22+
let currentTime=hours+" "+" : "+mins+" : "+seconds;
23+
currentTiming=currentTime;
24+
document.getElementById('showDate').innerHTML=currentTime;
25+
document.getElementById('day').innerHTML=getTodayDay();
26+
}
27+
28+
function onTimeStamp(){
29+
array.push(' '+(array.length+1)+' => '+currentTiming);
30+
document.getElementById('allTime').innerHTML=(array.length===0)?'':'Your TimeStamps';
31+
localStorage.setItem('array',JSON.stringify(array));
32+
document.getElementById('showTimeStamps').innerHTML=array;
33+
}
34+
35+
function onResetTimeStamp(){
36+
array=[];
37+
localStorage.clear('array');
38+
document.getElementById('showTimeStamps').innerHTML='';
39+
document.getElementById('allTime').innerHTML='';
40+
}
41+
42+
setInterval(() => {
43+
getTodayTime();
44+
}, 1000);

‎DigitalClock/styles.css

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
body{
2+
background-color: #FFFFFF;
3+
}
4+
.mainHeading{
5+
text-align: center;
6+
padding-top: 40px;
7+
font-size: 30px;
8+
font-weight: 100;
9+
font-family: Arial, Helvetica, sans-serif;
10+
}
11+
.btns{
12+
display: flex;
13+
flex-direction: row;
14+
justify-content: space-around;
15+
align-items: center;
16+
}
17+
.showDate{
18+
display: flex;
19+
flex-direction: row;
20+
justify-content: center;
21+
align-items: center;
22+
text-align: center;
23+
font-size: 2.5em;
24+
font-family:'Courier New', Courier, monospace;
25+
font-style: bold;
26+
}
27+
.timeBtn,.stopBtn{
28+
padding: 10px 15px 10px 15px;
29+
font-size: 17px;
30+
background-color: red;
31+
border-radius: 8px;
32+
color: #FFFFFF;
33+
font-weight: bold;
34+
}
35+
.timeBtn:hover{
36+
transform: scale(1.1);
37+
}
38+
.stopBtn:hover{
39+
transform: scale(1.1);
40+
}
File renamed without changes.

‎GuessNumber/index.html

Whitespace-only changes.

‎Registration.html

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<html>
2+
<head>
3+
<title>Registration Form</title>
4+
<script src="main.js"></script>
5+
<link rel="stylesheet" href="styles.css">
6+
</head>
7+
<body>
8+
<div class="mainHeading"><h1>Welcome Back!!</h1></div>
9+
<marquee>Please Proceed with Registration Process</marquee>
10+
<form action="post">
11+
<table align="center">
12+
<caption>Registration Form</caption>
13+
<tr>
14+
<td><label>First Name:</label></td>
15+
<td><input id="fname" name="fname" type="text" required autocapitalize="true"></td>
16+
</tr>
17+
<tr>
18+
<td><label>Last Name:</label></td>
19+
<td><input type="text" name="lname" id="lname" required></td>
20+
</tr>
21+
<tr>
22+
<td><label>Email Address:</label></td>
23+
<td><input type="email" name="gmail" id="gmail" required></td>
24+
</tr>
25+
<tr>
26+
<td><label>Favoraite Game:</label></td>
27+
<td>
28+
<select name="hobbies">
29+
<option selected>Select Option</option>
30+
<option value="cricket">Cricket</option>
31+
<option value="baseball">BaseBall</option>
32+
<option value="tennis">Tennis</option>
33+
<option value="badminton">Badminton</option>
34+
</select>
35+
</td>
36+
</tr>
37+
<tr>
38+
<td><button value="submit">Submit</button></td>
39+
<td><input type="reset" value="Reset"></td>
40+
</tr>
41+
</table>
42+
</form>
43+
<div><p id="showDate"></p></div>
44+
<!-- <script src="todayDate.js"></script> -->
45+
</body>
46+
</html>

‎todayDate.js

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
1-
constdate=newDate();
1+
22
function getTodayDay(){
3+
const date=new Date();
34
const allDays=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
45
const todayDay=date.getDay();
56
return allDays[todayDay];
67
}
78
function getTodayTime(){
9+
const date=new Date();
810
let hours=date.getHours();
911
let mins=date.getMinutes();
1012
let seconds=date.getSeconds();
11-
let ampm=hours>=12 ? "PM":"AM";
12-
if(hours>12) hours-=12;
13+
// let ampm=hours>=12 ? "PM":"AM";
14+
// if(hours>12) hours-=12;
15+
if(hours<12) hours='0'+hours;
1316
if(mins<10) mins='0'+(+mins);
1417
if(seconds<10) seconds='0'+(+seconds);
15-
return hours+" "+ampm+" : "+mins+" : "+seconds;
18+
let currentTime=hours+" "+" : "+mins+" : "+seconds;
19+
document.getElementById('showDate').innerHTML=currentTime;
1620
}
17-
console.log("Today is :",getTodayDay());
18-
console.log("Current Time is :",getTodayTime());
21+
22+
setInterval(() => {
23+
getTodayTime()
24+
}, 1000);
25+
// console.log("Today is :",getTodayDay());
26+
// console.log("Current Time is :",getTodayTime());
27+

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /