-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtask.html
206 lines (170 loc) · 4.53 KB
/
task.html
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Ananthan R</title>
<style>
/* code for splitting window into sections*/
.splitH {
height: 100%;
width: 50%;
position: fixed;
z-index: -1;
top: 0;
overflow-x: hidden;
padding-top: 20px;
}
.splitV {
height: 50%;
width: 50%;
position: fixed;
z-index: -1;
left: 0;
overflow-x: hidden;
padding-top: 20px;
}
.top {
top: 0;
background-color: #fdbb2d;
}
.bottom {
bottom: 0;
background-color: green;
}
.left {
left: 0;
}
.right {
right: 0;
background-color: #00d4ff;
}
/*styleing various elemnets*/
.digit {
font-size: 50px;
color: #fff;
text-align: center;
z-index: 1;
}
.txt {
font-size: 30px;
color: #fffcd6;
text-align:center;
bottom:0;
}
.btn {
width: 50px;
cursor: pointer;
font-size: 10px;
transition: 0.5s;
color: white;
font-weight: 500;
background-color: aqua;
}
.img2 {
display:block;
margin-left: auto;
margin-right: auto;
width : 50%;
}
.txt2{
text-align: center;
font-size: 20px;
color:#fff;
}
.image-container {
height: 50%;
width: 50%;
position: fixed;
bottom: 0;
left: 0;
background-color: green;
border: 1px solid #ccc;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
z-index: 9999;
max-width: 80%;
max-height: 80%;
overflow: auto;
}
/* Styling for the close button */
.close-btn {
position: absolute;
top: 5px;
right: 5px;
background-color: #f44336;
color: white;
border: none;
padding: 5px 10px;
cursor: pointer;
}
/* Styling for the image */
.image-container img {
max-width: 100%;
}
</style>
<script>
//function to show the image preview on clicking the button
function showImage() {
let imageContainer = document.createElement("div");
imageContainer.className = "image-container";
let image = document.createElement("img");
image.src = "https://images.pexels.com/photos/3334355/pexels-photo-3334355.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2";
image.height = "314";
image.width = "334";
let closeButton = document.createElement(
"button"
);
closeButton.textContent = "Close";
closeButton.className = "close-btn";
closeButton.onclick =
function () {
document.body.removeChild(imageContainer);
};
imageContainer.appendChild(closeButton);
imageContainer.appendChild(image);
document.body.appendChild(imageContainer);
}
// Set the date we're counting down to
var countDownDate = new Date("Jan 1, 2025 00:00:00").getTime();
// Update the count down every 1 second
var x = setInterval(function() {
// Get today's date and time
var now = new Date().getTime();
// Find the distance between now and the count down date
var distance = countDownDate - now;
// Time calculations for days, hours, minutes and seconds
var days = Math.floor(distance / (1000 * 60 * 60 * 24));
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
// Display the result in the element with id="demo"
document.getElementById("time").innerHTML = days + "d " + hours + "h "
+ minutes + "m " + seconds + "s " ;
// If the count down is finished , show the image
if (distance < 0 ) {
clearInterval(x);
showImage();
}
}, 1000);
</script>
</head>
<body>
<div class="splitH left">
<div class = "splitV top ">
<p id = "time" class = "digit"></p>
<p class = "txt">
Time till New Year 2025
</p>
<p class = "txt">
<button type="button" class = 'btn' id="preview" onclick="showImage()">Preview</button>
</p>
</div>
</div>
<div class="splitH right">
<img src = "https://upload.wikimedia.org/wikipedia/commons/6/6e/Shah_Rukh_Khan_graces_the_launch_of_the_new_Santro.jpg" class="img2" height = "220" width = "315">
<p class="txt"><b>About myself</b></p>
<p class = "txt2"> Name: Ananthan R <br> About Myself: Y24, I am interested in learning new things, so i opted for this project<br> skills: Ready to learn</p>
</div>
</body>
</html>