|
| 1 | +<% if (plugins.crypto) { %> |
| 2 | +<section> |
| 3 | + <h2 class="field"> |
| 4 | + <img width="20" src="<%= plugins.crypto.logo %>" /> |
| 5 | + <%= plugins.crypto.symbol ? `${plugins.crypto.symbol?.toUpperCase()}` : "" %> |
| 6 | + </h2> |
| 7 | + <% if (plugins.crypto.error) { %> |
| 8 | + <div class="row fill-width"> |
| 9 | + <section> |
| 10 | + <div class="field error"> |
| 11 | + <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"> |
| 12 | + <path |
| 13 | + fill-rule="evenodd" |
| 14 | + d="M2.343 13.657A8 8 0 1113.657 2.343 8 8 0 012.343 13.657zM6.03 4.97a.75.75 0 00-1.06 1.06L6.94 8 4.97 9.97a.75.75 0 101.06 1.06L8 9.06l1.97 1.97a.75.75 0 101.06-1.06L9.06 8l1.97-1.97a.75.75 0 10-1.06-1.06L8 6.94 6.03 4.97z" |
| 15 | + ></path> |
| 16 | + </svg> |
| 17 | + <%= plugins.crypto.error.message %> |
| 18 | + </div> |
| 19 | + </section> |
| 20 | + </div> |
| 21 | + <% } else { %> |
| 22 | + <div class="row"> |
| 23 | + <section> |
| 24 | + <div class="field"> |
| 25 | + <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"> |
| 26 | + <path |
| 27 | + fill-rule="evenodd" |
| 28 | + d="M6 2a.75.75 0 01.696.471L10 10.731l1.304-3.26A.75.75 0 0112 7h3.25a.75.75 0 010 1.5h-2.742l-1.812 4.528a.75.75 0 01-1.392 0L6 4.77 4.696 8.03A.75.75 0 014 8.5H.75a.75.75 0 010-1.5h2.742l1.812-4.529A.75.75 0 016 2z" |
| 29 | + ></path> |
| 30 | + </svg> |
| 31 | + <%= `${plugins.crypto.current_price.toFixed(plugins.crypto.precision || 2) } ${plugins.crypto.vs_currency?.toUpperCase()}` %> |
| 32 | + </div> |
| 33 | + </section> |
| 34 | + <section> |
| 35 | + <div class="field"> |
| 36 | + <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"> |
| 37 | + <path |
| 38 | + fill-rule="evenodd" |
| 39 | + d="M4.75 0a.75.75 0 01.75.75V2h5V.75a.75.75 0 011.5 0V2h1.25c.966 0 1.75.784 1.75 1.75v10.5A1.75 1.75 0 0113.25 16H2.75A1.75 1.75 0 011 14.25V3.75C1 2.784 1.784 2 2.75 2H4V.75A.75.75 0 014.75 0zm0 3.5h8.5a.25.25 0 01.25.25V6h-11V3.75a.25.25 0 01.25-.25h2zm-2.25 4v6.75c0 .138.112.25.25.25h10.5a.25.25 0 00.25-.25V7.5h-11z" |
| 40 | + ></path> |
| 41 | + </svg> |
| 42 | + <%= plugins.crypto.days %> |
| 43 | + </div> |
| 44 | + </section> |
| 45 | + <section> |
| 46 | + <div class="field"> |
| 47 | + <% if (plugins.crypto.price_change_percentage_24h > 0) { %> |
| 48 | + <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"> |
| 49 | + <path |
| 50 | + fill-rule="evenodd" |
| 51 | + d="M3.47 7.78a.75.75 0 010-1.06l4.25-4.25a.75.75 0 011.06 0l4.25 4.25a.75.75 0 01-1.06 1.06L9 4.81v7.44a.75.75 0 01-1.5 0V4.81L4.53 7.78a.75.75 0 01-1.06 0z" |
| 52 | + ></path> |
| 53 | + </svg> |
| 54 | + <% } else { %> |
| 55 | + <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"> |
| 56 | + <path |
| 57 | + fill-rule="evenodd" |
| 58 | + d="M13.03 8.22a.75.75 0 010 1.06l-4.25 4.25a.75.75 0 01-1.06 0L3.47 9.28a.75.75 0 011.06-1.06l2.97 2.97V3.75a.75.75 0 011.5 0v7.44l2.97-2.97a.75.75 0 011.06 0z" |
| 59 | + ></path> |
| 60 | + </svg> |
| 61 | + <% } %> <%= plugins.crypto.price_change_percentage_24h ?plugins.crypto.price_change_percentage_24h.toFixed(2) : 0 %>% |
| 62 | + </div> |
| 63 | + </section> |
| 64 | + </div> |
| 65 | + <div class="crypto-chart"><%- plugins.crypto.chart %></div> |
| 66 | + <% } %> |
| 67 | +</section> |
| 68 | +<% } %> |
0 commit comments