aboutsummaryrefslogtreecommitdiff
path: root/vfd-dashboard/src/main/scala/vfd/dashboard/ui/instruments/Led.scala
diff options
context:
space:
mode:
Diffstat (limited to 'vfd-dashboard/src/main/scala/vfd/dashboard/ui/instruments/Led.scala')
-rw-r--r--vfd-dashboard/src/main/scala/vfd/dashboard/ui/instruments/Led.scala18
1 files changed, 18 insertions, 0 deletions
diff --git a/vfd-dashboard/src/main/scala/vfd/dashboard/ui/instruments/Led.scala b/vfd-dashboard/src/main/scala/vfd/dashboard/ui/instruments/Led.scala
new file mode 100644
index 0000000..4173f37
--- /dev/null
+++ b/vfd-dashboard/src/main/scala/vfd/dashboard/ui/instruments/Led.scala
@@ -0,0 +1,18 @@
+package vfd.dashboard.ui.instruments
+
+import scalatags.JsDom.all._
+import vfd.dashboard.Environment
+
+class Led(implicit env: Environment) extends SvgInstrument[String] {
+
+ val initial = "none"
+
+ lazy val element = `object`(`type` := "image/svg+xml", "data".attr := env.asset("images/leds/led.svg"), width := 100.pct)(
+ "Error loading led.").render
+ protected def moveable = Seq()
+
+ protected def update(color: String) = {
+ part("light").setAttribute("fill", color)
+ }
+
+} \ No newline at end of file