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
93 lines (79 loc) · 1.89 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Modal</title>
</head>
<style>
img {
display: block;
margin-left: auto;
margin-right: auto;
width: 50%;
margin-top: 10%;
border-radius: 15px;
}
img:hover {
border: 8px violet;
border-style: ridge;
}
.mod-con {
display: block;
background-color:white;
width: 800px;
box-shadow:0 6 10 ;
border-radius: 10px;
text-align: center;
border: solid black 0.05px;
box-shadow: 10px 5px 5px black;
padding: 10px;
}
.mod{
display: none;
position: absolute;
top: 50%;
left: 20%;
}
#close{
color: white;
background-color: gray;
border-radius: 5px;
}
#down{
color: white;
background-color: rgb(5, 138, 190);
border-radius: 5px;
}
</style>
<body>
<div id="img">
<img src="https://raw.githubusercontent.com/CC-BHU/web-development/main/assets/images/task8.jpg"
alt="Image Not found" onclick="popupfun()">
</div>
<div id="modal" class="mod">
<div class="mod-con">
<h2>Red Dahlia Flower</h2>
<p>This is a rare Flower</p>
<button id="close" onclick="closeFunction()">Close</button>
<button id="down" onclick="downloadImage()">Download</button>
</div>
</div>
</body>
<script>
var model = document.getElementById("modal");
var img = document.getElementById("img");
var close = document.getElementById("close");
function closeFunction() {
model.style.display = "none";
}
img.onclick = function () {
model.style.display = "block";
}
function downloadImage() {
const imageSrc = "https://github.com/CC-BHU/web-development/blob/main/assets/images/task8.jpg?raw=true";
window.location.href = imageSrc;
}
</script>
</html>