Git Product home page Git Product logo

pure-js's Introduction

Pure JS

DEPRECATED in favor of @runroom/purejs

DEPRECATED

Pure JS is a pack of pure javascript non-jquery functions exported as Node.js modules.

Installation

$ yarn add pure-js
$ npm i pure-js

Supported modules

Anchor ⚓️


Adds an anchor link functionality. Of course it can be replaced with the html href attribute, but this function provides an offset option which adds more space to manage your fixed headers.

If it's used along with the ScrollDirection function, you must set the option as true.

import { Anchor, handleScrollToAnchor } from 'pure-js';

// Default settings
const settings = {
  trigger: '.js-anchor',
  scrollDirection: false,
  offset: 0
};

// You can use the default function to act on all triggers
Anchor(settings);

// Or you can just call the method to a single element
handleScrollToAnchor('#my-element');
Setting Description
trigger {string} The class of the link element
scrollDirection {boolean} use or not the ScrollDirection module
offset {integer} size (in pixels) of the offset top of the document

Cookies 🍪


Adds the functionality to your cookies policy modal. You can use any markup and this module will be in charge of creating the acceptance cookies and show/hide the modal

It uses js-cookie to manage Cookies setting.

import { Cookies } from 'pure-js';

// Default settings
const settings = {
  element: '.js-cookies',
  button: '.js-cookies-accept',
  cookieName: 'accept_cookies',
  visibleClass: 'cookies--state-visible',
  paddingBottom: false
};

Cookies();
Setting Description
element {string} The class of the cookie policy element
button {string} The class of the accept button
cookieName {string} The name of the accept cookie
visibleClass {string} The class of the element to make it visible
paddingBottom {boolean} To add a padding at the bottom of the document to prevent element overlay

ForEach ☔️


GoTop 🔝


ScrollDirection ⬆⬇


ScrollTo 🚀


ScrollTop 🙊


Touchable 👆🏽


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.