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 Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

  <div class="row ">
      <div id="tipContainer" class="small-10 medium-6 small-centered card tip columns animated ">

        <div class="media-object">
          <div class="media-object-section">
            <div class="thumbnail">
               <img id="avatar" class="avatar" src="" width="120" height="120">
                   <a href="#" class="button expanded">3/1</a>
          <div class="media-object-section">
            <div class="racingTipsList animated fadeIn"></div>


<div id="placeholder" class"parent">
          <p class="child subheader">There are no tips at the moment.</p>
  background: url('https://www.toptal.com/designers/subtlepatterns/patterns/squared_metal.png');

.tip {
  padding: 1em;
 // border-radius: 8px;
  background-color: #fff;
 box-shadow: 0px 0px 2px 4px #ccc;

.parent {
  position: relative;

.avatar {
  background-color: #ccc;

.child {
  width: 300px;
  height: 100px;
  padding: 20px;

  position: absolute;
  top: 50%;
  left: 50%;

  margin: -70px 0 0 -170px;

blockquote {
  background: #f9f9f9;
  border-left: 10px solid #ccc;
  margin: 1.5em 0px;
  padding: 0.5em 10px;
  quotes: "\201C""\201D""\2018""\2019";
  font-size: 18px;
blockquote:before {
  color: #ccc;
  content: open-quote;
  font-size: 4em;
  line-height: 0.1em;
  margin-right: 0.25em;
  vertical-align: -0.4em;
blockquote p {
  display: inline;
              var newList = [];
var initialDataLoaded = false;

// Initialize Firebase
var config = {
  apiKey: "AIzaSyBJNIl1BI_u7gYZ9-ZziEfyIgYG5z5w_Bs",
  authDomain: "prototypes-8c972.firebaseapp.com",
  databaseURL: "https://prototypes-8c972.firebaseio.com",
  storageBucket: "prototypes-8c972.appspot.com",
  messagingSenderId: "138505801580"

// New Firebase
var racecardDB = firebase.database().ref('racecard-tip');
var racecardRef = racecardDB.limitToLast(1);//limit to last

// Form as a JSON
$(document).ready(function() {
// Check for change & list Items
racecardRef.on("child_added", function(snapshot, prevChildKey) {
if (initialDataLoaded) {
  var tipsArray = snapshot.val();

    for (var prop in tipsArray){
        var str = '';
        var tipTime = moment.utc(tipsArray.tiptime).local().startOf('minute').fromNow();
    str += '<div><h5><a href="http://www.williamhill.com">' + tipsArray.race + " " + tipsArray.meeting + " - " + tipsArray.horse + '</a></h5><blockquote>' + tipsArray.tip + '<cite>, '+ tipsArray.pundit + ", " + tipTime +'</cite></blockquote>' + '</div>'
  //Switch image
  switch(tipsArray.pundit) {
    case "Mark Walton":
        img = "https://s3-us-west-2.amazonaws.com/s.cdpn.io/91318/mark-walton.jpg";
    case "Paddy Aspell":
        img =  "https://s3-us-west-2.amazonaws.com/s.cdpn.io/91318/paddy-aspell.jpg"
    case "Rory Delargy":
        img =  "https://s3-us-west-2.amazonaws.com/s.cdpn.io/91318/rory-delargy.jpeg"
        img = "http://placehold.it/120x120"
  $('#avatar').attr('src', img);
 // Animate In the content
  $('#placeholder').fadeOut( "slow" );
    // Create the list in HTML
} else{

racecardRef.once('value', function(snapshot) {
  initialDataLoaded = true;

🕑 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.