-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
112 lines (84 loc) · 2.05 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
<html>
<head>
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.0/css/materialize.min.css">
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script>
function load(){
$('.wrap').fadeIn(1500);
}
$(function() {
$.getJSON("data.json", function(data) {
window.datas = data;
var leng = datas.length;
var num = Math.floor((Math.random() * leng) + 1);
$data = datas;
var obj = $data[num];
$('#name').html(obj.name);
$('#q').html(obj.quote);
document.getElementById('profile').setAttribute('data', "img/"+obj.num+".svg");
})
.fail(function(err) {
console.log(err.responseText);
alert('Something went wrong');
})
});
</script>
<style>
@font-face {
font-family: font;
src: url(Quote.ttf);
}
body{
font-family: font;
padding:5%;
color:white;
}
#name{
}
.wrap{
display:none;
text-align:center;
}
#q{
}
.quotewrap{
}
.imgwrap{
}
#profile{
height:40vh;
width:auto;
}
.foot{
background-color: rgba(0,59,111, 0.9);
bottom:0;
left:0;
right:0;
position:fixed;
text-align: center;
margin-left: auto;
margin-right: auto;
font-size:2rem;
}
</style>
</head>
<body style="background-color:#003B6F;" onload="load()">
<div class="wrap container">
<div class="imgwrp">
<object id="profile" class="svg"></object>
</div>
<div class="quotewrap">
<h2 id="name"></h2>
<h1 id="q"></h1>
</div>
</div>
<footer class="foot">
<a style="float:right; margin-right:5%;"href="http://thedoctorwho2.deviantart.com/">Image creator</a>
<a style="" href="http://amolle.com/who/form.html">Submit Quote</a>
<a style="float:left;margin-left:5%;"href="http://amolle.com/old">Made by Andreas Molle</a>
</footer>
<!-- Compiled and minified JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.0/js/materialize.min.js"></script>
</body>
</html>