diff --git a/light9/web/live/index.html b/light9/web/live/index.html
--- a/light9/web/live/index.html
+++ b/light9/web/live/index.html
@@ -26,6 +26,20 @@
paper-slider { width: 100%; margin: -19px 0; }
+
+
-
+
- a
+ a
- attr
+ attr
diff --git a/light9/web/live/live.coffee b/light9/web/live/live.coffee
--- a/light9/web/live/live.coffee
+++ b/light9/web/live/live.coffee
@@ -38,9 +38,17 @@ Polymer
uri: { type: String, notify: true }
deviceClass: { type: String, notify: true }
deviceAttrs: { type: Array, notify: true }
+ bgStyle: { type: String, computed: '_bgStyle(deviceClass)' }
observers: [
'onGraph(graph)'
]
+ _bgStyle: (deviceClass) ->
+ hash = 0
+ for i in [(deviceClass.length-10)...deviceClass.length]
+ hash += deviceClass.charCodeAt(i)
+ hue = (hash * 8) % 360
+ accent = "hsl(#{hue}, 49%, 22%)"
+ "background: linear-gradient(to right, rgba(31,31,31,0) 50%, #{accent} 100%);"
onGraph: ->
@graph.runHandler(@update.bind(@), "#{@uri} update")
update: ->
diff --git a/light9/web/resource-display.html b/light9/web/resource-display.html
--- a/light9/web/resource-display.html
+++ b/light9/web/resource-display.html
@@ -1,20 +1,20 @@
+
-
- {{label}}
+ {{label}}
@@ -42,9 +42,14 @@
uri: { type: String },
label: { type: String },
rename: { type: Boolean },
+ minor: { type: Boolean },
+ resClasses: { type: String, computed: '_resClasses(minor)', value: 'resource' },
renameTo: { type: String, notify: true },
},
observers: ['onUri(graph, uri)'],
+ _resClasses: function(minor) {
+ return minor ? 'resource minor' : 'resource';
+ },
onUri: function(graph, uri) {
this.graph.runHandler(this.setLabel.bind(this), `label ${this.uri}`);
},
diff --git a/light9/web/style.css b/light9/web/style.css
--- a/light9/web/style.css
+++ b/light9/web/style.css
@@ -151,18 +151,28 @@ a.resource {
}
.resource {
- border: 1px solid gray;
+ border: 1px solid #545454;
border-radius: 5px;
padding: 1px;
margin: 2px;
- background: rgb(66, 66, 66);
+ background: rgb(49, 49, 49);
display: block;
+ text-shadow: 1px 1px 2px black;
+}
+.resource.minor {
+ background: none;
+ border: none;
}
.resource a {
color: rgb(150, 150, 255);
padding: 1px;
display: inline-block;
}
+.resource.minor a {
+ text-decoration: none;
+ color: rgb(155, 155, 193);
+ padding: 0
+}
.sub {
display: inline-block;
vertical-align: top;