FreeCodeCamp : Build a Random Quote Machine

Size
2,483 Kb
Views
10,120

How do I make an freecodecamp : build a random quote machine?

What is a freecodecamp : build a random quote machine? How do you make a freecodecamp : build a random quote machine? This script and codes were developed by Markku Lehmonen on 30 November 2022, Wednesday.

FreeCodeCamp : Build a Random Quote Machine Previews

FreeCodeCamp : Build a Random Quote Machine - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>FreeCodeCamp : Build a Random Quote Machine</title> <link rel='stylesheet prefetch' href='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css'>
<link rel='stylesheet prefetch' href='https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="container-fluid centerVertically"> <div class="quotePanel panel panel-default center-block"> <div class="quoteContainer panel-body"> <blockquote class="blockquote-reverse"> <p><i id="quoteText"></i></p> <footer><cite id="quoteAuthor" title="Source Title"></cite></footer> </blockquote> </div> <div class="panel-footer"> <button id="btnTweet" class="btn btn-default"><i class="fa fa-twitter" aria-hidden="true"></i></button> <button id="btnNewQuote" class="btn btn-default pull-right">New Quote</button> </div> </div>
</div> <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

FreeCodeCamp : Build a Random Quote Machine - Script Codes CSS Codes

body {background-color:#cccccc}
.quotePanel {width:600px;border-color:#999999; }
.quoteContainer {padding:35px 35px 35px 35px;}
.fa-twitter {position:relative; left:-2px; top:0px;}
button {height:35px;}
#btnTweet {width:35px;}
.panel-footer {padding-bottom:30px; padding-left:25px; padding-right:25px;}
.centerVertically {height:100vh;display:flex;align-items:center;}

FreeCodeCamp : Build a Random Quote Machine - Script Codes JS Codes

$(document).ready(function() { getNewQuote(); $("#btnTweet").on("click", tweetQuote); $("#btnNewQuote").on("click", getNewQuote);
});
function getNewQuote() { // Clear cache for getting a new quote every time $.ajaxSetup({ cache: false }); // Get and set a quote from QuotesOnDesign.com $.getJSON("//quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1&callback=", function(a) { $("#quoteText").html(a[0].content); $("#quoteAuthor").html(a[0].title); });
}
function tweetQuote() { var baseURL = "https://twitter.com/intent/tweet?text="; var quoteText = encodeURIComponent( '"' + $("#quoteText").text().trim() + '"' ); var hashTags = encodeURIComponent( " #design #quote #" + $("#quoteAuthor").text().trim().replace(' ', ' #') ); window.open(baseURL + quoteText + hashTags);
}
FreeCodeCamp : Build a Random Quote Machine - Script Codes
FreeCodeCamp : Build a Random Quote Machine - Script Codes
Home Page Home
Developer Markku Lehmonen
Username SharpDal
Uploaded November 30, 2022
Rating 3
Size 2,483 Kb
Views 10,120
Do you need developer help for FreeCodeCamp : Build a Random Quote Machine?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Markku Lehmonen (SharpDal) Script Codes
Name
A Pen by Markku Lehmonen
Create amazing video scripts with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!