Random Quote Generator

Developer
Size
2,674 Kb
Views
10,120

How do I make an random quote generator?

What is a random quote generator? How do you make a random quote generator? This script and codes were developed by Jimmy Lin on 11 December 2022, Sunday.

Random Quote Generator Previews

Random Quote Generator - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Random Quote Generator</title> <link rel='stylesheet prefetch' href='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet">
<div class="container-fluid"> <div> <div class="text-center"> <h1> Random Quote Generator</h1>
<br/> <button class="btn btn-default" type="submit" id="newQuote"> New Quote </button> <a href="a" class="btn btn-default" id="tweet">Tweet Out</a> </div> <br/> <br/>
<div class="quotes text-center"> <span class="quote"></span> <br/> <span class="author"></span> </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>

Random Quote Generator - Script Codes CSS Codes

body { font-family: Times New Roman;
}
h1 { font-family: Lobster;
}
.quotes { border-color: grey; border-radius:5px; border-style: solid; margin-right:auto; margin-left:auto; margin-top:20px; width:33%; padding:20px; height:auto;
}
.quote{ font-size:30px;
}
.author{ font-size:20px; font-style:italic; padding-left:50px;
}

Random Quote Generator - Script Codes JS Codes

$(document).ready(function(){ var randomQuote; var randomAuthor; var randomNum; var author; getQuote(); function getQuote(){ var quotes = ["We're not gonna die. We can't die, Bendis. You know why? Because we are so...very...pretty. We are just too pretty for God to let us die.", "Ten percent of nuthin' is...let me do the math here...nuthin' into nuthin'...carry the nuthin'...", "No power in the 'verse can stop me", "I'm a leaf on the wind- watch how I soar", "You know, with the exception of one deadly and unpredictable midget, this girl is the smallest cargo I've ever had to transport. Yet by far the most troublesome. Does that seem right to you?", "Can't stop the signal, Mal. Everything goes somewhere, and I go everywhere.", "Shiny. Let's be bad guys.", "Time for some thrilling heroics.", "When you can't run, you crawl, and when you can't crawl - when you can't do that... You find someone to carry you"] var author = ["Malcom Reynolds", "Jayne", "River", "Wash", "Early", "Mr. Universe", "Jayne", "Jayne", "Tracey/Zoey"] randomNum = Math.floor((Math.random()*quotes.length)); randomQuote = quotes[randomNum]; randomAuthor = author[randomNum]; $(".quote").text( "''"+ randomQuote+"''"); $(".author").text("- " +randomAuthor); } $("#newQuote").on("click", function(){ getQuote(); }); $("#tweet").on("click", function() { window.open("https:twitter.com/intent/tweet?text=" +randomQuote+ " " + randomAuthor); });
});
Random Quote Generator - Script Codes
Random Quote Generator - Script Codes
Home Page Home
Developer Jimmy Lin
Username odylic
Uploaded December 11, 2022
Rating 3
Size 2,674 Kb
Views 10,120
Do you need developer help for Random Quote Generator?

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!

Jimmy Lin (odylic) Script Codes
Create amazing love letters 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!