redesign gamification tile

This commit is contained in:
Lorin Werthen 2017-02-08 16:31:17 +01:00
parent 15ab0113c9
commit 56ee97d1e6
No known key found for this signature in database
GPG key ID: F11FFC921E0E08E0
4 changed files with 57 additions and 40 deletions

View file

@ -1,8 +1,20 @@
$ -> $ ->
$.getJSON 'https://zeus.ugent.be/game/top4/show.json', (data) -> $.getJSON 'https://zeus.ugent.be/game/top4/show.json', (data) ->
str = "<ol>" str = "<table>"
for x in data for x in data
str += "<li><img src=\"#{x.avatar_url}\"> <a href=\"#{x.github_url}\">#{x.github_name}</a> (#{x.score} Z$)</li>" str += """
str += "</ol>" <tr>
<td class="picture">
<img class="coder-picture" src="#{x.avatar_url}">
</td>
<td class="name">
<a class="coder-name" href="#{x.github_url}">#{x.github_name}</a>
</td>
<td class="score">
#{x.score}
</td>
</tr>
"""
str += "</table>"
$('#gamification-coders').html(str) $('#gamification-coders').html(str)

View file

@ -1,3 +1,5 @@
$top_coder_size: 80px;
a.box { a.box {
&:hover { &:hover {
box-shadow: 0 2px 3px rgba($black, 0.1), 0 0 0 1px $blue box-shadow: 0 2px 3px rgba($black, 0.1), 0 0 0 1px $blue
@ -39,47 +41,46 @@ a.box {
.icon a{ .icon a{
color:$tile-orange; color:$tile-orange;
} }
#gamification-coders { #gamification-coders {
display: flex; display: flex;
justify-content: center; justify-content: center;
img{
height:40px; table {
width:40px !important; position: relative;
border-radius:50px;
top: 0; tr:first-child {
left: 0; height: $top_coder_size;
z-index:1; width: $top_coder_size;
vertical-align:middle; .picture img {
} height: $top_coder_size;
ol{ width: $top_coder_size !important;
list-style-type: decimal-leading-zero; box-shadow: 0 0 0 3px #fff, 0 0 0 4px #999, 0 2px 5px 4px rgba(0,0,0,0.2);
counter-reset:li; }
> li{ }
position: relative; td {
float:left; vertical-align: middle;
padding:5px; text-align: center;
margin:20px; padding: 0;
margin-bottom:3px; &.picture {
margin-top:3px; width: $top_coder_size !important;
display:inline; }
&:before{ &.score {
position: absolute; text-align: right;
z-index:2; padding-right: 10px;
content:counter(li); /* Use the counter as content */
counter-increment:li;
color:whitesmoke;//$tile-orange;
opacity:0.9;
font: bold 32pt helvetica, arial, sans-serif;
height:30px;
width:30px;
display:inline-block;
margin-right:10px;
border-radius:50px;
text-align: center;
line-height: 30px;
} }
} }
} }
.picture img {
height: 40px;
width: 40px !important;
vertical-align: middle;
margin: 10px 0;
border-radius: 50px;
z-index: 1;
}
} }
#blokmap-tile { #blokmap-tile {

View file

@ -12,7 +12,11 @@
<div class="tile is-parent is-4"> <div class="tile is-parent is-4">
<div class="tile is-child box "> <div class="tile is-child box ">
<div class="content"> <div class="content">
<h1 class="has-text-centered"><a href="https://zeus.ugent.be/game">Top Zeus WPI coders this week</a></h1> <h1 class="has-text-centered">
<a href="https://zeus.ugent.be/game">
Top Zeus WPI coders this week
</a>
</h1>
<div id="gamification-coders" > <div id="gamification-coders" >
<!-- EMPTY --> <!-- EMPTY -->
</div> </div>

View file

@ -17,7 +17,7 @@
<%= @article[:description] %> <%= @article[:description] %>
</div> </div>
<div class="teaser"> <div class="teaser">
<%= get_teaser(@article) %> <%= get_teaser(@article) %>
</div> </div>
</div> </div>
</a> </a>