Added join/leave messages a-la fore.st
This commit is contained in:
parent
a0f680c02a
commit
d0ef60dd4f
6 changed files with 119 additions and 10 deletions
|
|
@ -176,6 +176,12 @@ p.panel-head-element{
|
|||
flex-direction: var(--chat-entry-flex-direction);
|
||||
}
|
||||
|
||||
.chat-entry-serverwhisper, .chat-entry-tokewhisper{
|
||||
overflow: hidden;
|
||||
transition: max-height 0.5s;
|
||||
max-height: 5em;
|
||||
}
|
||||
|
||||
.chat-entry-nameplate, .pm-panel-sesh-entry-nameplate{
|
||||
display: flex;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -499,31 +499,31 @@ p.channel-guide-entry-item{
|
|||
color: var(--userlist-color6);
|
||||
}
|
||||
|
||||
.chat-userlist-color0:not(.chat-entry-toke, .chat-entry-whisper, .chat-entry-tokewhisper, .chat-entry-announcement), .pm-panel-sesh-userlist-color0{/*green0*/
|
||||
.chat-userlist-color0:not(.chat-entry-toke, .chat-entry-serverwhisper, .chat-entry-tokewhisper, .chat-entry-announcement), .pm-panel-sesh-userlist-color0{/*green0*/
|
||||
border-left: solid 5px var(--userlist-color0);
|
||||
}
|
||||
|
||||
.chat-userlist-color1:not(.chat-entry-toke, .chat-entry-whisper, .chat-entry-tokewhisper, .chat-entry-announcement), .pm-panel-sesh-userlist-color1{/*red0*/
|
||||
.chat-userlist-color1:not(.chat-entry-toke, .chat-entry-serverwhisper, .chat-entry-tokewhisper, .chat-entry-announcement), .pm-panel-sesh-userlist-color1{/*red0*/
|
||||
border-left: solid 5px var(--userlist-color1);
|
||||
}
|
||||
|
||||
.chat-userlist-color2:not(.chat-entry-toke, .chat-entry-whisper, .chat-entry-tokewhisper, .chat-entry-announcement), .pm-panel-sesh-userlist-color2{/*blue0*/
|
||||
.chat-userlist-color2:not(.chat-entry-toke, .chat-entry-serverwhisper, .chat-entry-tokewhisper, .chat-entry-announcement), .pm-panel-sesh-userlist-color2{/*blue0*/
|
||||
border-left: solid 5px var(--userlist-color2);
|
||||
}
|
||||
|
||||
.chat-userlist-color3:not(.chat-entry-toke, .chat-entry-whisper, .chat-entry-tokewhisper, .chat-entry-announcement), .pm-panel-sesh-userlist-color3{/*tan0*/
|
||||
.chat-userlist-color3:not(.chat-entry-toke, .chat-entry-serverwhisper, .chat-entry-tokewhisper, .chat-entry-announcement), .pm-panel-sesh-userlist-color3{/*tan0*/
|
||||
border-left: solid 5px var(--userlist-color3);
|
||||
}
|
||||
|
||||
.chat-userlist-color4:not(.chat-entry-toke, .chat-entry-whisper, .chat-entry-tokewhisper, .chat-entry-announcement), .pm-panel-sesh-userlist-color4{/*pink0*/
|
||||
.chat-userlist-color4:not(.chat-entry-toke, .chat-entry-serverwhisper, .chat-entry-tokewhisper, .chat-entry-announcement), .pm-panel-sesh-userlist-color4{/*pink0*/
|
||||
border-left: solid 5px var(--userlist-color4);
|
||||
}
|
||||
|
||||
.chat-userlist-color5:not(.chat-entry-toke, .chat-entry-whisper, .chat-entry-tokewhisper, .chat-entry-announcement), .pm-panel-sesh-userlist-color5{/*orange*/
|
||||
.chat-userlist-color5:not(.chat-entry-toke, .chat-entry-serverwhisper, .chat-entry-tokewhisper, .chat-entry-announcement), .pm-panel-sesh-userlist-color5{/*orange*/
|
||||
border-left: solid 5px var(--userlist-color5);
|
||||
}
|
||||
|
||||
.chat-userlist-color6:not(.chat-entry-toke, .chat-entry-whisper, .chat-entry-tokewhisper, .chat-entry-announcement), .pm-panel-sesh-userlist-color6{/*violet*/
|
||||
.chat-userlist-color6:not(.chat-entry-toke, .chat-entry-serverwhisper, .chat-entry-tokewhisper, .chat-entry-announcement), .pm-panel-sesh-userlist-color6{/*violet*/
|
||||
border-left: solid 5px var(--userlist-color6);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -696,15 +696,27 @@ class chatPostprocessor{
|
|||
|
||||
//Add toke/tokewhisper class
|
||||
this.chatBody.classList.add("toke");
|
||||
}else if(this.rawData.type == "tokewhisper"){
|
||||
}else if(this.rawData.type == "tokewhisper" || this.rawData.type == "serverwhisper"){
|
||||
//Squash the high-level
|
||||
this.chatEntry.querySelector('.high-level').remove();
|
||||
|
||||
//remove the username
|
||||
this.chatEntry.querySelector('.chat-entry-username').remove();
|
||||
|
||||
//Add toke/tokewhisper class
|
||||
this.chatBody.classList.add("tokewhisper","serverwhisper");
|
||||
//Add serverwhisper class
|
||||
this.chatBody.classList.add("serverwhisper");
|
||||
|
||||
//If this is a toke whisper
|
||||
if(this.rawData.type == "tokewhisper"){
|
||||
//Add tokewhisper class
|
||||
this.chatBody.classList.add("tokewhisper");
|
||||
}
|
||||
|
||||
//Set variable to hold chatEntry so the one after doesnt get clobbered by the killServerWhisper function
|
||||
const currentWhisper = this.chatEntry;
|
||||
|
||||
//Kill server whispers after 10s, just like fore.st XP
|
||||
setTimeout(()=>{this.killServerWhisper(currentWhisper)}, 10000);
|
||||
}else if(this.rawData.type == "spoiler"){
|
||||
//Set whole-body spoiler
|
||||
this.chatBody.classList.add("spoiler");
|
||||
|
|
@ -719,4 +731,11 @@ class chatPostprocessor{
|
|||
this.chatBody.classList.add("italics");
|
||||
}
|
||||
}
|
||||
|
||||
killServerWhisper(whisper, delay = 500){
|
||||
//Drop max height to 0 to trigger the fancy animation
|
||||
whisper.style.maxHeight = 0;
|
||||
//Remove whisper after animation is done
|
||||
setTimeout(()=>{whisper.remove()}, delay);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue