1.0.4 • Published 4 years ago
bbblink v1.0.4
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
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)
allTheBlinks(interval = 500)
Makes everything on your page blink at a given interval in ms.
alltheBlinks(500)
OBSOLETE
stopBlink()
Not recommended. Stops all current blinking processes.
stopBlink()
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!