cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


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.

              <html lang="en">
    <meta charset="utf-8">
    <meta content="IE=edge" http-equiv="X-UA-Compatible">
    <meta content="width=device-width, initial-scale=1" name="viewport">
    <!-- Bootstrap says:  The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <title>Random Quote Generator</title>
    <!-- Bootstrap -->
    <link href=
    <link href="css/main.css" rel="stylesheet">
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <link href='https://fonts.googleapis.com/css?family=Cardo:400,400italic'
    rel='stylesheet' type='text/css'>

    <div class="container-fluid">
        <!-- responsive amount of space above the quote panel-->

        <div class="row visible-vs-block vs-spacer-row">

        <div class="row visible-sm-block sm-spacer-row">

        <div class="row visible-md-block md-spacer-row">

        <div class="row visible-lg active lg-spacer-row">
        <!-- The row contains 3 divs.  On either side a blank columnn increases with screen size, center column holds the quote panel and buttons -->
        <div class="row">
            <div class="col-xs-12 col-sm-1 col-md-2 col-lg-3 col-xl-4">

            <div class=
            "col-xs-12 col-sm-10 col-md-8 col-lg-6 col-xl-4 center-block">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title">Waywardpoints

                    <div class="panel-body">
                        <div class="row main-message" id="quote-content">
                            Quotesondesign.com did not respond. Try again.

                        <div class="row attribution" id=
                            <p id="quote-title">Quote source not reachable.</p>

                        <div class="row"><!-- row of buttons-->
                            <div class="col-xs-6" id="tweeter">
                            <div class="col-xs-6">
                                <button class="btn btn-default right-side" id=
                                "get-another-quote-button" name="new-quote"
                                type="button">New Quote</button>
                        <!-- row of buttons ends here-->
            <!-- center-block ends here-->

            <div class="col-xs-12 col-sm-1 col-md-2 col-lg-3 col-xl-4">
    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src=
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src=
    <script src="js/quote-generator.js">
              body {
    font-family: 'Cardo',serif;

.center-item {
    padding: 50px 10% 25%;

.btn {
    height: 28px;
    width: 95px;
    padding: 0px;

.right-side {
    float: right;

.center-block {
    display: block;
    margin-left: auto;
    margin-right: auto;

.vs-spacer-row {
    min-height: 15px;

.sm-spacer-row {
    height: 100px;

.md-spacer-row {
    height: 200px;

.lg-spacer-row {
    min-height: 250px;

.main-message {
    font-size: 1.5em;
    padding: 5% 10%;

.attribution {
    font-weight: 300;
    font-size: smaller;
    padding: 10px 2px;
    text-align: right;

.panel-heading {
    text-align: center;

              $(document).ready(function() //delay everything until page has loaded.
    //	automagically makes the Twitter Button
    ! function(d, s, id)
        var js, fjs = d.getElementsByTagName(s)[0],
            p = /^http:/.test(d.location) ? 'http' : 'https';
        if (!d.getElementById(id))
            js = d.createElement(s);
            js.id = id;
            js.src = p + '://platform.twitter.com/widgets.js';
            fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'twitter-wjs');
    //function provided by quotesondesign.com 
    $('#get-another-quote-button').on('click', function(e)
        $('body').css("background-color", '#' + Math.floor(Math
            .random() * 16777215).toString(16)); //change background color
        e.preventDefault(); // no idea what that does, looks important
            url: 'https://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1',
            success: function(data)
            { //assigns values *after* the quote json is downloaded.
                var post = data.shift(); // The data is an array of posts. Grab the first one.
                $('#quote-title').text(post.title); // is actually the author of the quote
                //Delete any existing tweeter button
                // Make a new twitter share button specific to the quote https://dev.twitter.com/web/tweet-button/javascript-create
                //I tried to change the text property only, but twitter made some sort of security error.
                        text: $('#quote-content > p').text(),
                        size: "large" //28px x 75px
                // If the Source is available, use it. Otherwise hide it.  Not using this right now.  Left here in case I should
                if (typeof post.custom_meta !==
                    'undefined' && typeof post.custom_meta.Source !== 'undefined')
                        'Source:' + post.custom_meta.Source);
            cache: false
    //Load initial quote -- Thanks http://stackoverflow.com/questions/2060019/how-to-trigger-click-on-page-load
    }, 10);
}); //end document ready function
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................