• Stars
    star
    2,316
  • Rank 19,136 (Top 0.4 %)
  • Language
    CSS
  • License
    MIT License
  • Created over 6 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

a [μ] microInteraction library built with CSS Animations and controlled by JavaScript Power

Micron.JS

Check Interactive Doc on Website.


Introduction

Micron.JS is a micro interaction library which can be used to add Interactions to different DOM Elements. Micron.JS animates an element using CSS power and the interactive behaviours are controlled by JavaScript.

Micron.JS is easy to adapt and can bring interactions to life using html5 data attributes or a chain of JavaScript methods.

Getting Started

To get started with Micron.JS, you need to include both micron.min.css * (which have all ready to use interaction animations) and micron.min.js If you don't need all the available interactions, you can simply include the respective *.min.css file only.

Installation

Compiled CSS and JavaScript minified files can be directly linked from UNPKG CDN or Micron.JS can be included within your workflow using your favorite package managers as well.

Link from UNPKG CDN

Include both the Micron CSS and JavaScript files in the header section of your document.

<link href="https://unpkg.com/[email protected]/dist/css/micron.min.css" type="text/css" rel="stylesheet">
<script src="https://unpkg.com/[email protected]/dist/script/micron.min.js" type="text/javascript"></script>

Package Managers

You can use either npm or bower to get the Micron.JS package.

Copy and Paste the command below in your terminal to get package with npm -

npm install webkul-micron

Load the package with the code below:

const micron = require('webkul-micron');

Copy and Paste the command below in your terminal to get package with bower -

bower install webkul-micron

Usage

Micron JS is very easy and quick to use.

Adding an Interaction

Add the data-micron="interaction" attribute to the respective element and Voila! you are already there.

Example Code

<a href="#!" class="button" data-micron="bounce">Label</a>

Controlling Duration

Micron Interactions defaults to ".45" seconds. Add the data-micron-duration="number" attribute to control the duration of the defined interaction.

Example Code

<a href="#!" class="button" data-micron="bounce" data-micron-duration=".95">Label</a>

Controlling Timing or Ease

Micron Interactions defaults to "ease-in-out". Add the data-micron-timing="@type" attribute to control the easing of the defined interaction.

For now, @type only supports the easings mentioned below-

linear

ease-in

ease-out

ease-in-out

Example Code

<a href="#!" class="button" data-micron="bounce" data-micron-timing="ease-in">Label</a>

Bind Interaction

Add data-micron-bind="true" & data-micron-id="name" to the defined triggering element, and interaction will be applied to the element which reference to the defined id attribute.

Example Code

<a href="#!" class="button" data-micron="bounce" data-micron-bind="true" data-micron-id="me">Label</a>
<a href="#!" class="button" id="me">Binded</a>

Access inside JavaScript

Call micron chained methods to apply interactions to any DOM Element, right in your custom block of JavaScript Code.

micron.getEle("").interaction("").duration("").timing("");

Pass an argument with selector name which can either be id or a class to getEle() method.

Pass an argument with interaction name to interaction() method.

Pass an argument which is a number to duration() method.

Pass an argument with type of ease to timing() method.

Example Code

function myFunc(){
    micron.getEle("#me").interaction("bounce").duration(".45").timing("ease-out");
 }

//Call Interaction
myFunc();

Interactions

Currently, Micron.JS supports the interactions mentioned below, head back to the homepage to see all interactions in the real action.

data-micron="shake"

data-micron="fade"

data-micron="jelly"

data-micron="bounce"

data-micron="tada"

data-micron="groove"

data-micron="swing"

data-micron="squeeze"

data-micron="flicker"

data-micron="jerk"

data-micron="blink"

data-micron="pop"

Customization

You can even add your very own css interaction to Micron.JS.

First include the code mentioned below in your css file.

.mjs-linear{animation-timing-function:cubic-bezier(0,0,1,1)}.mjs-ease-in{animation-timing-function:cubic-bezier(.4,0,1,1)}.mjs-ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.mjs-ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}

Create a class with .mjs- prefix. Call the keyframe css animation inside it. Use the interaction with your class name without .mjs- prefix.

Example Code

 /*Define a Class*/
 .mjs-custom{
    animation: custom-action;
 }

 @keyframes custom-action{
    from { . . . }
    to { . . . }
 }

Now use interaction with data-micron="custom"

Credits

© Copyright 2018 Webkul Software, All rights reserved.

More Repositories

1

coolhue

Coolest Gradient Hues and Swatches
JavaScript
3,452
star
2

