1.0.4 • Published 4 years ago

bbblink v1.0.4

Weekly downloads
1
License
ISC
Repository
-
Last release
4 years ago

bbblink 👁️ (Bring Back Blink)

bbblink an open-source library for making your DOM elements appear and disappear and appear and disappear...

Blink provides the polyfill you need to reverse the disastrous decision made in 2014 to remove the blink HTML tag.

Documentation

Installation

Install using NPM or yarn

NPM: npm install --save bbblink

Yarn: yarn add bbblink

Usage

Import using ES6 import syntax

import { alltheBlinks } from "bbblink";

or import using CommonJS syntax

const alltheBlinks = require('bbblink')

Functions

  1. makeBlink(DOM Element, interval = 500)

    Makes an element on your page blink at a given interval in ms.

    el = getElementbyId("not-blinking")
    makeBlink(el, 300)

    gif of make blink

  2. allTheBlinks(interval = 500)

    Makes everything on your page blink at a given interval in ms.

    alltheBlinks(500)

    gif of all the blinks

  3. OBSOLETE stopBlink()

    Not recommended. Stops all current blinking processes.

    stopBlink()

    gif of stop blink

React Example

Use bbblink with React event handlers.

import React, { useEffect } from "react";
import { allTheBlinks, makeBlink, stopBlink } from "bbblink";
import "./styles.css";

export default function App() {
  useEffect(() => {
    allTheBlinks();
  }, []);

  return (
    <div className="App">
      <h1 onClick={event => makeBlink(event.target)}>Hello CodeSandbox</h1>
      <h2 onClick={() => stopBlink()}>
        Start editing to see some magic happen!
      </h2>
    </div>
  );
}

Try it on Code Sandbox!

Edit floral-rgb-k7mnj

Created by

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago