From 75057bc40f41953759ae239db437f1fa0d871b20 Mon Sep 17 00:00:00 2001 From: Ryan Arthur Date: Mon, 25 Jun 2018 15:18:29 -0400 Subject: [PATCH] Position and style the dashboard banner --- apps/explorer_web/assets/css/_typography.scss | 2 +- apps/explorer_web/assets/css/app.scss | 1 + .../css/components/_dashboard-banner.scss | 76 +++++++++++++++++++ .../templates/chain/_transactions.html.eex | 2 +- .../templates/chain/show.html.eex | 55 +++++++++++++- 5 files changed, 131 insertions(+), 5 deletions(-) create mode 100644 apps/explorer_web/assets/css/components/_dashboard-banner.scss diff --git a/apps/explorer_web/assets/css/_typography.scss b/apps/explorer_web/assets/css/_typography.scss index d5b554a9f3..4aa0c3eb48 100644 --- a/apps/explorer_web/assets/css/_typography.scss +++ b/apps/explorer_web/assets/css/_typography.scss @@ -1,6 +1,6 @@ body { font-family: $font-family-sans-serif; - font-size: 13px; + font-size: 12px; } h1 { diff --git a/apps/explorer_web/assets/css/app.scss b/apps/explorer_web/assets/css/app.scss index dfdcbb2cb6..1ce1e0fc87 100644 --- a/apps/explorer_web/assets/css/app.scss +++ b/apps/explorer_web/assets/css/app.scss @@ -65,6 +65,7 @@ $fa-font-path: "~@fortawesome/fontawesome-free/webfonts"; @import "components/animations"; @import "components/card"; @import "components/tile"; +@import "components/dashboard-banner"; :export { diff --git a/apps/explorer_web/assets/css/components/_dashboard-banner.scss b/apps/explorer_web/assets/css/components/_dashboard-banner.scss new file mode 100644 index 0000000000..e97a854688 --- /dev/null +++ b/apps/explorer_web/assets/css/components/_dashboard-banner.scss @@ -0,0 +1,76 @@ +.dashboard-banner { + display: grid; + grid-template-rows: 2rem auto; + grid-template-columns: 1fr 2fr; + grid-template-areas: + "chart ." + "chart stats" + "legend stats"; + margin-top: -1rem; + margin-bottom: 2rem; + background-color: $white; + box-shadow: 0 5px 40px -5px rgba($black, 0.25); +} + +.dashboard-banner-chart { + grid-area: chart; + // 15px padding matches the Bootstarp conatiner padding. + padding: 1rem 1rem 1rem 15px; + max-height: 100px; + box-shadow: -15px 0 40px -5px rgba($black, 0.25); +} + +.dashboard-banner-chart-legend { + grid-area: legend; + display: flex; + // 15px padding matches the Bootstarp conatiner padding. + padding: 1rem 15px; + + &-item { + padding-left: 0.5rem; + flex-grow: 1; + + &:first-of-type { + border-left: 4px solid $secondary; + } + + &:last-of-type { + border-left: 4px solid $primary; + } + } + + &-label { + display: block; + color: $text-muted; + } + + &-value { + display: block; + } +} + +.dashboard-banner-network-stats { + grid-area: stats; + display: flex; + align-items: center; + justify-content: space-around; + // 15px padding matches the Bootstarp conatiner padding. + padding-right: 15px; + background-color: $primary; + box-shadow: -5px -5px 40px -5px rgba($black, 0.25); + + &-item { + padding-left: 1rem; + color: $white; + border-left: 4px solid rgba($white, 0.6); + } + + &-label { + display: block; + } + + &-value { + display: block; + font-size: 1.5rem; + } +} diff --git a/apps/explorer_web/lib/explorer_web/templates/chain/_transactions.html.eex b/apps/explorer_web/lib/explorer_web/templates/chain/_transactions.html.eex index 09c9e904ad..dcdde1d146 100644 --- a/apps/explorer_web/lib/explorer_web/templates/chain/_transactions.html.eex +++ b/apps/explorer_web/lib/explorer_web/templates/chain/_transactions.html.eex @@ -44,7 +44,7 @@ - <%= else %> + <% else %>
diff --git a/apps/explorer_web/lib/explorer_web/templates/chain/show.html.eex b/apps/explorer_web/lib/explorer_web/templates/chain/show.html.eex index 895c657d2e..8dd7fadfc7 100644 --- a/apps/explorer_web/lib/explorer_web/templates/chain/show.html.eex +++ b/apps/explorer_web/lib/explorer_web/templates/chain/show.html.eex @@ -1,5 +1,54 @@ -
+
+
+ +
+
+
+ + Price + + + $0.0498 USD + +
+
+ + Market cap + + + $100,350,800 USD + +
+
+
+
+ + Block time + + + 69.2105s + +
+
+ + Total transactions + + + 12,106,123 + +
+
+ + Wallet addresses + + + 1,400,500 + +
+
+
+
<%= render ExplorerWeb.ChainView, "_blocks.html", assigns %> <%= render ExplorerWeb.ChainView, "_transactions.html", assigns %> @@ -31,7 +80,7 @@
- +
@@ -53,7 +102,7 @@
- +