cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

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.

            
              <div class="numerator">
  <h1>Live Soccer Matches:</h1>
  <div class="number" id="hundreds" data-num="0">
    <!-- Emmet-generated with .n$@-0*10>.top{$@-0}+.bottom>div{$@-0} -->
    <!-- Could do it in JS -->
    <!-- Not very semantic but don't know how to move the text UP without moving the background -->
    <div class="n9">
      <div class="top">9</div>
      <div class="bottom"><div>9</div></div>
    </div>
    <div class="n8">
      <div class="top">8</div>
      <div class="bottom"><div>8</div></div>
    </div>
    <div class="n7">
      <div class="top">7</div>
      <div class="bottom"><div>7</div></div>
    </div>
    <div class="n6">
      <div class="top">6</div>
      <div class="bottom"><div>6</div></div>
    </div>
    <div class="n5">
      <div class="top">5</div>
      <div class="bottom"><div>5</div></div>
    </div>
    <div class="n4">
      <div class="top">4</div>
      <div class="bottom"><div>4</div></div>
    </div>
    <div class="n3">
      <div class="top">3</div>
      <div class="bottom"><div>3</div></div>
    </div>
    <div class="n2">
      <div class="top">2</div>
      <div class="bottom"><div>2</div></div>
    </div>
    <div class="n1">
      <div class="top">1</div>
      <div class="bottom"><div>1</div></div>
    </div>
    <div class="n0">
      <div class="top">0</div>
      <div class="bottom"><div>0</div></div>
    </div>
  </div>  
  <div class="number" id="tens" data-num="0">
    <!-- Emmet-generated with .n$@-0*10>.top{$@-0}+.bottom>div{$@-0} -->
    <!-- Could do it in JS -->
    <!-- Not very semantic but don't know how to move the text UP without moving the background -->
    <div class="n9">
      <div class="top">9</div>
      <div class="bottom"><div>9</div></div>
    </div>
    <div class="n8">
      <div class="top">8</div>
      <div class="bottom"><div>8</div></div>
    </div>
    <div class="n7">
      <div class="top">7</div>
      <div class="bottom"><div>7</div></div>
    </div>
    <div class="n6">
      <div class="top">6</div>
      <div class="bottom"><div>6</div></div>
    </div>
    <div class="n5">
      <div class="top">5</div>
      <div class="bottom"><div>5</div></div>
    </div>
    <div class="n4">
      <div class="top">4</div>
      <div class="bottom"><div>4</div></div>
    </div>
    <div class="n3">
      <div class="top">3</div>
      <div class="bottom"><div>3</div></div>
    </div>
    <div class="n2">
      <div class="top">2</div>
      <div class="bottom"><div>2</div></div>
    </div>
    <div class="n1">
      <div class="top">1</div>
      <div class="bottom"><div>1</div></div>
    </div>
    <div class="n0">
      <div class="top">0</div>
      <div class="bottom"><div>0</div></div>
    </div>
  </div>
  <div class="number" id="ones" data-num="0">
    <div class="n9">
      <div class="top">9</div>
      <div class="bottom"><div>9</div></div>
    </div>
    <div class="n8">
      <div class="top">8</div>
      <div class="bottom"><div>8</div></div>
    </div>
    <div class="n7">
      <div class="top">7</div>
      <div class="bottom"><div>7</div></div>
    </div>
    <div class="n6">
      <div class="top">6</div>
      <div class="bottom"><div>6</div></div>
    </div>
    <div class="n5">
      <div class="top">5</div>
      <div class="bottom"><div>5</div></div>
    </div>
    <div class="n4">
      <div class="top">4</div>
      <div class="bottom"><div>4</div></div>
    </div>
    <div class="n3">
      <div class="top">3</div>
      <div class="bottom"><div>3</div></div>
    </div>
    <div class="n2">
      <div class="top">2</div>
      <div class="bottom"><div>2</div></div>
    </div>
    <div class="n1">
      <div class="top">1</div>
      <div class="bottom"><div>1</div></div>
    </div>
    <div class="n0">
      <div class="top">0</div>
      <div class="bottom"><div>0</div></div>
    </div>
  </div>
  <p>Via <a href="http://livescore.com" target="_blank">LiveScore.com</a></p>
