Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions public/js/analytics.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'UA-111639102-2');
18 changes: 18 additions & 0 deletions public/js/price.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
function process_data(response){
console.log(response);
console.log(response[0]);
var priceUSD = response[0]["price_usd"];
//var priceJPY = response[0]["price_jpy"];
var priceBTC = response[0]["price_btc"];
document.getElementById("price-usd").innerHTML = parseFloat(priceUSD).toFixed(2);
// document.getElementById("price-jpy").innerHTML = parseFloat(priceJPY).toFixed(2);
document.getElementById("price-btc").innerHTML = priceBTC;
};

var $j = jQuery.noConflict();
$j(document).ready(function() {
const http = new XMLHttpRequest()
http.open("GET", "https://api.coinmarketcap.com/v1/ticker/ellaism/?convert=eur");
http.send();
http.onload = () => process_data(JSON.parse(http.responseText));
});
Binary file added public/siteicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 46 additions & 10 deletions views/index.pug
Original file line number Diff line number Diff line change
@@ -1,30 +1,60 @@
extends layout

block content
div(class="row", style="margin-top:15px;")

div(class="row text-center text-lg-left", style="margin-top:30px;")
div(class="well well-sm col-sm-3 ")
h5
span(class="glyphicon glyphicon-usd", style="margin-right:2pt;")
| Price
p
span(id="price-btc")
| ₿  | 
span(id="price-usd")
| $
div(class="well well-sm col-sm-3 col-sm-offset-1")
h5
span(class="glyphicon glyphicon-record", style="margin-right:2pt;")
| Difficulty
p #{(diff/1e12).toFixed(2)}TH
div(class="well well-sm col-sm-3 col-sm-offset-1")
h5
span(class="glyphicon glyphicon-flash", style="margin-right:2pt;")
| Hashrate
p #{(diff/15/1e9).toFixed(2)}G -> #{(diff/13/1e9).toFixed(2)}G

h3 Recent blocks
table.table

table.table(class='table-responsive table-striped')
thead
tr
th Number
th Miner
th Timestamp
th Time
th # Tx
th # Uncles
tbody
for block in blocks
tr
td
a(href="/block/" + block.number) #{block.number}
td
a(href="/account/" + block.author) #{nameformatter.format(block.author)}
td #{moment.unix(block.timestamp).format()}
td
a(href="/account/" + block.author)
- var dataURL = blockies.createDataURL({ seed: block.author})
img(src=dataURL,class="img-rounded space-right")
|#{nameformatter.format(block.author)}
- var duration = moment().diff(moment.unix(block.timestamp), 'seconds');
if duration < 50
td #{duration} seconds ago
else
td #{moment.unix(block.timestamp).fromNow()}
td #{block.transactions.length}
td #{block.uncles.length}
h3 Recent Transactions
if txs.length === 0
p No transactions during the last 10 blocks
else
table.table
table.table(class='table-responsive table-striped')
thead
tr
th Hash
Expand All @@ -37,10 +67,16 @@ block content
td
a(href="/tx/" + tx.hash) #{tx.hash.substr(0,10)}...
td
a(href="/account/" + tx.from) #{nameformatter.format(tx.from)}
a(href="/account/" + tx.from)
- var dataURL = blockies.createDataURL({ seed: tx.from })
img(src=dataURL,class="img-rounded space-right")
|#{nameformatter.format(tx.from)}
td
if tx.to
a(href="/account/" + tx.to) #{nameformatter.format(tx.to)}
a(href="/account/" + tx.to)
- var dataURL = blockies.createDataURL({ seed: tx.to })
img(src=dataURL,class="img-rounded space-right")
| #{nameformatter.format(tx.to)}
else
| New Contract
td #{ethformatter(tx.value)}
td #{ethformatter(tx.value)}
38 changes: 36 additions & 2 deletions views/layout.pug
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@ html(lang="en")
// The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags

meta(name='description', content='The explorer for the Ellaism blockchain')
meta(name='author', content='ellaism')
meta(name='keywords', content='ethereum, explorer, blockchain, Ellaism , Ella, etherchain, cryptocurrency, cryptocurrencies, bitcoin')

title Ellaism Explorer
title Ellaism Block Explorer

link(rel='stylesheet', href='/stylesheets/theme.css')
link(rel='stylesheet', href='/stylesheets/style.css')
script(src='/js/analytics.js')
script(src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js")
script(src="https://files.coinmarketcap.com/static/widget/currency.js")
script(src='/js/price.js')

link(rel="icon", type="image/png", href="https://www.gravatar.com/avatar/98abb59df18a837592a8079e31fd9c47?s=16", sizes="16x16")
link(rel="icon", type="image/png", href="https://www.gravatar.com/avatar/98abb59df18a837592a8079e31fd9c47?s=32", sizes="32x32")
Expand Down Expand Up @@ -60,6 +66,34 @@ html(lang="en")
a(href='/contract/verify') Verify Contract
li
a(href='/signature/verify') Verify Signature
li
a(href='https://ellaism.github.io/ellawallet/') Web Wallet
li
a(href='https://stats.ellaism.org/') Network Stats
li.dropdown
a.dropdown-toggle(href='#', data-toggle='dropdown', role='button', aria-haspopup='true', aria-expanded='false')
| Pools
span.caret
ul.dropdown-menu
li
a(href='https://pool.ellaism.org/') Dev Pool
li
a(href='https://pool.ellaism.io/') Ellaism.io
li
a(href='http://ella.minerpool.net/') MinerPool
li
a(href='http://ella.cryptobitpool.eu/') Cryptobitpool
li
a(href='http://ella.pool.sexy/#/') Pool Sexy
li
a(href='http://ella.cryptopools.info/') Cryptopools
li
a(href='https://ella.epool.io/') Epool.io
li
a(href='http://ellaismpool.com/') Ellaismpool
li
a(href='https://minerpool.net/pools/ellaism/') Full list


form.navbar-form.navbar-right(action="/search", method="POST")
.form-group
Expand All @@ -80,5 +114,5 @@ html(lang="en")
hr
footer
p
a(href="https://github.com/ellaism/etherchain-light") Etherchain Light
a(href="https://github.com/ellaism/etherchain-light") Ellaism Block Explorer.
| | #{nodeStatus.version} | #{nodeStatus.nbrPeers} Peers connected