hash.js

A jQuery like library .better I mean

View the Project on GitHub siliconduct/hash.js


hash.js


open up an issue for a feature request! (It would greatly help) Include it in the head

<script src="https://siliconduct.github.io/hash.js/hashtag_1.0.1.js"></script>


size: 1/6th of jQuery!
(when completed)
how to use
Just use it like jQuery :

hash('#id').hide(animationName);
hash('.class').show(animationName);
hash('by tag').animate(animation name, duration, delay);

Note: you must first enable animation by

hash().enableAnime();

Which enables it for all element on the page
Then enable it for an element

hash('.body').animate('jackInTheBox', "1s", "1s");//animation name, duration ,delay



We use animate.css engine for animating elements so the list could be a whole lot familiarÔÇŽ
list of animation inclues :

Attention seekers:

bounce
flash
pulse
rubberBand
shakeX
shakeY
headShake
swing
tada
wobble
jello
heartBeat

Back entrances:

backInDown
backInLeft
backInRight
backInUp
Back exits
backOutDown
backOutLeft
backOutRight
backOutUp

Back exits:

backOutDown
backOutLeft
backOutRight
backOutUp
Bouncing entrances
bounceIn
bounceInDown
bounceInLeft
bounceInRight
bounceInUp

Bouncing exits:

bounceOut
bounceOutDown
bounceOutLeft
bounceOutRight
bounceOutUp

Fading entrances:

fadeIn
fadeInDown
fadeInDownBig
fadeInLeft
fadeInLeftBig
fadeInRight
fadeInRightBig
fadeInUp
fadeInUpBig
fadeInTopLeft
fadeInTopRight
fadeInBottomLeft
fadeInBottomRight

Fading exit:

fadeOut
fadeOutDown
fadeOutDownBig
fadeOutLeft
fadeOutLeftBig
fadeOutRight
fadeOutRightBig
fadeOutUp
fadeOutUpBig
fadeOutTopLeft
fadeOutTopRight
fadeOutBottomRight
fadeOutBottomLeft

Flippers:

flip
flipInX
flipInY
flipOutX
flipOutY

Lightspeed:

lightSpeedInRight
lightSpeedInLeft
lightSpeedOutRight
lightSpeedOutLeft

Rotating entrances:

rotateIn
rotateInDownLeft
rotateInDownRight
rotateInUpLeft
rotateInUpRight

Rotating exits:

rotateOut
rotateOutDownLeft
rotateOutDownRight
rotateOutUpLeft
rotateOutUpRight

Specials:

hinge
jackInTheBox
rollIn
rollOut

Zooming entrances:

zoomIn
zoomInDown
zoomInLeft
zoomInRight
zoomInUp

Zooming exits:

zoomOut
zoomOutDown
zoomOutLeft
zoomOutRight
zoomOutUp

Sliding entrances:

slideInDown
slideInLeft
slideInRight
slideInUp

Sliding exits:

slideOutDown
slideOutLeft
slideOutRight
slideOutUp

Adding an event listener:

hash('body').on('click', function(){
   alert('clicked');
})

Append text:

hash("body").append("someText")

Prepend text:

hash("body").prepend("someText")

Set or get attributes:

hash("body").attr("id") // returns body
hash("body").attr("id", "body") // sets I'd to body

Change the style of an element:

hash("body").css(property, value)
Example:
hash("body").css("background", "black") //changes the css to background: black;

Ajax: change the content of an element with remote file content:

hash("body").ajax("https://url-to-file.com/TXT.txt", "get") //the second one is the method

Set a cookie ­čŹ¬:

hash().setCookie("username", "hashtag", "session", "/"); //key, value, expires, path

Get a cookie by name:

hash().getCookie("username"); //returns "hashtag"

Add an element:

hash("body").addElm("element name", "id of elm")
// You can use the set attribute function to add attributes or to change text into the element

Configure local storage:

hash().storage(action, key, value)

// action list:
//     "clear" clears the local storage
//     "get".  Gets the iten with specified key
//     "set"   set the key with the respective value
//     "remove" remove the item with the specified key

Toogle hide and show:

hash(".element").toogle();

Vibrate:

hash().vibrate(200);

image to text:

hash("#canvas").textToImg("some text");
hash().read("message");

collect data from user machine

hash().data
           .lang //en_US
           .userAgent //Mozilla/5.0 (Linux; Android 6.0.1; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Mobile Safari/537.36"
           .os //linux x86_64
           .cookies // true
           .vender //Google.inc
           .online // true id online
           .version //5.0
           .mobileType //4g
           .doNotTrack //true is turned on

hash().data //returns all data in a json format

to apply your custom actions on the selector

hash('body', 1).innerHTML = 'it works';
//           ^adding this 1 makes you to add custom action on the selector.
hash('body').innerHTML = 'it doesnt works :(';

FINGERPRINTING (KINDA)

hash().fingerprint(key); //sets the fingetprint on the user machine
hash().checkFingerprint(key); // trturns true id the fingerprints are matched (else false)

//example
if (hash().checkFingerprint('user1')) {
   console.log('not a new user');
}else{
   console.log('new user');
}
hash().fingerprint('user1');

MORE FEATURES COMMING SOON