-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
56 lines (55 loc) · 2.54 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
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/bootstrap/3.3.0/css/bootstrap.min.css">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:800' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="icon" type="image/png" href="electric-light-bulb.png" />
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.11.1.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/seedrandom/2.4.0/seedrandom.min.js"></script>
<script src="zeroclipboard/dist/ZeroClipboard.js"></script>
</head>
<body>
<div class="container-fluid container">
<h1>Inspirationnal Quote Generator</h1>
<h4>Generate fake quotes randomly</h4>
<div class="quote-cont">
<div class="filter">
<div class="quote"></div>
<div class="author"></div>
</div>
</div>
<button class="btn btn-default" onclick="genQuote()">Enlighten Me!</button>
<button class="btn btn-default" id="copy-button" data-clipboard-text="" title="Click to copy me.">Save URL</button>
<footer>2015 - LolVStein/alavit-d - sschvart</footer>
</div>
</body>
<script src="dictionary.js"></script>
<script src="functions.js" ></script>
<script>
Math.seedrandom();
function genQuote() {
$(".quote-cont").css('background-image', 'url("pics/' + rd(pics) + '")');
$(".quote").text(capitalize(rd(gen)() + '.'));
$(".author").text(rd(famous));
$("#copy-button").attr('data-clipboard-text', window.location.hostname + '/quotes/?quote=' + encodeURIComponent($(".quote").text()) + '&author=' + encodeURIComponent($(".author").text()) + '&img=' + encodeURIComponent($(".quote-cont").css('background-image')));
}
$(document).ready(function() {
var client = new ZeroClipboard( document.getElementById("copy-button") );
client.on( "ready", function( readyEvent ) {
client.on( "aftercopy", function( event ) {
} )
} );
var quote = getParameterByName('quote');
var author = getParameterByName('author');
var img = getParameterByName('img');
if (quote && author && img) {
$(".quote-cont").css('background-image', img);
$(".quote").text(quote);
$(".author").text(author)
}
else
genQuote();
});
</script>
</html>