Giter Club home page Giter Club logo

opacity's Introduction

Opacity ๐Ÿ”Ž

NPM Version Package License NPM Downloads

Blurb

A simple tool used to progressively reduce the opacity (get it?) of a website from any given date.

Common reasons to use include:

  • A client has promised to pay your final instalment, but you don't trust that they'll deliver.
  • You'd like your website to have an expiry date, and you're actually desperate enough that CSS is your only option to ensure it can't be used.
  • You're not quite sure how CSS transition works, and you can't think of a single better way to have your website fade out.
  • Just fuck you, Dan.

Installation

npm install opacity
yarn add opacity

Usage

Basic

Ruin their Christmas

import opacity from 'opacity';

const from = new Date(2021, 11, 25);
const to = new Date(2021, 11, 27);

opacity(from, to);

Basic+

Don't trouble yourself with having to calculate the end date

import opacity from 'opacity';

const from = new Date(2021, 11, 25);
const to = { days: 10 }; // `to` will be caluclated as 10 days after `from`

opacity(from, to);

Senior/Advanced

Make them suffer

import opacity from 'opacity';

const from = new Date(2021, 11, 25);
const to = { hours: 5 }; // `to` will be caluclated as 5 hours after `from`
const animated = true; // When enabled, the screen will progressively dissapear in front of their eyes

opacity(from, to, animated);

API

(from: Date, to: Duration | Date, animated?: boolean): void;

type Duration = {
  years?: number
  months?: number
  weeks?: number
  days?: number
  hours?: number
  minutes?: number
  seconds?: number
}

Issues

Perhaps you think you've found an issue, and you're certain it must be with this package? Impossible. The only possible outcome is you've done something wrong. We follow a strong support ethic of it-works-on-my-machine.

If you require assistance, be sure to ask for help on StackOverflow where someone can ignore your question and explain to you how stupid you are.

Migrating from v1 to v9

In order to upgrade simply install v9. There's absolutely 0 code changes between v1 and v9, we just think v9 sounded cooler.

opacity's People

Contributors

jackall3n avatar renovate[bot] avatar

Stargazers

Soorria Saruva avatar

Watchers

James Cloos avatar  avatar

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.