0.0.18 • Published 2 years ago

@memefighter/maker-core v0.0.18

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

The Meme Fighter Meme Maker

Drop-in meme creation for web apps.

meme maker

Getting Started

With Your Favorite Framework

Basic Example

npm i @memefighter/maker-core

import { start } from "@memefigher/maker-core";

function handler(memeImgUrl: string) {
  // Do something with the meme created by the user
}

function makeAMeme() {
  // Create an iframe element and retrieve a reference
  const iframe = document.querySelector("iframe");

  // Customize the appearance
  const styleVariables = {
    "--background-color": "#121212",
  };

  // Start the meme creation flow and pass the result to our handler
  start({
    iframe,
    styleVariables,
  }).then(handler);
}

⚠️ We recommend using the following style rule on your iframe:

iframe {
  aspect-ratio: 1;
  max-width: 100%;
  width: auto;
  height: auto;
}

Interface

The meme maker provides a basic level of aesthetic customization, and returns a url string pointing to the meme created by the user, which you can use in your app as you please.

function start ({
  /** Reference to the iframe which will house the meme maker. */
  iframe: HTMLIFrameElement;
  /** Customize the appearance of the meme maker. */
  styleVariables?: {
    /** Background color for the meme maker iframe. */
    "--background-color"?: string;
    /** Text color for the meme maker iframe. */
    "--foreground-color"?: string;
    /** Button color for the meme maker iframe. */
    "--button-color"?: string;
  };
}): string;
0.0.18

2 years ago

0.0.17

2 years ago

0.0.16

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago