Commit ce82bd26 authored by Clint Mourlevat's avatar Clint Mourlevat

Adding 24 hours last change

parent 4cae27e3
...@@ -34,7 +34,8 @@ namespace Stratis.Guru.Controllers ...@@ -34,7 +34,8 @@ namespace Stratis.Guru.Controllers
dynamic coinmarketcap = JsonConvert.DeserializeObject(_memoryCache.Get("Coinmarketcap").ToString()); dynamic coinmarketcap = JsonConvert.DeserializeObject(_memoryCache.Get("Coinmarketcap").ToString());
return View(new Ticker return View(new Ticker
{ {
UsdPrice = coinmarketcap.data.quotes.USD.price UsdPrice = coinmarketcap.data.quotes.USD.price,
Last24Change = coinmarketcap.data.quotes.USD.percent_change_24h/100
}); });
} }
......
...@@ -3,5 +3,6 @@ namespace Stratis.Guru.Models ...@@ -3,5 +3,6 @@ namespace Stratis.Guru.Models
public class Ticker public class Ticker
{ {
public double UsdPrice { get; set; } public double UsdPrice { get; set; }
public double Last24Change { get; set; }
} }
} }
\ No newline at end of file
...@@ -8,12 +8,13 @@ ...@@ -8,12 +8,13 @@
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 align-self-center text-center"> <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 align-self-center text-center">
<h1>The <strong>$STRAT</strong> price in realtime.</h1> <h1 class="m-0">The <strong>$STRAT</strong> price in realtime.</h1>
<h1 class="align-middle"> <h1 class="align-middle">
<div class="d-block"> <div class="d-inline-block align-middle">
<span class="click-edit">1 STRAT</span> = <span class="click-edit">1 STRAT</span> =
</div> </div>
<span class="display-1 font-weight-bold">@(Model.UsdPrice.ToString("C2"))</span> <span class="align-middle display-1 font-weight-bold">@(Model.UsdPrice.ToString("C2"))</span>
<span class="text-@(Model.Last24Change > 0 ? "success":"danger") font-weight-bold"><sup> @((Model.Last24Change > 0 ? "+":"-")) @(Model.Last24Change.ToString("P2"))</sup></span>
</h1> </h1>
<a asp-controller="Home" asp-action="Generator" class="btn-secondary-box"><i class="fa fa-paper-plane"></i> Get a Stratis Address</a> <a asp-controller="Home" asp-action="Generator" class="btn-secondary-box"><i class="fa fa-paper-plane"></i> Get a Stratis Address</a>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment