diff --git a/tabletemplate/css/bootstrap-switch.min.css b/tabletemplate/css/bootstrap-switch.min.css new file mode 100644 index 00000000..55969600 --- /dev/null +++ b/tabletemplate/css/bootstrap-switch.min.css @@ -0,0 +1,12 @@ +/** + * bootstrap-switch - Turn checkboxes and radio buttons into toggle switches. + * + * @version v3.3.4 + * @homepage https://bttstrp.github.io/bootstrap-switch + * @author Mattia Larentis (http://larentis.eu) + * @license Apache-2.0 + */ + +.bootstrap-switch{display:inline-block;direction:ltr;cursor:pointer;border-radius:4px;border:1px solid #ccc;position:relative;text-align:left;overflow:hidden;line-height:8px;z-index:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;-webkit-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.bootstrap-switch .bootstrap-switch-container{display:inline-block;top:0;border-radius:4px;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.bootstrap-switch .bootstrap-switch-handle-off,.bootstrap-switch .bootstrap-switch-handle-on,.bootstrap-switch .bootstrap-switch-label{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;cursor:pointer;display:table-cell;vertical-align:middle;padding:6px 12px;font-size:14px;line-height:20px}.bootstrap-switch .bootstrap-switch-handle-off,.bootstrap-switch .bootstrap-switch-handle-on{text-align:center;z-index:1}.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary,.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary{color:#fff;background:#337ab7}.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-info,.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-info{color:#fff;background:#5bc0de}.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-success,.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-success{color:#fff;background:#5cb85c}.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-warning,.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-warning{background:#f0ad4e;color:#fff}.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-danger,.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-danger{color:#fff;background:#d9534f}.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-default,.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-default{color:#000;background:#eee}.bootstrap-switch .bootstrap-switch-label{text-align:center;margin-top:-1px;margin-bottom:-1px;z-index:100;color:#333;background:#fff}.bootstrap-switch span::before{content:"\200b"}.bootstrap-switch .bootstrap-switch-handle-on{border-bottom-left-radius:3px;border-top-left-radius:3px}.bootstrap-switch .bootstrap-switch-handle-off{border-bottom-right-radius:3px;border-top-right-radius:3px}.bootstrap-switch input[type=radio],.bootstrap-switch input[type=checkbox]{position:absolute!important;top:0;left:0;margin:0;z-index:-1;opacity:0;filter:alpha(opacity=0);visibility:hidden}.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-label{padding:1px 5px;font-size:12px;line-height:1.5}.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-label{padding:5px 10px;font-size:12px;line-height:1.5}.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-label{padding:6px 16px;font-size:18px;line-height:1.3333333}.bootstrap-switch.bootstrap-switch-disabled,.bootstrap-switch.bootstrap-switch-indeterminate,.bootstrap-switch.bootstrap-switch-readonly{cursor:default!important}.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-label,.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-label,.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-label{opacity:.5;filter:alpha(opacity=50);cursor:default!important}.bootstrap-switch.bootstrap-switch-animate .bootstrap-switch-container{-webkit-transition:margin-left .5s;-o-transition:margin-left .5s;transition:margin-left .5s}.bootstrap-switch.bootstrap-switch-inverse .bootstrap-switch-handle-on{border-radius:0 3px 3px 0}.bootstrap-switch.bootstrap-switch-inverse .bootstrap-switch-handle-off{border-radius:3px 0 0 3px}.bootstrap-switch.bootstrap-switch-focused{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.bootstrap-switch.bootstrap-switch-inverse.bootstrap-switch-off .bootstrap-switch-label,.bootstrap-switch.bootstrap-switch-on .bootstrap-switch-label{border-bottom-right-radius:3px;border-top-right-radius:3px}.bootstrap-switch.bootstrap-switch-inverse.bootstrap-switch-on .bootstrap-switch-label,.bootstrap-switch.bootstrap-switch-off .bootstrap-switch-label{border-bottom-left-radius:3px;border-top-left-radius:3px} + +.bootstrap-switch .bootstrap-switch-handle-on, .bootstrap-switch .bootstrap-switch-handle-off, .bootstrap-switch .bootstrap-switch-label { display: inline-flex !important; } \ No newline at end of file diff --git a/tabletemplate/css/cryptocoins-colors.css b/tabletemplate/css/cryptocoins-colors.css new file mode 100644 index 00000000..6a9321eb --- /dev/null +++ b/tabletemplate/css/cryptocoins-colors.css @@ -0,0 +1,106 @@ +i.cc.ARCH, i.cc.ARCH-alt { color: #002652; } +i.cc.BANX, i.cc.BANX-alt { color: #225BA6; } +i.cc.BC, i.cc.BC-alt { color: #202121; } +i.cc.BCN, i.cc.BCN-alt { color: #964F51; } +.BTC, i.cc.BTC-alt { color: #F7931A; } +i.cc.BTCD, i.cc.BTCD-alt { color: #2A72DC; } +.BTS, i.cc.BTS-alt { fill: #03A9E0; } +i.cc.DASH, i.cc.DASH-alt { color: #1c75bc; } +i.cc.DOGE, i.cc.DOGE-alt { color: #BA9F33; } +i.cc.FC2, i.cc.FC2-alt { color: #040405; } +i.cc.FTC, i.cc.FTC-alt { color: #679EF1; } +i.cc.GEMZ, i.cc.GEMZ-alt { color: #e86060; } +i.cc.GRC, i.cc.GRC-alt { color: #88A13C; } +i.cc.IFC, i.cc.IFC-alt { color: #ed272d; } +i.cc.KORE, i.cc.KORE-alt { color: #DF4124; } +i.cc.LTC, i.cc.LTC-alt { color: #838383; } +i.cc.MAID, i.cc.MAID-alt { color: #5492D6; } +i.cc.MSC, i.cc.MSC-alt { color: #1D4983; } +i.cc.NBT { color: #FFC93D; } +i.cc.NMC, i.cc.NMC-alt { color: #6787B7; } +i.cc.NOTE, i.cc.NOTE-alt { color: #42daff; } +i.cc.NXT, i.cc.NXT-alt { color: #008FBB; } +i.cc.OPAL, i.cc.OPAL-alt { color: #7193AA; } +i.cc.POT, i.cc.POT-alt { color: #105B2F; } +i.cc.PPC, i.cc.PPC-alt { color: #3FA30C; } +i.cc.QRK, i.cc.QRK-alt { color: #22AABF; } +i.cc.RBT, i.cc.RBT-alt { color: #0d4982; } +i.cc.SDC, i.cc.SDC-alt { color: #981D2D; } +i.cc.STR, i.cc.STR-alt { color: #08B5E5; } +i.cc.SYNC, i.cc.SYNC-alt { color: #008DD2; } +i.cc.UNITY, i.cc.UNITY-alt { color: #ED8527; } +i.cc.VIOR, i.cc.VIOR-alt { color: #1F52A4; } +i.cc.VPN, i.cc.VPN-alt { color: #589700; } +i.cc.VRC, i.cc.VRC-alt { color: #418bca; } +i.cc.VTC, i.cc.VTC-alt { color: #1b5c2e; } +i.cc.XCP, i.cc.XCP-alt { color: #EC1550; } +i.cc.XEM, i.cc.XEM-alt { color: #41bf76; } +i.cc.XMR { color: #FF6600; } +i.cc.XRP, i.cc.XRP-alt { color: #346AA9; } +i.cc.YBC, i.cc.YBC-alt { color: #D6C154; } +i.cc.DMD, i.cc.DMD-alt { color: #5497b2; } +i.cc.FRK, i.cc.FRK-alt { color: #0633cd; } +i.cc.IOC, i.cc.IOC-alt { color: #2fa3de; } +i.cc.LDOGE, i.cc.LDOGE-alt { color: #ffcc00; } +i.cc.MTR, i.cc.MTR-alt { color: #b92429; } +i.cc.MUE, i.cc.MUE-alt { color: #f5a10e; } +i.cc.XAI, i.cc.XAI-alt { color: #2ef99f; } +i.cc.XBS, i.cc.XBS-alt { color: #d3261d; } +i.cc.XPM, i.cc.XPM-alt { color: #e5b625; } +i.cc.BAY, i.cc.BAY-alt { color: #584ba1; } +i.cc.DGB, i.cc.DGB-alt { color: #0066cc; } +i.cc.EMC, i.cc.EMC-alt { color: #674c8c; } +i.cc.ETH, i.cc.ETH-alt { color: #282828; } +i.cc.MINT, i.cc.MINT-alt { color: #006835; } +i.cc.MONA, i.cc.MONA-alt { color: #a99364; } +i.cc.MRC { color: #4279bd; } +i.cc.NEU, i.cc.NEU-alt { color: #2983c0; } +i.cc.NVC, i.cc.NVC-alt { color: #ecab41; } +i.cc.AEON, i.cc.AEON-alt { color: #164450; } +i.cc.AMP, i.cc.AMP-alt { color: #048DD2; } +i.cc.ANC, i.cc.ANC-alt { color: #000; } +i.cc.BTA { color: #210094; } +i.cc.CLAM, i.cc.CLAM-alt { color: #D6AB31; } +i.cc.CLOAK, i.cc.CLOAK-alt { color: #DF3F1E; } +i.cc.DCR, i.cc.DCR-alt { color: #43A2CA; } +i.cc.NEOS, i.cc.NEOS-alt { color: #3771B1; } +i.cc.NLG, i.cc.NLG-alt { color: #003E7E; } +i.cc.OK, i.cc.OK-alt { color: #0165A4; } +i.cc.OMNI, i.cc.OMNI-alt { color: #18347E; } +i.cc.RBY, i.cc.RBY-alt { color: #D31F26; } +i.cc.SCOT, i.cc.SCOT-alt { color: #3498DB; } +i.cc.SJCX, i.cc.SJCX-alt { color: #003366; } +i.cc.START, i.cc.START-alt { color: #01AEF0; } +i.cc.SYS, i.cc.SYS-alt { color: #0098DA; } +i.cc.VNL, i.cc.VNL-alt { color: #404249; } +i.cc.TX, i.cc.TX-alt { color: #1F8BCC; } +i.cc.XVG, i.cc.XVG-alt { color: #42AFB2; } +i.cc.FCT, i.cc.FCT-alt { color: #2175BB; } +i.cc.GDC, i.cc.GDC-alt { color: #E9A226; } +i.cc.JBS, i.cc.JBS-alt { color: #1A8BCD; } +i.cc.LISK, i.cc.LISK-alt { color: #1A6896; } +i.cc.PIGGY, i.cc.PIGGY-alt { color: #F27A7A; } +i.cc.RBIES, i.cc.RBIES-alt { color: #C62436; } +i.cc.SAR, i.cc.SAR-alt { color: #1B72B8; } +i.cc.SLG, i.cc.SLG-alt { color: #5A6875; } +i.cc.USDT, i.cc.USDT-alt { color: #2CA07A; } +i.cc.ZEIT, i.cc.ZEIT-alt { color: #ACACAC; } +i.cc.DGD, i.cc.DGX { color: #D8A24A; } +i.cc.ADC, i.cc.ADC-alt { color: #3CB0E5; } +i.cc.BSD, i.cc.BSD-alt { color: #1186E7; } +i.cc.DAO, i.cc.DAO-alt { color: #FF3B3B; } +i.cc.ERC, i.cc.ERC-alt { color: #101E84; } +i.cc.ETC, i.cc.ETC-alt { color: #669073; } +i.cc.GLD, i.cc.GLD-alt { color: #E8BE24; } +i.cc.GRS { color: #648FA0; } +i.cc.KOBO { color: #80C342; } +i.cc.LBC, i.cc.LBC-alt { color: #015C47; } +i.cc.PINK, i.cc.PINK-alt { color: #ED31CA; } +i.cc.RDD, i.cc.RDD-alt { color: #ED1C24; } +i.cc.RISE, i.cc.RISE-alt { color: #43CEA2; } +i.cc.SIA, i.cc.SIA-alt { color: #00CBA0; } +i.cc.SLS, i.cc.SLS-alt { color: #1EB549; } +i.cc.SNRG, i.cc.SNRG-alt { color: #160363; } +i.cc.STEEM, i.cc.STEEM-alt { color: #1A5099; } +i.cc.STRAT, i.cc.STRAT-alt { color: #33C7F5; } +i.cc.SWIFT, i.cc.SWIFT-alt { color: #428BCA; } \ No newline at end of file diff --git a/tabletemplate/css/cryptocoins.css b/tabletemplate/css/cryptocoins.css new file mode 100644 index 00000000..2335a61d --- /dev/null +++ b/tabletemplate/css/cryptocoins.css @@ -0,0 +1,641 @@ +@font-face { + font-family: 'cryptocoins'; + src: url('../fonts/cryptocoins.woff2?d2eit9') format('woff2'); + font-weight: normal; + font-style: normal; +} + +i.cc { + /* use !important to prevent issues with browser extensions that change fonts */ + font-family: 'cryptocoins' !important; + speak: none; + font-style: normal; + font-weight: normal; + font-variant: normal; + text-transform: none; + line-height: 1; + + /* Better Font Rendering =========== */ + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +i.cc.SAR:before { + content: "\e900"; +} +i.cc.SAR-alt:before { + content: "\e901"; +} +i.cc.SCOT:before { + content: "\e902"; +} +i.cc.SCOT-alt:before { + content: "\e903"; +} +i.cc.SDC:before { + content: "\e904"; +} +i.cc.SDC-alt:before { + content: "\e905"; +} +i.cc.SIA:before { + content: "\e906"; +} +i.cc.SIA-alt:before { + content: "\e907"; +} +i.cc.SJCX:before { + content: "\e908"; +} +i.cc.SJCX-alt:before { + content: "\e909"; +} +i.cc.SLG:before { + content: "\e90a"; +} +i.cc.SLG-alt:before { + content: "\e90b"; +} +i.cc.SLS:before { + content: "\e90c"; +} +i.cc.SLS-alt:before { + content: "\e90d"; +} +i.cc.SNRG:before { + content: "\e90e"; +} +i.cc.SNRG-alt:before { + content: "\e90f"; +} +i.cc.START:before { + content: "\e910"; +} +i.cc.START-alt:before { + content: "\e911"; +} +i.cc.STEEM:before { + content: "\e912"; +} +i.cc.STEEM-alt:before { + content: "\e913"; +} +i.cc.STR:before { + content: "\e914"; +} +i.cc.STR-alt:before { + content: "\e915"; +} +i.cc.STRAT:before { + content: "\e916"; +} +i.cc.STRAT-alt:before { + content: "\e917"; +} +i.cc.SWIFT:before { + content: "\e918"; +} +i.cc.SWIFT-alt:before { + content: "\e919"; +} +i.cc.SYNC:before { + content: "\e91a"; +} +i.cc.SYNC-alt:before { + content: "\e91b"; +} +i.cc.SYS:before { + content: "\e91c"; +} +i.cc.SYS-alt:before { + content: "\e91d"; +} +i.cc.TX:before { + content: "\e91e"; +} +i.cc.TX-alt:before { + content: "\e91f"; +} +i.cc.UNITY:before { + content: "\e920"; +} +i.cc.UNITY-alt:before { + content: "\e921"; +} +i.cc.USDT:before { + content: "\e922"; +} +i.cc.USDT-alt:before { + content: "\e923"; +} +i.cc.VIOR:before { + content: "\e924"; +} +i.cc.VIOR-alt:before { + content: "\e925"; +} +i.cc.VNL:before { + content: "\e926"; +} +i.cc.VNL-alt:before { + content: "\e927"; +} +i.cc.VPN:before { + content: "\e928"; +} +i.cc.VPN-alt:before { + content: "\e929"; +} +i.cc.VRC:before { + content: "\e92a"; +} +i.cc.VRC-alt:before { + content: "\e92b"; +} +i.cc.VTC:before { + content: "\e92c"; +} +i.cc.VTC-alt:before { + content: "\e92d"; +} +i.cc.XAI:before { + content: "\e92e"; +} +i.cc.XAI-alt:before { + content: "\e92f"; +} +i.cc.XBS:before { + content: "\e930"; +} +i.cc.XBS-alt:before { + content: "\e931"; +} +i.cc.XCP:before { + content: "\e932"; +} +i.cc.XCP-alt:before { + content: "\e933"; +} +i.cc.XEM:before { + content: "\e934"; +} +i.cc.XEM-alt:before { + content: "\e935"; +} +i.cc.XMR:before { + content: "\e936"; +} +i.cc.XPM:before { + content: "\e937"; +} +i.cc.XPM-alt:before { + content: "\e938"; +} +i.cc.XRP:before { + content: "\e939"; +} +i.cc.XRP-alt:before { + content: "\e93a"; +} +i.cc.XVG:before { + content: "\e93b"; +} +i.cc.XVG-alt:before { + content: "\e93c"; +} +i.cc.YBC:before { + content: "\e93d"; +} +i.cc.YBC-alt:before { + content: "\e93e"; +} +i.cc.ZEIT:before { + content: "\e93f"; +} +i.cc.ZEIT-alt:before { + content: "\e940"; +} +i.cc.MAID:before { + content: "\e941"; +} +i.cc.MAID-alt:before { + content: "\e942"; +} +i.cc.MINT:before { + content: "\e943"; +} +i.cc.MINT-alt:before { + content: "\e944"; +} +i.cc.MONA:before { + content: "\e945"; +} +i.cc.MONA-alt:before { + content: "\e946"; +} +i.cc.MRC:before { + content: "\e947"; +} +i.cc.MSC:before { + content: "\e948"; +} +i.cc.MSC-alt:before { + content: "\e949"; +} +i.cc.MTR:before { + content: "\e94a"; +} +i.cc.MTR-alt:before { + content: "\e94b"; +} +i.cc.MUE:before { + content: "\e94c"; +} +i.cc.MUE-alt:before { + content: "\e94d"; +} +i.cc.NBT:before { + content: "\e94e"; +} +i.cc.NEOS:before { + content: "\e94f"; +} +i.cc.NEOS-alt:before { + content: "\e950"; +} +i.cc.NEU:before { + content: "\e951"; +} +i.cc.NEU-alt:before { + content: "\e952"; +} +i.cc.NLG:before { + content: "\e953"; +} +i.cc.NLG-alt:before { + content: "\e954"; +} +i.cc.NMC:before { + content: "\e955"; +} +i.cc.NMC-alt:before { + content: "\e956"; +} +i.cc.NOTE:before { + content: "\e957"; +} +i.cc.NOTE-alt:before { + content: "\e958"; +} +i.cc.NVC:before { + content: "\e959"; +} +i.cc.NVC-alt:before { + content: "\e95a"; +} +i.cc.NXT:before { + content: "\e95b"; +} +i.cc.NXT-alt:before { + content: "\e95c"; +} +i.cc.OK:before { + content: "\e95d"; +} +i.cc.OK-alt:before { + content: "\e95e"; +} +i.cc.OMNI:before { + content: "\e95f"; +} +i.cc.OMNI-alt:before { + content: "\e960"; +} +i.cc.OPAL:before { + content: "\e961"; +} +i.cc.OPAL-alt:before { + content: "\e962"; +} +i.cc.PIGGY:before { + content: "\e963"; +} +i.cc.PIGGY-alt:before { + content: "\e964"; +} +i.cc.PINK:before { + content: "\e965"; +} +i.cc.PINK-alt:before { + content: "\e966"; +} +i.cc.POT:before { + content: "\e967"; +} +i.cc.POT-alt:before { + content: "\e968"; +} +i.cc.PPC:before { + content: "\e969"; +} +i.cc.PPC-alt:before { + content: "\e96a"; +} +i.cc.QRK:before { + content: "\e96b"; +} +i.cc.QRK-alt:before { + content: "\e96c"; +} +i.cc.RBIES:before { + content: "\e96d"; +} +i.cc.RBIES-alt:before { + content: "\e96e"; +} +i.cc.RBT:before { + content: "\e96f"; +} +i.cc.RBT-alt:before { + content: "\e970"; +} +i.cc.RBY:before { + content: "\e971"; +} +i.cc.RBY-alt:before { + content: "\e972"; +} +i.cc.RDD:before { + content: "\e973"; +} +i.cc.RDD-alt:before { + content: "\e974"; +} +i.cc.RISE:before { + content: "\e975"; +} +i.cc.RISE-alt:before { + content: "\e976"; +} +i.cc.GDC:before { + content: "\e977"; +} +i.cc.GDC-alt:before { + content: "\e978"; +} +i.cc.GEMZ:before { + content: "\e979"; +} +i.cc.GEMZ-alt:before { + content: "\e97a"; +} +i.cc.GLD:before { + content: "\e97b"; +} +i.cc.GLD-alt:before { + content: "\e97c"; +} +i.cc.GRC:before { + content: "\e97d"; +} +i.cc.GRC-alt:before { + content: "\e97e"; +} +i.cc.GRS:before { + content: "\e97f"; +} +i.cc.IFC:before { + content: "\e980"; +} +i.cc.IFC-alt:before { + content: "\e981"; +} +i.cc.IOC:before { + content: "\e982"; +} +i.cc.IOC-alt:before { + content: "\e983"; +} +i.cc.JBS:before { + content: "\e984"; +} +i.cc.JBS-alt:before { + content: "\e985"; +} +i.cc.KOBO:before { + content: "\e986"; +} +i.cc.KORE:before { + content: "\e987"; +} +i.cc.KORE-alt:before { + content: "\e988"; +} +i.cc.LBC:before { + content: "\e989"; +} +i.cc.LBC-alt:before { + content: "\e98a"; +} +i.cc.LDOGE:before { + content: "\e98b"; +} +i.cc.LDOGE-alt:before { + content: "\e98c"; +} +i.cc.LISK:before { + content: "\e98d"; +} +i.cc.LISK-alt:before { + content: "\e98e"; +} +i.cc.LTC:before { + content: "\e98f"; +} +i.cc.LTC-alt:before { + content: "\e990"; +} +i.cc.ADC:before { + content: "\e991"; +} +i.cc.ADC-alt:before { + content: "\e992"; +} +i.cc.AEON:before { + content: "\e993"; +} +i.cc.AEON-alt:before { + content: "\e994"; +} +i.cc.AMP:before { + content: "\e995"; +} +i.cc.AMP-alt:before { + content: "\e996"; +} +i.cc.ANC:before { + content: "\e997"; +} +i.cc.ANC-alt:before { + content: "\e998"; +} +i.cc.ARCH:before { + content: "\e999"; +} +i.cc.ARCH-alt:before { + content: "\e99a"; +} +i.cc.BANX:before { + content: "\e99b"; +} +i.cc.BANX-alt:before { + content: "\e99c"; +} +i.cc.BAY:before { + content: "\e99d"; +} +i.cc.BAY-alt:before { + content: "\e99e"; +} +i.cc.BC:before { + content: "\e99f"; +} +i.cc.BC-alt:before { + content: "\e9a0"; +} +i.cc.BCN:before { + content: "\e9a1"; +} +i.cc.BCN-alt:before { + content: "\e9a2"; +} +i.cc.BSD:before { + content: "\e9a3"; +} +i.cc.BSD-alt:before { + content: "\e9a4"; +} +i.cc.BTA:before { + content: "\e9a5"; +} +i.cc.BTC:before { + content: "\e9a6"; +} +i.cc.BTC-alt:before { + content: "\e9a7"; +} +i.cc.BTCD:before { + content: "\e9a8"; +} +i.cc.BTCD-alt:before { + content: "\e9a9"; +} +i.cc.BTS:before { + content: "\e9aa"; +} +i.cc.BTS-alt:before { + content: "\e9ab"; +} +i.cc.CLAM:before { + content: "\e9ac"; +} +i.cc.CLAM-alt:before { + content: "\e9ad"; +} +i.cc.CLOAK:before { + content: "\e9ae"; +} +i.cc.CLOAK-alt:before { + content: "\e9af"; +} +i.cc.DAO:before { + content: "\e9b0"; +} +i.cc.DAO-alt:before { + content: "\e9b1"; +} +i.cc.DASH:before { + content: "\e9b2"; +} +i.cc.DASH-alt:before { + content: "\e9b3"; +} +i.cc.DCR:before { + content: "\e9b4"; +} +i.cc.DCR-alt:before { + content: "\e9b5"; +} +i.cc.DGB:before { + content: "\e9b6"; +} +i.cc.DGB-alt:before { + content: "\e9b7"; +} +i.cc.DGD:before { + content: "\e9b8"; +} +i.cc.DGX:before { + content: "\e9b9"; +} +i.cc.DMD:before { + content: "\e9ba"; +} +i.cc.DMD-alt:before { + content: "\e9bb"; +} +i.cc.DOGE:before { + content: "\e9bc"; +} +i.cc.DOGE-alt:before { + content: "\e9bd"; +} +i.cc.EMC:before { + content: "\e9be"; +} +i.cc.EMC-alt:before { + content: "\e9bf"; +} +i.cc.ERC:before { + content: "\e9c0"; +} +i.cc.ERC-alt:before { + content: "\e9c1"; +} +i.cc.ETC:before { + content: "\e9c2"; +} +i.cc.ETC-alt:before { + content: "\e9c3"; +} +i.cc.ETH:before { + content: "\e9c4"; +} +i.cc.ETH-alt:before { + content: "\e9c5"; +} +i.cc.FC2:before { + content: "\e9c6"; +} +i.cc.FC2-alt:before { + content: "\e9c7"; +} +i.cc.FCT:before { + content: "\e9c8"; +} +i.cc.FCT-alt:before { + content: "\e9c9"; +} +i.cc.FRK:before { + content: "\e9ca"; +} +i.cc.FRK-alt:before { + content: "\e9cb"; +} +i.cc.FTC:before { + content: "\e9cc"; +} +i.cc.FTC-alt:before { + content: "\e9cd"; +} + diff --git a/tabletemplate/css/polobot.css b/tabletemplate/css/polobot.css new file mode 100644 index 00000000..9324db87 --- /dev/null +++ b/tabletemplate/css/polobot.css @@ -0,0 +1,76 @@ + .loader { + margin:auto; + border: 16px solid #f3f3f3; + border-top: 16px solid green; + border-bottom: 16px solid green; + border-radius: 50%; + width: 120px; + height: 120px; + animation: spin 2s linear infinite; +} + +@keyframes spin { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } +} + +.coindetails {color:black !important;} + .card {margin-bottom:20px} + *,body { + font-family: 'Roboto Condensed', sans-serif; + } + + .fa-chevron-down,.fa-chevron-up { + float:right + } + + .brand-margin{ + margin-top:4px; + margin-bottom:4px + } + + .inlinediv { + display: inline-block; + padding-right: 5%; + vertical-align: top; + } + .plb-tooltip { + white-space: nowrap; + text-decoration: none; + border-bottom: 1px dotted; + color: black; + } + .plb-tooltip:hover { + text-decoration: none; + } + + form h5 { + font-weight: 700; + } + + form p, + form h5 { + margin-bottom: 5px; + } + + .nav .fa { + color: black; + } + + #file, + #input-file { + display: none; + } + + div.alert{ + padding:0px;margin-bottom:0px + } + + .lendingimage { height:32px;width:32px;} + .margintop {margin-top:10px;} + .marginbottom {margin-bottom:10px;} + .marginzero {margin-bottom:0;} + .chartstyle {width:300px;height:400px;} + .cardicon {font-size:50px;text-align:center;padding-top:1.25rem;display:block} + + .bootstrap-switch .bootstrap-switch-handle-off, .bootstrap-switch .bootstrap-switch-handle-on, .bootstrap-switch .bootstrap-switch-label {padding:8px 12px;} \ No newline at end of file diff --git a/tabletemplate/fonts/cryptocoins.woff2 b/tabletemplate/fonts/cryptocoins.woff2 new file mode 100644 index 00000000..01ccc4ac Binary files /dev/null and b/tabletemplate/fonts/cryptocoins.woff2 differ diff --git a/tabletemplate/images/bitfinex.ico b/tabletemplate/images/bitfinex.ico new file mode 100644 index 00000000..79a54952 Binary files /dev/null and b/tabletemplate/images/bitfinex.ico differ diff --git a/tabletemplate/images/icon.ico b/tabletemplate/images/icon.ico new file mode 100644 index 00000000..6f1b5ae9 Binary files /dev/null and b/tabletemplate/images/icon.ico differ diff --git a/tabletemplate/images/icon192.png b/tabletemplate/images/icon192.png new file mode 100644 index 00000000..e4e5e7fb Binary files /dev/null and b/tabletemplate/images/icon192.png differ diff --git a/tabletemplate/images/icon32.png b/tabletemplate/images/icon32.png new file mode 100644 index 00000000..08bc4fae Binary files /dev/null and b/tabletemplate/images/icon32.png differ diff --git a/tabletemplate/images/icon384.png b/tabletemplate/images/icon384.png new file mode 100644 index 00000000..3b9ae86f Binary files /dev/null and b/tabletemplate/images/icon384.png differ diff --git a/tabletemplate/images/icon48.png b/tabletemplate/images/icon48.png new file mode 100644 index 00000000..4050a11a Binary files /dev/null and b/tabletemplate/images/icon48.png differ diff --git a/tabletemplate/images/ios_splash.png b/tabletemplate/images/ios_splash.png new file mode 100644 index 00000000..f0e0ab68 Binary files /dev/null and b/tabletemplate/images/ios_splash.png differ diff --git a/tabletemplate/images/poloniex.ico b/tabletemplate/images/poloniex.ico new file mode 100644 index 00000000..58605b36 Binary files /dev/null and b/tabletemplate/images/poloniex.ico differ diff --git a/tabletemplate/index.html b/tabletemplate/index.html new file mode 100644 index 00000000..9a9ea9bc --- /dev/null +++ b/tabletemplate/index.html @@ -0,0 +1,12 @@ + + + + + + + + Lending Bot + + diff --git a/tabletemplate/js/bootstrap-switch.min.js b/tabletemplate/js/bootstrap-switch.min.js new file mode 100644 index 00000000..1381dc11 --- /dev/null +++ b/tabletemplate/js/bootstrap-switch.min.js @@ -0,0 +1,10 @@ +/** + * bootstrap-switch - Turn checkboxes and radio buttons into toggle switches. + * + * @version v3.3.4 + * @homepage https://bttstrp.github.io/bootstrap-switch + * @author Mattia Larentis (http://larentis.eu) + * @license Apache-2.0 + */ + +(function(a,b){if('function'==typeof define&&define.amd)define(['jquery'],b);else if('undefined'!=typeof exports)b(require('jquery'));else{b(a.jquery),a.bootstrapSwitch={exports:{}}.exports}})(this,function(a){'use strict';function c(j,k){if(!(j instanceof k))throw new TypeError('Cannot call a class as a function')}var d=function(j){return j&&j.__esModule?j:{default:j}}(a),e=Object.assign||function(j){for(var l,k=1;k',{class:function(){var o=[];return o.push(l.options.state?'on':'off'),l.options.size&&o.push(l.options.size),l.options.disabled&&o.push('disabled'),l.options.readonly&&o.push('readonly'),l.options.indeterminate&&o.push('indeterminate'),l.options.inverse&&o.push('inverse'),l.$element.attr('id')&&o.push('id-'+l.$element.attr('id')),o.map(l._getClass.bind(l)).concat([l.options.baseClass],l._getClasses(l.options.wrapperClass)).join(' ')}}),this.$container=g('
',{class:this._getClass('container')}),this.$on=g('',{html:this.options.onText,class:this._getClass('handle-on')+' '+this._getClass(this.options.onColor)}),this.$off=g('',{html:this.options.offText,class:this._getClass('handle-off')+' '+this._getClass(this.options.offColor)}),this.$label=g('',{html:this.options.labelText,class:this._getClass('label')}),this.$element.on('init.bootstrapSwitch',this.options.onInit.bind(this,k)),this.$element.on('switchChange.bootstrapSwitch',function(){for(var n=arguments.length,o=Array(n),p=0;p-(l._handleWidth/2);l._dragEnd=!1,l.state(l.options.inverse?!p:p)}else l.state(!l.options.state);l._dragStart=!1}},'mouseleave.bootstrapSwitch':function(){l.$label.trigger('mouseup.bootstrapSwitch')}})}},{key:'_externalLabelHandler',value:function(){var l=this,m=this.$element.closest('label');m.on('click',function(n){n.preventDefault(),n.stopImmediatePropagation(),n.target===m[0]&&l.toggleState()})}},{key:'_formHandler',value:function(){var l=this.$element.closest('form');l.data('bootstrap-switch')||l.on('reset.bootstrapSwitch',function(){window.setTimeout(function(){l.find('input').filter(function(){return g(this).data('bootstrap-switch')}).each(function(){return g(this).bootstrapSwitch('state',this.checked)})},1)}).data('bootstrap-switch',!0)}},{key:'_getClass',value:function(l){return this.options.baseClass+'-'+l}},{key:'_getClasses',value:function(l){return g.isArray(l)?l.map(this._getClass.bind(this)):[this._getClass(l)]}}]),j}();g.fn.bootstrapSwitch=function(j){for(var l=arguments.length,m=Array(1 + + + + + + + + + + + + + + + + + + + + + + + + Lending Bot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + +
ExchangeRate ØCoinBalanceBalance $Interest 24hInterest TotalInterest $
+ +
+
+ +
+
+
+
+
+
+
+
+ + + +
ExchangeCoinDurationEndsAmountRateInterest
+
+
+
+ +
+
+
+
+ + + + + +
+
+
+
+ + + +
ExchangeTypeDateMessage
+
+
+
+
+
+
Settings
+
+
+ +
+ + +
+ +
+
Notification
+ + + + + + + +
+ +
+
Display Currency
+ +
+ +
+
Date ranges to display earnings for
+ + + + + +
+ +
+
Bitcoin Display Unit
+ + + + +
+ +
+
Which earnings are displayed in selected output currency
+ + +
+ +
+
Effective loan rates calculation
+

Effective rate can either take into consideration the actual amount actively lent OR consider only Poloniex 15% fee

+ + +
+ +
+
Date Format
+ +
+ +
+
Relative Dates
+ +
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tabletemplate/lendingbot.js b/tabletemplate/lendingbot.js new file mode 100644 index 00000000..4c7a01e1 --- /dev/null +++ b/tabletemplate/lendingbot.js @@ -0,0 +1,861 @@ +// vim: ts=4:sw=4:et +var localFile, reader; + +var Hour = new Timespan("Hour", 1/24); +var Day = new Timespan("Day", 1); +var Week = new Timespan("Week", 7); +var Month = new Timespan("Month", 30); +var Year = new Timespan("Year", 365); +var refreshRate = 30; +var timespans = []; +var summaryCoinRate, summaryCoin; +var earningsOutputCoinRate, earningsOutputCoin; +var outputCurrencyDisplayMode = 'all' +var validOutputCurrencyDisplayModes = ['all', 'summary']; +var effRateMode = 'lentperc'; +var validEffRateModes = ['lentperc', 'onlyfee']; + +// BTC DisplayUnit +var BTC = new BTCDisplayUnit("BTC", 1); +var mBTC = new BTCDisplayUnit("mBTC", 1000); +var Bits = new BTCDisplayUnit("Bits", 1000000); +var Satoshi = new BTCDisplayUnit("Satoshi", 100000000); +var displayUnit = BTC; +var btcDisplayUnitsModes = [BTC, mBTC, Bits, Satoshi]; + +// Date Format +var dateformat = localStorage.getItem('dateformat') || 'DD. M. YYYY H:mm:ss '; +var Jsondata; +var accounttotal; + +var mincoins = JSON.parse(localStorage.getItem('MinCoins')) || {'BTC':0.01,'BTS':10,'CLAM':10,'DASH':0.01,'DOGE':100,'ETH':0.01,'FCT':100,'LTC':0.01,'MAID':10,'STR':100,'XMR':0.01,'XRP':100}; + +function mincoincheck(exchange,coin,value){ + if(exchange == "BITFINEX"){ + //BITFINEX -> 50$ + } + var response; + if (mincoins[coin] && value >= mincoins[coin]) {response = value;} + else if(mincoins[coin]) {response = '' + value + '';} + return response || value; +} + +function notification(string,type){ + + if((moment().diff(moment(localStorage.getItem('last_updated')),'seconds') < ( localStorage.getItem('refreshRate') || 30)) || string.indexOf('Update') >= 0) {} else {return false;} + + if (localStorage.getItem('notificationOnUpdate')) { + toastr.options = {"positionClass": "toast-top-right"} + if(type == "success" || type == "update"){ + toastr.success(string); + } else if (type == "warning") { + toastr.error(string); + } + else { + toastr.info(string) + } + } +} + +function coinicon(string){ + var arr = ['BTC','BTS','CLAM','DASH','DOGE','ETH','FCT','LTC','MAID','STR','XMR','XRP']; + var output = ''; + for (var i = arr.length - 1; i >=0; i--) { + if (string.indexOf(arr[i]) >= 0) { + output = " "; + } + } + return output + string; +} + +function shorttimestring(timestring){ + if(localStorage.getItem('relativedates') != "true"){return timestring;} + var time = moment(timestring,'YYYY-MM-DD h:mm:ss').format(dateformat); + var shorttime; + + $.each(["years","months","weeks","days","hours","minutes","seconds"],function(key,value){ + if (moment().diff(moment(timestring,'YYYY-MM-DD h:mm:ss'),value) >= 1) { + shorttime = '' + moment().diff(moment(timestring,'YYYY-MM-DD h:mm:ss'),value) + ' ' + value + ' ago'; + return false; + } + }) + + return shorttime; +} + +function timeleft(timestring){ + if(moment().isSameOrAfter(moment(timestring))){return false;} + var time = moment(timestring,'YYYY-MM-DD h:mm:ss').format(dateformat); + var shorttime; + + $.each(["years","months","weeks","days","hours","minutes","seconds"],function(key,value){ + if (timestring.diff(moment(moment(),'YYYY-MM-DD h:mm:ss'),value) >= 1) { + shorttime = '' + timestring.diff(moment(moment(),'YYYY-MM-DD h:mm:ss'),value) + ' ' + value + ''; + return false; + } + }) + + return shorttime; +} + + var coindataSet; + +function updateJson(data) { + + coindataSet = []; + Jsondata = data["raw_data"]; + $('.exchangefilter').empty(); + $('.exchangefilter').append(""); + + $.each(Jsondata,function(key,value){ + $('.exchangefilter').append(""); + + switch(key){ + + case "POLONIEX": + poloapi(value); + break; + + case "BITFINEX": + bitfinexapi(value); + break; + } + }) + + function poloapi(data){ + $.get( "https://poloniex.com/public?command=returnTicker", function( poloniexdata ) { + poloniexdata["BTC_BTC"] = {}; + $.each(poloniexdata,function(k,v){ + if (k.indexOf('BTC_') >=0) { + var coin = k.replace("BTC_",""); + var highbid = v["highestBid"]; + $.each(Jsondata["POLONIEX"],function(key,value){ + + if (key == coin) { + + Jsondata["POLONIEX"][key]["highestBid"] = Jsondata["POLONIEX"][key]["highestBid"] || highbid || 1; + Jsondata["POLONIEX"][key]["totalCoins"] = prettyFloat(+value["totalCoins"] || +value["maxToLend"],4); + Jsondata["POLONIEX"][key]["balance"] = prettyFloat(localStorage.getItem('displayCurrencyRate') * (Jsondata["POLONIEX"][key]["totalCoins"] * value["highestBid"]),2); + Jsondata["POLONIEX"][key]["interestcoin"] = Jsondata["POLONIEX"][key]["totalEarnings"] || 0; + Jsondata["POLONIEX"][key]["interest24h"] = prettyFloat(+Jsondata["POLONIEX"][key]["yesterdayEarnings"],8) || 0; + Jsondata["POLONIEX"][key]["interestcurrency"] = prettyFloat(Jsondata["POLONIEX"][key]["totalEarnings"] * value["highestBid"] * localStorage.getItem('displayCurrencyRate'),2); + + coindataSet.push([exchangeicon("POLONIEX",false), prettyFloat(Math.pow((+value["averageLendingRate"] * 0.85 / 100) + 1, 365) - 1,2) * 100 + " %",coinicon(key),value["totalCoins"],value["balance"],value["interest24h"],value["interestcoin"],value["interestcurrency"]]); + + } + + }) + + } + + }); + rendertable(); + }); + } + + function bitfinexapi(data){ + var ticker = []; + + $.each(data,function(key,value){ + ticker.push("t" + key.toUpperCase()+"BTC"); + }) + + $.get( "https://api.bitfinex.com/v2/tickers?symbols="+ticker.toString() , function( data ) { + $.each(data,function(key,value){ + var coin = value[0].substring(1,value[0].length-3); + + Jsondata["BITFINEX"][coin]["highestBid"] = Jsondata["BITFINEX"][coin]["highestBid"] || value[7] || 1; + Jsondata["BITFINEX"][coin]["totalCoins"] = prettyFloat(+Jsondata["BITFINEX"][coin]["totalCoins"] || +Jsondata["BITFINEX"][coin]["maxToLend"],4); + Jsondata["BITFINEX"][coin]["balance"] = prettyFloat(localStorage.getItem('displayCurrencyRate') * (Jsondata["BITFINEX"][coin]["totalCoins"] * Jsondata["BITFINEX"][coin]["highestBid"]),2); + Jsondata["BITFINEX"][coin]["interestcoin"] = Jsondata["BITFINEX"][coin]["totalEarnings"] || 0; + Jsondata["BITFINEX"][coin]["interest24h"] = prettyFloat(+Jsondata["BITFINEX"][coin]["yesterdayEarnings"],8) || 0; + Jsondata["BITFINEX"][coin]["interestcurrency"] = prettyFloat(Jsondata["BITFINEX"][coin]["totalEarnings"] * Jsondata["BITFINEX"][coin]["highestBid"] * localStorage.getItem('displayCurrencyRate'),2); + + coindataSet.push([exchangeicon("BITFINEX",false), ""+prettyFloat(Math.pow((+Jsondata["BITFINEX"][coin]["averageLendingRate"] * 0.85 / 100) + 1, 365) - 1,4) * 100 + " %",coinicon(coin),Jsondata["BITFINEX"][coin]["totalCoins"],Jsondata["BITFINEX"][coin]["balance"],Jsondata["BITFINEX"][coin]["interest24h"],Jsondata["BITFINEX"][coin]["interestcoin"],Jsondata["BITFINEX"][coin]["interestcurrency"]]); + }) + rendertable(); + }) + + } + var rendered = 0; + function rendertable(){ + rendered++; + if((rendered % 2) != 0){return false;} + if ( $.fn.dataTable.isDataTable( '#coinstatustable' ) ) { + cointable = $('#coinstatustable').DataTable().columns.adjust().draw( false ); + } + else { + cointable = $('#coinstatustable').DataTable({data: coindataSet,"bPaginate": false,"bInfo" : false,responsive: true} ); + } + } + + $('.displayCurrency').each(function(){ + $(this).html(($(this).html().replace("$",localStorage.getItem("displayCurrency")))); + }) + + var successnumber = 0; + var cancelednumber = 0; + var errornumber = 0; + var infonumber = 0; + + var logdataSet = []; + + var regexarray = [/(\d{4}[.-]\d{2}[.-]\d{2}[ ]\d{2}[:]\d{2}[:]\d{2})/,/[ ]\d{0,20}[.]\d{0,20}[ ]([A-Z]{0,10})[ ]/,/[ ](\d{0,20}[.]\d{0,20})[ ]/,/\bfor?\b[ ](\d{0,3}[ ]\bdays?\b)/,/(\d{0,4}[.]\d{0,18})[%]/]; + +for(exchange in data.log){ + + var rowCount = data.log[exchange].length; + localStorage.setItem('last_updated',data["last_update"]); + + for (var i = rowCount - 1; i >=0; i--) { + + var logstring = ((data.log[exchange][i]).match(regexarray[0]))[1]; + var logdate = shorttimestring(logstring); + var logmessage = data.log[exchange][i].replace(logstring,""); + + if((logmessage).indexOf("min_loan_size") >= 0){ + var coinobject = ((logmessage).match(/([A-Z]{0,5})'/))[1]; + var coinamountobject = ((logmessage).match(/: (\d{1,4}[\.]*\d*)/))[1]; + if(mincoins[coinobject] != coinamountobject) { + mincoins[coinobject] = coinamountobject; + localStorage.setItem("MinCoins",JSON.stringify(mincoins)); + }; + } + + if (logmessage.indexOf("Error") >= 0) { + if (localStorage.getItem('notificationOnError') == "true"){notification(logmessage,"warning");} + logmessage = '' + logmessage + ''; + errornumber++; + logdataSet.push([exchangeicon(exchange,false),"Error",logdate,logmessage.replace("Error: ","")]); + } + else if (logmessage.indexOf("Placing") >= 0) { + if (localStorage.getItem('notificationOnLoan') == "true"){notification(logmessage,"success");} + logmessage = '' + coinicon(logmessage) + ''; + successnumber++; + logdataSet.push([exchangeicon(exchange,false),"Success",logdate,logmessage]); + } + else if (logmessage.indexOf("Canceling") >= 0) { + logmessage = '' + logmessage + ''; + logdataSet.push([exchangeicon(exchange,false),"Canceled",logdate,logmessage]); + cancelednumber++; + + } + else { + logmessage = '' + coinicon(logmessage) + ''; + logdataSet.push([exchangeicon(exchange,false),"Info",logdate,logmessage]); + infonumber++; + } + + } + + } + + updateOutputCurrency(data.outputCurrency); + updateRawValues(data.raw_data); + + $('#successnumber').bootstrapSwitch('onText', successnumber); + $('#cancelednumber').bootstrapSwitch('onText', cancelednumber); + $('#errornumber').bootstrapSwitch('onText', errornumber); + $('#infonumber').bootstrapSwitch('onText', infonumber); + + if ( $.fn.dataTable.isDataTable( '#logtable' ) ) { + logtable = $('#logtable').DataTable().columns.adjust().draw( false ); + } + else { + logtable = $('#logtable').DataTable({data: logdataSet,responsive: true,createdRow: function( row, data, dataIndex ) { + $( row ).find('td:eq(1) a').attr('data-order',$( row ).find('td:eq(1) a').attr('data-date')); + $( row ).addClass($( row ).find('td:eq(2) span').attr('data-type')); + }}); + } + +} + +function exchangeicon(exchange,icononly){ + if (exchange == "POLONIEX" && icononly == false){return '' + exchange} + if (exchange == "BITFINEX" && icononly == false){return '' + exchange} + if (exchange == "POLONIEX" && icononly == true){return ''} + if (exchange == "BITFINEX" && icononly == true){return ''} +} + +function updateOutputCurrency(outputCurrency){ + var OutCurr = Object.keys(outputCurrency); + summaryCoin = localStorage.getItem('displayCurrency') || outputCurrency['currency']; + summaryCoinRate = parseFloat(localStorage.getItem('displayCurrencyRate') || outputCurrency['highestBid']); + // switch between using outputCoin for summary only or all lending coins earnings + if(outputCurrencyDisplayMode == 'all') { + earningsOutputCoin = summaryCoin; + earningsOutputCoinRate = summaryCoinRate; + } else { + earningsOutputCoin = 'BTC' + earningsOutputCoinRate = 1; + } +} + +// prints a pretty float with accuracy. +// above zero accuracy will be used for float precision +// below zero accuracy will indicate precision after must significat digit +// strips trailing zeros +function prettyFloat(value, accuracy) { + var precision = Math.round(Math.log10(value)); + var result = precision < 0 ? value.toFixed(Math.min((accuracy - precision), 8)) : value.toFixed(accuracy); + return isNaN(result) ? '0' : result.replace(/(?:\.0+|(\.\d+?)0+)$/, '$1'); +} + +function printFloat(value, precision) { + var multiplier = Math.pow(10, precision); + var result = Math.round(value * multiplier) / multiplier; + return result = isNaN(result) ? '0' : result.toFixed(precision); +} + +function updateRawValues(rawData){ + var table = document.getElementById("detailsTable"); + table.innerHTML = ""; + var currencies = Object.keys(rawData); + var totalBTCEarnings = {}; + +var dataSet = []; +var coinlist = ""; +$('.loanfilter').empty(); +$('.loanfilter').append(""); +var loanarray = {}; + +for (exchange in rawData) { + var currencies = Object.keys(rawData[exchange]); + + for (var keyIndex = 0; keyIndex < currencies.length; ++keyIndex) + { + var currency = currencies[keyIndex]; + var btcMultiplier = currency == 'BTC' ? displayUnit.multiplier : 1; + var averageLendingRate = parseFloat(rawData[exchange][currency]['averageLendingRate']); + var lentSum = parseFloat(rawData[exchange][currency]['lentSum']); + var totalCoins = parseFloat(rawData[exchange][currency]['totalCoins'] || rawData[exchange][currency]['maxToLend']); + var maxToLend = parseFloat(rawData[exchange][currency]['maxToLend']); + var highestBidBTC = parseFloat(rawData[exchange][currency]['highestBid']); + + // https://github.com/emilam/poloniexlendingbot/commit/8ac76573651855b43ab193dcf46e1e16144ac704 + if(rawData[exchange][currency]["allLoans"] && rawData[exchange][currency]["allLoans"].length > 0){ + loanarray[currency] = ""; + for (var i = 0; i < rawData[exchange][currency]["allLoans"].length; ++i) { + var loan = rawData[exchange][currency]["allLoans"][i]; + dataSet.push([exchangeicon(exchange,false),coinicon(currency),loan["duration"]+" days",timeleft(moment(loan["date"]).add(loan["duration"],'days')),loan["amount"],prettyFloat(parseFloat(loan["rate"]) * 100, 3) +" %",loan["amount"]*loan["rate"] + " " +currency]); + + }} + + if (currency == 'BTC') { + // no bids for BTC provided by poloniex + // this is added so BTC can be handled like other coins for conversions + highestBidBTC = 1; + } + var couple = rawData[exchange][currency]['couple']; + + if (!isNaN(averageLendingRate) && !isNaN(lentSum) || !isNaN(totalCoins)) + { + + + var rate = +averageLendingRate * 0.85 / 100; // 15% goes to Poloniex fees + + var earnings = ''; + var earningsSummaryCoin = ''; + timespans.forEach(function(timespan) { + // init totalBTCEarnings + if (isNaN(totalBTCEarnings[timespan.name])) { + totalBTCEarnings[timespan.name] = 0; + } + + // calculate coin earnings + timespanEarning = timespan.calcEarnings(lentSum, rate); + earnings += timespan.formatEarnings(currency, timespanEarning, true); + + // sum BTC earnings for all coins + if(!isNaN(highestBidBTC)) { + timespanEarningBTC = timespan.calcEarnings(lentSum * highestBidBTC, rate); + totalBTCEarnings[timespan.name] += timespanEarningBTC; + if(currency != earningsOutputCoin) { + earningsSummaryCoin += timespan.formatEarnings(earningsOutputCoin, timespanEarningBTC * earningsOutputCoinRate); + } + } + + }); + + var effRateModePerc = 1; + if (effRateMode == 'lentperc') + effRateModePerc = lentSum / totalCoins; + var effectiveRate = rate * 100 * effRateModePerc; + var yearlyRate = rate * 100 * 365 * effRateModePerc; // no reinvestment + var yearlyRateComp = (Math.pow(rate + 1, 365) - 1) * 100 * effRateModePerc; // with daily reinvestment + + var lentPerc = lentSum / totalCoins * 100; + var lentPercLendable = lentSum / maxToLend * 100; + function makeTooltip(title, text) { + return ' ' + text + ''; + } + var avgRateText = makeTooltip("Average loan rate, simple average calculation of active loans rates.", "Avg."); + var effRateText; + if (effRateMode == 'lentperc') + effRateText = makeTooltip("Effective loan rate, considering lent precentage and poloniex 15% fee.", "Eff."); + else + effRateText = makeTooltip("Effective loan rate, considering poloniex 15% fee.", "Eff."); + var compoundRateText = makeTooltip("Compound rate, the result of reinvesting the interest.", "Comp."); + var displayCurrency = currency == 'BTC' ? displayUnit.name : currency; + + if(yearlyRateComp > 0){ + localStorage.setItem('yearlyrate'+currency,(+localStorage.getItem('yearlyrate'+currency) + printFloat(yearlyRateComp, 2) / 2)); + } else { + yearlyRateComp = localStorage.getItem('yearlyrate'+currency); + } + + if (lentSum > 0) { + var detaildown = (localStorage.getItem(displayCurrency) == "true") ? 'none' : ''; + var detailup = (localStorage.getItem(displayCurrency) == "true") ? '' : 'none'; + } else { + var detaildown = "none"; + var detailup = ";color:transparent;"; + } + + var earnings = '
' + earnings + '
'; + var earningsSummaryCoin = '
' + earningsSummaryCoin + '
'; + var calculation = "
" + printFloat(averageLendingRate, 5) + '% Day' + avgRateText + '
' + + printFloat(effectiveRate, 5) + '% Day' + effRateText + '
' + + printFloat(yearlyRate, 2) + '% Year' + '
' + + printFloat(yearlyRateComp, 2) + '% Year' + compoundRateText + "
" ; + + var lentStr = '
'+printFloat(lentPerc, 2)+'
'; + + var card= '
'; + + var header = '' + exchangeicon(exchange,true) + coinicon(displayCurrency) + '' + lentStr + 'Lent ' + printFloat(lentSum * btcMultiplier, 4) +' of ' + mincoincheck(exchange,displayCurrency,printFloat(totalCoins * btcMultiplier, 4)) + ' (' + printFloat(lentPerc, 2) + '%)' + ''; + + if(localStorage.getItem(displayCurrency) == "true") { + var dropdown = '
' + earnings + earningsSummaryCoin + calculation + '
'; + } else { + var dropdown = '
'; + } + + coinlist += '
' + card + header + dropdown + '
'; + + } + +}} + + $('#coindetails').html(coinlist); + + $.each(loanarray,function(key,value){ + $('.loanfilter').append(""); + }); + + if ( $.fn.dataTable.isDataTable( '#openloans' ) ) { + mydatatable = $('#openloans').DataTable().columns.adjust().draw( false ); + } + else if (dataSet.length > 0) { + mydatatable = $('#openloans').DataTable({data: dataSet,responsive: true,createdRow: function( row, data, dataIndex ) { + $( row ).find('tr').addClass($( row ).find('td:eq(2) span').attr('data-type')); + }}); + } + + // show account summary + if (currencies.length > 1 || summaryCoin != earningsOutputCoin) { + earnings = ''; + timespans.forEach(function(timespan) { + earnings += timespan.formatEarnings( summaryCoin, totalBTCEarnings[timespan.name] * summaryCoinRate); + + }); + $('#coindetails').prepend("
Estimated Earnings
" + earnings + "
"); + } + + + +} + +function handleLocalFile(file) { + localFile = file; + reader = new FileReader(); + reader.onload = function(e) { + updateJson(JSON.parse(reader.result)); + }; + reader.readAsText(localFile, 'utf-8'); +} + +function loadData() { + if (localFile) { + reader.readAsText(localFile, 'utf-8'); + setTimeout('loadData()', refreshRate * 1000) + } else { + // expect the botlog.json to be in the same folder on the webserver -> https://github.com/BitBotFactory/poloniexlendingbot/pull/435/files + var file = ['botlog.json','botlog2.json']; + $.getJSON(file[1], function (seconddata) { + $.getJSON(file[0], function (data) { + var firstdata = data["raw_data"]; + delete data["raw_data"]; + data["raw_data"] = {}; + data["raw_data"][data["exchange"]] = firstdata; + data["raw_data"][seconddata["exchange"]] = seconddata["raw_data"]; + + var firstlog = data["log"]; + delete data["log"]; + data["log"] = {}; + data["log"][data["exchange"]] = firstlog; + data["log"][seconddata["exchange"]] = seconddata["log"]; + delete data["exchange"]; + updateJson(data); + //reload every 30sec + setTimeout('loadData()', refreshRate * 1000) + }).fail( function(d, textStatus, error) { + $('#status').text("getJSON failed, status: " + textStatus + ", error: "+error); + // retry after 60sec + setTimeout('loadData()', 60000) + }); + }).fail(function(){ + $.getJSON(file[0], function (data) { + updateJson(data); + // reload every 30sec + setTimeout('loadData()', refreshRate * 1000); + }).fail( function(d, textStatus, error) { + $('#status').text("getJSON failed, status: " + textStatus + ", error: "+error); + // retry after 60sec + setTimeout('loadData()', 60000) + }); + }) + } +} + +function Timespan(name, multiplier) { + this.name = name; + this.multiplier = multiplier; + this.calcEarnings = function(sum, rate) { + return sum * Math.pow(1 + rate, multiplier) - sum; + }; + this.formatEarnings = function(currency, earnings, minimize_currency_xs) { + if (currency == "BTC" && this == Hour) { + return printFloat(earnings * 100000000, 0) + " Satoshi / " + name + "
"; + } else { + var currencyClass = ''; + if (minimize_currency_xs) { + currencyClass = 'hidden-md-down'; + } + if (currency == "BTC") { + return displayUnit.formatValue(earnings) + " " + displayUnit.name + " / " + name + "
" + } else if (currency == "USD" || currency == "USDT" || currency == "EUR") { + return prettyFloat(earnings, 2) + " " + currency + " / "+ name + "
"; + } else { + return printFloat(earnings, 8) + " " + currency + " / "+ name + "
"; + } + } + }; +} + +function BTCDisplayUnit(name, multiplier) { + this.name = name; + this.multiplier = multiplier; + this.precision = Math.log10(multiplier); + this.formatValue = function(value) { + return printFloat(value * this.multiplier, 8 - this.precision); + } +} + +function setEffRateMode() { + var q = location.search.match(/[\?&]effrate=[^&]+/); + + if (q) { + //console.log('Got effective rate mode from URI'); + effRateMode = q[0].split('=')[1]; + } else { + if (localStorage.effRateMode) { + //console.log('Got effective rate mode from localStorage'); + effRateMode = localStorage.effRateMode; + } + } + if (validEffRateModes.indexOf(effRateMode) == -1) { + console.error(effRateMode + ' is not valid effective rate mode! Valid values are ' + validModes); + effRateMode = validEffRateModes[0]; + } + localStorage.effRateMode = effRateMode; + $("input[name='effRateMode'][value='"+ effRateMode +"']").prop('checked', true);; + //console.log('Effective rate mode: ' + effRateMode); +} + +function setBTCDisplayUnit() { + var q = location.search.match(/[\?&]displayUnit=[^&]+/); + var displayUnitText = 'BTC'; + + if (q) { + //console.log('Got displayUnitText from URI'); + displayUnitText = q[0].split('=')[1]; + } else { + if (localStorage.displayUnitText) { + //console.log('Got displayUnitText from localStorage'); + displayUnitText = localStorage.displayUnitText; + } + } + + $("input[name='btcDisplayUnit'][value='"+ displayUnitText +"']").prop('checked', true);; + + btcDisplayUnitsModes.forEach(function(unit) { + if(unit.name == displayUnitText) { + displayUnit = unit; + localStorage.displayUnitText = displayUnitText; + } + }) + //console.log('displayUnitText: ' + displayUnitText); +} + +function setOutputCurrencyDisplayMode() { + var q = location.search.match(/[\?&]earningsInOutputCurrency=[^&]+/); + var outputCurrencyDisplayModeText = 'all'; + + if (q) { + outputCurrencyDisplayModeText = q[0].split('=')[1]; + } else { + if (localStorage.outputCurrencyDisplayModeText) { + outputCurrencyDisplayModeText = localStorage.outputCurrencyDisplayModeText; + } + } + + $("input[name='outputCurrencyDisplayMode'][value='"+ outputCurrencyDisplayModeText +"']").prop('checked', true);; + + validOutputCurrencyDisplayModes.forEach(function(mode) { + if(mode == outputCurrencyDisplayModeText) { + outputCurrencyDisplayMode = mode; + localStorage.outputCurrencyDisplayModeText = outputCurrencyDisplayModeText; + } + }) + +} + +function loadSettings() { + // Refresh rate + refreshRate = localStorage.getItem('refreshRate') || 30 + $('#refresh_interval').val(refreshRate) + + //Date Format + $('#dateformat').val(localStorage.getItem('dateformat') || "YYYY-MM-DD h:mm:ss") + + // Time spans + var timespanNames = JSON.parse(localStorage.getItem('timespanNames')) || ["Year", "Month", "Week", "Day", "Hour"] + + timespans = [Year, Month, Week, Day, Hour].filter(function(t) { + // filters out timespans not specified + return timespanNames.indexOf(t.name) !== -1; + }); + + timespanNames.forEach(function(t) { + $('input[data-timespan="' + t + '"]').prop('checked', true); + }); + + + +$('input.switchradio,input.logswitch').each(function(key,value){ + if(value.id){ + $("#"+value.id).bootstrapSwitch('state',JSON.parse(localStorage.getItem(this.id)) || false); + } +}) + +$('input.switchradio,input.logswitch').on('switchChange.bootstrapSwitch', function (event, state) { + if(this.id){ + localStorage.setItem(this.id,$("#"+this.id).bootstrapSwitch('state')); + } +}); + +$('input.logswitch').on('switchChange.bootstrapSwitch', function (event, state) { + if(this.id){ + if($.fn.dataTable.isDataTable( '#logtable' )){ + + var searchstring = []; + $('input.logswitch').each(function(){ + if ($(this).bootstrapSwitch('state')) {searchstring.push($(this).data("off-text"));} + }) + if($('.exchangefilter').val()) {searchstring.push($('.exchangefilter').val())}; + searchstring = searchstring.toString().replace(/,/g,"|"); + logtable.columns( 1 ).search(searchstring,true).draw(false); + } + } +}); + +$('#dropdownMenuButton').on('change', function() { + if($.fn.dataTable.isDataTable( '#logtable' )){ + logtable.columns( 0 ).search(this.value).draw(false); + } +}) + +$('.loanfilter').on('change', function() { + if($.fn.dataTable.isDataTable( '#openloans' )){ + mydatatable.columns( 1 ).search(this.value).draw(false); + } +}) + + +$('#coinstatustable tbody').on('click', '.coinforecast', function () { + var data = cointable.row( $(this).closest('tr') ).data(); + coinforecast(data[2].split("> ")[1] || data[2],data[3],$(data[1]).text()); + } ); + +} + +function doSave() { + // Validation + var tempRefreshRate = $('#refresh_interval').val() + if(tempRefreshRate < 10 || tempRefreshRate > 3600) { + alert('Please input a value between 10 and 3600 for refresh rate') + return false + } + + // Refresh rate + localStorage.setItem('refreshRate', tempRefreshRate) + + // Date Format + localStorage.setItem('dateformat', $('#dateformat').val()) + + // Time spans + var timespanNames = []; + $('input[type="checkbox"]:checked').each(function(i, c){ + timespanNames.push($(c).attr('data-timespan')); + }); + localStorage.setItem('timespanNames', JSON.stringify(timespanNames)) + + // Bitcoin Display Unit + localStorage.displayUnitText = $('input[name="btcDisplayUnit"]:checked').val(); + btcDisplayUnitsModes.forEach(function(unit) { + if(unit.name == localStorage.displayUnitText) { + displayUnit = unit; + } + }) + + // OutputCurrencyDisplayMode + localStorage.outputCurrencyDisplayModeText = $('input[name="outputCurrencyDisplayMode"]:checked').val(); + if(validOutputCurrencyDisplayModes.indexOf(localStorage.outputCurrencyDisplayModeText) !== -1) { + outputCurrencyDisplayMode = localStorage.outputCurrencyDisplayModeText; + } + + //Effective rate calculation + localStorage.effRateMode = $('input[name="effRateMode"]:checked').val(); + if(validEffRateModes.indexOf(localStorage.effRateMode) !== -1) { + effRateMode = localStorage.effRateMode; + } + + notification("Settings saved!","success"); + + // Now we actually *use* these settings! + update(); +} + +function update() { + loadSettings(); + setEffRateMode(); + setBTCDisplayUnit(); + setOutputCurrencyDisplayMode(); + loadData(); + if (window.location.protocol == "file:") { + $('#file').show(); + } +} + +function coindetails(param,coin,status) { + localStorage.setItem(coin,status); + $(param).parent().parent().next('.coindetails').toggle(); + $(param).hide(); + $(param).siblings('.fa').toggle(); + } + + +//Coin-Forecast +var ctx = $("#myChart"); +var chart = ""; + +function coinforecast(coinname,amount,rate){ + + var coinyears = []; + var year = moment().year(); + var yeararray = []; + + for (var n = 0; n < 5; ++ n) { + coinyears[n] = parseFloat(amount + (amount * (rate.replace(" %","") / 100))); + amount = coinyears[n]; + year = year + 1; + yeararray.push(year); + } + + var $inspector = $("").css('display', 'none').addClass(coinname); + + $("body").append($inspector); + + try { + coincolor = $inspector.css('color'); + } finally { + $inspector.remove(); + } + +data = { labels: yeararray,datasets: [{label: coinname,backgroundColor: coincolor,borderColor: coincolor,data: coinyears,fill: false}] }; + +chart = new Chart(ctx, { + type: 'line', + data: data, + options: { + scales: { + xAxes: [{ + time: { + unit: 'years' + }, + scaleLabel: { + display: true, + labelString: 'Date' + } + }] + } + } +}) +$('#coinforecast').modal('toggle'); +} +// + +$(document).ready(function () { + toastr.options = { + "positionClass": "toast-top-center" + } + + update(); + + $('#dropdownMenuLink').html(localStorage.getItem('displayCurrency')); + + $('a[data-toggle="tab"]').on('show.bs.tab', function(e) { + localStorage.setItem('activeTab', $(e.target).attr('href')); + }); + + $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) { + if($(e.target).attr("href") == "#logtab"){ + $( document ).ready(function() { + if($.fn.dataTable.isDataTable( '#logtable' )){ + logtable.columns.adjust().draw(false); + } + }); + } + }) + + var activeTab = localStorage.getItem('activeTab'); + if(activeTab){ + $('#navbarNav a[href="' + activeTab + '"]').tab('show'); + } + + jQuery(".switchradio,.logswitch").bootstrapSwitch(); + + $.get( "https://blockchain.info/ticker?cors=true", function( data ) { + $.each(data,function(v,m){ + $('#currencydropdown').append(''+v+''); + }); + }); + + localStorage.setItem("displayCurrency",localStorage.getItem("displayCurrency") || "BTC"); + localStorage.setItem("displayCurrencyRate",localStorage.getItem("displayCurrencyRate") || 1); + + $(document.body).on('click',".dropdown-item",function(){ + localStorage.setItem("displayCurrency",$(this).data("name")); + localStorage.setItem("displayCurrencyRate",$(this).data("value")); + window.location.reload(true); + }); + + $(document).on('click','.fa-chevron-up,.fa-chevron-down',function(){ + $(this).toggle().siblings('.fa').toggle(); + $(this).closest('.card').find('.coindetails').toggle(); + }) + + + +}); \ No newline at end of file diff --git a/tabletemplate/manifest.json b/tabletemplate/manifest.json new file mode 100644 index 00000000..e3766f86 --- /dev/null +++ b/tabletemplate/manifest.json @@ -0,0 +1,19 @@ +{ + "name" : "Poloniex Lending Bot", + "short_name" : "Lending Bot", + "icons" : [{ + "src" : "images/icon192.png", + "sizes" : "192x192", + "type" : "image/png" + }, { + "src" : "images/icon384.png", + "sizes" : "384x384", + "type" : "image/png" + } + ], + "background_color": "#FAFAFA", + "theme_color": "#e7e7e7", + "start_url" : "lendingbot.html", + "display" : "standalone", + "orientation" : "portrait" +} diff --git a/tabletemplate/robots.txt b/tabletemplate/robots.txt new file mode 100644 index 00000000..1f53798b --- /dev/null +++ b/tabletemplate/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: / diff --git a/www/index.html b/www/index.html new file mode 100644 index 00000000..9a9ea9bc --- /dev/null +++ b/www/index.html @@ -0,0 +1,12 @@ + + + + + + + + Lending Bot + + diff --git a/www/manifest.json b/www/manifest.json index 9fb6db72..e3766f86 100644 --- a/www/manifest.json +++ b/www/manifest.json @@ -1,19 +1,19 @@ -{ - "name" : "Poloniex Lending Bot", - "short_name" : "Lending Bot", - "icons" : [{ - "src" : "images/icon192.png", - "sizes" : "192x192", - "type" : "image/png" - }, { - "src" : "images/icon384.png", - "sizes" : "384x384", - "type" : "image/png" - } - ], - "background_color": "#FAFAFA", - "theme_color": "#e7e7e7", - "start_url" : "lendingbot.html", - "display" : "standalone", - "orientation" : "portrait" -} +{ + "name" : "Poloniex Lending Bot", + "short_name" : "Lending Bot", + "icons" : [{ + "src" : "images/icon192.png", + "sizes" : "192x192", + "type" : "image/png" + }, { + "src" : "images/icon384.png", + "sizes" : "384x384", + "type" : "image/png" + } + ], + "background_color": "#FAFAFA", + "theme_color": "#e7e7e7", + "start_url" : "lendingbot.html", + "display" : "standalone", + "orientation" : "portrait" +} diff --git a/www/robots.txt b/www/robots.txt new file mode 100644 index 00000000..1f53798b --- /dev/null +++ b/www/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: /