diff --git a/_public/_styles/chat.css b/_public/_styles/chat.css index ae51e35..44f1945 100644 --- a/_public/_styles/chat.css +++ b/_public/_styles/chat.css @@ -1,6 +1,5 @@ body { font-family: "Roboto"; - font-size: 18px; line-height: 18px; color: #FFFFFF; diff --git a/_public/_styles/settings.css b/_public/_styles/settings.css index f92e4a0..7c5b5ff 100644 --- a/_public/_styles/settings.css +++ b/_public/_styles/settings.css @@ -31,7 +31,7 @@ form { } form :nth-child(n) { - margin-bottom: 20px; + margin-bottom: 10px; } input { @@ -90,4 +90,45 @@ form .message { form button:hover { background-color: var(--primary-color-02); color: var(--secondary-color-03); +} + +.settings-section { + display: flex; + flex-direction: column; + color: var(--secondary-color-03); +} + +.settings-section span { + display: flex; + flex-direction: row; + align-items: center; + font-weight: bold; + + margin-bottom: 0; +} + +.settings-section span.youtube { + color: #f70000; +} + +.settings-section span div { + margin-left: 5px; + margin-bottom: 0; +} + +.settings-section div { + display: flex; + flex-direction: row; + align-items: center; + + margin-left: 5px; +} + +.settings-section div div { + margin-right: 5px; +} + +.settings-section svg { + fill: #f70000; + margin-bottom: 0; } \ No newline at end of file diff --git a/config/config.json b/config/config.json index a48efcc..cfacf08 100644 --- a/config/config.json +++ b/config/config.json @@ -1 +1 @@ -{"channelTag":""} \ No newline at end of file +{"channelTag":"LofiGirl","fontSize":"24"} \ No newline at end of file diff --git a/src/app.ts b/src/app.ts index c97a0b7..5f45eb6 100644 --- a/src/app.ts +++ b/src/app.ts @@ -34,6 +34,7 @@ app.get("/", (request: Request, response: Response) => { app.post("/", (request: Request, response: Response) => { config.setChannelTag(request.body.channelTag); + config.setFontSize(request.body.fontSize); ytChat.connectChannel(config.getChannelTag()); response.render('settings', { diff --git a/src/config.ts b/src/config.ts index d89ba6d..623a5b5 100644 --- a/src/config.ts +++ b/src/config.ts @@ -2,6 +2,7 @@ import * as fs from 'fs'; interface ConfigData { channelTag: string; + fontSize: number; } export class Config @@ -21,7 +22,10 @@ export class Config let rawData : string = fs.readFileSync(configFilePath, 'utf8'); this.configuration = JSON.parse(rawData); } else { - this.configuration = { channelTag: "" } as ConfigData; + this.configuration = { + channelTag: "", + fontSize: 18 + } as ConfigData; } } @@ -46,4 +50,26 @@ export class Config } }); } + + /** + * Getting the font size for live chat from config + * @return Font size + */ + getFontSize() : number { + return this.configuration.fontSize; + } + + /** + * Setting font size for live chat to config + * @param fontSize Font size + */ + setFontSize(fontSize : number) : void { + this.configuration.fontSize = fontSize; + + fs.writeFile(this.configFilePath, JSON.stringify(this.configuration), function(err) { + if (err) { + console.log(err); + } + }); + } } \ No newline at end of file diff --git a/src/socket.ts b/src/socket.ts index fbdb6ef..15fa6ef 100644 --- a/src/socket.ts +++ b/src/socket.ts @@ -21,10 +21,5 @@ export class ChatSocket { console.log(`\x1b[44m` + `\x1b[37m` + ` INFO ` + `\x1b[40m` + `\x1b[0m` + ` Detected a connection to chat`+ `\x1b[0m`); }); - - this.io.on("settings", (socket) => { - console.log(`\x1b[44m` + `\x1b[37m` + ` INFO ` + `\x1b[40m` + `\x1b[0m` - + ` Detected a connection to chat`+ `\x1b[0m`); - }); } } \ No newline at end of file diff --git a/views/chat.ejs b/views/chat.ejs index b707928..c7c618e 100644 --- a/views/chat.ejs +++ b/views/chat.ejs @@ -91,7 +91,7 @@ }); -
+