Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
85 lines (78 sloc) 2.35 KB
<html>
<head>
<meta charset="utf-8">
<title>AngelList Startup Ticker</title>
<meta name="description" content="">
<meta name="author" content="">
<link rel="stylesheet" href="bootstrap.css">
<style type="text/css">
body {
padding-top: 60px; /* 40px to make the container go all the way to the bottom of the topbar */
}
.topbar-inner, .topbar .fill {
background-color: #F2F3F4;
background-image: none;
}
.topbar h3 a, .topbar .brand {
color: black;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="/socket.io/socket.io.js"></script>
<script>
$(document).ready(function(){
var socket = io.connect('http://localhost:3000');
socket.on('startup', function (startup) {
var a = $(document.createElement('a')).attr("href",startup.angellist_url);;
var li = document.createElement('li');
var img = $(document.createElement('img')).attr("class","thumbnail");
img.load(function(){
$(this).hide();
var w = this.width;
var h = this.height;
function pad(a,b,callback){
var adj = Math.floor(b*90.0/a);
var margin = 0;
if (adj < 90) {
margin = Math.ceil((90 - adj)/2.0);
}
callback(90,adj,margin);
}
var padding = "";
if (w > h) {
pad(w,h,function(width,height,padding){
$(img).attr("width", width);
$(img).attr("height", height);
$(img).css("padding", padding + "px 0px " + (width - height - padding) + "px");
});
}
else {
pad(h,w,function(height,width,padding){
$(img).attr("width", width);
$(img).attr("height", height);
$(img).css("padding", "0px " + padding + "px 0px " + (height - width - padding) + "px");
});
}
$(a).append(this);
$(li).append(a);
$(".media-grid").prepend(li);
$(this).show();
});
img.attr("src",startup.logo_url);
});
});
</script>
</head>
<body>
<div class="topbar">
<div class="fill">
<div class="container">
<a class="brand" href="#">AngelList Startups</a>
</div>
</div>
</div>
<div class="container">
<ul class="media-grid" />
</div>
</body>
</html>