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

@blackpixel/framer-controlpanellayer

v1.0.3

Published

Produce a developer panel for controlling aspects of your prototype within the prototype itself.

Downloads

9

Readme

ControlPanelLayer Framer Module

license PRs Welcome Maintenance

The ControlPanelLayer module makes it easy to construct a developer panel for controlling aspects of your prototype within the prototype itself.

Installation

NPM Installation

$ cd /your/framer/project
$ npm i @blackpixel/framer-controlpanellayer

Manual installation

Copy or save the ControlPanelLayer.coffee file into your project's modules folder.

Adding It to Your Project

In your Framer project, add the following:

ControlPanelLayer = require "ControlPanelLayer"

API

new ControlPanelLayer

Instantiates a new instance of ControlPanelLayer.

Available options

myControlPanel = new ControlPanelLayer
	scaleFactor: <number>
	specs: <object>
	draggable: <boolean>
	textColor: <string> (hex or rgba)
	backgroundColor: <string> (hex or rgba)
	inputTextColor: <string> (hex or rgba)
	inputBackgroundColor: <string> (hex or rgba)
	buttonTextColor: <string> (hex or rgba)
	buttonColor: <string> (hex or rgba)
	commitAction: -> <action>
	closeAction: -> <action>

The specs object

The ControlPanelLayer requires your behavior specifications to be organized in key-value object form. Each item must include a label and value. Optionally, you may include an explanatory tip. Additional keys will be ignored.

Specs object values can include strings, numbers, and booleans.

exampleSpecs =
	defaultText:
		label: "Default text"
		value: "hello"
		tip: "Initial text to display."
	animationTime:
		label: "Animation time"
		value: 5
		tip: "How long the animation will run."
	autoplay:
		label: "Should autoplay"
		value: false

Referring to a particular spec is done with the usual dot or bracket notation, e.g., exampleSpecs.animationTime.value or exampleSpecs["animationTime"]["value"] or exampleSpecs["animationTime"].value.

The commit action

The ControlPanelLayer features a Commit button that can be customized to perform any action. You will want to at least overwrite your specs object with any changes that resulted from using the ControlPanelLayer.

myControlPanel = new ControlPanelLayer
	specs: exampleSpecs
	commitAction: -> exampleSpecs = this.specs

The close action

The panel close button works to hide the panel, but you may supply it with additional functionality.

myControlPanel = new ControlPanelLayer
	specs: exampleSpecs
	closeAction: -> print "panel closed"

Example of integration with QueryInterface

Using ControlPanelLayer in conjunction with QueryInterface provides a way to maintain settings across a reload or link to your prototype with custom settings included in the URL.

{QueryInterface} = require 'QueryInterface'

querySpecs = new QueryInterface
	key: "specs"
	default: exampleSpecs
	
myControlPanel = new ControlPanelLayer
	specs: querySpecs.value
	commitAction: -> querySpecs.value = this.specs; window.location.reload(false)

myControlPanel.show()

Show the ControlPanelLayer instance.

myControlPanel.hide()

Hide the ControlPanelLayer instance.

myControlPanel.hidden

readonly

Returns

(Boolean): Whether or not the ControlPanelLayer is currently hidden.


Website: blackpixel.com  ·  GitHub: @bpxl-labs  ·  Twitter: @blackpixel  ·  Medium: @bpxl-craft