Pen Settings

HTML

CSS

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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

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.

HTML

              
                <header>
  <h5>Inspired by <a target="_blank" href="https://dribbble.com/shots/2228698-Day-003-Quote-Card">Alek Manov's Quote Card</a>
     Powered by <a target="_blank" href="https://quotesondesign.com/">Quotes On Design</a>
  </h5>
</header>

<div class="card shadow">
  <div class="card-inner">
    <p>
    </p>
  </div>
  <h6></h6>
  <div class="next-btn">NEXT</div>
  <div class="btn-wrapper">
    <a class="btn twitter-share-button" href="#" target="_blank">Twitter</a>
    <a class="btn tumblr-share-button" href="#" target="_blank">Tumblr</a>
  </div>
  <div class="info">Enter, Space or Click</div>
</div>

<div class="card shadow">
  <div class="card-inner">
    <p>
    </p>
  </div>
  <h6></h6>
  <div class="next-btn">NEXT</div>
  <div class="btn-wrapper">
    <a class="btn twitter-share-button" href="#" target="_blank">Twitter</a>
    <a class="btn tumblr-share-button" href="#" target="_blank">Tumblr</a>
  </div>
  <div class="info">Enter, Space or Click</div>
</div>

<div class="card active shadow">
  <div class="card-inner">
    <p>Design is easy. All you do is stare at the screen until drops of blood form on your forehead.
    </p>
  </div>
  <h6>- Marty Neumeier</h6>
  <div class="next-btn btns">NEXT</div>
  <div class="btn-wrapper">
    <a class="btn twitter-share-button" target="_blank" href="https://twitter.com/intent/tweet?hashtags=quotes&related=freecodecamp&text=%22Design%20is%20easy.%20All%20you%20do%20is%20stare%20at%20the%20screen%20until%20drops%20of%20blood%20form%20on%20your%20forehead.%22%20Marty%20Neumeier">Twitter</a>
    <a class="btn tumblr-share-button" target="_blank" href="https://www.tumblr.com/widgets/share/tool?posttype=quote&tags=quotes,freecodecamp&content=Design%20is%20easy.%20All%20you%20do%20is%20stare%20at%20the%20screen%20until%20drops%20of%20blood%20form%20on%20your%20forehead.&caption=Marty%20Neumeier&canonicalUrl=https%3A%2F%2Fwww.tumblr.com%2Fbuttons&shareSource=tumblr_share_button">Tumblr</a>
  </div>
  <div class="info">Enter, Space or Click</div>
</div>
              
            
!

CSS

              
                body {
    position: relative;
    font-family: 'Della Respira', serif;
    background-color: #e2e1e0;
    font-size: 16px;
    perspective: 2400px;
    overflow-y: scroll;
    background: url('https://pre00.deviantart.net/52ce/th/pre/i/2011/174/b/c/candy_blur_abstract_hd_by_ivereor-d3jsglw.png') no-repeat center center fixed;
    background-size: cover;
}

.shadow {
    box-shadow: 0 19px 70px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22);
}

.card {
    position: absolute;
    left: 50%;
    margin: 10em 0 8em -30em;
    padding: 5em 5em 3em 2em;
    font-size: 16px;
    width: 50em;
    border-radius: 2px;
    background-color: #fff;
    transition: all 1s;
}
.card:nth-child(1) {
    margin-top: 7.4em;
}
.card:nth-child(2) {
    margin-top: 8.6em;
    transform: scale(1.03);
}

.active {
    transform: scale(1.06);
}

.card p {
    padding-bottom: 1em;
    font-size: 2em;
    line-height: 1.45;
}
.card p::before {
    content: open-quote open-quote;
    position: absolute;
    top: -2.6%;
    left: 4.2%;
    margin: 0;
    font-size: 6em;
    color: #16b6df;
}
.card h6 {
    margin: 0 0 0.4em 0;
    font-family: sans-serif;
    font-size: 2em;
    font-weight: bold;
    padding-left: 3.64em;
}

.card-inner {
    margin: 3em;
    padding-left: 4.2em;
    border-left: 2px solid #bbb;
}

.btn-wrapper {
    float: right;
    margin-right: 1.2em;
    line-height: 4.8;
}

