FreeCodeCamp : Build a Random Quote Machine
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 - 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);
}
Developer | Markku Lehmonen |
Username | SharpDal |
Uploaded | November 30, 2022 |
Rating | 3 |
Size | 2,483 Kb |
Views | 10,120 |
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!
Name | Size |
A Pen by Markku Lehmonen | 7,804 Kb |
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!
Name | Username | Size |
A Pen by utcwebdev | Utcwebdev | 2,856 Kb |
Main page display | BarryKe | 4,562 Kb |
CMP5-Opdracht15 | SannevanGastel | 2,733 Kb |
Funny menu | AxeLVaisper | 4,671 Kb |
The Monty Hall Problem | Melatonind | 4,360 Kb |
Sticky menu on scroll | Senff | 2,869 Kb |
Masonry | Uriuriuriu | 5,005 Kb |
ABVI Menu Discarded | Overdrivemachines | 3,607 Kb |
3D flipping card | Ssaakkaa | 2,238 Kb |
About Us | Francescaedits | 1,902 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!