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

golden-section-ui

v1.0.2

Published

A configurable ES6 module that generates a dynamic UI-layout grid based on the golden ratio.

Downloads

6

Readme

Golden Section UI

A configurable ES6 module that generates a dynamic UI-layout grid based on the golden ratio (see demo).

Installation

npm i --save golden-section-ui

Basic Usage

Import the goldenSection class and constants object into your project using ES module syntax.

import {goldenSection, GS} from 'golden-section-ui';

Generate a Grid

Call goldenSection.generate({targetNodeId: "host-node-id"})to generate a grid within the HTML element with the id, host-node-id. You can additional options -- refer to the Generate Options list for specific options.

Generate Options

  • targetNodeId : REQUIRED, the parent node that will contain the Golden-Section layout.

  • orientation: Use a GS.ORIENTATION constant to determine the position on the largest section in relation to the other sections with the layout grid. Orientation also determines whether the major axis is vertical or horizontal. It will also determine the direction of the long axis of the layout.

  • alignment: Use a GS.ALIGN constant to determine how the layout is aligned horizontally within the containing element.

  • verticalAlignment: Use a GS.VERTICAL_ALIGN constant to determine how the layout is aligned vertically within the containing element.

  • rotation: Use a GS.ROTATION constant to determine the rotational direction of the layout.

  • sectionCount: An integer value that sets the number of sections to be rendered, the maximum is 8.

  • sectionClasses: An array of one or more class names to be applied to the rendered sections. A class name is applied to a section in sequence to the sections being rendered, first element of styles array to the first section, second style to the second section and so on. If there are fewer class names in the sectionClasses array than layout sections, the generator will cycle back through the array of class names, assigning them in sequence.

  • majorAxisMax: An optional integer value that determines the maximum major-axis dimension of the golden-section layout. Otherwise size constraints are hosted by the dimensions of the host HTML node.

  • majorAxisMin: An optional integer value that determines the minimum major-axis dimension of the golden-section layout. Otherwise size constraints are hosted by the dimensions of the host HTML node.

  • cssTransition: An object setting with two properties:

    • duration: An optional millisecond value that maps to the transition-duration property -- default is 500.
    • timing: An optional property that maps to the transition-timing-function -- default is ease-out.
  • renderInterval: An optional millisecond setting that controls the time interval between layout-section rendering. By default, all sections render simultaneously.

  • resizeThrotleInterval: An optional millisecond value that throttles the resize event. By default, it's set to 15ms.

Constants

Use these constants for UI configuration.

ORIENTATION: TOP | RIGHT | BOTTOM | LEFT

ROTATION: CW | CCW

ALIGN: LEFT | CENTER | RIGHT

VERTICAL_ALIGN:  TOP | MIDDLE | BOTTOM