Skip to content

ineffecient use of space on mobile

Solved Customisation
  • Hi @phenomlab ,

    When I access these pages that show posts on mobile:

    /posts
    /best
    /controversial

    I see something like this:
    Screen Shot 2022-05-12 at 1.11.28 PM.png

    This is how it looks on default. Our forum is the same, NodeBB community forum is the same…

    Although this page design does not bother me on desktop, I feel on mobile ~40% of the page is wasted for space…

    1. I wonder your opinion about this.

    2. Do you think these pages can be re-designed with CSS codes?

    I thought something like this, as in the topics… so, the blue line and avatar goes to the right side edge… username comes next to avatar, date goes to the left side… And of course “the post area” will be expanded to whole page…

    Screen Shot 2022-05-12 at 1.11.28 PM copy.jpg

  • @crazycells I knew that was coming 😄 - here it is

    @media (max-width: 767px) {
    .posts-list .posts-list-item {
        width: auto;
    }
    .posts-list .posts-list-item .post-body {
        border-right: none !important;
        width: 100%;
    }
    .posts-list .posts-list-item .post-info {
        position: revert;
        left: 0px;
        width: 500px;
    }
    .posts-list .posts-list-item .post-info .post-author {
        max-width: none !important;
        display: flex;
    }
    .posts-list .posts-list-item .post-info .post-author span {
        margin-left: 10px;
    }
    }
    

    Some other adjustments to get even more estate on mobile (30px either side) - your tastes may vary

    @media (max-width: 767px) {
    .posts-list .posts-list-item {
        width: auto;
    }
    .posts-list .posts-list-item .post-info {
        position: revert;
        left: 0px;
        width: 100%;
        margin-left: 15px;
    }
    .posts-list .posts-list-item .post-info .post-author {
        max-width: none !important;
        display: flex;
    }
    .posts-list .posts-list-item .post-body {
        border-right: none !important;
        width: 100%;
    }
    .posts-list .posts-list-item .post-info .post-author span {
        margin-left: 10px;
    }
    }
    

    The second CSS block gives you this

    1a9607f4-c011-4521-ba7b-e1b5fe44a045-image.png

    A final note that this of course does not include the colour scheme. This is from “Midnight” - a new theme I’ve developed in DEV which is almost ready for release, but has a few bugs I need to iron out first. I’ll publish a blog post on this new theme set soon.

  • @crazycells Funny you should mention that ! I was looking at this in my DEV environment yesterday and decided to alter the layout a bit

    bae79dbc-d2ef-4ceb-b25b-1bbcc24561bd-image.png

    My personal thoughts are that this looks much better and is easier to read 🙂

  • @phenomlab said in ineffecient use of space on mobile:

    @crazycells Funny you should mention that ! I was looking at this in my DEV environment yesterday and decided to alter the layout a bit

    lol, let’s say “great minds think alike” 😄

  • @phenomlab yes, I think this is definitely way better than the current form…

    Is this all CSS? or have you changed the codes in files as well?

  • @crazycells It’s all CSS !

  • @phenomlab said in ineffecient use of space on mobile:

    @crazycells It’s all CSS !

    great. Can you please share it when it is ready? I am looking forward to it.

    I have realized this recently, after using “/best-posts” plugin… it is very hard to follow these posts on mobile…

  • @crazycells I knew that was coming 😄 - here it is

    @media (max-width: 767px) {
    .posts-list .posts-list-item {
        width: auto;
    }
    .posts-list .posts-list-item .post-body {
        border-right: none !important;
        width: 100%;
    }
    .posts-list .posts-list-item .post-info {
        position: revert;
        left: 0px;
        width: 500px;
    }
    .posts-list .posts-list-item .post-info .post-author {
        max-width: none !important;
        display: flex;
    }
    .posts-list .posts-list-item .post-info .post-author span {
        margin-left: 10px;
    }
    }
    

    Some other adjustments to get even more estate on mobile (30px either side) - your tastes may vary

    @media (max-width: 767px) {
    .posts-list .posts-list-item {
        width: auto;
    }
    .posts-list .posts-list-item .post-info {
        position: revert;
        left: 0px;
        width: 100%;
        margin-left: 15px;
    }
    .posts-list .posts-list-item .post-info .post-author {
        max-width: none !important;
        display: flex;
    }
    .posts-list .posts-list-item .post-body {
        border-right: none !important;
        width: 100%;
    }
    .posts-list .posts-list-item .post-info .post-author span {
        margin-left: 10px;
    }
    }
    

    The second CSS block gives you this

    1a9607f4-c011-4521-ba7b-e1b5fe44a045-image.png

    A final note that this of course does not include the colour scheme. This is from “Midnight” - a new theme I’ve developed in DEV which is almost ready for release, but has a few bugs I need to iron out first. I’ll publish a blog post on this new theme set soon.

  • @phenomlab said in ineffecient use of space on mobile:

    @crazycells I knew that was coming - here it is

    lol of course 😄

    Thanks a lot. It is definitely much better than the previous version…

    Since we have not adapted posts as boxes yet, I would like to separate the posts by a line from edge to edge… but not sure what classes should I use? I know the code will be something like this:

    .posts-list .posts-list-item .post-info {
    border-bottom: 1px solid #000;
    }
    

    but this does not extend from edge to edge. Do you have any other suggestions to separate posts from each other?

    Actually, it looks good when I add:

        margin-bottom: 35px;
    

    but, I wanted to ask in case you have a better solution.

  • @crazycells This is fine. The generally accepted way of adding a space between elements is to use margin so you’re on the right track.

  • phenomlabundefined phenomlab has marked this topic as solved on
  • crazycellsundefined crazycells referenced this topic on

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 💗

  • 7 Votes
    8 Posts
    184 Views

    @crazycells hmm. That’s odd. I haven’t made any changes from recollection but I could be wrong. I’ll need to check.

    EDIT - very strange. I honestly don’t recall adding the below CSS block to alter the bottom bar, but you’re right…

    .bottombar-nav { padding: 0px !important; }

    I’ve removed this so it reflects stock Harmony.

  • 2 Votes
    26 Posts
    1k Views

    @Panda said in Interesting Widget code, but can’t fetch API:

    How did you drop that widget into the post there?
    I hadnt seen this BSgenerator anywhere on sudonix site, do you use it somewhere already?

    Yes, here

    https://sudonix.org/topic/414/corporate-bullshit-generator?_=1687774393044

    It’s not a “post” or “topic” in the common sense. It is actually a page in it’s own right and leverages nodebb-plugin-custom-pages. This in turn creates a new “route” which behaves like a page, meaning it is then exposed for widgets.

    @Panda said in Interesting Widget code, but can’t fetch API:

    Also can you explain more what you mean by calling the code externally. In my API call example, how would I go about doing that?

    By this, I mean create all the required code in an external JS file that is reachable by the NodeBB instance - so, in “public” for example - or in my case /public/js. The widget then “calls” that file and because it runs outside of the scope of NodeBB, you just need to return the values to the widget.

    Hope this makes sense?

  • 1 Votes
    1 Posts
    278 Views
    No one has replied
  • 1 Votes
    4 Posts
    475 Views

    @eeeee if you’re using the console, you could try

    node app.js > app.log 2>&1

    This would redirect stdout to a file named app.log and redirect stderr to stdout.

    I’m not sure about standard logging under NodeBB, but there is an error log located at logs/error.log.

    Failing that, you could always stop the NodeBB service then use ./nodebb dev from the console which would then provide debug output.

  • 0 Votes
    2 Posts
    156 Views

    @eeeee they are nothing to worry about, and can be ignored.

  • 0 Votes
    6 Posts
    537 Views

    @cagatay You should ask in the NodeBB forums. Perhaps reference this post

    https://discuss.flarum.org/d/23066-who-read

  • Forum Icons NodeBB

    Solved Customisation
    13
    0 Votes
    13 Posts
    800 Views

    @cagatay That matches what I see

    4f0f858d-9812-42b1-9f61-ffb13d31dccd-image.png

  • 12 Votes
    47 Posts
    2k Views

    @phenomlab I’m really looking forward to trying out ghost fairly soon. Should I underestimate the fact I’m not a writer? 😉.