Random Quote Generator
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 Jessica Pittman on 28 October 2022, Friday.
Random Quote Generator - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Random Quote Generator</title> <!DOCTYPE html>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Patua+One|Merriweather" rel="stylesheet"> <link rel='stylesheet prefetch' href='https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css'>
<link rel='stylesheet prefetch' href='https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div id="container"> <h1 class="tada animated"> Random Quotes </h1> <div id="q-container"> <div class="q-left">“</div> <div class="q-holder"> <span id="quote"></span><span id="author"></span> </div> <div class="q-right">”</div> </div> <div class="newQuoteButton"><span style="float: left; margin-left: 42px;"><button id="tweetQuote" class="tweet"><i class="ion-social-twitter"></i> Tweet me</button></span><button title="New Quote" id="newQuote"><i class="ion-loop" aria-hidden="true"></i></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>
Random Quote Generator - Script Codes CSS Codes
* { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;
}
body { background: #580784; background-image: url(http://i64.tinypic.com/2re5oxk.jpg); background-blend-mode: screen;
}
#container { margin-top: 25vh; width: 100%;
}
h1 { font-weight: 200; margin: 0 auto; color: #3E1255; font-family: 'Patua One', cursive; font-size: 34px; text-align: center;
}
#q-container { padding-top: 5px; max-width: 420px; width: 100%; display: flex; margin: 0 auto;
}
.q-right,
.q-left { display: inline-block; font-size: 80px; font-weight: bold; color: #3E1255; max-width: 40px; width: 100%; height: 60px; overflow: hidden;
}
.q-left { padding-left: 8px; margin-top: -25px;
}
.q-right { position: relative; margin-top: 115px; margin-left: -15px; z-index: 2;
}
.q-holder { position: relative; border-radius: 10px; padding: 10px; max-width: 340px; width: 100%; height: 150px; display: inline-block; background: #BDABC7; font-size: 18px; font-family: 'Merriweather', serif; color: #7A3A9D; vertical-align: top;
}
#quote { display: block;
}
#author { font-size: 12px; display: block; font-style: italic; position: absolute; bottom: 20px; right: 10px;
}
#author:before { content: "- "; font-style: none;
}
.tweet { color: #3E1255; font-size: 10px; font-family: Merriweather, serif; font-weight: 700; text-transform: uppercase; }
.tweet i { font-size: 12px; }
.newQuoteButton { color: #3E1255; margin: 0 auto; max-width: 420px; width: 100%; text-align: right; padding-right: 55px; margin-top: -20px;
}
Random Quote Generator - Script Codes JS Codes
window.onload = randomQuote();
function getQuote() { randomQuote();
}
function randomQuote() { var quotes = [{ text: "Fear is a place where you just tell the truth.", author: "Clive Barker" }, { text: "Wasted youth is better by far the a wise and productive old age.", author: "Meatloaf" }, { text: "Seek the truth, no matter where it lies.", author: "Metallica" }, { text: "The foolish man think with narrow mind and speak with wide mouth.", author: "Charlie Chin" }, { text: "There is no knowledge that is not power.", author: "Mortal Kombat 3" }, { text: "We've got far too many hung juries and not enough hung defendants.", author: "Dennis Miller" }, { text: "Conservatives want live babies so they can raise them to be dead soldiers.", author: "George Carlin" }, { text: "The strength of the Constitution lies entirely in the determination of each citizen to defend it.", author: "Albert Einstein" }, { text: "Any plan, no matter how poorly conceived, if boldly executed, is better than inaction.", author: "U.S. Infantry Manual" }, { text: "Affection can no more spoil a child than the sun could be put out by a bucket of gasoline.", author: "L. Ron Hubbard" }, { text: "A fanatic is a nut who has something to believe in.", author: "Dean Koontz" }, { text: "Whether or not God exists is not as important as whether a belief in God exists.", author: "Daniel Jackson, SG-1" }, { text: "Those who make peaceful revolution impossible will make violent revolution inevitable.", author: "John F. Kennedy" }, { text: "A tax-supported, compulsory educational system is the complete model of the totalitarian state.", author: "Isabel Paterson" }, { text: "A person's a person, no matter how small.", author: "Dr. Suess" }, { text: "Puritanism: The haunting fear that someone, may be happy.", author: "H. L. Mencken" }, { text: "Man is the only animal that blushes...or needs to.", author: "Mark Twain" }, { text: "Common sense isn't all that common.", author: "Voltaire" }, { text: "Why is it that, as a culture, we are more comfortable seeing two men holding guns than holding hands?", author: "Ernest Gaines" }, { text: "Resist much. Obey little.", author: "Walt Whitman" }, { text: "A patriot must always be ready to defend his country against its government.", author: "Edward Abbey" } ]; var random = quotes[Math.floor(Math.random() * quotes.length)]; document.getElementById("quote").innerHTML = random.text; document.getElementById("author").innerHTML = random.author;
}
function tweetIt() { var phrase = "\"" + document.getElementById('quote').innerText + "\"" + ' - ' + document.getElementById('author').innerText; var tweetUrl = 'https://twitter.com/intent/tweet?hashtags=quotes&text=' + encodeURIComponent(phrase); window.open(tweetUrl);
}
var displayNewQuote = document.getElementById('newQuote');
displayNewQuote.addEventListener('click', getQuote);
var tweetQuote = document.getElementById('tweetQuote');
tweetQuote.addEventListener('click', tweetIt);
![Random Quote Generator - Script Codes](http://shots.codepen.io/jessikuh/pen/PGEbJL-512.jpg)
Developer | Jessica Pittman |
Username | jessikuh |
Uploaded | October 28, 2022 |
Rating | 3 |
Size | 3,909 Kb |
Views | 20,240 |
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 |
Wikipedia Viewer | 2,212 Kb |
Tribute Page | 3,087 Kb |
Personal Portfolio | 3,389 Kb |
Font Combinations | 1,640 Kb |
A Pen by Jessica Pittman | 2,123 Kb |
Control Group Heating | 3,470 Kb |
Wedding | 4,650 Kb |
Thunderbird Resort | 3,328 Kb |
Line Graph | 4,374 Kb |
Commissioned Skin | 2,399 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 Huan Nghiem | Nightshade | 10,646 Kb |
Gradient-ui-button-mark-fx | Tabspace | 1,881 Kb |
Login-ng-modal | Heedoo | 3,566 Kb |
Portfolio Layout Flex | Lahvjal | 3,489 Kb |
Custom Select Element | Agrayson | 3,616 Kb |
STAR WARS LIGHTSABER | Francoiscoron | 4,420 Kb |
Guidepopup | Wooljs | 3,747 Kb |
Ipad Mini Showcase | Hornebom | 10,479 Kb |
Flip test | Madhes | 1,635 Kb |
Simple Weather App | Cmwebby | 0 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!