-
Notifications
You must be signed in to change notification settings - Fork 0
/
mh-pollutinum-scoreboard.user.js
68 lines (56 loc) · 2.02 KB
/
mh-pollutinum-scoreboard.user.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// ==UserScript==
// @name 🐭️ MouseHunt - Quick Pollutinum Refined Scoreboard Search
// @version 1.0.1
// @description Click the barrel on the hunter profile page to quickly search the scoreboard for them.
// @license MIT
// @author bradp
// @namespace bradp
// @match https://www.mousehuntgame.com/*
// @icon https://i.mouse.rip/mouse.png
// @grant none
// @run-at document-end
// @require https://cdn.jsdelivr.net/npm/mousehunt-utils@1.7.3/mousehunt-utils.js
// ==/UserScript==
(function () {
'use strict';
const main = () => {
const existing = document.querySelector('.mh-quick-scoreboard-search');
if (existing) {
existing.remove();
}
const append = document.querySelector('.friendsPage-friendRow-titleBar');
if (! append) {
return;
}
const name = document.querySelector('.friendsPage-friendRow-titleBar-name');
if (! name) {
return;
}
const scoreboardSearch = makeElement('a', 'mh-quick-scoreboard-search');
scoreboardSearch.setAttribute('href', `https://www.mousehuntgame.com/scoreboards.php?tab=main&scoreboard=QuestPollutionOutbreak::pollutinum_refined&search=${name.getAttribute('data-text')}`);
scoreboardSearch.setAttribute('title', 'View on Pollutinum Refined Scoreboard');
const image = makeElement('img', 'mh-quick-scoreboard-search-image');
image.setAttribute('src', 'https://www.mousehuntgame.com/images/items/stats/transparent_thumb/fc76ba2c71538601379542e747e2e581.png?cv=2');
scoreboardSearch.appendChild(image);
// append to the append el as the first child
append.prepend(scoreboardSearch);
};
onNavigation(main, {
page: 'hunterprofile',
tab: 'profile'
});
addStyles(`.mh-quick-scoreboard-search {
position: absolute;
right: 6px;
top: -6px;
}
.mh-quick-scoreboard-search img {
width: 50px;
height: 50px;
transition: all 0.2s ease-in-out;
}
.mh-quick-scoreboard-search:hover img {
transform: scale(1.3);
}`);
main();
}());