@@ -206,12 +206,15 @@ var Main = function () {
206
206
if (i < n) {
207
207
var j = i + 1;
208
208
var progressBar = document.getElementById("Bar");
209
+ var percent = document.getElementById("percent");
209
210
document.getElementById("counter").innerHTML = "Epochs: " + j * 40;
210
211
var width = 100 * (j / n);
211
212
if (width >= 102) {
212
213
progressBar.style.width = 0;
214
+ percent.innerHTML = "0%";
213
215
} else {
214
216
progressBar.style.width = width + "%";
217
+ percent.innerHTML = width + "%";
215
218
}
216
219
_this2.gradualStyler(n, i + 1);
217
220
} else {
@@ -240,6 +243,7 @@ var Main = function () {
240
243
this.styleImg.onerror = function () {
241
244
alert("Error loading " + _this3.styleImg.src + ".");
242
245
};
246
+ this.dispImg = document.getElementById('img_lower');
243
247
this.stylized = document.getElementById('stylized');
244
248
245
249
this.styleRatio = 1.0;
@@ -251,14 +255,18 @@ var Main = function () {
251
255
// Initialize buttons
252
256
this.styleButton = document.getElementById('style-button');
253
257
this.styleButton.onclick = function () {
258
+ var cover = document.getElementsByClassName('img-container')[0];
259
+ cover.style.display = "none";
254
260
_this3.disableStylizeButtons();
255
261
_this3.gradualStyler(25, 0);
262
+ var results = document.getElementById('result');
263
+ results.style.display = "block";
256
264
};
257
265
258
266
// Initialize selectors
259
267
this.contentSelect = document.getElementById('content-select');
260
268
this.contentSelect.onchange = function (net) {
261
- return _this3.image_select(_this3.contentImg, net.target.value);
269
+ _this3.image_select(_this3.contentImg, net.target.value), _this3.image_select(_this3.dispImg , net.target.value);
262
270
};
263
271
this.contentSelect.onclick = function () {
264
272
return _this3.contentSelect.value = '';
@@ -603,10 +611,20 @@ var Main = function () {
603
611
window.onload = function () {
604
612
var dwn = document.getElementById('btndownload'),
605
613
canvas = document.getElementById('stylized'),
606
- context = canvas.getContext('2d');
614
+ context = canvas.getContext('2d'),
615
+ show = document.getElementById('btnshow');
607
616
dwn.onclick = function () {
608
617
download(canvas, 'design.png');
609
618
};
619
+ show.onclick = function () {
620
+ var link = document.getElementById('stylized').toDataURL("image/png;base64");
621
+ var box = document.getElementById('img_over');
622
+ var cover = document.getElementsByClassName('img-container')[0];
623
+ box.src = link;
624
+ cover.style.display = "block";
625
+ new BeerSlider(document.getElementById('slider'));
626
+ console.log("done");
627
+ };
610
628
};
611
629
612
630
function download(canvas, filename) {
@@ -63856,10 +63874,6 @@ function fromByteArray (uint8) {
63856
63874
63857
63875
var base64 = require('base64-js')
63858
63876
var ieee754 = require('ieee754')
63859
- var customInspectSymbol =
63860
- (typeof Symbol === 'function' && typeof Symbol.for === 'function')
63861
- ? Symbol.for('nodejs.util.inspect.custom')
63862
- : null
63863
63877
63864
63878
exports.Buffer = Buffer
63865
63879
exports.SlowBuffer = SlowBuffer
@@ -63896,9 +63910,7 @@ function typedArraySupport () {
63896
63910
// Can typed array instances can be augmented?
63897
63911
try {
63898
63912
var arr = new Uint8Array(1)
63899
- var proto = { foo: function () { return 42 } }
63900
- Object.setPrototypeOf(proto, Uint8Array.prototype)
63901
- Object.setPrototypeOf(arr, proto)
63913
+ arr.__proto__ = { __proto__: Uint8Array.prototype, foo: function () { return 42 } }
63902
63914
return arr.foo() === 42
63903
63915
} catch (e) {
63904
63916
return false
@@ -63927,7 +63939,7 @@ function createBuffer (length) {
63927
63939
}
63928
63940
// Return an augmented `Uint8Array` instance
63929
63941
var buf = new Uint8Array(length)
63930
- Object.setPrototypeOf( buf, Buffer.prototype)
63942
+ buf.__proto__ = Buffer.prototype
63931
63943
return buf
63932
63944
}
63933
63945
@@ -63954,6 +63966,17 @@ function Buffer (arg, encodingOrOffset, length) {
63954
63966
return from(arg, encodingOrOffset, length)
63955
63967
}
63956
63968
63969
+ // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
63970
+ if (typeof Symbol !== 'undefined' && Symbol.species != null &&
63971
+ Buffer[Symbol.species] === Buffer) {
63972
+ Object.defineProperty(Buffer, Symbol.species, {
63973
+ value: null,
63974
+ configurable: true,
63975
+ enumerable: false,
63976
+ writable: false
63977
+ })
63978
+ }
63979
+
63957
63980
Buffer.poolSize = 8192 // not used by this implementation
63958
63981
63959
63982
function from (value, encodingOrOffset, length) {
@@ -63966,7 +63989,7 @@ function from (value, encodingOrOffset, length) {
63966
63989
}
63967
63990
63968
63991
if (value == null) {
63969
- throw new TypeError(
63992
+ throw TypeError(
63970
63993
'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +
63971
63994
'or Array-like Object. Received type ' + (typeof value)
63972
63995
)
@@ -63977,12 +64000,6 @@ function from (value, encodingOrOffset, length) {
63977
64000
return fromArrayBuffer(value, encodingOrOffset, length)
63978
64001
}
63979
64002
63980
- if (typeof SharedArrayBuffer !== 'undefined' &&
63981
- (isInstance(value, SharedArrayBuffer) ||
63982
- (value && isInstance(value.buffer, SharedArrayBuffer)))) {
63983
- return fromArrayBuffer(value, encodingOrOffset, length)
63984
- }
63985
-
63986
64003
if (typeof value === 'number') {
63987
64004
throw new TypeError(
63988
64005
'The "value" argument must not be of type number. Received type number'
@@ -64024,8 +64041,8 @@ Buffer.from = function (value, encodingOrOffset, length) {
64024
64041
64025
64042
// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:
64026
64043
// https://github.com/feross/buffer/pull/148
64027
- Object.setPrototypeOf( Buffer.prototype, Uint8Array.prototype)
64028
- Object.setPrototypeOf( Buffer, Uint8Array)
64044
+ Buffer.prototype.__proto__ = Uint8Array.prototype
64045
+ Buffer.__proto__ = Uint8Array
64029
64046
64030
64047
function assertSize (size) {
64031
64048
if (typeof size !== 'number') {
@@ -64129,8 +64146,7 @@ function fromArrayBuffer (array, byteOffset, length) {
64129
64146
}
64130
64147
64131
64148
// Return an augmented `Uint8Array` instance
64132
- Object.setPrototypeOf(buf, Buffer.prototype)
64133
-
64149
+ buf.__proto__ = Buffer.prototype
64134
64150
return buf
64135
64151
}
64136
64152
@@ -64452,9 +64468,6 @@ Buffer.prototype.inspect = function inspect () {
64452
64468
if (this.length > max) str += ' ... '
64453
64469
return '<Buffer ' + str + '>'
64454
64470
}
64455
- if (customInspectSymbol) {
64456
- Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect
64457
- }
64458
64471
64459
64472
Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
64460
64473
if (isInstance(target, Uint8Array)) {
@@ -64580,7 +64593,7 @@ function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
64580
64593
return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
64581
64594
}
64582
64595
}
64583
- return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)
64596
+ return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
64584
64597
}
64585
64598
64586
64599
throw new TypeError('val must be string, number or Buffer')
@@ -64909,7 +64922,7 @@ function hexSlice (buf, start, end) {
64909
64922
64910
64923
var out = ''
64911
64924
for (var i = start; i < end; ++i) {
64912
- out += hexSliceLookupTable[ buf[i]]
64925
+ out += toHex( buf[i])
64913
64926
}
64914
64927
return out
64915
64928
}
@@ -64946,8 +64959,7 @@ Buffer.prototype.slice = function slice (start, end) {
64946
64959
64947
64960
var newBuf = this.subarray(start, end)
64948
64961
// Return an augmented `Uint8Array` instance
64949
- Object.setPrototypeOf(newBuf, Buffer.prototype)
64950
-
64962
+ newBuf.__proto__ = Buffer.prototype
64951
64963
return newBuf
64952
64964
}
64953
64965
@@ -65436,8 +65448,6 @@ Buffer.prototype.fill = function fill (val, start, end, encoding) {
65436
65448
}
65437
65449
} else if (typeof val === 'number') {
65438
65450
val = val & 255
65439
- } else if (typeof val === 'boolean') {
65440
- val = Number(val)
65441
65451
}
65442
65452
65443
65453
// Invalid ranges are not set to a default, so can range check early.
@@ -65495,6 +65505,11 @@ function base64clean (str) {
65495
65505
return str
65496
65506
}
65497
65507
65508
+ function toHex (n) {
65509
+ if (n < 16) return '0' + n.toString(16)
65510
+ return n.toString(16)
65511
+ }
65512
+
65498
65513
function utf8ToBytes (string, units) {
65499
65514
units = units || Infinity
65500
65515
var codePoint
@@ -65625,20 +65640,6 @@ function numberIsNaN (obj) {
65625
65640
return obj !== obj // eslint-disable-line no-self-compare
65626
65641
}
65627
65642
65628
- // Create lookup table for `toString('hex')`
65629
- // See: https://github.com/feross/buffer/issues/219
65630
- var hexSliceLookupTable = (function () {
65631
- var alphabet = '0123456789abcdef'
65632
- var table = new Array(256)
65633
- for (var i = 0; i < 16; ++i) {
65634
- var i16 = i * 16
65635
- for (var j = 0; j < 16; ++j) {
65636
- table[i16 + j] = alphabet[i] + alphabet[j]
65637
- }
65638
- }
65639
- return table
65640
- })()
65641
-
65642
65643
}).call(this,require("buffer").Buffer)
65643
65644
},{"base64-js":302,"buffer":304,"ieee754":629}],305:[function(require,module,exports){
65644
65645
require('../../modules/core.regexp.escape');
0 commit comments