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

dino-knob

v3.31.2021

Published

Knob/Dial Control and Power Button with mouse, wheel, touch and keyboard support, jQuery plugin.

Downloads

19

Readme

DinoKnob

Knob/Dial Control and Power Button with mouse, wheel, touch and keyboard (← ↑ → ↓ ) support.
It also includes 5 default countdown timers preset to: 15sec, 1min, 5min, 10min, 15min.

Maintenance Website GitHub last commit GitHub issues GitHub pull requests

CRAN/METACRAN GitHub release (latest by date) npm bundle size (version) GitHub code size in bytes GitHub forks

Example Page

Live example page: https://mcx-systems.net/DinoKnob

Preview Page Screenshot

Screenshot

Supported Browser

Chrome | Firefox | IE | Opera | Safari --- | --- | --- | --- | --- | Latest ✔ | Latest ✔ | 9+ ✔ | Latest ✔ | 8.0+ ✔ |

Tested in latest Edge, Chrome, Firefox, Opera, Safari and Mobile Safari \

  • Canvas-based, no image files required.
  • Mouse, wheel, touch and keyboard controls.

Install

You can install through npm and use browserify to make it run on the browser.

npm install --save dino-knob

or

$ yarn add dino-knob

Or just download the minified version here.

Events / Actions

  • Normal left click / drag / touch changes value, releasing button commits value.
  • Pulling mouse / touch outside the element before release restores back to old value.

Functions

  • 5 x Timer Output Switch - 15 seconds, 1 minute, 5 minutes, 10 minutes, 15 minutes / all preset \
  • 1 x Button Output Switch ON / OFF \
  • 1 x Range Knob / Can be used as Lights DIMMER - Output values from 0 - 100% and 0 to 255 PWM

Example for dinoKnob control

$(document).ready(function()
{
	$('#KnobTest1').dinoKnob({
			// Theme Light or Dark
			theme: 'dark',
			// Circle range Bar style:
			// (Hot, Cold or Mono, yellow, blue, red, green)
			barTheme: 'blue',
			// Step Value of the Knob
			snap: 5,
			// Knob Display Max Value as 100%
			maxValue: 100,
			// Max angle value, for alarm icon
			maxAlarm: 50,
			// Enable Timer Button
			showTimer: true,
			// Enable Alerts Button
			showAlert: true,
			// Enable Labels Button
			showLabel: true,
			// Enable Debug
			debug: true,
			// Event on knob turn - change
			onTurn: function(dinoId, value, percent, degree, ratio)
			{
				$("#per1").val(percent);
				$("#des1").val(degree);
				$("#rat1").val(ratio);
				$("#val1").val(value);

				$("#range1").val($("#KnobExample1 input[type=hidden]").val());
			},
			onStatus: function(dinoId, state, timerState, timerTime)
			{
				$("#sta1").val(state);
				$("#stu1").val(timerState);
				$("#stp1").val(timerTime + ' seconds');
			},
			onTimer: function(dinoId, timeLeft)
			{
				$("#still1").val(timeLeft + ' seconds');
			},
			onError: function(dinoId, error)
			{
				// Return knob errors
				$("#err1").val(error);
			}
		});

	// Depends on maxAngle, set to max of 255 default
	$("#KnobExample1 input[type=checkbox]").prop('checked', true).trigger('change');
	$("#KnobExample1 input[type=hidden]").val(255).trigger('change');
	$("#range1").val($("#KnobExample1 input[type=hidden]").val());
	//$('#KnobExample1').data('plugin_dinoKnob').destroy();
});

You may update both the maxAngle value
($("#KnobTest1 input[type=hidden]").val(255).trigger('change');)

and the button state value

($("#KnobTest1 input[type=checkbox]").prop('checked', true).trigger('change'))
programmatically in your script to display new values.

Return values from example

Variable | Type -----------|------- id | String value | int percent | int degree | int ratio | int state | bool timerState | bool timerTime | int timeLeft | int error | String

Credits