From 56ee97d1e61e57d8254fd051e7826197c8599228 Mon Sep 17 00:00:00 2001 From: Lorin Werthen Date: Wed, 8 Feb 2017 16:31:17 +0100 Subject: [PATCH] redesign gamification tile --- content/assets/scripts/gamification.coffee | 18 ++++- .../assets/stylesheets/includes/tiles.scss | 71 ++++++++++--------- content/index.erb | 6 +- layouts/partials/_tile.erb | 2 +- 4 files changed, 57 insertions(+), 40 deletions(-) diff --git a/content/assets/scripts/gamification.coffee b/content/assets/scripts/gamification.coffee index 0b0ea66..976f9db 100644 --- a/content/assets/scripts/gamification.coffee +++ b/content/assets/scripts/gamification.coffee @@ -1,8 +1,20 @@ $ -> $.getJSON 'https://zeus.ugent.be/game/top4/show.json', (data) -> - str = "
    " + str = "" for x in data - str += "
  1. #{x.github_name} (#{x.score} Z$)
  2. " - str += "" + str += """ + + + + + + """ + str += "
    + + + #{x.github_name} + + #{x.score} +
    " $('#gamification-coders').html(str) diff --git a/content/assets/stylesheets/includes/tiles.scss b/content/assets/stylesheets/includes/tiles.scss index bd43fe4..1245168 100644 --- a/content/assets/stylesheets/includes/tiles.scss +++ b/content/assets/stylesheets/includes/tiles.scss @@ -1,3 +1,5 @@ +$top_coder_size: 80px; + a.box { &:hover { box-shadow: 0 2px 3px rgba($black, 0.1), 0 0 0 1px $blue @@ -39,47 +41,46 @@ a.box { .icon a{ color:$tile-orange; } + #gamification-coders { display: flex; justify-content: center; - img{ - height:40px; - width:40px !important; - border-radius:50px; - top: 0; - left: 0; - z-index:1; - vertical-align:middle; - } - ol{ - list-style-type: decimal-leading-zero; - counter-reset:li; - > li{ - position: relative; - float:left; - padding:5px; - margin:20px; - margin-bottom:3px; - margin-top:3px; - display:inline; - &:before{ - position: absolute; - z-index:2; - 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; + + table { + position: relative; + + tr:first-child { + height: $top_coder_size; + width: $top_coder_size; + .picture img { + height: $top_coder_size; + width: $top_coder_size !important; + box-shadow: 0 0 0 3px #fff, 0 0 0 4px #999, 0 2px 5px 4px rgba(0,0,0,0.2); + } + } + td { + vertical-align: middle; + text-align: center; + padding: 0; + &.picture { + width: $top_coder_size !important; + } + &.score { + text-align: right; + padding-right: 10px; } } } + + .picture img { + height: 40px; + width: 40px !important; + vertical-align: middle; + margin: 10px 0; + border-radius: 50px; + z-index: 1; + } + } #blokmap-tile { diff --git a/content/index.erb b/content/index.erb index 3f14787..f56f353 100644 --- a/content/index.erb +++ b/content/index.erb @@ -12,7 +12,11 @@
    -

    Top Zeus WPI coders this week

    +

    + + Top Zeus WPI coders this week + +

    diff --git a/layouts/partials/_tile.erb b/layouts/partials/_tile.erb index 6e88fe4..75ba5ae 100644 --- a/layouts/partials/_tile.erb +++ b/layouts/partials/_tile.erb @@ -17,7 +17,7 @@ <%= @article[:description] %>
    - <%= get_teaser(@article) %> + <%= get_teaser(@article) %>