Ionaru /
easy-markdown-editor
EasyMDE: A simple, beautiful, and embeddable JavaScript Markdown editor. Delightful editing for beginners and experts alike. Features built-in autosaving and spell checking.
Loading repository data…
dissimulate / repository
A simple, easy to use, versatile and customisable Javascript colour picker.
A simple, easy to use, versatile and customisable Javascript colour picker.
Demo: http://lonely-pixel.com/projects/picker
And on codepen: http://codepen.io/suffick/pen/DpnmA
Using Picker is as simple as this:
var parent = document.getElementById('parent');
var picker = new Picker(parent);
parent.onclick = function() {
picker.show();
};
picker.on_done = function(colour) {
parent.style.background = colour.rgba().toString();
};
Explained:
<script src="picker.min.js"></script>
<div id="parent">click me</div>
<script>
/* STEP 1 */
/* Create a new picker object and set the parent element. */
var parent = document.getElementById('parent'); /* or jQuery */ $('#parent');
var picker = new Picker(parent);
/* STEP 2 */
/* Set Picker to open when you want, when the parent is clicked for example. */
parent.onclick = function() {
picker.show();
};
/* STEP 3 */
/*
You can do what you want with the chosen colour using two events,
on_change and on_done.
*/
picker.on_done = function(colour) {
/*
You can get the colour using the hsl(), hsla(), rgb(), rgba() and hex() functions.
Each function returns an object containing each component (e.g r, g and b) and a
toString() function, which returns the colour as a string to use with CSS or JS.
E.g 'rgba(255, 0, 0, 0.4)'.
*/
parent.style.background = colour.rgba().toString();
};
/* on_change is called every time the selection is changed without clicking 'ok' */
</script>
There are also a number of options you can choose.
var picker = new Picker({
/* The colour picker's parent */
parent: (parent element),
/*
Where the colour picker is relative to the parent.
Defaults to 'right'.
*/
orientation: ('left', 'right', 'top', 'bottom', 'centre', 'center'),
/*
The colour picker's x position relative to the parent.
Defaults to 'auto'.
*/
x: (number),
/*
The colour picker's y position relative to the parent.
Defaults to 'auto'.
*/
y: (number),
/*
The colour picker's arrow size.
Defaults to 20.
*/
arrow_size: (number)
});
You can customise the CSS in the source file, or do it dynamically like so:
picker.wrapper.background = '#333';
Easy!
Picker is in it's early stages, and although it's fully functional and usable, there could be a bug or two. Please let me know if you find a problem, have feedback or would like to contact me for any other reason via contact@lonely-pixel.com.
Selected from shared topics, language and repository description—not editorial ratings.
Ionaru /
EasyMDE: A simple, beautiful, and embeddable JavaScript Markdown editor. Delightful editing for beginners and experts alike. Features built-in autosaving and spell checking.
pulsardev /
Vue Tour is a lightweight, simple and customizable guided tour plugin for use with Vue.js. It provides a quick and easy way to guide your users through your application.
noelboss /
Featherlight is a very lightweight jQuery lightbox plugin. It's simple yet flexible and easy to use. Featherlight has minimal css and uses no inline styles, everything is name-spaced, it's completely customizable via config object and offers image, ajax and iframe support out of the box. Featherlights small footprint weights about 4kB – in total.
vercel /
Retrying made simple, easy and async
issaafalkattan /
A simple react one page landing page templates for startups/companies
alex-seville /
blanket.js is a simple code coverage library for javascript. Designed to be easy to install and use, for both browser and nodejs.