Random Quote Machine

Developer
Size
1,924 Kb
Views
4,048

How do I make an random quote machine?

What is a random quote machine? How do you make a random quote machine? This script and codes were developed by Mfcastro on 20 January 2023, Friday.

Random Quote Machine Previews

Random Quote Machine - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Random Quote Machine </title> <link rel='stylesheet prefetch' href='http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css'>
</head>
<body> <div class="container"> <div class=""> <button class="btn btn-default" id="quote">Generate Quote</button> </div> <div class="jumbotron" id="quoteMachine"> </div>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/mathjs/2.4.1/math.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Random Quote Machine - Script Codes JS Codes

$(document).ready(function(){ function getRandomArbitrary(min, max) { return Math.random() * (max - min) + min;
}
var rando = getRandomArbitrary(0, 10);
$("#quote").click(function() { randQ(); function randQ() { if (rando >= 9) { return $("#quoteMachine").replaceWith("<div class ='jumbotron' id='quoteMachine'><blockquote><h1>Life is what you make it! </h1><footer>Marco</footer></blockquote></div>"); } else if (rando >= 8) { return $("#quoteMachine").replaceWith("<div class ='jumbotron' id='quoteMachine'><blockquote><h1>It is what it is! </h1><footer>Marco</footer></blockquote></div>"); } else if (rando >= 7) { return $("#quoteMachine").replaceWith("<div class ='jumbotron' id='quoteMachine'><blockquote><h1>Why not you! </h1><footer>Marco</footer></blockquote></div>"); } else if (rando >= 6) { return $("#quoteMachine").replaceWith("<div class ='jumbotron' id='quoteMachine'><blockquote><h1>Gosh am I tired! </h1><footer>Marco</footer></blockquote></div>"); } else if (rando >= 5) { return $("#quoteMachine").replaceWith("<div class ='jumbotron' id='quoteMachine'><blockquote><h1>Look at you programming and stuff! </h1><footer>Marco</footer></blockquote></div>"); } else if (rando >= 4) { return $("#quoteMachine").replaceWith("<div class ='jumbotron' id='quoteMachine'><blockquote><h1>wowza! </h1><footer>Marco</footer></blockquote></div>"); } else if (rando >= 3) { return $("#quoteMachine").replaceWith("<div class ='jumbotron' id='quoteMachine'><blockquote><h1>I love you Emily! </h1><footer>Marco</footer></blockquote></div>"); } else if (rando >= 2) { return $("#quoteMachine").replaceWith("<div class ='jumbotron' id='quoteMachine'><blockquote><h1>I have a headache! </h1><footer>Marco</footer></blockquote></div>"); } else if (rando >= 1) { return $("#quoteMachine").replaceWith("<div class ='jumbotron' id='quoteMachine'><blockquote><h1>I hate this place! </h1><footer>Marco</footer></blockquote></div>"); } else { return $("#quoteMachine").replaceWith("<div class ='jumbotron' id='quoteMachine'><blockquote><h1>All done! </h1><footer>Marco</footer></blockquote></div>"); } }
});
});
Random Quote Machine - Script Codes
Random Quote Machine - Script Codes
Home Page Home
Developer Mfcastro
Username marcocastro
Uploaded January 20, 2023
Rating 3
Size 1,924 Kb
Views 4,048
Do you need developer help for 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!

Mfcastro (marcocastro) Script Codes
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!