-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
44 lines (40 loc) · 1.02 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
var app = new Vue({
el: '#app',
data: {
viewAll: false,
donationType: null,
allPixels: [],
version: []
},
computed: {
copyRightYear: function() {
return new Date().getFullYear();
},
pixels: function() {
return this.viewAll ? this.allPixels : this.allPixels.slice(0, 21);
}
},
methods: {
onNavClick: function(id) {
document.getElementById(id).scrollIntoView({ behavior: 'smooth' });
}
},
created: function() {
var fetchList = function(callback) {
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState === 4 && xmlhttp.status === 200) {
callback(xmlhttp.responseText);
}
};
xmlhttp.open('GET', 'https://trackers.uglyemail.com/list.txt', true);
xmlhttp.send();
};
fetchList(function(res) {
var pixels = res.split('\n').map(function(row) {
return row.split('@@=')[0];
});
this.allPixels = pixels.sort();
}.bind(this));
}
});