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

tek-tek.js

v1.0.0

Published

text writer with many options, using pure javascript

Downloads

1

Readme

Tek.js

text writer with many options, using pure javascript author: @giath_atrash © copyright: 2022 - 2023


USAGE :

first we need to define the class

var tek = new Tek();

we can add some options

var tek = new Tek({
	animationSpeed: 50,  // defualt
	separator: ',,', // defualt
});

now we have to add new element to our class

we can use cssSelector [div, .class, #id, etc...]

tek.el('.element');

you can add words using html attribute like :

<div data-words="Hello,,world"></div>

or you can make it as array when adding new element like :

this method is asynchronous function

tek.el('.element', ["Hello", "World"]);

RUN :

to run the writer you need the item_id you can get it after adding new element now we can run using run() method with item_id as argument

tek.el('.element', ["Hello", "World"])
.then(item_id => {
	tek.run(item_id);
});

run() method is asynchronous too, but what we can do with it ??

tek.el('.element', ["Hello", "World"])
.then(item_id => {
	tek.run(item_id).then(() => {
		// last word of array just finshed
		// this place will fire once
		// so do something
		console.log("i'm have done!");
	});
});

what if we have 999 item ??

how we can run all of it using getAll() method this method is asynchronous too

tek.getAll(items => {
	for(i in items){
		items[i].run();
	}
});

ITEM OPTIONS :

tek.el('.element', [...words], {
	colors: [], // object
	colorMode: "convert", // string
	delay: 1500, // number
	writeSpeed: 100, // number
	hideMode: "backspace", // string
	loop: true, // boolean
});

colors :

defualt: [] type: object

  • #hex
  • rgb()
  • hsl()
  • colorName

example :

colors: ["red", "#f0f", "rgb(0,0,0)", "hsl(0deg 100% 200%)"],

colorMode :

defualt: convert type: string

  • blink
  • fade => recommended
  • convert

delay :

defulat : 1500 type: number how much time need to wait for start removing the word

writeSpeed :

defualt: 100 type: number words write and remove speed

hideMode :

defualt: backspace type: string

  • fadeOut
  • backspace

loop :

defualt: true type: boolean


METHODS :

el() :

add new element to class @param {string} cssSelector @param {object} words - can be blank if [data-words] exits @param {object} options @return asyn function

run() :

start writing @param {string} item_id @return asyn function

getAll() :

get all items @return asyn function

stop() :

stop writing and looping @param {string} item_id @return asyn function

delete() :

delete item from class for no running it again @param {string} item_id @return asyn function

info() :

get item info and options @param {string} item_id @return asyn function