-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHideGuildMenu.plugin.js
More file actions
65 lines (51 loc) · 1.63 KB
/
HideGuildMenu.plugin.js
File metadata and controls
65 lines (51 loc) · 1.63 KB
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
// //META{"name":"HideGuilds"}*//
// /*globals BdApi*/
class HideGuilds {
getName() { return "Hide Guilds"; }
getDescription() { return "Hides the servers until you hover over to the left side."; }
getVersion() { return "0.0.5"; }
getAuthor() { return "Bonkeyzz"; }
constructor() {
this.guildBarClass = ".wrapper-3NnKdC";
this.scrollerBase = document.querySelector(this.guildBarClass)
this.initialWidth = this.scrollerBase.width() + "px";
this.targetWidth = "0.5%";
this.animationDuration = "0.5s";
this.guildBarAnimationCss = "";
this.initialized = false;
console.log("%c[HideGuilds]%c Original Width: " + this.initialWidth, 'color: #00FFFF; font-weight: bold;', '');
}
load() {
this.guildBarAnimationCss =
`
@keyframes guilds_slideout {
from { width: ${this.initialWidth}; }
to { width: ${this.targetWidth}; }
}
@keyframes guilds_slidein {
from { width: ${this.targetWidth}; }
to { width: ${this.initialWidth}; }
}
${this.guildBarClass} {
width: ${this.initialWidth}px;
animation-name: guilds_slidein;
animation-duration: ${this.animationDuration};
}
${this.guildBarClass}:not(:hover) {
width: ${this.targetWidth};
animation-name: guilds_slideout;
animation-duration: ${this.animationDuration};
}
`;
}
start() {
BdApi.injectCSS('guildBarAnimation', this.guildBarAnimationCss);
this.initialized = true;
console.log("%c[HideGuilds]%c Started!", 'color: #00FFFF; font-weight: bold;', '');
}
stop() {
BdApi.clearCSS('guildBarAnimation');
this.initialized = false;
console.log("%c[HideGuilds]%c Stopped!", 'color: #00FFFF; font-weight: bold;', '');
}
}