1.2.5 • Published 3 years ago

katty v1.2.5

Weekly downloads
-
License
-
Repository
-
Last release
3 years ago

Katty

Add a cat to your website

NPM

React example (ts) Quick

import { EXAMPLE_ACTIONS, EXAMPLE_SIZE, useKattyDefault } from "katty";

export const Component = (): ReactElement => {
  const platformRef = useRef<HTMLDivElement>(null);

  useKattyDefault(platformRef.current, 1.5 /* scale */);

  return <div ref={platformRef}></div>;
};

React example (ts) more options

import { EXAMPLE_ACTIONS, EXAMPLE_SIZE, useKatty } from "katty";

export const Component = (): ReactElement => {
  const platformRef = useRef<HTMLDivElement>(null);

  useKatty({
    actions: EXAMPLE_ACTIONS,
    size: {
      width: EXAMPLE_SIZE.width * 1.5,
      height: EXAMPLE_SIZE.height * 1.5,
    },
    element: platformRef.current,
  });

  return <div ref={platformRef}></div>;
};

Typescript example

import { Animal, EXAMPLE_ACTIONS, EXAMPLE_SIZE } from "katty";
import { ReactElement, useEffect, useRef } from "react";

const animal = new Animal({
  actions: EXAMPLE_ACTIONS,
  size: EXAMPLE_SIZE,
  element: <HTML_ELEMENT>,
});

animal.startLiving();

setTimeout(() => {
  animal.murderBrutally()
}, 10 * 1000)
1.2.5

3 years ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.9

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.10

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.0.0

3 years ago