From 1d42fdad8138984bac460cb575d16ff7378a7716 Mon Sep 17 00:00:00 2001 From: Harish Krishna Date: Sat, 23 Jun 2012 17:39:54 -0400 Subject: [PATCH 1/5] Basic style changes: removing ul/li, using spans instead. styling ul/li @sidebar --- javascripts/sidebar.js | 33 +++++++++++++++++++++------------ stylesheets/styles.css | 26 +++++++++++++------------- 2 files changed, 34 insertions(+), 25 deletions(-) diff --git a/javascripts/sidebar.js b/javascripts/sidebar.js index c72d53d..cd36d94 100644 --- a/javascripts/sidebar.js +++ b/javascripts/sidebar.js @@ -9,21 +9,30 @@ $(function() { // Render license/source information _(tutorials).each(function(tutorial){ - t = $(tutorial) - d = t.data() - attribution = "" - if(d.authorGithub) { - attribution += '
  • Author: ' + d.authorGithub + '
  • ' - } else if(d.author) { - attribution += "
  • Author: " + d.author + "
  • " - } - if(d.source) { - attribution += '
  • Original Source
  • ' + t = $(tutorial); + d = t.data(); + var meta = d.authorGithub || d.author || d.source || d.license; + if(meta) { + var attribution = ""; + if(d.authorGithub) { + attribution += 'by ' + d.authorGithub + ''; + } else if(d.author) { + attribution += "by " + d.author + "" + } + if(d.source) { + if (d.authorGithub || d.author) { + attribution += '|'; + } + attribution += 'Original Source'; + } if(d.license) { - attribution += '
  • License
  • ' + if (d.authorGithub || d.author || d.source) { + attribution += '|'; + } + attribution += 'License'; } + t.prepend("

    " + attribution + "

    "); } - if(attribution) { t.prepend("")} }); dict = _.chain(tutorials) diff --git a/stylesheets/styles.css b/stylesheets/styles.css index eb7587f..eda3ebd 100644 --- a/stylesheets/styles.css +++ b/stylesheets/styles.css @@ -65,7 +65,7 @@ code, pre { pre { padding:8px 15px; - background: #f8f8f8; + background: #f8f8f8; border-radius:5px; border:1px solid #e5e5e5; overflow-x: auto; @@ -103,9 +103,9 @@ header { #download { list-style:none; height:40px; - + padding:0; - + background: #eee; background: -moz-linear-gradient(top, #f8f8f8 0%, #dddddd 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f8f8f8), color-stop(100%,#dddddd)); @@ -113,7 +113,7 @@ header { background: -o-linear-gradient(top, #f8f8f8 0%,#dddddd 100%); background: -ms-linear-gradient(top, #f8f8f8 0%,#dddddd 100%); background: linear-gradient(top, #f8f8f8 0%,#dddddd 100%); - + border-radius:5px; border:1px solid #d2d2d2; box-shadow:inset #fff 0 1px 0, inset rgba(0,0,0,0.03) 0 -1px 0; @@ -186,33 +186,33 @@ footer { } @media print, screen and (max-width: 960px) { - + div.wrapper { width:auto; margin:0; } - + header, section#main, footer { float:none; position:static; width:auto; } - + header { padding-right:320px; } - + section#main { border:1px solid #e5e5e5; border-width:1px 0; padding:20px 0; margin:0 0 20px; } - + header a small { display:inline; } - + #download { position:absolute; right:50px; @@ -224,11 +224,11 @@ footer { body { word-wrap:break-word; } - + header { padding:0; } - + #download, header p.view { position:static; } @@ -238,7 +238,7 @@ footer { body { padding:15px; } - + #download { display:none; } From afba40a4c29a54ea2cd593391ff05d106d956ab9 Mon Sep 17 00:00:00 2001 From: Harish Krishna Date: Sat, 23 Jun 2012 17:48:11 -0400 Subject: [PATCH 2/5] Basic styles --- stylesheets/styles.css | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/stylesheets/styles.css b/stylesheets/styles.css index eda3ebd..192e99b 100644 --- a/stylesheets/styles.css +++ b/stylesheets/styles.css @@ -162,6 +162,27 @@ strong { margin: 0; } +#sidebar ul, #main div.tutorial ul { + list-style:none; + margin-left:0; + padding:0; +} + +#sidebar ul li{ + cursor:pointer; + color:#39C; +} + +#sidebar ul li:hover{ + cursor:pointer; + color:#2c85b1; + text-decoration:none; +} + +div.tutorial p.about span{ + margin-right:5px; +} + section#main { width:560px; float:right; From 5f769063bd9deffca46c6969334644b15708c2b7 Mon Sep 17 00:00:00 2001 From: Harish Krishna Date: Sat, 23 Jun 2012 18:16:13 -0400 Subject: [PATCH 3/5] Adding social integration --- _layouts/default.html | 13 ++++++++++++- stylesheets/styles.css | 12 ++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/_layouts/default.html b/_layouts/default.html index 347c5c9..2ecde6e 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -8,7 +8,7 @@ {% else %} tutorials.github.com {% endif %} - + @@ -37,6 +37,17 @@

    tutorials.github.com

    Decentralized polyglot tutorials

    +
    • Download ZIP File
    • Download TAR Ball
    • diff --git a/stylesheets/styles.css b/stylesheets/styles.css index 192e99b..7a4e9b8 100644 --- a/stylesheets/styles.css +++ b/stylesheets/styles.css @@ -179,6 +179,18 @@ strong { text-decoration:none; } +.headroom{ + margin: 20px 0 0 0; +} + +.footroom{ + margin: 0 0 20px; +} + +div.social a.ftg{ + width:85px; +} + div.tutorial p.about span{ margin-right:5px; } From 2e62e18405d928f3c51bfd84dbe5861d607d0a3b Mon Sep 17 00:00:00 2001 From: Harish Krishna Date: Sat, 23 Jun 2012 18:42:39 -0400 Subject: [PATCH 4/5] Making the title stick to the top when scrolled. --- javascripts/sidebar.js | 11 +++++++++++ stylesheets/styles.css | 12 ++++++++++++ 2 files changed, 23 insertions(+) diff --git a/javascripts/sidebar.js b/javascripts/sidebar.js index cd36d94..d976701 100644 --- a/javascripts/sidebar.js +++ b/javascripts/sidebar.js @@ -54,6 +54,17 @@ $(function() { // Draw the sidebar redraw(); + // sticky header + var $title = $('section#main h1'); + var headOffset = 50; + $(window).scroll(function(){ + if( $(window).scrollTop() > headOffset ) { + $title.addClass("fixed_top"); + } else { + $title.removeClass("fixed_top"); + } + }); + // Hide tutorials if the user clicks on a facet $("nav li").live("click", function(e) { target = $(this).data(); diff --git a/stylesheets/styles.css b/stylesheets/styles.css index 7a4e9b8..87380fe 100644 --- a/stylesheets/styles.css +++ b/stylesheets/styles.css @@ -201,6 +201,18 @@ section#main { padding-bottom:50px; } +section#main h1.fixed_top{ + position:fixed; + top:0px; + z-index:100; + width: 560px; + padding: 10px 0; + -moz-box-shadow: 0px 5px 10px #FFF; + -webkit-box-shadow: 0px 5px 10px #FFF; + box-shadow: 0px 5px 10px #FFF; + background:#FFF; +} + small { font-size:11px; } From 646f39278e4810bfde4b91e3fede9b7444121d1e Mon Sep 17 00:00:00 2001 From: Harish Krishna Date: Sat, 23 Jun 2012 22:09:21 -0400 Subject: [PATCH 5/5] Fixed the title with CSS and adjusting the body through JS. Sidebar fix. footer in place. fork me ribbon. root link set to '/'. Other minor CSS/JS changes. --- _layouts/default.html | 35 +++++++++++++++------------- javascripts/sidebar.js | 31 +++++++++++++++++-------- stylesheets/styles.css | 52 ++++++++++++++++++++++++++++++++++-------- 3 files changed, 82 insertions(+), 36 deletions(-) diff --git a/_layouts/default.html b/_layouts/default.html index 2ecde6e..a42e2b9 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -34,10 +34,19 @@
      -

      tutorials.github.com

      -

      Decentralized polyglot tutorials

      - -
      +
      + {{ content }} +
      +