Skip to content

Bottom footer navbar button extend

Solved Customisation
32 2 12.1k 1
  • Small request for my forum or here @phenomlab

    I would like the bottom bar of the site to be hidden with a button and for it to appear/disappear after a click or a mouseover with a small animation that doesn’t take too many resources.

    It would also be nice if the setting was kept in the DOM session if possible so that the user doesn’t have to mess with it all the time.

    We could imagine that it is active by default and if the user does not want it, he hides it. It will simply remain the button on the left or right side

    Thanks 😉

  • Instructions

    1. Go to /admin/extend/widgets and locate the “Global Footer” widget
    2. At the very top of the existing code you have in that widget, add

    <div id="console-nav-tab"><i class="fa-solid fa-angles-left"></i></div>

    1. Add this CSS
    div#console-nav-tab {
    position: fixed;
        bottom: 0px;
        z-index: 900;
        height: 30px;
        left: 0px;
    }
    div#console-nav-tab i {
        font-size: 16px;
        margin-left: 10px;
        line-height: 2.0 !important;
    }
    .toBottom {
       bottom: 0px !important;
    }
    

    Note, that you probably need to modify the existing CSS ID floatleft to accommodate the additional DIV and icon. For example

    #floatleft {
        float: left;
        padding-left: 30px; /*additional left padding to support additional DIV and icon */
        font-size: 80%;
        line-height: 2.0;
        font-weight: 600;
        display: flex;
    }
    
    1. Go to /admin/appearance/customise#custom-js and add this block of code (bottom is fine, or wherever you want to place it)
    $(document).ready(function() {
        $(window).on('action:ajaxify.end', function(data) {
            var getState = localStorage.getItem("footer");
            if (getState === "hidden") {
                $("#console-nav-footer").hide();
                $("#console-nav-tab i").addClass("fa-solid fa-angles-right");
                $('.pagination-block').addClass("toBottom");
            } else {
                $("#console-nav-tab i").addClass("fa-solid fa-angles-left");
                $('.pagination-block').removeClass("toBottom");
            }
            $("#console-nav-tab").click(function() {
                $("#console-nav-footer").toggle(250, function() {
                    if ($("#console-nav-footer").is(":hidden")) {
                        localStorage.setItem("footer", "hidden");
                        $("#console-nav-tab i").addClass("fa-solid fa-angles-right");
                        $('.pagination-block').addClass("toBottom");
                    } else {
                        localStorage.setItem("footer", "shown");
                        $("#console-nav-tab i").addClass("fa-solid fa-angles-left");
                        $('.pagination-block').removeClass("toBottom");
                    }
                });
                $("i", this).toggleClass("fa-solid fa-angles-left fa-solid fa-angles-right");
            });
        });
    });
    
    1. Test, and make necessary modifications to suit your own environment
  • Small request for my forum or here @phenomlab

    I would like the bottom bar of the site to be hidden with a button and for it to appear/disappear after a click or a mouseover with a small animation that doesn’t take too many resources.

    It would also be nice if the setting was kept in the DOM session if possible so that the user doesn’t have to mess with it all the time.

    We could imagine that it is active by default and if the user does not want it, he hides it. It will simply remain the button on the left or right side

    Thanks 😉

    @DownPW said in Bottom footer navbar button extend:

    We could imagine that it is active by default and if the user does not want it, he hides it. It will simply remain the button on the left or right side

    So are you looking for a button on the footer that when clicked will remove from the screen with an animation, but leave just enough so that it can be clicked to make it reappear again with the same animation ?

  • @DownPW said in Bottom footer navbar button extend:

    We could imagine that it is active by default and if the user does not want it, he hides it. It will simply remain the button on the left or right side

    So are you looking for a button on the footer that when clicked will remove from the screen with an animation, but leave just enough so that it can be clicked to make it reappear again with the same animation ?

    @phenomlab said in Bottom footer navbar button extend:

    @DownPW said in Bottom footer navbar button extend:

    We could imagine that it is active by default and if the user does not want it, he hides it. It will simply remain the button on the left or right side

    So are you looking for a button on the footer that when clicked will remove from the screen with an animation, but leave just enough so that it can be clicked to make it reappear again with the same animation ?

    Exactly 😉

  • @phenomlab said in Bottom footer navbar button extend:

    @DownPW said in Bottom footer navbar button extend:

    We could imagine that it is active by default and if the user does not want it, he hides it. It will simply remain the button on the left or right side

    So are you looking for a button on the footer that when clicked will remove from the screen with an animation, but leave just enough so that it can be clicked to make it reappear again with the same animation ?

    Exactly 😉

    @DownPW Right. I’m on it (well, tomorrow now)

  • @DownPW Right. I’m on it (well, tomorrow now)

    @phenomlab hé hé 🙂

  • @phenomlab said in Bottom footer navbar button extend:

    @DownPW said in Bottom footer navbar button extend:

    We could imagine that it is active by default and if the user does not want it, he hides it. It will simply remain the button on the left or right side

    So are you looking for a button on the footer that when clicked will remove from the screen with an animation, but leave just enough so that it can be clicked to make it reappear again with the same animation ?

    Exactly 😉

    @DownPW said in Bottom footer navbar button extend:

    Exactly

    Something like this ?

  • @phenomlab

    clearly that ^^

  • @phenomlab

    clearly that ^^

    @DownPW ok, good. Let me write the code to record the session state (in the same way that the theme engine works) and I’ll release the code, plus CSS.

  • hell yeah 😉
    Simple to modify ?

    Example: put the button on the left or right

  • hell yeah 😉
    Simple to modify ?

    Example: put the button on the left or right

    @DownPW yes, that will be a simple CSS modification

  • hell yeah 😉
    Simple to modify ?

    Example: put the button on the left or right

    @DownPW said in Bottom footer navbar button extend:

    Example: put the button on the left or right

    Looks better on the left I think - more natural

    6ab4dc12-17f0-4c64-b3c3-af2ba7e6cf6d-image.png

  • @DownPW said in Bottom footer navbar button extend:

    Example: put the button on the left or right

    Looks better on the left I think - more natural

    6ab4dc12-17f0-4c64-b3c3-af2ba7e6cf6d-image.png

  • @DownPW I’ll make some small adjustments to the final code to accommodate this. Just need to write the session cookie data, then I’ll release the code.

  • @DownPW Can you let me know if you used the same code for the footer as what is here ? I think this is the case, but want to check. There needs to be some modifications to this code to support the footer toggle.

  • Updated position of collapse/expand so it’s on the left for a more natural feel

  • Very great 😉

  • @DownPW Can you let me know if you used the same code for the footer as what is here ? I think this is the case, but want to check. There needs to be some modifications to this code to support the footer toggle.

    @phenomlab said in Bottom footer navbar button extend:

    Can you let me know if you used the same code for the footer as what is here ?

    yes Mark, with minor adjustement.

  • Instructions

    1. Go to /admin/extend/widgets and locate the “Global Footer” widget
    2. At the very top of the existing code you have in that widget, add

    <div id="console-nav-tab"><i class="fa-solid fa-angles-left"></i></div>

    1. Add this CSS
    div#console-nav-tab {
    position: fixed;
        bottom: 0px;
        z-index: 900;
        height: 30px;
        left: 0px;
    }
    div#console-nav-tab i {
        font-size: 16px;
        margin-left: 10px;
        line-height: 2.0 !important;
    }
    .toBottom {
       bottom: 0px !important;
    }
    

    Note, that you probably need to modify the existing CSS ID floatleft to accommodate the additional DIV and icon. For example

    #floatleft {
        float: left;
        padding-left: 30px; /*additional left padding to support additional DIV and icon */
        font-size: 80%;
        line-height: 2.0;
        font-weight: 600;
        display: flex;
    }
    
    1. Go to /admin/appearance/customise#custom-js and add this block of code (bottom is fine, or wherever you want to place it)
    $(document).ready(function() {
        $(window).on('action:ajaxify.end', function(data) {
            var getState = localStorage.getItem("footer");
            if (getState === "hidden") {
                $("#console-nav-footer").hide();
                $("#console-nav-tab i").addClass("fa-solid fa-angles-right");
                $('.pagination-block').addClass("toBottom");
            } else {
                $("#console-nav-tab i").addClass("fa-solid fa-angles-left");
                $('.pagination-block').removeClass("toBottom");
            }
            $("#console-nav-tab").click(function() {
                $("#console-nav-footer").toggle(250, function() {
                    if ($("#console-nav-footer").is(":hidden")) {
                        localStorage.setItem("footer", "hidden");
                        $("#console-nav-tab i").addClass("fa-solid fa-angles-right");
                        $('.pagination-block').addClass("toBottom");
                    } else {
                        localStorage.setItem("footer", "shown");
                        $("#console-nav-tab i").addClass("fa-solid fa-angles-left");
                        $('.pagination-block').removeClass("toBottom");
                    }
                });
                $("i", this).toggleClass("fa-solid fa-angles-left fa-solid fa-angles-right");
            });
        });
    });
    
    1. Test, and make necessary modifications to suit your own environment
  • why deleted ?

  • why deleted ?

    @DownPW Because it’s not finished. I forgot the session state…


