-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfilter.js
39 lines (35 loc) · 1.44 KB
/
filter.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
// go to https://designers.mx/mixes?page=50
$(window).bind("load", function() {
/* Reset Styling */
var clearFilter = function() {
$('.mix--preview, .mix--preview > a').removeClass('this_has_rdio this_has_soundcloud this_has_spotify').css('opacity', '1').css('border', '0');
$('#xyz button').removeClass('active');
};
/* Removes All But Chosen */
var removeAllBut = function(service, color) {
$('.indicator--' + service).closest('.mix--preview').addClass('this_has_' + service);
$('.mix--preview').not('.this_has_' + service).css('opacity', '0.1');
$('.this_has_' + service + '> a').css('border', '2px solid' + color);
};
$('html').delay(4000).addClass('active').append('<div id="xyz"></div>');
$('#xyz').load(chrome.extension.getURL("content.html"), function() {
$('#btn_spotify').on('click', function() {
clearFilter();
removeAllBut('spotify', '#8bc305');
$(this).addClass('active');
});
$('#btn_rdio').on('click', function() {
clearFilter();
removeAllBut('rdio', '#2d90ce');
$(this).addClass('active');
});
$('#btn_soundcloud').on('click', function() {
clearFilter();
removeAllBut('soundcloud', '#dc4303');
$(this).addClass('active');
});
$('#btn_reset').on('click', function() {
clearFilter();
});
});
});