Skip to content
This repository was archived by the owner on Dec 15, 2020. It is now read-only.

added Bootstrap, jQuery and Random Quote #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 31 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
<!DOCTYPE html>
<html>
<head>

<title>One PR A Day</title>
<meta name="viewport" content="width=device-width,initial-scale=1" />

<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:400,600|Patua+One">
<link rel="stylesheet" type="text/css" href="stylesheets/styles.css">

<!-- Latest compiled and minified CSS -->
<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://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</head>

<body>

<!-- Non-breaking spaces between "pull request" and "this project" so automatic line breaks don't split those up
(improves legibility, especially on small devices) -->
<h1>I will be accepting up to one pull&nbsp;request per day on <a href="https://github.com/thepracticaldev/1pr">this&nbsp;project</a>.</h1>
Expand All @@ -25,8 +24,33 @@ <h1>I will be accepting up to one pull&nbsp;request per day on <a href="https://
</ul>

</main>



<!-- Quote starts -->
<div class="container quote">
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">Random Quote</h3>
</div>
<!-- /.panel-heading -->
<div class="panel-body">
<div id="res">
<blockquote>
<p id="quote"></p>
<footer>by <cite title="Source Title" id="quote_author"></cite></footer>
</blockquote>
</div>
<!-- /#res -->
</div>
<!-- /.panel-body -->
<div class="panel-footer no-margin-center">
<button id="generate_quote" class="btn btn-primary">Try another!</button>
</div>
<!-- /.panel-footer -->
</div>
<!-- /.panel -->
</div>
<!-- /.container -->
<!-- Quote ends -->
<div id="contributors-container">

<h4>A project by</h4>
Expand All @@ -37,5 +61,6 @@ <h4>A project by</h4>
</div>

<script src="scripts/contributors.js" async></script>
<script src="scripts/quote.js" async></script>
</body>
</html>
18 changes: 18 additions & 0 deletions scripts/quote.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
$(document).ready(function() {
$("#res").hide();
function generate_quote() {
$api_link = "http://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=jsonp&jsonp=?";
$.getJSON($api_link, function(data) {
$quote = data.quoteText;
$quote_author = data.quoteAuthor;
$("#quote").html($quote);
$("#quote_author").html($quote_author);
});
}
$("#generate_quote").on("click", function() {
$("#res").show('slow');
generate_quote();
});
$("#res").show('slow');
generate_quote();
})
13 changes: 12 additions & 1 deletion stylesheets/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,18 @@ h1 {
}



/* Random Quote */
.quote{
margin-top:10px;
margin-bottom:10px;
}
.no-margin-center{
text-align:center;
margin: 0px auto;
}
blockquote {
margin: 0 0 0px;
}


/* Min-width break to add more padding on wider screens */
Expand Down