Skip to content

How to style tool tip of nodebb-plugin-user-level

Solved Customisation
  • Hi,

    I would like to ask how to style the tool tip in nodebb-plugin-user-level, that appears when you click on the user level icon. I just want to change some text styling. I’m trying to target it with the dev tools but can’t see any changes to the DOM.

    Btw it seems that on your site you removed the level in form of text, it looks nice and minimalistic but the tool tip information doesn’t make much sense to me.

    edit: I think I got it, after the stars there come different medals right? I like the star system 🙂

    Screenshot 2023-10-09 211928.png

  • @dave1904 said in How to style tool tip of nodebb-plugin-user-level:

    I’m trying to target it with the dev tools but can’t see any changes to the DOM.

    That’s a common issue in the sense that it will disappear from the DOM on lost focus, and this post will certainly help with that

    https://sudonix.org/topic/483/targeting-a-disappearing-element-for-its-css

    @dave1904 said in How to style tool tip of nodebb-plugin-user-level:

    edit: I think I got it, after the stars there come different medals right? I like the star system

    Exactly that. Thanks.

  • See here for icon :

    https://sudonix.org/post/6686

    Here my CSS for user level :

    /*----------------------------------------------------------------------------*/
    /*--------------           nodebb-plugin-user-level          -----------------*/
    /*----------------------------------------------------------------------------*/
    
    /* style */
    .user-level-topic {
      vertical-align: middle;
      border-radius: 0.25rem !important;
      border: 2px solid var(--bs-user-level-border);
      margin-left: 8px;
      margin-right: 5px;
      margin-top: -2px;
      color: var(--bs-body-color-primary) !important;
      background: var(--bs-user-level-bg) !important;
      float: right;
      font-size: 12px;
      padding: 0px 10px !important;
      font-weight: 600;
      height: 23px !important;
    }
    
    /* Style on Profile page */
    .level-index>div:first-child {
        padding: 6px 15px 3px 15px;
        border: 2px solid var(--bs-user-level-border);
        border-radius: var(--bs-border-radius);
        margin: 5px 28px 5px 0px;
        color: var(--bs-link-color);
      
    }
    
    .level-index > div:first-child:before {
        font-family: var(--bs-shoutbox-header-font-family) !important;
        content: var(--bs-shoutbox-header-icon) !important;
        margin-right: 8px;
    }
    
    /* icon, font */
    .user-level-topic:before {
      /* content: "\f521";   */
      /* font-family: "Font Awesome 6 pro "; */
      content: var(--bs-user-level-icon);
      font-family: "Font Awesome 6 Pro"; 
      margin-right: 5px;
      font-weight: 600;
    }
    
    /* Popover Style */
    .popover-body {
        background: var(--bs-body-bg) !important;
        color: var(--bs-body-color) !important;
        border: 1px solid var(--bs-border-color);
        border-radius: 0 0 0.375rem 0.375rem;
        margin: 0px;
    }
    .popover-header {
        border-top: 1px solid var(--bs-border-color);
        border-left: 1px solid var(--bs-border-color);
        border-right: 1px solid var(--bs-border-color);
        background-color: var(--bs-alert-info-bg);
        color: var(--bs-link-color);
        border-top-left-radius: 0.375rem;
        border-top-right-radius: 0.375rem;
        margin: 0px;
    }
    .bs-popover-auto[data-popper-placement^=top]>.popover-arrow::after, .bs-popover-top>.popover-arrow::after,{
        border-top-color: var(--bs-border-color);
    }
    .bs-popover-auto[data-popper-placement^=top]>.popover-arrow::after, .bs-popover-bottom>.popover-arrow::after,{
        border-bottom-color: var(--bs-border-color);
    }
    .bs-popover-auto[data-popper-placement^=left]>.popover-arrow::after, .bs-popover-end>.popover-arrow::after {
        border-left-color: var(--bs-border-color);
    }
    .bs-popover-auto[data-popper-placement^=right]>.popover-arrow::after, .bs-popover-end>.popover-arrow::after {
        border-right-color: var(--bs-border-color);
    }
    

    and hack for user level on Account profile :

    10b383aa-8e0b-4b45-87c8-d206053a9b7f-image.png

  • @DownPW thanks. I forgot about that.

  • dave1904undefined dave1904 has marked this topic as solved 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 💗

  • Widget | CSS customization

    Solved WordPress
    53
    17 Votes
    53 Posts
    3k Views

    @Sala the only way you can achieve this is to use a robots.txt file and disallow access to those links.

  • Fixing YouTube videos css

    Solved WordPress
    8
    2 Votes
    8 Posts
    263 Views

    @phenomlab It looks good, but not anymore. I’ve already lost so much time. Now it’s time to move on

  • NodeBB inline videoplayer

    Solved Customisation
    12
    3 Votes
    12 Posts
    715 Views

    @phenomlab
    YAY! It works
    Thanks so much

  • 2 Votes
    1 Posts
    168 Views
    No one has replied
  • chat list navbar

    Solved Customisation
    30
    3 Votes
    30 Posts
    2k Views

    No no it’s ok @phenomlab
    I just comment the 2 lines mentionned aboves 😉

  • 0 Votes
    5 Posts
    782 Views

    @pwsincd hi. Just following up on this thread (I know it’s old) but was curious to understand if it’s still an issue or not ?

  • 5 Votes
    9 Posts
    2k Views

    @phenomlab

    Very very great Mark 😉
    Thanks again, It’s perfect now !

    –> I share my code that I modified.

    I’ve added French and English comments.
    If you see things to change Mark, don’t hesitate.

    As usual, all the access paths (FA icons, logo) will have to be modified according to your architecture.

    You can also very well add/remove time slots and change welcome messages to suit your needs.

    Widgets ACP/HTML Widget Footer Logo <center> <br><br> <img id="thislogo" src="path/to/my/image"> </center> Widget Welcome Message <!-- IF loggedIn --> <div class="getUsername">, <a href="/me"><span class="username"></span></a></div> <!-- ENDIF loggedIn --> CSS

    – I added the size font-weight: 900; in the CSS because otherwise some FA icon wasn’t displayed correctly and reduce margin :

    i#thisicon { font-family: "Font Awesome 5 Free"; font-style: normal; margin-right: 8px; font-weight: 900; } .getUsername { padding-top: 20px; text-align: right; } /*Smartphone*/ /*On désactive le message de bienvenue"*/ /*We disable the welcome message"*/ @media all and (max-width: 1024px) { .getUsername { display: none; } } JAVASCRIPT // ------------------------------------------ // Welcome Message avec icône et Footer logo // Welcome Message with icon and Footer logo // ------------------------------------------ $(window).on('action:ajaxify.end', function (data) { //On récupère le username dans le DOM et on l'affiche //We retrieve the username from the DOM and display it function updateUsername() { $('.getUsername .username').text(app.user.username); } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', updateUsername); } else { updateUsername(); } //On déclare les variables principales (themessage & thehours) ainsi que les variables secondaires correspondants aux plages horaires //We declare the main variables (themessage & thehours) as well as the secondary variables corresponding to the time slots var thehours = new Date().getHours(); var themessage; var wakeup = ('Good day'); var morning = ('Good morning'); var lunch = ('Bon appétit'); var afternoon = ('Good afternoon'); var drink = ('Cheers'); var evening = ('Good evening'); var night = ('Good night'); var welcome = ('Welcome'); var matched = false; //On peux ici tester le résultat du code en spécifiant une heure (!!!IMPORTANT: Commenter une fois le script testé!!!) //Here we can test the result of the code by specifying a time (!!!IMPORTANT: Comment once the script has been tested!!!) //thehours = 20 //On déclare les plages horaires avec les icones FA et les logos //We declare the time slots with FA icons and logos path if (thehours >= 0 && thehours < 6) { themessage = night; theicon = "fa-solid fa-moon"; thelogo = "/assets/customlogo/XXX.png"; } else if (thehours >= 6 && thehours < 8) { themessage = wakeup; theicon = "fa-solid fa-mug-hot"; thelogo = "/assets/customlogo/XXX.png"; } else if (thehours >= 8 && thehours < 12) { themessage = morning; theicon = "fa-solid fa-sun"; thelogo = "/assets/customlogo/XXX.png"; } else if (thehours >= 12 && thehours < 13) { themessage = lunch; theicon = "fas fa-hamburger"; thelogo = "/assets/customlogo/XXX.png"; } else if (thehours >= 13 && thehours < 16) { themessage = afternoon; theicon = "fa-solid fa-sun"; thelogo = "/assets/customlogo/XXX.png"; } else if (thehours >= 16 && thehours < 18) { themessage = welcome; theicon = "fa-solid fa-rocket"; thelogo = "/assets/customlogo/XXX.png"; } else if (thehours >= 18 && thehours < 19) { themessage = drink; theicon = "fa-solid fa-wine-glass"; thelogo = "/assets/customlogo/XXX.png"; } else if (thehours >= 19 && thehours < 20) { themessage = lunch; theicon = "fas fa-pizza-slice"; thelogo = "/assets/customlogo/XXX.png"; } else if (thehours >= 20 && thehours < 24) { themessage = evening; theicon = "fa-solid fa-tv"; thelogo = "/assets/customlogo/XXX.png"; } // Si la page active est un topic, on désactive/cache le message de bienvenue // If the active page is a topic, we deactivate/hide the welcome message if (window.location.href.indexOf("topic") > -1) { console.log("This is a topic, so hide the user welcome message"); $('#thisuser').hide(); } // Sinon, on affiche le message en fonction, l'icone FA et son emplacement (prepend) // Otherwise, we display the message in function, the FA icon and its location (prepend) else { $('.getUsername').prepend("<i id='thisicon' class='" + theicon + "'></i>" + themessage); $("#thislogo").attr("src", thelogo); //$('.getUsername').prepend("<img id='thisicon' src='" + thelogo + "'></>" + themessage); } });
  • 1 Votes
    6 Posts
    977 Views

    @jac said in [NodeBB] custom Gravatar image not showing:

    @phenomlab said in [NodeBB] custom Gravatar image not showing:

    @jac are you using Custom ?

    Sure am mate 👍🏻

    Confirmed Fixed