npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

thy-clock

v1.0.1

Published

This is a stylish analogoue alarm-clock ⏰ web component, that can easily be integrated in your web application. It can easily be cstomized to your needs.

Downloads

131

Readme

ThyClock

This is a stylish analogoue alarm-clock ⏰ web component, that can easily be integrated in your web application. It can easily be cstomized to your needs.

Screenshot

Features

  • small
  • lightweight
  • framework agnostic (like any other true web component)
  • integrates for example with vanilla, vue, react, angular, svelte, solid.js and many more

Implementation Examples

    // default
    <thy-clock></thy-clock>

    // few colors and size changed
    <thy-clock 
      size="400"
      dial-color="#121212"
      dial-background-color="transparent"
      second-hand-color="#cc0000"
    ></thy-clock>
    
    // fully customized
    <thy-clock 
      size="400"
      second-hand-animation="sweep"
      dial-color="#fac2ff"
      dial-background-color="#8634eb"
      second-hand-color="#0ca2e8"
      minute-hand-color="#dd0000"
      hour-hand-color="#0ce838"
      alarm-time="13:30"
      alarm-hand-color="#0000aa"
      alarm-hand-tip-color="#aa0000"
      numeral-font="Times"
      brand-font="monospace"
      brand-text="THY-CLOCK"
      brand-text2="Germany"
      numerals='[{"3":"III"},{"6":"VI"},{"9":"IX"},{"12":"XII"}]'
      time-offset-operator="-"
      time-offset-hours="2"
      time-offset-minutes="30"
    ></thy-clock>

Events

Listen to events:

<script>
    const alarmClock = document.getElementById("alarmclock");
    
    alarmClock.addEventListener('alarm', (e) => {
        console.log('Alarm is ringing', e.detail.date);
    });
    
    alarmClock.addEventListener('every-second', (e) => {
      console.log('Every second', e.detail.seconds, e.detail.date);
    });
</script>

Installation

npm install thy-clock

Usage

<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>My fancy app</title>
    <script type="module">import 'thy-clock';</script>
  </head>
  <body>
    <thy-clock></thy-clock> // see Implementation Examples above
  </body>
</html>

Attributes

The following attributes are available: | attribute name | type | default value | info | | --- | --- | --- | --- | | size | number | 250| size in px | | dial-color | string | #000000| color of dial numerals, ticks and brand-text | | dial-background-color | string | #FFFFFF| dial background, can be set to transparent | | second-hand-color | string | #F3A829| color of second-hand and center disc | | minute-hand-color | string | #222222| color of minute-hand | | hour-hand-color | string | #222222| color of hour-hand | | alarm-hand-color | string | #FFFFFF| color of alarm-hand (only visible if alarm-time is set) | | alarm-hand-tip-color | string | #026729| color of tip (only visible if alarm-time is set) | | hide-numerals | boolean | false| hides the numerals if present | | numeral-font | string | arial| font type for the numerals | | brand-font | string | arial| font type for the brand-text & brand-text2 | | brand-text | string or null | null| text on dial | | brand-text2 | string or null | null| text line 2 (small) on dial | | ticking-minutes | boolean | false| sets the minute hand only at the full minute (default is sweeping) | | second-hand-animation | HandAnimation | "tick" or "smooth-tick" or "sweep"| sets the second hand animation (default is smooth-tick) | | numerals | Object<Numeral>* | { 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, 10: 10, 11: 11, 12: 12 }| gives you the possibility to set only specific numerals, or change their values(e.g. roman figures) | | alarm-time | string or null | null| String of hours and minutes with colon-separator like "12:45" | | time-offset-operator | string | +| "+" or "-" to add or subtract the offset | | time-offset-hours | number | 0| offset in hours | | time-offset-minutes | number | 0| offset in minutes |

* Interface Numeral:

interface Numeral {
  [key: number]: number | string;
}

Demo (or it didn't happen)

VISIT DEMO SITE

✨ Have fun! ✨

Remember: time flies ! 🕛 🕐 🕑 🕒 🕓 🕔 🕕