Userlist collapse and cinema mode now state now persistant.

This commit is contained in:
rainbow napkin 2025-09-06 19:08:10 -04:00
parent 770bdc4794
commit 9650caeed0
101 changed files with 164 additions and 112 deletions

View file

@ -277,6 +277,26 @@ class channel{
//Set Chat Box Width minimum while Locked to Aspect-Ratio
this.chatBox.chatWidthMinimum = value / 100;
return;
case 'userlistHidden':
//If the userlist class isn't loaded in yet
if(this.userList == null){
//We're fuckin' done here
return;
}
//Pass value down to UI toggle, making sure to allow for string conversion
this.userList.toggleUI(!(value == true || value == "true"));
return;
case 'cinemaMode':
//If the userlist class isn't loaded in yet
if(this.player == null){
//We're fuckin' done here
return;
}
//Pass value down to UI toggle, making sure to allow for string conversion
this.player.toggleCinemaMode(value == true || value == "true");
return;
}
}
@ -289,7 +309,9 @@ class channel{
["syncTolerance",0.4],
["liveSyncTolerance", 2],
["syncDelta", 6],
["chatWidthMin", 20]
["chatWidthMin", 20],
["userlistHidden", false],
["cinemaMode", false]
]);
}

View file

@ -430,11 +430,13 @@ class player{
* Toggles Cinema Mode on or off
* @param {Boolean} cinema - Whether or not to enter Cinema Mode. Defaults to toggle if left unspecified
*/
toggleCinemaMode(cinema = !this.navBar.checkVisibility()){
toggleCinemaMode(cinema = this.navBar.checkVisibility()){
localStorage.setItem("cinemaMode", cinema);
if(cinema){
this.navBar.style.display = "flex";
}else{
this.navBar.style.display = "none";
}else{
this.navBar.style.display = "flex";
}
//Resize the video if we're aspect locked

View file

@ -198,6 +198,8 @@ class userList{
}
toggleUI(show = !this.userDiv.checkVisibility()){
localStorage.setItem("userlistHidden", !show);
if(show){
this.userDiv.style.display = "flex";
this.toggleIcon.classList.replace("bi-caret-left-fill","bi-caret-down-fill");