Skip to content

Bottom footer navbar button extend

Solved Customisation
32 2 4.7k 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? Why not buy me a coffee? It's a nice gesture, and a great way to show your appreciation 💗

Related Topics
  • The theme came with space on left side

    Solved WordPress css
    7
    3 Votes
    7 Posts
    729 Views
    @phenomlab yes it’s a different theme. The other one was not offering much on editable sidebar. It was like flarum hahah
  • Footer bar add center text

    Solved Customisation css
    41
    1
    8 Votes
    41 Posts
    5k 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
    2k 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.
  • Viewing Permission.

    Solved General support customisation
    33
    12 Votes
    33 Posts
    3k Views
    @phenomlab Ah Mark you are a star. Thank you very much. I just logged on and seen someone had worked their magic Again it is very much appreciated.
  • [NODEBB] Reply Button/arrow answer

    Solved Customisation css nodebb
    25
    4
    4 Votes
    25 Posts
    4k Views
    Topic open https://sudonix.com/topic/207/nodebb-help-for-my-custom-css
  • Avatar on Topic Header

    Solved Customisation css avatar header
    9
    1
    0 Votes
    9 Posts
    840 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
  • NodeBB Footer

    Solved Customisation footer nodebb
    10
    1 Votes
    10 Posts
    1k Views
    @phenomlab said in NodeBB Footer: @jac and you. Hope all is well and you recover quickly Thanks pal
  • CSS Help on my Flarum

    Solved Customisation
    5
    2
    2 Votes
    5 Posts
    759 Views
    @mike-jones Yes, you’ll typically see this type of behaviour if there is another style that has higher priority in the sense that yours will be overridden. Using !important will override the higher preference, but should be used sparingly rather than everywhere.