-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
main.js.map
13 lines (13 loc) · 12.8 KB
/
main.js.map
1
2
3
4
5
6
7
8
9
10
11
12
13
{
"version": 3,
"file": "main.js",
"sourceRoot": "",
"sources": [
"main.coffee"
],
"names": [],
"mappings": ";AAAA,IAAA,UAAA,EAAA,cAAA,EAAA,UAAA,EAAA,MAAA,EAAA,SAAA,EAAA,QAAA,EAAA,MAAA,EAAA,KAAA,EAAA,WAAA,EAAA,YAAA,EAAA;;AAAA,UAAA,GACE;EAAA,GAAA,EAAK,IAAI,GAAJ,CAAA,CAAL;EACA,GAAA,EAAK,IAAI,GAAJ,CAAA,CADL;EAEA,GAAA,EAAK,IAAI,GAAJ,CAAA,CAFL;EAGA,GAAA,EAAK,IAAI,GAAJ,CAAA,CAHL;EAIA,IAAA,EAAM,IAAI,IAAJ,CAAA;AAJN;;AAKF,MAAA,GAAS,CAAA;;AACT,KAAA,GAAQ,CAAA;;AAER,cAAA,GACE;EAAA,KAAA,EAAO,UAAP;EACA,QAAA,EAAU,KADV;EAEA,qBAAA,EAAuB,CAFvB;EAGA,qBAAA,EAAsB;AAHtB,EAVF;;;AAgBA,MAAA,GAAS,QAAA,CAAC,MAAD,EAAS,QAAT,EAAmB,EAAnB,CAAA;AACP,MAAA,GAAA,EAAA;EAAA,KAAA,GAAQ,EAAE,CAAC,MAAH,GAAY,CAAC,MAAO,CAAA,QAAA,CAAP,IAAoB,CAArB;EACpB,GAAA,GAAM,EAAE,CAAC,GAAH,GAAS,CAAC,MAAO,CAAA,QAAA,CAAP,IAAoB,CAArB;EAEf,MAAM,CAAC,SAAP,CACE;IAAA,KAAA,EAAU,GAAH,GAAY,CAAA,GAAI,CAAA,GAAI,IAAI,CAAC,GAAL,CAAS,CAAT,EAAY,IAAI,CAAC,KAAL,CAAW,CAAA,GAAE,GAAb,CAAZ,CAAJ,GAAmC,CAAnD,GAA0D,CAAjE;IACA,GAAA,EAAQ,KAAH,GAAc,GAAA,GAAM,GA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,WAAjB,EAXA;;SAaA,CAAA,CAAE,KAAF,CACA,CAAC,EADD,CACI,OADJ,EACa,OADb,EACsB,QADtB,CAEA,CAAC,EAFD,CAEI,OAFJ,EAEa,QAFb,EAEuB,QAAA,CAAA,CAAA;IACrB,CAAA,CAAE,aAAF,CAAgB,CAAC,MAAjB,CAAwB,CAAA,CAAE,mBAAF,CAAsB,CAAC,KAAvB,CAAA,CAAxB;WACA,WAAA,CAAA;EAFqB,CAFvB,CAKA,CAAC,EALD,CAKI,OALJ,EAKa,OALb,EAKsB,QAAA,CAAA,CAAA;IACpB,CAAA,CAAE,aAAF,CAAgB,CAAC,OAAjB,CAAyB,CAAA,CAAE,mBAAF,CAAsB,CAAC,IAAvB,CAAA,CAAzB;WACA,WAAA,CAAA;EAFoB,CALtB;AAfA,CAAF",
"sourcesContent": [
"currencies =\n btc: new BTC()\n eth: new ETH()\n ltc: new LTC()\n xrp: new XRP()\n nano: new NANO()\nprices = {}\nstats = {}\n\ncurrencyFormat =\n style: 'currency'\n currency: 'USD'\n minimumFractionDigits: 0\n maximumFractionDigits:0\n\n# render TX\nshowTx = (engine, currency, tx) ->\n value = tx.amount * (prices[currency] or 1)\n fee = tx.fee * (prices[currency] or 1)\n\n engine.addMeteor\n speed: if fee then 2 + 4 * Math.min(2, Math.log10(1+fee))/2 else 6\n hue: if value then 220 - 220 * Math.min(6, Math.log10(1+value))/6 else 220\n thickness: Math.max(5, Math.log10(1+value) * 10)\n length: Math.min(3, Math.log10(1 + fee))/3 * 250\n link: tx.link\n donation: tx.donation\n\n updateStats currency, value, fee\n\n# render block\nshowBlock = (engine, currency, block) ->\n engine.addBlock Math.min(250, block.count / 4)\n stats[currency].count = Math.max(0, stats[currency].count - block.count) if stats[currency]?\n\n# get current price\nupdatePrices = (currencies) ->\n currencyAPI = 'https://min-api.cryptocompare.com/data/price?fsym=USD&tsyms='\n $.get currencyAPI + currencies.join(',').toUpperCase(), (data) ->\n if data\n for currency, price of data\n currency = currency.toLowerCase()\n prices[currency] = Math.round(1/price*100)/100\n $(\".#{currency} .price\").text prices[currency].toLocaleString(undefined, { style: 'currency', currency: 'USD' })\n\n marketcapAPI = 'https://api.coinlore.com/api/global/'\n $.get marketcapAPI, (data) ->\n if data\n $(\".marketcap\").text JSON.parse(data)[0].total_mcap.toLocaleString(undefined, currencyFormat)\n\n\n setTimeout updatePrices.bind(null, currencies), 10*1000\n\n# update stats for a currency, called whenever there is a new TX\n# to do that, keep a log of the last 60 seconds of tx\nupdateStats = (currency, value = 0, fee = 0) ->\n stats[currency] = {last: [], count: 0} unless stats[currency]?\n # increase number of unverified TX\n stats[currency].count++ unless currencies[currency].noBlocks\n # calculate stats for last 60s\n last = stats[currency].last\n timestamp = new Date().getTime()\n last.push {timestamp, value, fee}\n i = last.length\n last.splice(i, 1) while i-- when timestamp - last[i].timestamp > 60*1000\n duration = Math.max(last[last.length - 1].timestamp - last[0].timestamp, 1) / 1000\n txPerSecond = Math.round(last.length / duration * 10)/10\n #valuePerSecond = Math.round(stat.reduce(((a, b) -> a + b.value), 0) / duration)\n valuePerTx = Math.round(last.reduce(((a, b) -> a + b.value), 0) / last.length)\n #feePerSecond = Math.round(stat.reduce(((a, b) -> a + b.fee), 0) / duration * 100)/100\n feePerTx = Math.round(last.reduce(((a, b) -> a + b.fee), 0) / last.length * 100)/100\n $(\".#{currency} .stats\").text \"\"\"\n #{txPerSecond.toLocaleString()} tx/s (#{stats[currency].count} unconfirmed)\n #{valuePerTx.toLocaleString(undefined, currencyFormat)} value/tx\n #{feePerTx.toLocaleString(undefined, { style: 'currency', currency: 'USD' })} fee/tx\n \"\"\"\n\n# set up a lane\ninitialize = (currency) ->\n if currencies[currency]? and $(\".#{currency}\")\n container = $(\".#{currency}\")\n container.css 'background-image', \"url('img/#{currency}.png')\"\n container.find(\"canvas\").remove()\n canvas = $ '<canvas></canvas>'\n container.append canvas\n engine = new CanvasRenderer canvas.get(0)\n canvas.data 'engine', engine\n engine.start() if container.is ':visible'\n currencies[currency].start showTx.bind(null, engine, currency), showBlock.bind(null, engine, currency)\n\n # donation links\n if currencies[currency].donationAddress\n container.find('.donate').on 'click', =>\n $('.overlay .donation').show().siblings().hide()\n $('.overlay').fadeToggle()\n .find('.address').text currencies[currency].donationAddress\n .end().find('.donation img').attr 'src', \"img/#{currency}-qr.png\"\n else\n container.find('.donate').remove()\n\n# update lane rendering (for resizing and lane toggling\nupdateLanes = ->\n $(\".currencies > div\").each ->\n container = $(@)\n engine = container.find('canvas').data 'engine'\n if container.is ':visible'\n engine.resize container.find('canvas').get(0)\n engine.start()\n else\n engine.stop()\n\nshowHelp = ->\n $('.overlay .help').show().siblings().hide()\n $('.overlay').fadeIn()\n\n# start everything\n$ ->\n # load prices\n updatePrices Object.keys(currencies)\n # set up overlay\n $('.overlay').on 'click', (e) ->\n if $('.overlay .help').is(':visible') # don't show help at the beginning after closing\n document.cookie = \"nohelp=true; expires=#{new Date(Date.now()+1000*60*60*24*365).toString()}; path=/\"\n $(this).fadeOut() if $(e.target).is('.overlay, .help')\n $('.overlay').hide() if !!document.cookie.match(/nohelp/) or !!location.hash.match(/nohelp/i)\n $('nav').hide() if !!location.hash.match(/nohelp/i)\n # initialize coins\n $('.currencies > div').each -> initialize $(@).attr 'class'\n # listen to resizing\n $(window).resize updateLanes\n # set up nav\n $ 'nav'\n .on 'click', '.help', showHelp\n .on 'click', '.right', ->\n $(\".currencies\").append($(\".currencies > div\").first())\n updateLanes()\n .on 'click', '.left', ->\n $(\".currencies\").prepend($(\".currencies > div\").last())\n updateLanes()\n"
]
}