1.0.0 • Published 7 years ago

my-gradient-background v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

Travis build status Codecov branch npm downloads MIT License

gzip size size

Maintainability PRs Welcome

my-gradient-background

What?

A Web Component for an element gradient transition.

Getting started

npm install --save my-gradient-background

Usage

const MyGradientBackground = require("my-gradient-background");

if (!window.customElements.get("my-gradient-background")) {
  window.customElements.define("my-gradient-background", MyGradientBackground);
}
<my-gradient-background gradient="red, white, blue"></my-gradient-background>

<script type="text/javascript">
  const gradientEle = document.querySelector("my-gradient-background");

  window.setTimeout(() => {
      // use any linear-gradient color
      // https://developer.mozilla.org/en-US/docs/Web/CSS/linear-gradient
      gradientEle.setAttribute("gradient", "#e66465, #9198e5");
  }, 2500);
</script>