@minskylab/realshadow

0.2.3 • Public • Published

Real Shadow

Realshadow adds a real time based shadow for any HTML Element. It works with the current time calculating each 1 second the shadow based on the current hour. You can see the below image for more details.

realshadow how it works

Demo

See this codepen: https://codepen.io/bregydoc/pen/RwoXPVJ.

How to use

Only need to add this line at the end of your body tag:

<script src="https://unpkg.com/@minskylab/realshadow/umd/index.min.js" type="text/javascript"></script>

Now, you can apply the real shadow only adding the data-rs-kind data tag with options drop|box|text|both:

Basic Example

<div data-rs-kind="box" />
<span data-rs-kind="text"> HELLO WORLD </span>

Options

You can configure the behavior of your realshadow using the below data tags.

data-rs-kind="box" # Shadow kind
data-rs-from-hour="06" # Sunset hour
data-rs-to-hour="18" # Sunrise hour
data-rs-distance="10" # Shadow distance
data-rs-color="#0d1117" # Shadow color
data-rs-blur-radius="2" # Shadow blur radius (in pixels)
data-rs-hour="10:00" # Forced static hour

Shadow kind

The shadow kind: drop|box|text|both.

box-shadow: Official Documentation. text-shadow: Official Documentation. drop (filter): Official Documentation.


Contribute

I need to complete this documentation, if you want to help only make an issue or pull request. Thanks.

/@minskylab/realshadow/

    Package Sidebar

    Install

    npm i @minskylab/realshadow

    Weekly Downloads

    10

    Version

    0.2.3

    License

    MIT

    Unpacked Size

    368 kB

    Total Files

    17

    Last publish

    Collaborators

    • anna_albirena
    • eltruforce
    • bregy
    • mariagnoriegag