Permalink
Browse files

Merge branch 'master' of github.com:sharadmv/electricity-js

  • Loading branch information...
2 parents 95db043 + 2553498 commit 42d2f10a2f19b2dc3cdbef1f402e6c2585d53431 @geraldfong geraldfong committed Jul 22, 2012
View
@@ -1,9 +1,8 @@
-@import "http://fonts.googleapis.com/css?family=Dosis:300,400,700";
-
-@import "http://fonts.googleapis.com/css?family=Josefin+Sans:400,600";
+@import "http://fonts.googleapis.com/css?family=Metrophobic";
body {
background-color: white;
- font-family: 'Josefin Sans', sans-serif;
+ font-family: 'Metrophobic', sans-serif;
+ font-size: 14px;
}
#main {
width: 960px;
View
@@ -1,10 +1,12 @@
// Fonts
-@import "http://fonts.googleapis.com/css?family=Dosis:300,400,700";
-@import "http://fonts.googleapis.com/css?family=Josefin+Sans:400,600";
+//@import "http://fonts.googleapis.com/css?family=Dosis:300,400,700";
+//@import "http://fonts.googleapis.com/css?family=Josefin+Sans:400,600";
+@import "http://fonts.googleapis.com/css?family=Metrophobic";
body{
background-color: white;
- font-family: 'Josefin Sans', sans-serif;
+ font-family: 'Metrophobic', sans-serif;
+ font-size: 14px;
}
#main{
View
@@ -11,7 +11,7 @@
<link rel="stylesheet" type="text/css" href="css/bootstrap-responsive.min.css" />
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"/>
<link rel="stylesheet/less" type="text/css" href="css/common.less">
- <link rel="stylesheet" href="css/floor.css" type="text/css" media="screen" charset="utf-8">
+ <link rel="stylesheet/less" href="css/floor.less" type="text/css" media="screen" charset="utf-8">
<script src="external/less-1.3.0.min.js" type="text/javascript"></script>
</head>
<body>
File renamed without changes
File renamed without changes
View
@@ -37,7 +37,7 @@ $(document).ready () ->
bridge.getService "electrify-service", (e) ->
e.subscribe({
broadcast: (id, data, state) ->
- d id, data, state
+ #d id, data, state
for device in gDevices
if device.remoteId == parseInt(id)
if state isnt device.state
@@ -131,7 +131,7 @@ createFloor = () ->
createDevices = () ->
circleInfo = [
- [[110, 300], 1, "Light"]
+ [[110, 300], 1, "Lamp"]
[[300, 200], 2, "Refrigerator"]
[[480, 310], 3, "Speakers"]
]
@@ -141,12 +141,14 @@ createDevices = () ->
class Device
- RADIUS:20
-
+ RADIUS : 10
+ ON_COLOR : "#DDD"
+ OFF_COLOR : "#001e5d"
+
constructor: (@name, @coords, @remoteId) ->
- circle = new paper.Path.Circle @coords, 10
- circle.strokeColor = "blue"
- circle.fillColor = "blue"
+ circle = new paper.Path.Circle @coords, @RADIUS
+ circle.strokeColor = @OFF_COLOR
+ circle.fillColor = @OFF_COLOR
circle.name = @name
@originalRadius = circle.bounds.width / 2
@@ -188,10 +190,10 @@ class Device
@ui.strokeColor = "blue"
updateState: () ->
- if @state
- @ui.fillColor = "#001e5d"
+ if not @state
+ @ui.fillColor = @ON_COLOR
else
- @ui.fillColor = "#DDD"
+ @ui.fillColor = @OFF_COLOR
selectDevice = (device) ->
View
@@ -45,7 +45,6 @@
return e.subscribe({
broadcast: function(id, data, state) {
var device, _i, _len, _results;
- d(id, data, state);
_results = [];
for (_i = 0, _len = gDevices.length; _i < _len; _i++) {
device = gDevices[_i];
@@ -199,7 +198,7 @@
createDevices = function() {
var circleInfo, info;
- circleInfo = [[[110, 300], 1, "Light"], [[300, 200], 2, "Refrigerator"], [[480, 310], 3, "Speakers"]];
+ circleInfo = [[[110, 300], 1, "Lamp"], [[300, 200], 2, "Refrigerator"], [[480, 310], 3, "Speakers"]];
return window.gDevices = (function() {
var _i, _len, _results;
_results = [];
@@ -213,16 +212,20 @@
Device = (function() {
- Device.prototype.RADIUS = 20;
+ Device.prototype.RADIUS = 10;
+
+ Device.prototype.ON_COLOR = "#DDD";
+
+ Device.prototype.OFF_COLOR = "#001e5d";
function Device(name, coords, remoteId) {
var circle;
this.name = name;
this.coords = coords;
this.remoteId = remoteId;
- circle = new paper.Path.Circle(this.coords, 10);
- circle.strokeColor = "blue";
- circle.fillColor = "blue";
+ circle = new paper.Path.Circle(this.coords, this.RADIUS);
+ circle.strokeColor = this.OFF_COLOR;
+ circle.fillColor = this.OFF_COLOR;
circle.name = this.name;
this.originalRadius = circle.bounds.width / 2;
this.ui = circle;
@@ -266,10 +269,10 @@
};
Device.prototype.updateState = function() {
- if (this.state) {
- return this.ui.fillColor = "#001e5d";
+ if (!this.state) {
+ return this.ui.fillColor = this.ON_COLOR;
} else {
- return this.ui.fillColor = "#DDD";
+ return this.ui.fillColor = this.OFF_COLOR;
}
};

0 comments on commit 42d2f10

Please sign in to comment.