A Pen by Zoran Stanic on CodePen.
Created
November 11, 2016 00:16
-
-
Save pilgrim011/17162efb04a8b71fa2e37985e66bfe5d to your computer and use it in GitHub Desktop.
randomQuotes2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<link rel="stylesheet" type="text/css" | |
href="https://fonts.googleapis.com/css?family=Tangerine"> | |
</head> | |
<body> | |
<div class="container-fluid text-center"> | |
<h1> | |
Random Quotes Machine | |
</h1> | |
<p> | |
My favourite quotes | |
</p> | |
<button class="btn btn-default" type="submit">New Quote</button> | |
<div class="quotes"> | |
<span class="quote"> | |
<h3>Ovo je citat</h3> | |
<h5>Ovo je autor</h5> | |
</span> | |
<a class="twitter-share-button" target="_blank" | |
href="https://twitter.com/share"> | |
<button type="button" class="btn btn-primary">Tweet this!</button> | |
</a> | |
</div> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
$("button").on("click", function(){ | |
$.getJSON("https://jsonp.afeld.me/?url=http://quotes.stormconsultancy.co.uk/random.json?callback=",function(a) { | |
$(".quote").html("<h3>" + a.quote + "</h3>" + "<h5>" + a.author + "</h5>"); | |
}); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
background-color:black; | |
} | |
h1{ | |
color:white; | |
font-family:Tangerine; | |
font-size:50px; | |
} | |
p{ | |
color:white; | |
font-family:Tangerine; | |
font-style:italic; | |
font-size:25px; | |
} | |
.quotes{ | |
background-color:black; | |
width:33%; | |
margin-left:auto; | |
margin-right:auto; | |
border-color:white; | |
border-style:solid; | |
border-radius:5px; | |
margin-top:20px; | |
padding:20px; | |
height:auto; | |
color:white; | |
} | |
.quote{ | |
font-size:30px; | |
} | |
.author{ | |
font-size:20px; | |
font-style:italic; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment