Added '(Classic)' postifx to 'The Network', fixed small theming bug

This commit is contained in:
rainbow napkin 2026-10-05 22:31:11 -04:00
parent e6e061ab44
commit 1d09833c2a
3 changed files with 31 additions and 9 deletions

View file

@ -360,6 +360,10 @@ p.channel-guide-entry-item{
} }
/* Movie Night didnt have a shadow here, but I wanted to add one like ol' ttn had. Lil' hacky to avoid editing hypertext but it works.*/ /* Movie Night didnt have a shadow here, but I wanted to add one like ol' ttn had. Lil' hacky to avoid editing hypertext but it works.*/
.chat-panel-control{
padding-bottom: 0.1em;
}
#chat-panel-buffer-div:before{ #chat-panel-buffer-div:before{
content: ''; content: '';
box-shadow: 0px .5em .5em var(--bg2); box-shadow: 0px .5em .5em var(--bg2);
@ -398,11 +402,12 @@ p.channel-guide-entry-item{
#chat-panel-prompt{ #chat-panel-prompt{
background-color: rgba(0,0,0,0); background-color: rgba(0,0,0,0);
padding-bottom: 0.2em;
} }
#chat-panel-send-button{ #chat-panel-send-button{
height: 100%; height: 100%;
width: 2.5rem; width: 3.2rem;
padding: 0; padding: 0;
margin: 0 0; margin: 0 0;
border-radius: 0; border-radius: 0;
@ -643,7 +648,7 @@ select.panel-head-element{
#chat-panel-control-div:has(#chat-panel-prompt:focus):has(#chat-panel-send-button:not([style*="display: none"])):before{ #chat-panel-control-div:has(#chat-panel-prompt:focus):has(#chat-panel-send-button:not([style*="display: none"])):before{
content: ''; content: '';
box-shadow: var(--focus-glow0-inset-top-alt); box-shadow: var(--focus-glow0-inset-top-alt);
width: calc(100% - 2.5rem); width: calc(100% - 3.2rem);
height: 2em; height: 2em;
position: absolute; position: absolute;
pointer-events: none; pointer-events: none;
@ -655,7 +660,7 @@ select.panel-head-element{
content: ''; content: '';
position: absolute; position: absolute;
background: linear-gradient(to top, var(--focus0), rgb(0,0,0,0)); background: linear-gradient(to top, var(--focus0), rgb(0,0,0,0));
width: calc(100% - 2.5rem); width: calc(100% - 3.2rem);
height: 3px; height: 3px;
top: -3px; top: -3px;
pointer-events: none; pointer-events: none;
@ -666,7 +671,7 @@ select.panel-head-element{
#chat-panel-send-button:active:not([disabled]):before{ #chat-panel-send-button:active:not([disabled]):before{
content: ''; content: '';
position: absolute; position: absolute;
width: 2.5rem; width: 3.2rem;
height: 3px; height: 3px;
top: -3px; top: -3px;
right: 0; right: 0;

View file

@ -353,7 +353,7 @@ class channel{
["syncTolerance",1], ["syncTolerance",1],
["liveSyncTolerance", 10], ["liveSyncTolerance", 10],
["syncDelta", 6], ["syncDelta", 6],
["theme", "The Network"], ["theme", "The Network (Classic)"],
["chatWidthMin", 20], ["chatWidthMin", 20],
["disablePortrait", false], ["disablePortrait", false],
["disableSendButton", false], ["disableSendButton", false],

View file

@ -27,14 +27,14 @@ class themeManager{
*/ */
this.themes = new Map([ this.themes = new Map([
["Movie Night", "/css/theme/movie-night.css"], ["Movie Night", "/css/theme/movie-night.css"],
["The Network", "/css/theme/the-network.css"] ["The Network (Classic)", "/css/theme/the-network-classic.css"]
]); ]);
/** /**
* Sets default theme for new users * Sets default theme for new users
*/ */
this.defaultTheme = "The Network"; this.defaultTheme = "The Network (Classic)";
/** /**
* Define property to hold theme link DOM node * Define property to hold theme link DOM node
@ -51,7 +51,7 @@ class themeManager{
*/ */
setTheme(theme = localStorage.getItem("theme")){ setTheme(theme = localStorage.getItem("theme")){
//If we didnt get a theme to set //If we didnt get a theme to set
if(theme == null){ if(theme == null || theme == ""){
//Use the first theme in the list //Use the first theme in the list
theme = this.defaultTheme; theme = this.defaultTheme;
} }
@ -65,6 +65,14 @@ class themeManager{
//Create new link element and use it to set themeLink //Create new link element and use it to set themeLink
this.themeLink = this.genThemeLink(theme); this.themeLink = this.genThemeLink(theme);
//If we got a bad link
if(this.themeLink == null){
//Reset the theme to the default theme
this.setTheme(this.defaultTheme);
//Do not pass go, do not collect $200
return;
}
//Append themeLink to header //Append themeLink to header
document.querySelector('head').appendChild(this.themeLink); document.querySelector('head').appendChild(this.themeLink);
@ -73,6 +81,15 @@ class themeManager{
} }
genThemeLink(theme = localStorage.getItem("theme")){ genThemeLink(theme = localStorage.getItem("theme")){
//Grab themePath by name
let themePath = this.themes.get(theme)
//If we got dookie-dick for a theme
if(themePath == null || themePath == ""){
//GIMME A THEME WITH NUTHIN'! NUTHIN'?!?! NUTHIN'!! https://i.ytimg.com/vi/CccHBlGrOu8/hqdefault.jpg
return;
}
//Create new link element and use it to set themeLink //Create new link element and use it to set themeLink
const themeLink = document.createElement('link'); const themeLink = document.createElement('link');
@ -81,7 +98,7 @@ class themeManager{
themeLink.rel = "stylesheet"; themeLink.rel = "stylesheet";
//Set theme href to theme location //Set theme href to theme location
themeLink.href = this.themes.get(theme); themeLink.href = themePath;
return themeLink; return themeLink;
} }