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 🙏

© 2024 – Pkg Stats / Ryan Hefner

nightlyweb

v1.0.1

Published

Give your website dark-mode using NightlyWeb library.

Downloads

4

Readme

🌙 NightlyWeb

NightlyWEb is a lightweight and customizable CSS and JavaScript library for adding dark mode functionality to your website. With just a few lines of code, you can enhance user experience by providing a visually comfortable dark mode option.

Features

Easy Integration: Simple integration with NightlyWeb CDN.

🌈 Customizable: Tailor the dark mode to match your website's design.

🕶️ User-Friendly: Enhance user experience by providing a visually friendly dark mode.

🚀 Lightweight: Minimal impact on page load times.

Getting Started

Installation

Include the CSS and JS in your HTML file:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/nightlyweb.min.css">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/nightlyweb.min.js"></script>

Usage

Initialize NightlyWeb by adding the following code:

<!-- Dark mode toggle switch div -->
<div class="NightlyWeb">
    <input type="checkbox" id="darkModeToggle">
    <label for="darkModeToggle"></label>
</div>
  • add this few lines of code to anywhere in your html body tag. That's it! NightlyWEb will now toggle between light and dark modes.
  • you can the toggle button on the top right corner of your web page.

Customization

If you want to change the position or size of the toggle button then >

/* Toggle switch styles */
.NightlyWeb {
  z-index: 999999999;
  position: fixed;
  top: 10px;
  right: 10px;
  cursor: pointer;
  user-select: none;
}
  • simply add this code to your .css file and customize as your desired position and size.

Example

Preview image of NightlyWeb

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Example - NightlyWeb</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/nightlyweb.min.css" />
    <style>
      body {
        font-family: Arial, sans-serif;
        margin: 20px auto;
        max-width: 960px;
      }
      h2 {
        color: #007bff;
      }
      p {
        line-height: 1.5;
      }
      ul {
        list-style-type: circle;
        margin-left: 20px;
      }
      ol {
        list-style-type: decimal;
        margin-left: 20px;
      }
      img {
        max-width: 100%;
        height: auto;
      }
      table {
        border-collapse: collapse;
        width: 100%;
      }
      table,
      th,
      td {
        border: 1px solid #dddddd;
        text-align: left;
        padding: 8px;
      }
      th {
        background-color: #f2f2f2;
      }
      footer {
        margin-top: 20px;
        padding: 10px;
        background-color: #f2f2f2;
        text-align: center;
      }
    </style>
  </head>
  <body>
    <!-- Dark mode toggle switch div -->
    <div class="NightlyWeb">
      <input type="checkbox" id="darkModeToggle" />
      <label for="darkModeToggle"></label>
    </div>

    <h1>Welcome to My Enhanced Simple Website</h1>

    <h2>Section 1: Introduction</h2>
    <p>This is a paragraph of text on the page.</p>

    <h2>Section 2: Lists</h2>
    <ul>
      <li>Unordered List Item 1</li>
      <li>Unordered List Item 2</li>
      <li>Unordered List Item 3</li>
    </ul>

    <ol>
      <li>Ordered List Item 1</li>
      <li>Ordered List Item 2</li>
      <li>Ordered List Item 3</li>
    </ol>

    <h2>Section 3: Image</h2>
    <img src="https://placekitten.com/800/400" alt="Cute Kitten" />

    <h2>Section 4: Table</h2>
    <table>
      <tr>
        <th>Header 1</th>
        <th>Header 2</th>
      </tr>
      <tr>
        <td>Data 1</td>
        <td>Data 2</td>
      </tr>
      <tr>
        <td>Data 3</td>
        <td>Data 4</td>
      </tr>
    </table>

    <h2>Section 5: Button</h2>
    <button type="button">Click me</button>

    <footer>
      <p>
        &copy; 2023 Example - NightlyWeb Website <br />
        Made by Maruf OVi
      </p>
    </footer>
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/nightlyweb.min.js"></script>
  </body>
</html>

Missed Tag

If you notice any html tag or your custom is missed then >

body.dark-mode [add_missed_tag] {
  background-color: #333333;
}
  • simply replace the [add_missed_tag] with the actual missed tag.

License

NightlyWeb is licensed under the MIT License.

🚀 Happy coding with NightlyWeb! 🌙