Permalink
Browse files

Merge branch 'dom-update' into techcrunch

  • Loading branch information...
2 parents 02137c9 + 8e85da3 commit fcaf373d3ce5e3d87c7d14654bf0989a75745ed4 Davis Barber committed Sep 9, 2011
Showing with 21 additions and 19 deletions.
  1. +2 −3 src/faker.coffee
  2. +3 −2 src/public/scripts/lepidoptera.coffee
  3. +16 −14 src/public/stylesheets/screen.css
View
5 src/faker.coffee
@@ -52,18 +52,17 @@ fakeData = (feed_name="ford", swarm_id=config.swarms[Math.floor(Math.random() *
headers: { 'X-BugSwarmApiKey': config.producer_key }
car = cars[Math.floor(Math.random() * cars.length)]
- car_name = "#{car.name} #{++car.count}"
req = http.request options, (res) ->
setInterval ->
feed =
- car_name: car_name
+ car_name: car.name
latitude: center_latitude + Math.random() * max_distance
longitude: center_longitude + Math.random() * max_distance
for feeder in config.feeds
feed[feeder.name] = Math.floor(Math.random() * feeder.max)
req.write JSON.stringify feed
- , 5000
+ , 3000 + (Math.random() * 2000)
req.write '\n'
reqs.push req
View
5 src/public/scripts/lepidoptera.coffee
@@ -44,12 +44,12 @@ lepidoptera = ->
updateFeed = (resource_id, body) ->
data = JSON.parse body.data
+ down = Math.random() < .5
- console.log "updateFeed(#{resource_id},#{JSON.stringify data})"
+ console.log "updateFeed(#{resource_id},#{JSON.stringify data}, #{down})"
dom_name = $("##{resource_id} > .car_name")
dom_name.html(data.car_name) if dom_name[0]?
-
for feed in config.feeds
# if the feed doesn't exist, add it
dom_feed = $("##{resource_id} > .feeds > .#{feed.name}")
@@ -59,6 +59,7 @@ lepidoptera = ->
# replace the inner html with the new mpg data
dom_feed.find(".data").html "#{data[feed.name]}"
+ dom_feed.toggleClass('down', down)
# see if we have a marker on the map for this resource
for m in markers
View
30 src/public/stylesheets/screen.css
@@ -109,10 +109,11 @@ html, body {
margin-top:0px;
margin-right:0px;
margin-left:10px;
+ width: 500px;
}
#content #map_canvas {
- width:828px;
+ width:778px;
height:625px;
float:left;
margin-left: 10px;
@@ -122,7 +123,7 @@ html, body {
* SIDEBAR
*/
#content #sidebar {
- width:325px;
+ width:375px;
height:625px;
float:right;
margin-right:20px;
@@ -158,26 +159,26 @@ html, body {
margin:0px;
padding:0px;
overflow:auto;
- width:325px;
+ width:375px;
}
#content #sidebar #resources .resource {
background-color:#77797E;
- height:100px;
+ height:140px;
margin-bottom:10px;
}
#content #sidebar #resources .resource .car_icon_wrapper {
background-image:url("../images/icon-car-list-inactive.png");
background-repeat:no-repeat;
width:50px;
- height:35px;
+ height:45px;
float:left;
margin:0px;
padding:0px;
margin-right:10px;
margin-left:5px;
- margin-top:15px;
+ margin-top:25px;
}
#content #sidebar #resources .resource.alive .car_icon_wrapper {
@@ -191,16 +192,16 @@ html, body {
#content #sidebar #resources .resource .car_name {
font-family:Cabin;
- font-size:18px;
+ font-size:23px;
color:#FFFFFF;
width:100px;
- height:35px;
+ height:45px;
float:left;
- margin-top:15px;
+ margin-top:20px;
}
#content #sidebar #resources .resource .feeds {
- height:50px;
+ height:75px;
margin:0px;
padding:0px;
background-color:#707277;
@@ -212,16 +213,17 @@ html, body {
width:35%;
float:left;
font-family:Arial;
- font-size:15px;
+ font-size:20px;
color:#D7D7D7;
margin-top:5px;
+ margin-bottom:8px;
}
#content #sidebar #resources .resource .feeds .feed .icon_wrapper {
margin:0px;
padding:0px;
font-family:Arial;
- font-size:15px;
+ font-size:20px;
color:#D7D7D7;
float:left;
margin-left:8px;
@@ -235,7 +237,7 @@ html, body {
height:15px;
}
-#content #sidebar #resources .resource .feeds .feed.change.down .icion_wrapper {
+#content #sidebar #resources .resource .feeds .feed.change.down .icon_wrapper {
background-image:url("../images/icon-arrow-down.png");
}
@@ -246,7 +248,7 @@ html, body {
#content #sidebar #resources .resource .feeds .feed .data {
font-family:Arial;
- font-size:15px;
+ font-size:20px;
color:#FFFFFF;
margin-left:2px;
margin-top:2px;

0 comments on commit fcaf373

Please sign in to comment.