-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
117 lines (89 loc) · 1.85 KB
/
index.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
<!DOCTYPE html>
<head>
<title>Chuck norris</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style>
body{
background-color: black;
}
h1{
color:white;
}
p{
color:white;
font-size: 40px;
}
#joke{
color:white;
text-align: center;
}
#button{
align-content: right;
}
.sharp {
border-radius:0;
}
.box{
background-color: rgba(0,0,0,0.75);
width: 100%;
margin-right:auto;
margin-left: auto;
padding: 25px;
vertical-align:middle;
}
.centered {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.carousel-content {
position: absolute;
bottom: 10%;
left: 5%;
z-index: 20;
color: white;
text-shadow: 0 1px 2px rgba(0,0,0,.6);
}
.hero-unit {
background-image:url('../img/chuck-norris-wallpapers.jpg');
background-size:cover;
background-color: #EEEEEE;
min-height: 100%;
height: 100%;
}
html, body {
height: 100%;
</style>
</head>
<body>
<div class="hero-unit height:100%">
<span class="fa fa-quote-left"></span>
<div class="container-fluid centered">
<div class="box">
<br/>
<p id="joke"></p>
<button id="button" class="btn btn-primary sharp pull-right">New joke</button>
<br>
</div>
</div>
</div>
</body>
<script>
$( "#button" ).click(function() {
var myurl= "http://api.icndb.com/jokes/random";
console.log(myurl);
$.ajax({
url : myurl,
dataType : "json",
success : function(parsed_json) {
var everything = "";
everything = "<br>" + parsed_json['value']['joke'] + "<br> <br>";
$("#joke").html(everything);
}
});
});
</script>