npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

sgb13-navbar

v2.8.0

Published

This document explains how to easily configure the float navigation system without having to modify the core implementation files. It also covers how to manage the styling with the included CSS utilities.

Downloads

538

Readme

Float Container Configuration Guide

This document explains how to easily configure the float navigation system without having to modify the core implementation files. It also covers how to manage the styling with the included CSS utilities.

Configuration Approach

The navigation system now uses a configuration-driven approach where all navigation items, links, and UI elements are defined in a single centralized configuration file.

Files Overview

  • navigation-config.js - Contains all the configurable navigation elements
  • config.js - Contains general system configuration settings
  • float-ui.js - Implementation that reads from configuration
  • css-utils.js - Utilities for managing the navbar CSS styles
  • main.js - Entry point and initialization

How to Update Navigation Elements

1. Updating Navigation Links

To update the navigation links (Game Tips, Download App, etc.), edit the navLinks array in navigation-config.js:

navLinks: [
  {
    href: '/new-url',              // Change the URL
    translationKey: 'gameTips',    // Reference to translations.js
    iconClass: 'fa-solid fa-gamepad' // FontAwesome icon class
  },
  // Add or remove items as needed
]

2. Updating Grid Items

To update the grid items (Fortune Wheel, VIP Program, etc.), edit the gridItems array:

gridItems: [
  {
    href: 'https://example.com',
    imgSrc: '/path/to/image.png',
    text: 'Display Text',
    translationKey: 'translationKey',
    target: '_self'
  },
  // Add or remove items as needed
]

3. Updating Dropdown Menus

To update dropdown menus (Follow Us, etc.), edit the dropdownMenus array:

dropdownMenus: [
  {
    translationKey: 'menuTitle',
    iconClass: 'fa-solid fa-users',
    subItems: [
      {
        href: 'https://example.com',
        translationKey: 'subItemText',
        iconClass: 'fa-brands fa-example',
        target: '_blank'
      },
      // Add or remove sub-items as needed
    ]
  }
]

4. Updating Logo and Partnership Logo

To update the logo or partnership logo:

logo: {
  src: '/path/to/new-logo.png',
  alt: 'Logo Alt Text'
},

partnershipLogo: {
  href: 'https://partner-site.com',
  imgSrc: '/path/to/partner-logo.png',
  imgAlt: 'Partner Logo Alt Text'
}

Programmatically Updating Configuration

You can also update the configuration programmatically using the exported function:

import { updateNavigationConfig } from './float-ui.js';

// Update specific parts of the navigation
updateNavigationConfig({
  navLinks: [
    // New set of navigation links
  ],
  logo: {
    src: '/path/to/new-logo.png'
  }
});

Managing CSS Styles

The system includes built-in CSS management utilities that allow you to control the styling of the navbar.

Enabling/Disabling CSS Injection

In config.js, you can control whether the CSS is automatically injected:

features: {
  enabled: true,
  // ...
  injectCSS: true  // Set to false to disable CSS injection
}

CSS Utility Functions

You can also manipulate the CSS programmatically:

import { injectNavbarCSS, removeNavbarCSS, toggleNavbarCSS, updateNavbarCSS } from './css-utils.js';

// Inject the default CSS
injectNavbarCSS();

// Remove the CSS
removeNavbarCSS();

// Toggle CSS based on a condition
toggleNavbarCSS(true); // Enable
toggleNavbarCSS(false); // Disable

// Update with custom CSS
updateNavbarCSS(`
  /* Your custom CSS here */
  .sidenav {
    background-color: #333;
    color: white;
  }
`);

Translation Keys

All text elements use translation keys that reference the translation system. To add or update translations:

  1. Add the translation key to navigation-config.js
  2. Make sure the corresponding keys exist in the translations.js file

Adding New Navigation Elements Dynamically

You can also add new navigation links or dropdown menus dynamically after initialization:

import { addNavLink, addDropdownMenu } from './float-ui.js';

// Add a new navigation link
addNavLink({
  href: '/new-page',
  translationKey: 'newPageName',
  iconClass: 'fa-solid fa-star'
});

// Add a new dropdown menu
addDropdownMenu({
  translationKey: 'newDropdown',
  iconClass: 'fa-solid fa-list',
  subItems: [
    // Array of sub-items
  ]
});