From 19b2afbf346f5a622449e5c460a432c946962fe9 Mon Sep 17 00:00:00 2001 From: Jakob Odersky Date: Sat, 20 Jun 2015 15:55:00 +0200 Subject: design hud skeleton --- .../src/main/scala/vfd/dashboard/ui/Layout.scala | 39 ++++- vfd-main/public/images/hud/horizon.svg | 79 +++++++++ vfd-main/public/images/hud/hud.svg | 182 +++++++++++++++++++++ vfd-main/public/images/hud/roll.svg | 143 ++++++++++++++++ vfd-main/public/stylesheets/main.css | 13 +- 5 files changed, 438 insertions(+), 18 deletions(-) create mode 100644 vfd-main/public/images/hud/horizon.svg create mode 100644 vfd-main/public/images/hud/hud.svg create mode 100644 vfd-main/public/images/hud/roll.svg diff --git a/vfd-dashboard/src/main/scala/vfd/dashboard/ui/Layout.scala b/vfd-dashboard/src/main/scala/vfd/dashboard/ui/Layout.scala index 8bc35cd..8f84945 100644 --- a/vfd-dashboard/src/main/scala/vfd/dashboard/ui/Layout.scala +++ b/vfd-dashboard/src/main/scala/vfd/dashboard/ui/Layout.scala @@ -37,8 +37,7 @@ class Layout(socket: MavlinkSocket)(implicit env: Environment) { "marginwidth".attr := "0", src := "http://www.openstreetmap.org/export/embed.html?bbox=6.5611016750335684%2C46.51718501017836%2C6.570038795471191%2C46.520577350893525&layer=mapnik") - val feed = div(style := "width: 100%; color: #ffffff; background-color: #c2c2c2; text-align: center;")( - p(style := "padding-top: 220px")("video feed")) + val feed = div(style := "width: 100%; height: 100%; color: #ffffff; background-color: #c2c2c2; text-align: center;") val altimeter = new Altimeter( Var(0.0) @@ -222,7 +221,31 @@ class Layout(socket: MavlinkSocket)(implicit env: Environment) { ) ) - val element = div(`class` := "d-container d-column")( + + + val hud = { + def overlay(name: String, z: Int, thinnerThanWide: Boolean = false) = { + val direction = if (thinnerThanWide) "row" else "column" + div( + style:= + "position: absolute; left: 0; right: 0; top: 0; bottom: 0;" + + s"display: flex; align-content: center; align-items: stretch; flex-direction: $direction;"+ + s"z-index: $z;" + )( + `object`(`type`:="image/svg+xml", "data".attr:=env.asset("images/hud/" + name + ".svg"), style := "flex: 1 1 100%;") + ) + + } + + Seq( + overlay("horizon", 0), + overlay("roll", 1) + ) + } + + + + val element = div(`class` := "d-container d-column", style:="width: 100%; height: 100%;")( div(`class` := "d-above")( top ), @@ -234,12 +257,10 @@ class Layout(socket: MavlinkSocket)(implicit env: Environment) { div(`class` := "d-container d-left")( left ), - div(`class` := "d-container d-column d-middle")( - panel(feed), - panel(map) - ), - div(`class` := "d-container d-right")() + div(`class` := "d-main", style:="position: relative;")( + hud: _* + ) ) ).render -} \ No newline at end of file +} diff --git a/vfd-main/public/images/hud/horizon.svg b/vfd-main/public/images/hud/horizon.svg new file mode 100644 index 0000000..1562d41 --- /dev/null +++ b/vfd-main/public/images/hud/horizon.svg @@ -0,0 +1,79 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/vfd-main/public/images/hud/hud.svg b/vfd-main/public/images/hud/hud.svg new file mode 100644 index 0000000..943d7a4 --- /dev/null +++ b/vfd-main/public/images/hud/hud.svg @@ -0,0 +1,182 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vfd-main/public/images/hud/roll.svg b/vfd-main/public/images/hud/roll.svg new file mode 100644 index 0000000..93a9f90 --- /dev/null +++ b/vfd-main/public/images/hud/roll.svg @@ -0,0 +1,143 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + diff --git a/vfd-main/public/stylesheets/main.css b/vfd-main/public/stylesheets/main.css index 5430334..f254449 100644 --- a/vfd-main/public/stylesheets/main.css +++ b/vfd-main/public/stylesheets/main.css @@ -1,5 +1,6 @@ html, body { - height: 100%; + width: 100%; + height: 100%; } body { @@ -58,12 +59,10 @@ body { .d-column { flex-direction: column; - height: 100%; } .d-row { flex-direction: row; - width: 100%; } .d-above { @@ -74,12 +73,8 @@ body { flex: 1 1 30%; } -.d-middle { - flex: 1 1 45%; -} - -.d-right { - flex: 1 1 25%; +.d-main { + flex: 1 1 70%; } .d-panel { -- cgit v1.2.3