Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


    <!-- FIRST LINE for the CSS files -->
    <link href="|Orbitron" rel="stylesheet">
<!--     <link href="" rel="stylesheet"> -->
    <link href="RandomQuoteMachine.css" rel="stylesheet" type="text/css">
    <div class="container-fluid">
        <div class="row">
            <div class="col-xs-8 col-xs-offset-2">
                <div class="well center-block">
                    <h1 id="quotes"></h1>
                    <h2 id="character-movie"></h2>
                    <div class="footer">
                        <button id="newQuote" class="btn btn-primary btn-responsive">NEW QUOTE</button>
                        <!--<button id="newImage" class="btn btn-primary btn-responsive">NEW IMAGE</button>-->
                        <button id="tweetQuote" class="btn btn-primary btn-responsive">TWEET QUOTE</button>
    <!--or just add the JS directly to the HTML file, that's ok, right?-->
        window.onload = function () {
        // Get random quote
        document.getElementById("newQuote").onclick = getQuotes;
        //  Get new image
        // document.getElementById("newImage").onclick = getImage;
        // Tweet the quote
        document.getElementById("tweetQuote").onclick = tweetQuote;

        function fetchQuotes(callback) {
            // arnold json gist
            const endpoint =
                // fetch gist
                .then(blob => blob.json())
                .then(data => callback(data));
        // callback for quotes promise
        function getQuotes() {
            fetchQuotes(function (quotes) {
                // get random quote from JSON 
                const quoteID = getRandomInt(1, 100);
                // get json data
                var quoteStr = quotes[quoteID].quote
                var characterMovieStr = quotes[quoteID].character + ' - ' + quotes[quoteID].movie
                var para = document.createElement("p");
                var node = document.createTextNode(quoteStr);
                var element = document.getElementById("quotes");
                para = document.createElement("p");
                node = document.createTextNode(characterMovieStr);
                element = document.getElementById("character-movie");

        function getRandomInt(min, max) {
            return Math.floor(Math.random() * (max - min + 1)) + min;

        // function getImage() {
        //     display_random_image();
        // }

        function tweetQuote() {
            var quoteStr = document.getElementById("quotes").innerText + ' - ' +
                document.getElementById("character-movie").innerText + ' %23arniequotes';
  "" + quoteStr);

        function clearBox() {
            document.getElementById("quotes").innerHTML = "";
            document.getElementById("character-movie").innerHTML = "";
    <!-- LAST LINE for the JavaScript file -->


                /*.container {
    color: #000000;
    left: 50%;
    margin: auto;
    overflow: hidden;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 640px;

div.row {
    margin: 100px 0;

.footer {
    display: flex;
    justify-content: space-between;
    /* ^^ this!! for the longest time!!! couldnt even!*/
    padding: 0 1px 1px;
    position: relative;

h1 {
    font-family: Orbitron, monospace;

h2 {
    font-family: Kanit, monospace;

#newQuote {
    white-space: normal;
#newImage {
    white-space: normal;
#tweetQuote {
    white-space: normal;


                // JavaScript is in the HTML file