Skip to content

Fixed background to nodebb forum

Solved Configure
25 2 4.9k 1
  • I’ve been asked to do this:

    On the forum, mobile friendly and on PC you’ll get a fire coloured gradient for the background with everything within a frame on top of that background so the frame can be scrolled but the background doesn’t change.
    Centred experience such as tumblr or twitter in the sense that it’s the info that gets scrolled but not the whole page

    The forum is nodebb hosted, so although I can add custom CSS or Javascript, where can I upload the image to use?
    Also what CSS to write please?

  • I’ve been asked to do this:

    On the forum, mobile friendly and on PC you’ll get a fire coloured gradient for the background with everything within a frame on top of that background so the frame can be scrolled but the background doesn’t change.
    Centred experience such as tumblr or twitter in the sense that it’s the info that gets scrolled but not the whole page

    The forum is nodebb hosted, so although I can add custom CSS or Javascript, where can I upload the image to use?
    Also what CSS to write please?

    @Panda this is untested as I’m not in front of a PC currently, but should work

    body {
    background-image: url("/path/to/your/image.jpg");
    min-height: 100%;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: center;
    background-size: cover;
    }
    

    The image can be hosted anywhere outside of the NodeBB ecosystem provided it is reachable from any machine with an Internet connection. It doesn’t necessarily need to be on the site itself

  • @Panda this is untested as I’m not in front of a PC currently, but should work

    body {
    background-image: url("/path/to/your/image.jpg");
    min-height: 100%;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: center;
    background-size: cover;
    }
    

    The image can be hosted anywhere outside of the NodeBB ecosystem provided it is reachable from any machine with an Internet connection. It doesn’t necessarily need to be on the site itself

    @phenomlab there was error, close } without opening {

    Is there missing line at start?

    On that topic the brackets and some words in that code block (center , cover etc) are very feint to read on my device?

  • Ah I figured out needed
    body {

    Its working but got this funny response as if background is being clicked, and slightly moves sometimes, when you scroll up and down on forum content

  • Apart from the slight move issue
    The dark background was also too stong and making forum text hard to read.

    I asked chatGPT for fix, both its suggestions didnt work

    1st suggestion change alpha value on rgb made no difference

    Screenshot_20230730_153940_Chrome~2.jpg

    2nd idea, filter:

    Screenshot_20230730_154031_Chrome~2.jpg

    This only made forum text weaker!

    Its now saying I need to edit the image in a paint program, and save it with more transparency, but as Im loading from website I cant do that

    Is there a CSS way to reduce alpha value on image from external url?

  • Ah I figured out needed
    body {

    Its working but got this funny response as if background is being clicked, and slightly moves sometimes, when you scroll up and down on forum content

    @Panda yes, sorry. I’ve updated the original post

  • Apart from the slight move issue
    The dark background was also too stong and making forum text hard to read.

    I asked chatGPT for fix, both its suggestions didnt work

    1st suggestion change alpha value on rgb made no difference

    Screenshot_20230730_153940_Chrome~2.jpg

    2nd idea, filter:

    Screenshot_20230730_154031_Chrome~2.jpg

    This only made forum text weaker!

    Its now saying I need to edit the image in a paint program, and save it with more transparency, but as Im loading from website I cant do that

    Is there a CSS way to reduce alpha value on image from external url?

    @Panda there is. What you are seeing here with the image moving when clicked is called Cumulative Layout Shift which occurs when the body height is set incorrectly.

    Filter and Opacity are a bad idea as you are targeting the body element meaning all ancestors are affected by that change which in turn makes the text even harder to read.

    Tired want to use a overlay with the image, to add background color with transparency which should solve the issue.

  • @Panda there is. What you are seeing here with the image moving when clicked is called Cumulative Layout Shift which occurs when the body height is set incorrectly.

    Filter and Opacity are a bad idea as you are targeting the body element meaning all ancestors are affected by that change which in turn makes the text even harder to read.

    Tired want to use a overlay with the image, to add background color with transparency which should solve the issue.

    @phenomlab
    I did try putting 95% height, but didnt solve it

    Re: putting a background color on…
    If you look at the aignite site can you suggest what line to put to make the dark background more transparent

    I try to avoid CSS, so dont know it!

  • @phenomlab
    I did try putting 95% height, but didnt solve it

    Re: putting a background color on…
    If you look at the aignite site can you suggest what line to put to make the dark background more transparent

    I try to avoid CSS, so dont know it!

    @Panda said in Fixed background to nodebb forum:

    I try to avoid CSS, so dont know it!

    You’ll never avoid having to use it. I’d recommend you start to learn it because you’ll come across this in all aspects of web development.

  • @Panda said in Fixed background to nodebb forum:

    I try to avoid CSS, so dont know it!

    You’ll never avoid having to use it. I’d recommend you start to learn it because you’ll come across this in all aspects of web development.

    @phenomlab making min height 90% fixed it 😊

  • Pandaundefined Panda has marked this topic as solved on
  • @phenomlab making min height 90% fixed it 😊

    @Panda Good. And the background image with the text?

  • @Panda Good. And the background image with the text?

    @phenomlab
    Sort of …
    Its taken me ages to get a skin that looks ok even over a feint background

    If I pick a skin can I change just one of the colors if its not dark enough?

  • @phenomlab
    Sort of …
    Its taken me ages to get a skin that looks ok even over a feint background

    If I pick a skin can I change just one of the colors if its not dark enough?

    @Panda yes, but you should start with a sane value and work backwards. The lower the last number in terms of rgba the higher the transparency.

  • @Panda yes, but you should start with a sane value and work backwards. The lower the last number in terms of rgba the higher the transparency.

    @phenomlab ah ok
    So how do I change one color in a skin?

  • @phenomlab ah ok
    So how do I change one color in a skin?

    @Panda first, define “skin”

  • @Panda first, define “skin”

    @phenomlab I go to admin menu and select skins
    Current one is Quartz

  • @phenomlab I go to admin menu and select skins
    Current one is Quartz

    @Panda ok, but which code runs this? Is it mine, or someone else’s work (it does make a difference.

    Edit - ok, unless I login, I cannot change the skin if it’s under admin. I’m being forced to wear sunglasses currently.

  • @Panda ok, but which code runs this? Is it mine, or someone else’s work (it does make a difference.

    Edit - ok, unless I login, I cannot change the skin if it’s under admin. I’m being forced to wear sunglasses currently.

    @phenomlab
    on aignite.nodebb.com I want to pick skin with colors that look ok over back image.
    But all the skins I try have at least one text color that is light and hard to see over image

  • @phenomlab
    on aignite.nodebb.com I want to pick skin with colors that look ok over back image.
    But all the skins I try have at least one text color that is light and hard to see over image

    @Panda it seems you are using the NodeBB skins which frankly, are terrible. They are all based on bootswatch and all have issues.

    You really need to custom develop a skin if your want it to look right.

  • @Panda it seems you are using the NodeBB skins which frankly, are terrible. They are all based on bootswatch and all have issues.

    You really need to custom develop a skin if your want it to look right.

    @phenomlab yea, this is what Im asking,
    Using a skin but maybe modifying one of the color choices


Did this solution help you?
Did you find the suggested solution useful? Why not buy me a coffee? It's a nice gesture, and a great way to show your appreciation 💗

Related Topics
  • NodeBB: Consent page

    Solved Configure nodebb consent
    16
    4 Votes
    16 Posts
    4k Views
    @DownPW I still do not see any issues.
  • NodeBB: Upgrading to NodeBB v3.x

    Solved Configure nodebb v3.x
    6
    0 Votes
    6 Posts
    1k Views
    @mventures You’d need to connect to the server and execute it directly - not on your local terminal. Review the guide below, which will show you how to gain access via SSH to your server https://docs.ovh.com/gb/en/dedicated/ssh-introduction/ Once you have access, you’ll need to navigate to the actual folder where NodeBB is installed You’ll then need to change to the directory as shown below /home/unbuntu/nodebb [image: 1680448167972-fdffe673-bf63-4b6d-a728-5506fddc1aff-image.png] In most cases, initial access takes you to the root of the file system. You can always issue pwd in a Linux terminal which will show you the Present Working Directory. From there, you can issue the command cd /home/ubuntu/nodebb Once in the NodeBB directory, you’d use the below commands ./nodebb stop git fetch && git checkout develop && git reset --hard origin/develop ./nodebb upgrade ./nodebb start Line 1 stops the NodeBB instance Line 2 gets the latest files from GIT (repository) and then checks out the development branch. It then resets the version you are using to the development branch ready for v3 Line 3 Runs the upgrade once the new branch is set, and code pulled Line 4 Restarts the NodeBB instance after the upgrade has completed Note that when you restart NodeBB and log back in, things will look very different to what you had in v2.
  • NodeBB: Creating pages

    Solved Configure nodebb create page
    9
    0 Votes
    9 Posts
    2k Views
    OK, I think I have figured out how to place a link in the footer which will click to a new page.
  • NodeBB: Privileges for the Announcement channel

    Solved Configure nodebb
    6
    1
    1 Votes
    6 Posts
    1k Views
    Up to you really
  • 5 Votes
    13 Posts
    2k Views
    'use strict'; const winston = require('winston'); const user = require('../user'); const notifications = require('../notifications'); const sockets = require('../socket.io'); const plugins = require('../plugins'); const meta = require('../meta'); module.exports = function (Messaging) { Messaging.notifyQueue = {}; // Only used to notify a user of a new chat message, see Messaging.notifyUser Messaging.notifyUsersInRoom = async (fromUid, roomId, messageObj) => { let uids = await Messaging.getUidsInRoom(roomId, 0, -1); uids = await user.blocks.filterUids(fromUid, uids); let data = { roomId: roomId, fromUid: fromUid, message: messageObj, uids: uids, }; data = await plugins.hooks.fire('filter:messaging.notify', data); if (!data || !data.uids || !data.uids.length) { return; } uids = data.uids; uids.forEach((uid) => { data.self = parseInt(uid, 10) === parseInt(fromUid, 10) ? 1 : 0; Messaging.pushUnreadCount(uid); sockets.in(`uid_${uid}`).emit('event:chats.receive', data); }); if (messageObj.system) { return; } // Delayed notifications let queueObj = Messaging.notifyQueue[`${fromUid}:${roomId}`]; if (queueObj) { queueObj.message.content += `\n${messageObj.content}`; clearTimeout(queueObj.timeout); } else { queueObj = { message: messageObj, }; Messaging.notifyQueue[`${fromUid}:${roomId}`] = queueObj; } queueObj.timeout = setTimeout(async () => { try { await sendNotifications(fromUid, uids, roomId, queueObj.message); } catch (err) { winston.error(`[messaging/notifications] Unabled to send notification\n${err.stack}`); } }, meta.config.notificationSendDelay * 1000); }; async function sendNotifications(fromuid, uids, roomId, messageObj) { const isOnline = await user.isOnline(uids); uids = uids.filter((uid, index) => !isOnline[index] && parseInt(fromuid, 10) !== parseInt(uid, 10)); if (!uids.length) { return; } if (roomId != 11) { // 5 Is the ID of the ID of the global chat room. Messaging.getUidsInRoom(roomId, 0, -1); // Proceed as normal. } else { user.getUidsFromSet('users:online', 0, -1); // Only notify online users. } const { displayname } = messageObj.fromUser; const isGroupChat = await Messaging.isGroupChat(roomId); const notification = await notifications.create({ type: isGroupChat ? 'new-group-chat' : 'new-chat', subject: `[[email:notif.chat.subject, ${displayname}]]`, bodyShort: `[[notifications:new_message_from, ${displayname}]]`, bodyLong: messageObj.content, nid: `chat_${fromuid}_${roomId}`, from: fromuid, path: `/chats/${messageObj.roomId}`, }); delete Messaging.notifyQueue[`${fromuid}:${roomId}`]; notifications.push(notification, uids); } };
  • 14 Votes
    69 Posts
    26k Views
    @phenomlab Seems to be better with some scaling fix for redis on redis.conf. I haven’t seen the message yet since the changes I made # I increase it to the value of /proc/sys/net/core/somaxconn tcp-backlog 4096 # I'm uncommenting because it can slow down Redis. Uncommented by default !!!!!!!!!!!!!!!!!!! #save 900 1 #save 300 10 #save 60 10000 If you have other Redis optimizations. I take all your advice https://severalnines.com/blog/performance-tuning-redis/
  • MailGun Not Working NodeBB

    Solved Configure mail mailgun
    6
    1 Votes
    6 Posts
    1k Views
    @phenomlab did it i did not create smtp user on mailgun. everything is working now. [image: 1667569376261-6cc6061f-ed5d-41f6-8eb7-5d98f98b3706-image.png]
  • Customising NodeBB

    Locked Customisation nodebb
    3
    0 Votes
    3 Posts
    2k Views
    Closing this thread as a duplicate of https://sudonix.com/topic/12/nodebb-customisation