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

grid-resize-helper

v1.0.15

Published

This library allows you to drag on the configured edges of a grid layout to resize it

Downloads

5

Readme

Description

This library allows you to drag on the configured edges of a grid layout to resize it

Live Demo: https://thiago099.github.io/grid-resize-helper-example/

Source: https://github.com/Thiago099/grid-resize-helper-example/

Limitations

You must specify the areas of your grid you want to make resizable and assign them to control a part of the grid

Usage:

   import { makeGridAreasResizable } from "grid-resize-helper"

    let gridElement = document.querySelector('.container');

    makeGridAreasResizable(gridElement, 
    /* Elements */ 
    [
        { 
            query: ".menu", // This element will be used to create the helper, it will only be as wide as the element
            helpers: [
                { 
                    position: "x+", // This is where on the element the helper will be
                    edge: 0 // This is wich edge of your grid the in the respective axis of the position
                },
            ]
        },
        {
            query: ".right",
            helpers: [
                {
                    position: "x-",
                    edge: 1
                },
            ]
        },
        {
            query: ".header",
            helpers: [
                {
                    position: "y+",
                    edge: 0
                },
            ]
        },
        {
            query: ".footer",
            helpers: [
                {
                    position: "y-",
                    edge: 1
                },
            ]
        }
    ],
    /*Config */ { // The config parameter is optinal
        //debugBackgroundColor:"rgba(255,0,0,0.3)", // Make the helpers this color instead of invisible
        thickness:"8px", // this can either be auto(the size of the gap) or a value, relative values are relative to each section of the grid
        minWidth: 30, // minium width of a section
        minHeight: 30, // minimun height of a section
        helperClass: "helper",
        helperActiveClass: "helper-active"
    })

Here is the html for the example:

  <head>
    <meta charset="UTF-8" />
    <link rel="icon" type="image/svg+xml" href="/vite.svg" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Vite App</title>
  </head>
  <body>
    <div class="container">
      <div class="menu">
      </div>
      <div class="header">
      </div>
      <div class="main">
      </div>
      <div class="footer">
      </div>
      <div class="right">
      </div>
  </div>
  
  <style>
      body {
          margin: 0;
      }
  
      .container {
          display: grid;
          grid-template-areas:
              'header header header'
              'menu main right'
              'menu footer right';
          grid-template-columns: 1fr 3fr 1fr;
          grid-template-rows: 50px 4fr 2fr;
          gap: 10px;
          background-color: #2196F3;
          height: 100vh;
          width: 100vw;
          padding: 5px;
          box-sizing: border-box;
      }
  
      .container > div {
          background-color: rgba(255, 255, 255, 0.8);
      }
  
      .menu {
          grid-area: menu;
      }
  
      .main {
          grid-area: main;
      }
  
      .right {
          grid-area: right;
      }
  
      .footer {
          grid-area: footer;
      }
  
      .header {
          grid-area: header;
      }
  </style>