diff --git a/client/index.js b/client/index.js index dad70a1f..6771ee7e 100644 --- a/client/index.js +++ b/client/index.js @@ -12,6 +12,7 @@ const uploadElement = require('upload-element') const WebTorrent = require('webtorrent') const JSZip = require('jszip') const SimplePeer = require('simple-peer') +const kjua = require('kjua') const util = require('./util') @@ -195,6 +196,13 @@ function onTorrent (torrent) { '[Download .torrent]' ) + util.log('
') + + util.log(document.getElementById('qr-code').appendChild(kjua({ + text: window.location.origin + '/#' + torrent.infoHash, + crisp: true + }))) + function updateSpeed () { const progress = (100 * torrent.progress).toFixed(1) diff --git a/package.json b/package.json index 9a8deb13..28eed94e 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "escape-html": "1.0.3", "express": "4.18.2", "jszip": "3.10.1", + "kjua": "0.1.2", "prettier-bytes": "1.0.4", "pug": "3.0.2", "rollbar": "2.25.2",