.btn {
    font-family: sans-serif;
    margin-right: 0.4em;
    padding: 0.2em 0.4em;
    text-decoration: none;
    border: 1px solid ;
    border-radius: 2px;
    transition: all 0.3s;
}
.twitter-share-button {
    color: #00aced;
    border-color: #00aced;
}
.twitter-share-button:hover {
    color: white;
    background: #00aced;
}
.tumblr-share-button {
    color: #32506d;
    border-color: #32506d;
}
.tumblr-share-button:hover {
    color: white;
    background: #32506d;
}

.next-btn {
    float: right;
    margin-top: 0.2em;
    width: 4em;
    height: 4em;
    border-radius: 50%;
    text-align: center;
    line-height: 4.2;
    color: white;
    cursor: pointer;
    border: 2px solid #16b6df;
    background-color: #16b6df;
    transition: all 0.3s;
}
.next-btn:hover {
    color: #16b6df;
    background-color: white;
}

.info {
    position: absolute;
    right: 2.6em;
    bottom: 1.8em;
    clear: both;
    text-align: right;
    color: #16b6df;
    opacity: 0;
    transition: opacity 0.3s;
}
.show {
    opacity: 1;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    padding: 0 0.6em;

    background-color: rgba(0,0,0,0.30);
    border-bottom-right-radius: 10px;
}
header h5 {
    color: black;
    font-family: sans-serif;
    font-size: 0.8em;
    margin: 1em;
}
header a {
    color: white;
}
              
            
!

JS

              
                $(function () {
    //disable browser cache for this page.
    $.ajaxSettings.cache = false;

    function deUnicodes(str) {
        // this list may not cover all
        return str
            .replace(/(\r\n|\n|\r)/gm,"") // remove newline at the end
            .replace(/&#8217;/g, "'")
            .replace(/&#8211;/g, "-")
            .replace(/&#8212;/g, "-")
            .replace(/&#8221;/g, '"')
            .replace(/&#8220;/g, '"');
    }

    $('.next-btn').on("click", function () {
        var $currentActive = $('.active');
        // flip card animation
        $currentActive.css({ "transform": "rotateX(-62deg) translate3d(0, 100px, 600px)", "opacity": "0" });

        // shuffle last(foreground) card to first(background).
        setTimeout(function () {
            // clean up previous card
            $currentActive.removeClass("active");
            $currentActive.removeAttr("style");
            $currentActive.find('p').html("");
            $currentActive.find('h6').html("");
            $('body').prepend($currentActive);

            // set up next card
            var $nextCard = $('.card:last');
            $nextCard.addClass("active");
            $.getJSON("https://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1", function(a) {
                // this API returns text with <p>...</p> tags and empty space at the end, so we remove them
                var quote = a[0].content.replace(/(<([^>]+)>)/ig,"").trim();
                var author = a[0].title;

                $nextCard.find('p').html(quote);    // Browsers display unicodes fine.
                $nextCard.find('h6').html("- " + author);

                // However Twitter and Tumble don't handle these unicodes.
                var sanitizedQuote = deUnicodes(quote);
                $nextCard.find('.twitter-share-button').attr('href', 
                    'https://twitter.com/intent/tweet?hashtags=quotes&related=freecodecamp&text=' 
                    + encodeURIComponent('"' + sanitizedQuote + '" ' + author));
                $nextCard.find('.tumblr-share-button').attr('href', 
                    'https://www.tumblr.com/widgets/share/tool?posttype=quote&tags=quotes,freecodecamp'
                    + '&content=' + encodeURIComponent(sanitizedQuote) 
                    + '&caption=' + encodeURIComponent(author)
                    + '&canonicalUrl=https%3A%2F%2Fwww.tumblr.com%2Fbuttons&shareSource=tumblr_share_button');
              });
        }, 400);
    });

    $(document).keypress(function(e) {
        // 13 for Enter, 0 or 32 for Space.
        if(e.which == 13 || e.which == 0 || e.which == 32) {    
            $('.active').find('.next-btn').click();
        }
    });

    $('.next-btn').on({
        mouseenter: function () {
            $('.info').addClass("show");
        },
        click: function () {
            $('.info').removeClass("show");
        },
        mouseleave: function () {
            $('.info').removeClass("show");
        }
    });
});
              
            
!
999px

Console