This repository was archived by the owner on Jul 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathtask8.html
106 lines (95 loc) · 2.69 KB
/
task8.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
<!DOCTYPE html>
<html>
<head>
<title>Task 8</title>
<style>
.image-container {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.image-container img {
width: 50%;
transition: border 0.4s;
}
.image-container img:hover {
border: 5px solid blue;
}
.modal {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
z-index: 1;
visibility: hidden;
opacity: 0;
transition: opacity 0.5s;
}
.modal.active {
visibility: visible;
opacity: 1;
}
.modal-content {
background-color: white;
padding: 15px;
border-radius: 10px;
box-shadow: 0px 0px 10px black;
max-width: 500px;
}
.modal-header {
text-align: center;
font-weight: bolder;
font-size: 25px;
margin-bottom: 10px;
}
.modal-footer {
text-align: right;
margin-top: 10px;
}
.close {
background-color: grey;
color: white;
}
.downl {
background-color: blue;
color: white;
}
</style>
</head>
<body>
<div class="image-container">
<img src="https://github.com/CC-BHU/web-development/blob/main/assets/images/task8.jpg?raw=true" alt="red dahlia" onclick="openModal()">
</div>
<div class="modal" id="modal">
<div class="modal-content">
<div class="modal-header"> Red Dahlia Flower </div>
<div class="modal-body">
<p>The Red Dahlia flower is a stunning and vibrant flower known for its rich, deep red color. It belongs to the Dahlia genus, which includes a wide variety of flowers in different shapes, sizes and colors. The red Dahlia is particularly captivating due to its bold and intense hue.</p>
</div>
<div class="modal-footer">
<button class="close" onclick="closeModal()">Close</button>
<button class="downl" onclick="downloadImage()">Download</button>
</div>
</div>
</div>
<script>
function openModal() {
const modal = document.getElementById("modal");
modal.classList.add("active");
}
function closeModal() {
const modal = document.getElementById("modal");
modal.classList.remove("active");
}
function downloadImage() {
const imageSrc = "https://github.com/CC-BHU/web-development/blob/main/assets/images/task8.jpg?raw=true";
window.location.href = imageSrc;
}
</script>
</body>
</html>