Random Quote generator

Developer
Size
2,637 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 Michael on 26 October 2022, Wednesday.

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://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <body> <div class= "container fluid" id=""> <div class= "jumbotron"> <blockquote class="blockquote"> <p class="m-b-0" id="quote">Click the new quote button to change quotes </br> - Author.</p> </blockquote> </div> <button type='button' class="btn btn-primary btn-lg" id="btn">New Quote</button> </div> <div class="twitter button-big social"> <i class="fa fa-twitter"></i>
</div>
<div class="facebook button-big social"> <i class="fa fa-facebook"></i>
</div>
</body> <script src='https://code.jquery.com/jquery-2.2.4.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Random Quote generator - Script Codes CSS Codes

@import url("//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css");
/* div styles for presentation */
.social
{ border-right: 5em; margin-bottom: 0.2em; margin-left: 0.2; margin-right: 5em; background-color: #ecf0f1; float: right;
}
/* General rule */
.button-big
{ font-size: 2.5em; width: 4em; text-align:center; padding: 0.2em 0em 0.2em 0em;
}
/* Twitter class and animation */
.twitter
{ color: #0096ff; border: 1px solid #0096ff;
}
.twitter:hover
{ animation: twitterAnim 0.4s normal forwards linear; -webkit-animation: twitterAnim 0.4s normal forwards linear;
}
@keyframes twitterAnim { 50% { background-color: #0096ff; } 100% { background-color: #0096ff; border: 1px solid #0096ff; color: #fff; }
}
@-webkit-keyframes twitterAnim { 50% { background-color: #0096ff; } 100% { background-color: #0096ff; border: 1px solid #0096ff; color: #fff; }
}
/* Facebook class and animation */
.facebook
{ color: #3B5998; border: 1px solid #3B5998;
}
.facebook:hover
{ animation: facebookAnim 0.4s normal forwards linear; -webkit-animation: facebookAnim 0.4s normal forwards linear;
}
@keyframes facebookAnim { 50% { background-color: #3B5998; } 100% { background-color: #3B5998; border: 1px solid #3B5998; color: #fff; }
}
@-webkit-keyframes facebookAnim { 50% { background-color: #3B5998; } 100% { background-color: #3B5998; border: 1px solid #3B5998; color: #fff; }
}
/* Links */
a
{ color: #9b59b6; text-decoration: none;
}

Random Quote generator - Script Codes JS Codes

$(document).ready(function(){ $('button').on('click',function(){ $.getJSON("https://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1&callback=", function(a) { $("#quote").html(a[0].content + "<p>&mdash; " + a[0].title + "</p>") $.ajaxSetup({ cache: false }) function randomColor() { var c = "#"; for (var i = 0; i < 6; i++) { c += (Math.random() * 16 | 0).toString(16); } return c; } //function returns random hexadecimals that represent colors document.getElementById("quote").style.color = randomColor(); document.getElementById("btn").style.backgroundColor = randomColor(); });//get a new json everytime. });// on-click function .
}); // getting the document ready .
Random Quote generator - Script Codes
Random Quote generator - Script Codes
Home Page Home
Developer Michael
Username buffmike
Uploaded October 26, 2022
Rating 3
Size 2,637 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!

Michael (buffmike) Script Codes
Name
A Pen by michael
Prince Legend
React
Portfolio.
Weather App
Wiki search
Vue1
Create amazing Facebook ads 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!