Created
February 16, 2010 21:38
-
-
Save bangpound/305958 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style type="text/css"> | |
/* <![CDATA[ */ | |
.road { | |
height: 28px; | |
background-color: #ccc; | |
border-color: black; | |
border-width: 2px; | |
border-top-style: solid; | |
border-bottom-style: solid; | |
position: absolute; | |
width: 100%; | |
} | |
.road hr { | |
border-color: yellow; | |
border-style: dashed; | |
margin: 0; | |
margin-top: 12px; | |
position: absolute; | |
width: 100%; | |
} | |
#graph,#graph-legend { | |
position: relative; | |
} | |
#graph img,#graph-legend img { | |
height: auto; | |
width: 65px; | |
padding-top: 5px; | |
padding-bottom: 5px; | |
padding-left: 5px; | |
padding-right: 4px; | |
z-index: 1; | |
position: relative; | |
} | |
#graph-legend { | |
border: 1px solid black; | |
padding: 8px; | |
} | |
#graph-legend .road { | |
width: 75px; | |
} | |
#graph-legend dt,dd { | |
height: 35px; | |
} | |
#graph-legend dt { | |
float: left; | |
width: 75px; | |
} | |
#graph-legend img { | |
} | |
#graph-legend dd { | |
margin: 0 0 0 80px !important; | |
padding: 0 !important; | |
} | |
/* ]]> */ | |
</style> | |
<script type="text/javascript"> | |
/* <![CDATA[ */ | |
BusGraph = function (json) { | |
var bus, road, busses; | |
bus = parseInt(json.feed.entry[0].content.$t, 10); | |
road = parseInt(json.feed.entry[1].content.$t, 10); | |
$(document).ready(function() { | |
var $graph, rows, wholerows, remainder; | |
$graph = $('#graph'); | |
wholerows = Math.floor(road / 5); | |
remainder = road % 5; | |
for (rows = 0; rows < wholerows; rows++) { | |
$('<div class="road"><hr /></div>').appendTo('#graph').css('top', rows * 35); | |
} | |
if (remainder) { | |
$('<div class="road"><hr /></div>').appendTo('#graph').css('top', rows * 35).css('width', remainder * 75 + "px"); | |
} | |
for (busses = 1; busses <= bus; busses++) { | |
$('<img/>').attr('src', 'http://homepage.mac.com/bangpound/icirr-bus/bus.png').addClass('bus').appendTo('#graph'); | |
} | |
$('#bus-count').text(bus); | |
}); | |
}; | |
/* ]]> */ | |
</script> | |
<script src="http://spreadsheets.google.com/feeds/cells/t817jNpBzsf3jaW1ho6CE3Q/od6/public/basic?alt=json-in-script&min-row=2&min-col=1&max-row=2&max-col=2&callback=BusGraph" type="text/javascript"></script> | |
<p>Our goal is to send <strong>200 buses</strong>, that's <strong>10,000 riders</strong>, to Washington DC on March 21st. We have <strong><em id="bus-count"></em></strong> buses. <a href="http://spreadsheets.google.com/viewform?hl=en&formkey=dE03M2xYS1hVVnB5czBTNXlRQ2RDWEE6MA">Help us reach our goal of 200</a>!</p> | |
<div id="graph"> | |
</div> | |
<dl id="graph-legend"> | |
<dt><div class="road"><hr /></div></dt> | |
<dd>funds raised</dd> | |
<dt><img src="http://homepage.mac.com/bangpound/icirr-bus/bus.png" alt="Bus" /></dt> | |
<dd>number of buses organized</dd> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment