forked from lingonsaft/hacktoberfest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlorem-picsum.html
37 lines (34 loc) · 1.36 KB
/
lorem-picsum.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
<!DOCTYPE <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Lorem Picsum</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"/>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<link rel="stylesheet" type="text/css" media="screen" href="styles.css" />
</head>
<body>
<div class="header">
<h1>Lorem Picsum</h1>
<h2>Get random pictures</h2>
</div>
<div class="picsum">
<img id="pic" src="https://picsum.photos/500/500/?random" style="height: 500px; width: 500px; border: 1px solid black"/>
<br/>
</div>
<div class="footer">
<a class="btn btn-primary" onclick="getPicsum()">Get Picsum</a>
</div>
<script>
function getPicsum() {
let pic = document.querySelectorAll("#pic")[0];
if (pic != null) {
pic.src = "";
pic.src = "https://picsum.photos/500/500/?random";
}
}
</script>
</body>
</html>