From e19ae744121aabd4478ab2341f754cdbee57bbef Mon Sep 17 00:00:00 2001 From: rainbow napkin Date: Thu, 25 Sep 2025 23:32:04 -0400 Subject: [PATCH] Started work on PM Panel layout --- src/app/pm/pmHandler.js | 4 ++ src/controllers/panel/pmController.js | 20 +++++++++ src/routers/panelRouter.js | 2 + src/views/channel.ejs | 2 + src/views/partial/channel/chatPanel.ejs | 1 + src/views/partial/panels/pm.ejs | 37 +++++++++++++++++ www/css/panel/pm.css | 54 +++++++++++++++++++++++++ www/css/theme/movie-night.css | 17 ++++++++ www/js/channel/channel.js | 5 +++ www/js/channel/panels/pmPanel.js | 43 ++++++++++++++++++++ www/js/channel/pmHandler.js | 13 ++++++ 11 files changed, 198 insertions(+) create mode 100644 src/controllers/panel/pmController.js create mode 100644 src/views/partial/panels/pm.ejs create mode 100644 www/css/panel/pm.css create mode 100644 www/js/channel/panels/pmPanel.js diff --git a/src/app/pm/pmHandler.js b/src/app/pm/pmHandler.js index 01af129..cf8daab 100644 --- a/src/app/pm/pmHandler.js +++ b/src/app/pm/pmHandler.js @@ -45,6 +45,10 @@ class pmHandler{ this.namespace.on("connection", this.handleConnection.bind(this) ); } + /** + * Handles global server-side initialization for new connections to the private messaging system + * @param {Socket} socket - Requesting Socket + */ async handleConnection(socket){ try{ //ensure unbanned ip and valid CSRF token diff --git a/src/controllers/panel/pmController.js b/src/controllers/panel/pmController.js new file mode 100644 index 0000000..7b46625 --- /dev/null +++ b/src/controllers/panel/pmController.js @@ -0,0 +1,20 @@ +/*Canopy - The next generation of stoner streaming software +Copyright (C) 2024-2025 Rainbownapkin and the TTN Community + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as +published by the Free Software Foundation, either version 3 of the +License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see .*/ + +//root index functions +module.exports.get = async function(req, res){ + res.render('partial/panels/pm', {}); +} \ No newline at end of file diff --git a/src/routers/panelRouter.js b/src/routers/panelRouter.js index 7cafe14..59888c1 100644 --- a/src/routers/panelRouter.js +++ b/src/routers/panelRouter.js @@ -25,6 +25,7 @@ const popoutContainerController = require("../controllers/panel/popoutContainerC const profileController = require("../controllers/panel/profileController"); const queueController = require("../controllers/panel/queueController"); const settingsController = require("../controllers/panel/settingsController"); +const pmController = require("../controllers/panel/pmController"); //Validators const accountValidator = require("../validators/accountValidator"); @@ -38,5 +39,6 @@ router.get('/popoutContainer', popoutContainerController.get); router.get('/profile', accountValidator.user(), profileController.get); router.get('/queue', queueController.get); router.get('/settings', settingsController.get); +router.get('/pm', pmController.get); module.exports = router; diff --git a/src/views/channel.ejs b/src/views/channel.ejs index 561702d..07d9f36 100644 --- a/src/views/channel.ejs +++ b/src/views/channel.ejs @@ -47,12 +47,14 @@ along with this program. If not, see . %> + <%# panels %> + <%# main client %> diff --git a/src/views/partial/channel/chatPanel.ejs b/src/views/partial/channel/chatPanel.ejs index b5c4bef..e56c28a 100644 --- a/src/views/partial/channel/chatPanel.ejs +++ b/src/views/partial/channel/chatPanel.ejs @@ -74,6 +74,7 @@ along with this program. If not, see . %>
+ diff --git a/src/views/partial/panels/pm.ejs b/src/views/partial/panels/pm.ejs new file mode 100644 index 0000000..af3e372 --- /dev/null +++ b/src/views/partial/panels/pm.ejs @@ -0,0 +1,37 @@ +<%# Canopy - The next generation of stoner streaming software +Copyright (C) 2024-2025 Rainbownapkin and the TTN Community + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as +published by the Free Software Foundation, either version 3 of the +License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see . %> + +
+
+
+ + Start Sesh +
+
+ +
+
+
+
+ +
+
+ + +
+
+
+
\ No newline at end of file diff --git a/www/css/panel/pm.css b/www/css/panel/pm.css new file mode 100644 index 0000000..09b3c56 --- /dev/null +++ b/www/css/panel/pm.css @@ -0,0 +1,54 @@ +/*Canopy - The next generation of stoner streaming software +Copyright (C) 2024-2025 Rainbownapkin and the TTN Community + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as +published by the Free Software Foundation, either version 3 of the +License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see .*/ +#pm-panel-main-div{ + display: flex; + flex-direction: horizontal; + height: 100%; +} + +#pm-panel-sesh-list-container{ + flex: 1; + max-width: 10em; +} + +#pm-panel-sesh-container{ + display: flex; + flex-direction: column; + flex: 1; + height: calc(100% - 0.25em); + margin-top: 0; +} + +#pm-panel-start-sesh{ + width: calc(100% - 1.25em); + margin-left: 0.25em; + padding: 0 0.5em; + text-wrap: nowrap; + display: flex; +} + +#pm-panel-start-sesh span{ + flex: 1; + text-align: center; +} + +#pm-panel-sesh-buffer{ + flex: 1; +} + +#pm-panel-sesh-control-div{ + margin: 0.5em; +} \ No newline at end of file diff --git a/www/css/theme/movie-night.css b/www/css/theme/movie-night.css index fee6c3e..1cfda84 100644 --- a/www/css/theme/movie-night.css +++ b/www/css/theme/movie-night.css @@ -103,6 +103,14 @@ a:active, i:active:not(button i), .interactive:active{ text-shadow: var(--focus-glow0-alt0); } +div.interactive:hover{ + background-color: var(--bg2); +} + +div.interactive:active{ + background-color: var(--bg1); +} + button i{ margin: 0.05em; text-wrap: nowrap; @@ -610,6 +618,15 @@ div.archived p{ border-left: var(--accent1-alt0) solid 1px; } +/* PM Panel */ +#pm-panel-sesh-container{ + border-left: 1px solid var(--accent0); +} + +#pm-panel-start-sesh{ + border-bottom: 1px solid var(--accent0); +} + /* altcha theming*/ div.altcha{ box-shadow: 4px 4px 1px var(--bg1-alt0) inset; diff --git a/www/js/channel/channel.js b/www/js/channel/channel.js index 0377d1e..523cf6b 100644 --- a/www/js/channel/channel.js +++ b/www/js/channel/channel.js @@ -51,6 +51,11 @@ class channel{ * Child User List Object */ this.userList = new userList(this); + + /** + * Child PM Handler + */ + this.pmHandler = new pmHandler(this); /** * Child Canopy Panel Object diff --git a/www/js/channel/panels/pmPanel.js b/www/js/channel/panels/pmPanel.js new file mode 100644 index 0000000..761c2d8 --- /dev/null +++ b/www/js/channel/panels/pmPanel.js @@ -0,0 +1,43 @@ +/*Canopy - The next generation of stoner streaming software +Copyright (C) 2024-2025 Rainbownapkin and the TTN Community + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as +published by the Free Software Foundation, either version 3 of the +License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see .*/ + +/** + * Class representing the settings panel + * @extends panelObj + */ +class pmPanel extends panelObj{ + /** + * Instantiates a new Panel Object + * @param {channel} client - Parent client Management Object + * @param {Document} panelDocument - Panel Document + */ + constructor(client, panelDocument){ + super(client, "Private Messaging", "/panel/pm", panelDocument); + } + + closer(){ + } + + docSwitch(){ + this.setupInput(); + } + + /** + * Defines input-related event handlers + */ + setupInput(){ + } +} \ No newline at end of file diff --git a/www/js/channel/pmHandler.js b/www/js/channel/pmHandler.js index 94f392b..956bd57 100644 --- a/www/js/channel/pmHandler.js +++ b/www/js/channel/pmHandler.js @@ -20,5 +20,18 @@ along with this program. If not, see .*/ class pmHandler{ constructor(client){ this.client = client; + + this.pmIcon = document.querySelector('#chat-panel-pm-icon'); + + this.defineListeners(); + this.setupInput(); + } + + defineListeners(){ + + } + + setupInput(){ + this.pmIcon.addEventListener("click", ()=>{this.client.cPanel.setActivePanel(new pmPanel(client))}); } } \ No newline at end of file