vivid

a JavaScript library which is built to easily customize and use the SVG Icons with a blaze.
JavaScript
1,799
star
3

csspin

CSS Spinners and Loaders - Modular, Customizable and Single HTML Element Code for Pure CSS Loader and Spinner
CSS
1,041
star
4

myscale

myScale - Quick SVG Icon Resizer
JavaScript
128
star
5

magento2-code-generator

PHP
39
star
6

magento2-varnish-redis-ssl-docker-compose

Deploy Magento2 with Varnish Cache and Redis with SSL termination using Docker-compose tool
VCL
38
star
7

mobikul-standalone-pos

It is a standalone POS application, the user can simply download the application and start selling the products without any dependency on the server or website.
Java
32
star
8

beedii

Free Hand Drawn Emoji Font - Beedii
25
star
9

mojoicons

Handcrafted 100 Outline and Flat Icons for Free -
24
star
10

magento2-docker-compose

Magento 2 with Docker Compose
Shell
19
star
11

renamer

Sketch Plugin to rename multiple selected layers or groups or artboards at once
JavaScript
16
star
12

qloapps_docker

Dockerize version of QloApps v1.5.0, an open source Hotel Commerce Solution
Dockerfile
15
star
13

cssemoji

Colorful Animated CSS Emoji
CSS
10
star
14

MobikulFBSignI

Swift
9
star
15

magento2_vscode

Magento2 vscode
JavaScript
9
star
16

magento2-varnish-docker-compose

Magento 2 integration with Varnish Cache using Docker-compose tool
VCL
8
star
17

magento2-custom-command

Magento2 Webkul Custom Command Module - allow to create your own custom commands, and here we created command to delete orders
PHP
5
star
18

magento2_product_carousel_widget

The extension Product Carousel Widget for Magento 2 will allow you to display your products in a very elegant carousel style. The module allows you to put different product ids (separated by comma) and each product is linkable to a separate product.
JavaScript
5
star
19

docker_opencart

PHP
4
star
20

magento2_customlog

Magento2 Custom Log File Using Monolog
PHP
4
star
21

multi-vendor-marketplace-lite-for-woocommerce

Multi-Vendor Marketplace Lite for WooCommerce https://wordpress.org/plugins/multi-vendor-marketplace-lite-for-woocommerce/
PHP
4
star
22

Vagrant_qloapps

Vagrant Shell Provisioning For QloApps v1.5.1
Shell
3
star
23

opencart_setup

Console App To Create Opencart Setup through Command Line
PHP
3
star
24

Magento-Bootstrap

Twitter Bootstrap Magento Template - Bootstrap is really a brilliant CSS framework and saves tons of time if you are creating UI/UX design . WebKul is proudly announcing the ”Bootstrap Magento Template” free of cost and its totally open source . This is the alpha version of the “bootstrap magento theme” lets us know your valuable feedback so that we can improve it
CSS
3
star
25

LAMP-WITH-PRESTASHOP

PHP
2
star
26

christmas

Christmas Goodies Crafted with ❤️ at Webkul Design
HTML
2
star
27

magento2_cartPageAdditionalInfo

PHP
2
star
28

odoo-posbox

This repo contains image for ODOO POSBOX having nginx enabled i.e working with https.
2
star
29

savicon

Font with Useful Icons
1
star
30

magento2_ajax_contact_form

Magento2 Ajax Contact Form
PHP
1
star
31

booking-commerce-wordpress

Wordpress extension for Booking Commerce
PHP
1
star
32

uxem

Empathy map tool for UX designers to visualise and organise user's behaviour
1
star
33

magento2_docker

Dockerized Image of magento2
PHP
1
star
34

Joomla-Fancy-Image-Transition

Joomla fancy Image transition is joomla 1.5 native extension and have enormous features like slideshow ,picture gallery and dozens
1
star
35

orocommerce

Shell
1
star
36

magento2_verticalproductslider

Magento2 Vertical Product Slider - allow to display products in vertical Slider with magento2 system configuration and block code https://store.webkul.com/
HTML
1
star
37

woocommerce-salesforce-connector

This plug-in provide integration between Wordpress WooCommerce and Salesforce.
PHP
1
star
38

woocommerce-google-chrome-autologin

WooCommerce Google Chrome Smart Lock facilitates the customer, store owner to login with saved password in their systems.The admin can allow to save password to their and login with that password. No need to remember password.
PHP
1
star
39

docker_magento

PHP
1
star
40

Docker_wordpress

Dockerize Your Wordpress
PHP
1
star