Skip to content

Releases: neplextech/canvacord

v6.0.2

10 Mar 12:02
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v6.0.1...v6.0.2

v6.0.1

05 Jan 16:01
Compare
Choose a tag to compare

Changes

  • fix: leaderboard height adjustment issue

Full Changelog: v6.0.0...v6.0.1

v6.0.0

31 Dec 15:09
Compare
Choose a tag to compare

Canvacord v6.0.0 is here!

🚀 Easily generate images using html and css in nodejs. Canvacord is suitable for creating dynamic images such as social media posts, greetings cards, memes, etc. It is also possible to create your own templates and builders to generate images. You are only limited by your imagination.

Features

  • 🪟 Open source, no privacy issues, 100% transparent - Canvacord is completely open source and free to use. This makes everything transparent and you can even contribute to the project. Best of all, you dont have to worry about privacy issues 😊.
  • 💪 Easy to use - Canvacord provides a simple api to generate images on-the-fly.
  • 🎨 Customizable - You can create your own templates and builders to generate images. Canvacord allows you to define how your image should look using html and css. No more hassle learning complicated canvas api.
  • 🚀 Fast - Canvacord is powered by highly optimized, battle tested libraries, which makes it fast and reliable.
  • 🔒 Typescript support - Canvacord is written in typescript and provides type definitions out of the box.
  • 📸 Wide formats support - Canvacord supports many image formats such as png, jpeg, webp, gif, svg, etc.
  • 📄 Wide range of templates - Canvacord provides many built-in templates to generate images such as triggered gif, beautiful image, facepalm image, etc. to quickly generate that meme you saw on reddit 🤡. No need to touch complicated canvas api, just a simple schema object is enough.

Installation

$ npm install canvacord

Canvacord stays away from node-gyp based dependencies, so you don't have to worry about weird errors while installing the library. Although canvacord utilizes @napi-rs/canvas under the hood, it is recommended to use the builder api for image generation. Only utilize the canvas api if you need to perform image manipulation.

Documentation

https://canvacord.js.org

Discord support server

https://neplextech.com/discord

What's Changed

New Contributors

Full Changelog: v5.4.10...v6.0.0

v6.0.0-beta.0

11 Nov 13:55
7651c1a
Compare
Choose a tag to compare
v6.0.0-beta.0 Pre-release
Pre-release

6.0.0-beta.0 (Experimental Release)

Documentation is a WIP.

New Image generation API (Partial)

import { canvacord } from 'canvacord';

// old image-generation methods
const triggered = await canvacord.triggered(img);
const trash = await canvacord.trash(img);

// image filterer methods (filters can be chained together)
// with 500x500 canvas size
const filtered = await canvacord.filters(500, 500).drawImage(img).hueRotate(70).encode();
// auto size detection
const filtered = await canvacord(img).hueRotate(70).encode();

Builders (Partial)

RankCardBuilder

import { RankCardBuilder } from 'canvacord';

const card = new RankCardBuilder()
    .setUsername('wumpus')
    .setDisplayName('Wumpus')
    .setDiscriminator('1234')
    .setAvatar('https://cdn.discordapp.com/embed/avatars/0.png?size=256')
    .setCurrentXP(300)
    .setRequiredXP(600)
    .setLevel(2)
    .setRank(5)
    .setStatus('online');

const image = await card.build({ format: 'png' }); // 'svg' generates svg image (best quality compared to other formats)

Leaderboard builder (prototype)

Builder API

Builder API allows you to create custom designs using react-like syntax and tailwindcss. You can use transpilers like babel or typescript to transpile jsx code.

import { JSX, Builder, Font } from 'canvacord';

interface Props {
  text: string;
}

class Design extends Builder<Props> {
  constructor() {
    // set width and height
    super(500, 500);
    // initialize props
    this.bootstrap({ text: '' });
  }

  setText(text: string) {
    this.options.set('text', text);
    return this;
  }

  // this is where you have to define output ui
  async render() {
    return (
      <div className="flex items-center justify-center h-full w-full bg-teal-500">
        <h1 className="text-white font-bold text-7xl">{this.options.get('text')}</h1>
      </div>
    );
  }
}

// usage

// load default font
Font.loadDefault();

// create design
const design = new Design().setText('Hello World');
const image = await design.build({ format: 'png' });

// do something with generated image

Output

test

For more info, join our discord server: https://neplextech.com/discord

v5.4.10

19 Jun 13:24
Compare
Choose a tag to compare

What's Changed

  • Discriminator update for RankCard by @21Z in #161

Full Changelog: v5.4.9...v5.4.10

v5.4.9

11 May 08:32
Compare
Choose a tag to compare

What's Changed

  • Add conditional discriminator rendering by @skdhg
  • Create PULL_REQUEST_TEMPLATE.md by @slim-codes in #142
  • [FEATURE] show specific progress from one level to the next by @Mittelblut9 in #151
  • Add invisible type to Rank Card by @Damien111 in #149
  • Fix: Failed to convert JavaScript value Undefined into rust type String by @21Z in #154

Possible Discriminator Styles

RankCard

RankCard

RankCard

New Contributors

Full Changelog: v5.4.8...v5.4.9

v5.4.8

21 Sep 20:01
Compare
Choose a tag to compare

Fixes

  • fix rank card gradient

Full Changelog: v5.4.7...v5.4.8

v5.4.7

12 Sep 11:50
Compare
Choose a tag to compare

Updates

  • Bump @napi-rs/canvas
  • Use Intl formatter if available (module: abbrev)

Full Changelog: v5.4.6...v5.4.7

v5.4.6

16 Aug 09:03
Compare
Choose a tag to compare

Assets

  • bundle NotoColorEmoji font

Canvacord

  • apply noto color emoji font
  • fix typings

Full Changelog: v5.4.5...v5.4.6

v5.4.5

13 Aug 13:25
Compare
Choose a tag to compare

Updates

  • fix typings

Full Changelog: v5.4.4...v5.4.5