Did this solution help you?
Did you find the suggested solution useful? Support 💗 Sudonix with a coffee
If your organisation needs deeper expertise around infrastructure, security, or technology leadership, learn more about Phenomlab Ltd. Many of the deeper technical guides behind Sudonix are published there.

Related Topics
  • Block Domain

    Solved Let's Build It code javascript block domain nodebb
    26
    1 Votes
    26 Posts
    8k Views
    Yes ogproxy too is functionnal on dev
  • Rotating Star Effect

    Solved Let's Build It wordpress css
    17
    12 Votes
    17 Posts
    4k Views
    @phenomlab thanks a lot for these, both of the below are awesome! https://codepen.io/bennettfeely/pen/vYLmYJz https://codepen.io/C-L-the-selector/pen/MWZbWBo
  • Footer bar add center text

    Solved Customisation css
    41
    1
    8 Votes
    41 Posts
    14k Views
    @phenomlab said in Footer bar add center text: div#console-nav-tab Ah ok test with bottom: 0px !important; idem
  • hover link effect

    Solved Customisation css link hover
    18
    1
    6 Votes
    18 Posts
    5k Views
    @DownPW Looking at the underlying code, class start is being added on hover by jQuery in this function document.querySelectorAll(".button-gradient, .button-transparent").forEach((button) => { const style = getComputedStyle(button); const lines = document.createElement("div"); lines.classList.add("lines"); const groupTop = document.createElement("div"); const groupBottom = document.createElement("div"); const svg = createSVG( button.offsetWidth, button.offsetHeight, parseInt(style.borderRadius, 10) ); groupTop.appendChild(svg); groupTop.appendChild(svg.cloneNode(true)); groupTop.appendChild(svg.cloneNode(true)); groupTop.appendChild(svg.cloneNode(true)); groupBottom.appendChild(svg.cloneNode(true)); groupBottom.appendChild(svg.cloneNode(true)); groupBottom.appendChild(svg.cloneNode(true)); groupBottom.appendChild(svg.cloneNode(true)); lines.appendChild(groupTop); lines.appendChild(groupBottom); button.appendChild(lines); button.addEventListener("pointerenter", () => { button.classList.add("start"); }); svg.addEventListener("animationend", () => { button.classList.remove("start"); }); }); }) The CSS for start is below .button-gradient.start .lines svg, .button-transparent.start .lines svg { animation: stroke 0.3s linear; } And this is the corresponding keyframe @keyframes stroke { 30%, 55% { opacity: 1; } 100% { stroke-dashoffset: 5; opacity: 0; } } It’s using both CSS and SVG, so might not be a simple affair to replicate without the SVG files.
  • chat list navbar

    Solved Customisation css navbar chat menu
    30
    2
    3 Votes
    30 Posts
    10k Views
    No no it’s ok @phenomlab I just comment the 2 lines mentionned aboves
  • New message CSS problem

    Unsolved Customisation css
    11
    1
    2 Votes
    11 Posts
    3k Views
    @DownPW hi. Sorry for digging up an old post, but I’m going through items still unresolved and was looking to get an understanding of where you are currently with this?
  • Avatar on Topic Header

    Solved Customisation css avatar header
    9
    1
    0 Votes
    9 Posts
    2k Views
    @jac said in Avatar on Topic Header: @downpw said in Avatar on Topic Header: Great Plugin I make it a bit cleaner via this CSS code: /*------------------------------------------------------------------*/ /*---------------- nodebb-plugin-browsing-users -----------------*/ /*------------------------------------------------------------------*/ /*Space between the avatar and the RSS icon */ .topic [component="topic/browsing-users"] { margin-bottom: -5px; padding-left: 10px; } /*Space between avatars*/ .pull-left { float: left!important; padding-right: 5px; } Do you have a screenshot of how this looks with the CSS change? Just added this change, thanks @DownPW
  • Multiple link on one ico non Navbar

    Solved Customisation links css navbar
    7
    1
    2 Votes
    7 Posts
    2k Views
    yeah you’re right @phenomlab. Problem of NodeBB Version