</div>
            
          
!
            
              html, body { height: 100%; }
h1, p { color: white;}
body
{
  /*  Add noise to remove banding */
  background-image: url(http://i.imgur.com/Dt45LS0.png), radial-gradient(#a0ffa0, #a0e6a0 60%, #a09ca0);
  /* Change size here. There are sometimes rounding errors */
  font-size: 1em;
}
.numerator
{
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  height: 11em;
  text-align: center;
}
.numerator .number
{
  display: inline-block;
  position: relative;
  height: 11em;
  width: 6.563em;
  margin: 0 0.25em;
  transform-style: preserve-3d;
  cursor: default;
  user-select: none;
}
.numerator .number:before,
.numerator .number:after
{
  content: '';
  position: absolute;
  display: inline-block;
  width: 0.813em;
  height: 1.813em;
  top: 50%;
  margin-top: -0.875em;
  z-index: 99;
  transform: translateZ(2em);
}
.numerator .number:before
{
  left: -0.125em;
  box-shadow: -0.126em 0 0.063em -0.063em rgba(0,0,0,0.2);
  background-repeat: no-repeat;
  background-image: 
    linear-gradient(to right, transparent, transparent 0.688em, black 0.688em, black 0.750em, rgba(255,255,255,0.4)),
    linear-gradient(to bottom,
      rgb(0,0,0) 0,
      rgb(146,146,146) 0.063em,        /*  1px */
      rgb(58,58,58) 0.438em,           /*  7px */
      rgb(132,132,132) 0.750em,        /* 12px */
      rgb(132,132,132) 0.813em,        /* 13px */
      rgb(21,21,21) 1.313em,           /* 21px */
      rgb(21,21,21) 1.688em,           /* 27px */
      rgb(0,0,0) 1.750em,              /* 28px */
      rgba(255,255,255,0.05) 1.750em); /* 28px */
  background-size: 0.813em 1.750em, 0.750em 1.813em;
}
.numerator .number:after
{
  right: -0.125em;
  box-shadow: 0.126em 0 0.063em -0.063em rgba(0,0,0,0.2);
  background-repeat: no-repeat;
  background-image: 
    linear-gradient(to left, transparent, transparent 0.688em, black 0.688em, black 0.750em, rgba(255,255,255,0.3)),
    linear-gradient(to bottom,
      rgb(0,0,0) 0,
      rgb(146,146,146) 0.063em,
      rgb(58,58,58) 0.438em,
      rgb(132,132,132) 0.750em,
      rgb(132,132,132) 0.813em,
      rgb(21,21,21) 1.313em,
      rgb(21,21,21) 1.688em,
      rgb(0,0,0) 1.750em,
      rgba(255,255,255,0.05) 1.750em);
  background-size: 0.813em 1.750em, 0.750em 1.813em;
  background-position: 0 0, 0.063em 0;
}
.numerator .number > div
{
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
}
.numerator .number > div .top,
.numerator .number > div .bottom
{
  position: absolute;
  width: 100%;
  height: 50%;
  overflow: hidden;
  left: 0;
  background-image: url(http://i.imgur.com/Dt45LS0.png),
    linear-gradient(124deg,
      rgb(50,60,60),
      rgb(20,28,28));
  border-radius: 0.045em;
  box-shadow: 0 0 0 0.010em black,
    inset 0.010em 0.010em 0 rgba(255,255,255,0.2);
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  font-size: 7em;
  color: white;
  line-height: 1.571em;
  backface-visibility: hidden;
  transition: transform .7s;
  /* I'd like to put perspective but it makes zindex buggy */
}
.numerator .number > div .top
{
  top: -0.007em;
  transform-origin: center bottom;
}
.numerator .number > div .bottom
{
  bottom: -0.007em;
  transform-origin: center top;
  transform: rotateX(180deg);
}
.numerator .number > div .bottom > div
{
  position: relative;
  top: -100%;
}

.numerator .number .n0 .bottom { z-index: 0; }
.numerator .number .n1 .bottom { z-index: 1; }
.numerator .number .n2 .bottom { z-index: 2; }
.numerator .number .n3 .bottom { z-index: 3; }
.numerator .number .n4 .bottom { z-index: 4; }
.numerator .number .n5 .bottom { z-index: 5; }
.numerator .number .n6 .bottom { z-index: 6; }
.numerator .number .n7 .bottom { z-index: 7; }
.numerator .number .n8 .bottom { z-index: 8; }
.numerator .number .n9 .bottom { z-index: 9; }

.numerator .number[data-num="0"] .n0 ~ div .top,
.numerator .number[data-num="1"] .n1 ~ div .top,
.numerator .number[data-num="2"] .n2 ~ div .top,
.numerator .number[data-num="3"] .n3 ~ div .top,
.numerator .number[data-num="4"] .n4 ~ div .top,
.numerator .number[data-num="5"] .n5 ~ div .top,
.numerator .number[data-num="6"] .n6 ~ div .top,
.numerator .number[data-num="7"] .n7 ~ div .top,
.numerator .number[data-num="8"] .n8 ~ div .top,
.numerator .number[data-num="9"] .n9 ~ div .top
{ transform: rotateX(-180deg); }

.numerator .number[data-num="0"] .n1 ~ div .bottom,
.numerator .number[data-num="1"] .n2 ~ div .bottom,
.numerator .number[data-num="2"] .n3 ~ div .bottom,
.numerator .number[data-num="3"] .n4 ~ div .bottom,
.numerator .number[data-num="4"] .n5 ~ div .bottom,
.numerator .number[data-num="5"] .n6 ~ div .bottom,
.numerator .number[data-num="6"] .n7 ~ div .bottom,
.numerator .number[data-num="7"] .n8 ~ div .bottom,
.numerator .number[data-num="8"] .n9 ~ div .bottom,
.numerator .number[data-num="9"] div .bottom
{ transform: rotateX(0); }

.numerator .number[data-num="0"]:hover .n0 .top,
.numerator .number[data-num="1"]:hover .n1 .top,
.numerator .number[data-num="2"]:hover .n2 .top,
.numerator .number[data-num="3"]:hover .n3 .top,
.numerator .number[data-num="4"]:hover .n4 .top,
.numerator .number[data-num="5"]:hover .n5 .top,
.numerator .number[data-num="6"]:hover .n6 .top,
.numerator .number[data-num="7"]:hover .n7 .top,
.numerator .number[data-num="8"]:hover .n8 .top,
.numerator .number[data-num="9"]:hover .n9 .top
{ transform: rotateX(-30deg); }
            
          
!
            
              //$('.numerator .number').on('click', function() {
//  var $t = $(this);
//  $t.attr('data-num', (+$t.attr('data-num') + 1) % 10);
//});
var live_games, games, hundreds, tens, ones;
getLiveScoreData();
var int = setInterval(getLiveScoreData, 10000);

function getLiveScoreData() {
  console.log("Fired off request")
  $.getJSON('https://api.import.io/store/data/3fe68349-d94f-4b74-a60e-952eb5d42176/_query?input/webpage/url=http%3A%2F%2Fwww.livescore.com%2F&_user=8ed92629-06c9-4220-b1ae-37db7ace4625&_apikey=8ed9262906c94220b1ae37db7ace462583d722794076edfeaddd0a38b2bde46cb4549151d7f053199906febdb48f8ba1fd21b01e09fbfee593897ca358a8021843772d460689ae801058b3d1221afafc', function(data) {
    games = data.results.length;
    live_games = data.results.filter(function(el) {
      return el.min_value &&
        el.min_value != "FT" &&
        el.min_value != "AET" && 
        (el.min_value.indexOf("'") > -1 || 
         el.min_value == "Pen" || 
         el.min_value == "HT"
        );
    }).length;
    console.log(live_games);
    hundreds = Math.floor(live_games / (Math.pow(10, 2)) % 10);tens = Math.floor(live_games / (Math.pow(10, 1)) % 10);
    ones = live_games % 10;
    $('#hundreds').attr('data-num', hundreds);
    $('#tens').attr('data-num', tens);
    $('#ones').attr('data-num', ones);    
  });
}
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console