0.1.1 • Published 1 year ago

time-moji v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

SZFK7.png

Time-Moji: A lightweight JavaScript library that adds dynamic and visually appealing time-based emoji displays to your web applications. With Time-Moji, you can easily convert the current time into corresponding emojis, adding a fun and engaging element to your time displays.

NPM Version

Features:

  • Clock Emoji 🕥: Display the current time with a corresponding clock emoji, providing a fun and engaging user experience.
  • Landscape Emoji 🏙️: Display landscape emojis to represent different times of the day, adding visual context to your time displays.
  • Customization: Easily customize the appearance of your time displays by toggling between clock and landscape modes.
  • Simple Integration: Integrate Time-Moji into your projects with just a few lines of JavaScript code, making it easy to add dynamic time displays to any web page.

Usage: 1. Include the Time-Moji library in your HTML file using a script tag.

<script src="https://cdn.jsdelivr.net/npm/time-moji@latest/time-moji.js"></script>

or

<script src="https://unpkg.com/time-moji/time-moji.js"></script>

or Install with NPM

npm i time-moji
  1. Use JavaScript to dynamically update the time display based on the current time and chosen display mode.
Tmj.getTimeMoji(dateTime: Date, type: string)
ParameterDescription
dateTimeA Date object representing the time
typeA string indicating the display type ('clock' or 'landscape') {🕟,🌉}
  1. Customize the appearance and behavior of your time displays to suit your application's needs.

Sample Usage

<div class="emoji-time"></div>
<script>
function updateTime() {
    const emoji = document.querySelector('.emoji-time');
    emoji.textContent = Tmj.getTimeMoji(new Date(),'clock');
}
window.addEventListener('DOMContentLoaded', () => {
    updateTime();
    setInterval(updateTime, 1000);
});
</script>

Table of Emojis

HourClock Emoji ('clock')Landscape Emoji ('landscape')
0🕛🌉
1🕐🌉
2🕑🌉
3🕒🌉
4🕓🌉
5🕔🌄
6🕕🌇
7🕖🌇
8🕗🌇
9🕘🌇
10🕙🏙️
11🕚🏙️
12🕛🏙️
13🕐🏙️
14🕑🏙️
15🕒🏙️
16🕓🏙️
17🕔🏙️
18🕕🌆
19🕖🌆
20🕗🌉
21🕘🌉
22🕙🌉
23🕚🌉

When 30min passed:

0min Emoji30min Emoji
🕐🕜
🕑🕝
🕒🕞
🕓🕟
🕔🕠
🕕🕡
🕖🕢
🕗🕣
🕘🕤
🕙🕥
🕚🕦
🕛🕧

Any error will return '🚨'

Get Started: Visit the Time-Moji GitHub repository to learn more and get started with integrating dynamic time displays into your web applications.

License: Time-Moji is licensed under the MIT License, allowing you to use and modify the library freely in both personal and commercial projects.


ko-fi

0.1.1

1 year ago

0.1.0

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago