JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.11/vue.js"></script>
<!--
Follow me on
Dribbble: https://dribbble.com/supahfunk
Twitter: https://twitter.com/supahfunk
Codepen: http://codepen.io/supah/
-->
<div class="leaderboard">
<h1>
<svg class="ico-cup">
<use xlink:href="#cup"></use>
</svg>
Most active Players
</h1>
<ol>
<li v-for="story in stories">
<mark>{{ story.plot }}</mark>
<small>{{story.upvotes}}</small>
</li>
</ol>
</div>
<svg style="display: none;">
<symbol id="cup" x="0px" y="0px"
width="25px" height="26px" viewBox="0 0 25 26" enable-background="new 0 0 25 26" xml:space="preserve">
<path fill="#F26856" d="M21.215,1.428c-0.744,0-1.438,0.213-2.024,0.579V0.865c0-0.478-0.394-0.865-0.88-0.865H6.69
C6.204,0,5.81,0.387,5.81,0.865v1.142C5.224,1.641,4.53,1.428,3.785,1.428C1.698,1.428,0,3.097,0,5.148
C0,7.2,1.698,8.869,3.785,8.869h1.453c0.315,0,0.572,0.252,0.572,0.562c0,0.311-0.257,0.563-0.572,0.563
c-0.486,0-0.88,0.388-0.88,0.865c0,0.478,0.395,0.865,0.88,0.865c0.421,0,0.816-0.111,1.158-0.303
c0.318,0.865,0.761,1.647,1.318,2.31c0.686,0.814,1.515,1.425,2.433,1.808c-0.04,0.487-0.154,1.349-0.481,2.191
c-0.591,1.519-1.564,2.257-2.975,2.257H5.238c-0.486,0-0.88,0.388-0.88,0.865v4.283c0,0.478,0.395,0.865,0.88,0.865h14.525
c0.485,0,0.88-0.388,0.88-0.865v-4.283c0-0.478-0.395-0.865-0.88-0.865h-1.452c-1.411,0-2.385-0.738-2.975-2.257
c-0.328-0.843-0.441-1.704-0.482-2.191c0.918-0.383,1.748-0.993,2.434-1.808c0.557-0.663,1-1.445,1.318-2.31
c0.342,0.192,0.736,0.303,1.157,0.303c0.486,0,0.88-0.387,0.88-0.865c0-0.478-0.394-0.865-0.88-0.865
c-0.315,0-0.572-0.252-0.572-0.563c0-0.31,0.257-0.562,0.572-0.562h1.452C23.303,8.869,25,7.2,25,5.148
C25,3.097,23.303,1.428,21.215,1.428z M5.238,7.138H3.785c-1.116,0-2.024-0.893-2.024-1.99c0-1.097,0.908-1.99,2.024-1.99
c1.117,0,2.025,0.893,2.025,1.99v2.06C5.627,7.163,5.435,7.138,5.238,7.138z M18.883,21.717v2.553H6.118v-2.553H18.883
L18.883,21.717z...
SCSS
/*--------------------
Body
--------------------*/
*,
*::before,
*::after {
box-sizing: border-box;
}
body {
min-height: 420px;
height: 130vh;
margin: 0;
background: radial-gradient(ellipse farthest-corner at center top, #f39264 0%, #f2606f 100%);
color: #fff;
font-family: 'Open Sans', sans-serif;
}
/*--------------------
Leaderboard
--------------------*/
.leaderboard {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 405px;
height: 308px;
background: linear-gradient(to bottom, #3a404d, #181c26);
border-radius: 10px;
box-shadow: 0 7px 30px rgba(62, 9, 11, .3);
h1 {
font-size: 18px;
color: #e1e1e1;
padding: 12px 13px 18px;
& svg {
width: 25px;
height: 26px;
position: relative;
top: 3px;
margin-right: 6px;
vertical-align: baseline;
}
}
ol {
counter-reset: leaderboard;
li {
position: relative;
z-index: 1;
font-size: 14px;
counter-increment: leaderboard;
padding: 18px 10px 18px 50px;
cursor: pointer;
backface-visibility: hidden;
transform: translateZ(0) scale(1.0, 1.0);
&::before {
content: counter(leaderboard);
position: absolute;
z-index: 2;
top: 15px;
left: 15px;
width: 20px;
height: 20px;
line-height: 20px;
color: #c24448;
background: #fff;
border-radius: 20px;
text-align: center;
}
mark {
position: absolute;
z-index: 2;
top: 0;
left: 0;
width: 100%;
height: 100%;
padding: 18px 10px 18px 50px;
margin: 0;
background: none;
color: #fff;
&::before, &::after {
content: '';
position: absolute;
z-index: 1;
bottom: -11px;
left: -9px;
border-top: 10px solid #c24448;
border-left: 10px solid transparent;
...
JavaScript
var vm = new Vue({
el: '.leaderboard',
data: {
stories: [
{
plot: "I find your lack of faith disturbing.",
upvotes: 28
},
{
plot: "Great shot kid, that was one in a million.",
upvotes: 24
},
{
plot: "General Grievous, you're shorter than I expected.",
upvotes: 27
},
{
plot: "I sense great fear in you, Skywalker.",
upvotes: 41
},
{
plot: "I sense great fear in you, Skywalker.",
upvotes: 41
},
{
plot: "I sense great fear in you, Skywalker.",
upvotes: 41
},
]
},
computed: {
famous: function() {
return this.stories.filter(function(item){
return item.upvotes > 30;
});
}
}
})