8.8.0 • Published 3 years ago

hamadashadow v8.8.0

Weekly downloads
1
License
ISC
Repository
github
Last release
3 years ago

hamadaShadow

What is this?

Get perfect Hamada shadow every time form the non-disigner developer.

Installation

npm i hamadaShadow --save

How to use?

import { hamadaShadow } from "hamadaShadow";

hamadaShadow({
  shadow_type: "soft",
  padding: false,
});

Options

hamadaShadow support 2 options:

  • shadow_type - hard | soft ( By default to soft)
  • padding - boolean (By default to false)

Source Code

function hamadaShadow(options) {
  let element = document.querySelectorAll(".hamadaShadow");

  if (options.shadow_type === "hard") options.shadow_type = "0px";
  else options.shadow_type = "15px";

  element.forEach((e) => {
    e.style.boxShadow = `10px 10px ${options.shadow_type} 1px rgb(0,0,0,0.12)`;
    if (options.padding) {
      e.style.padding = "1rem";
    }
  });
}