JSPM

@minskylab/realshadow

0.2.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q30347F
  • License MIT

A simple library to give shadows based on the current real time for any html element.

Package Exports

  • @minskylab/realshadow

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@minskylab/realshadow) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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.