• Stars
    star
    203
  • Rank 186,915 (Top 4 %)
  • Language
    TypeScript
  • Created about 4 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Simple & easy to use image manipulation module for beginners.

SWUbanner

Canvacord

Easily generate images on-the-fly with node.js using wide range of templates.

Warning

You are looking at the next version of canvacord, which is under development. Go to the main branch to view legacy codebase.

Features

Coming Soon!

Contributing

About the project

Unlike previous versions, this project internally uses react-like elements (JSX) to generate an image with the help of satori, without depending upon canvas libraries. Internally, there exists a concept of Nodes which are basically components for canvacord template. The root node is known as a template. Templates are dynamic, which makes it easier to customize each and every part of the image you are generating. You can follow the example below to add your own components/templates to this library:

Adding custom template and node

import { JSX, Node, Builder } from "canvacord";

// JSX refers to JSX factory
// Builder refers to template builder
// Node refers to component base

class TextNode extends Node<{
  data: string;
  color: string;
}> {
  /*
   * Visual representation of this node
   */
  public toElement() {
    return (
      <h1
        style={{
          color: this.getProperty("color"),
        }}
      >
        {this.getProperty("data")}
      </h1>
    );
  }
}

class ProfileCard extends Builder {
  public setUsername(name: string, color: string) {
    const node = new TextNode({
      data: name,
      color,
    });

    super.addComponent(node);
  }

  public render() {
    // return root layout along with components
    return (
      <div
        style={{
          width: `${this.width}px`,
          height: `${this.height}px`,
          display: "flex",
          alignItems: "center",
          justifyContent: "center",
          backgroundColor: "#1A1A23",
        }}
      >
        {/* Render all of the components in the canvas */}
        {this.components.map((component) => {
          return component.toElement();
        })}
      </div>
    );
  }
}

More Repositories

1

youtube-sr

Simple library for Node, Deno & Bun to make YouTube search easily
TypeScript
75
star
2

youtube-notification-bot

Simple and easy to use discord bot to notify members whenever a video is posted on a YouTube channel.
JavaScript
72
star
3

soundcloud-scraper

☁️ Get basic informations about a song from a SoundCloud URL
JavaScript
66
star
4

discord-ytdl-core

Simple ytdl wrapper for discord bots with custom ffmpeg args support.
TypeScript
53
star
5

discord-tutorial-bot

Simple leveling bot for discord.
JavaScript
52
star
6

discord-ui-clone

Discord UI Clone in HTML
HTML
47
star
7

illustrator.js

JavaScript image processing library
TypeScript
41
star
8

scratch-for-discord

Desktop app for Scratch For Discord
TypeScript
39
star
9

GiveawayBoat

Discord giveaway bot using "discord-giveaways"
JavaScript
31
star
10

TikTok-Search

Simple module to fetch data from TikTok.
JavaScript
25
star
11

create-discord-app

A Simple CLI to generate discord bot projects easily!
JavaScript
24
star
12

youtube-together-bot

Discord bot to create YouTube Together Activity
JavaScript
23
star
13

discord.tsx

Create Discord.js components in JSX
TypeScript
20
star
14

downloader

Downloader for discord-player using youtube-dl.
JavaScript
16
star
15

emoji-api

Simple Emoji API.
TypeScript
16
star
16

camb-dict

Unofficial cambridge dictionary api
TypeScript
13
star
17

dankmemer.js

An API wrapper for Dank Memer API.
JavaScript
11
star
18

serverstats

Simple serverstats bot for discord written in discord.js
JavaScript
11
star
19

node-xvdl

πŸ”ž Video downloader for xvideos.com written in pure JavaScript.
JavaScript
11
star
20

webview-native

[WIP] Native webview bindings for Node.js
JavaScript
9
star
21

jspiano

Simple Node.js Piano (windows)
JavaScript
8
star
22

dartjs

Discord.js v12 voice polyfill
TypeScript
8
star
23

extractor

Some extractors for discord-player.
TypeScript
8
star
24

P74Y

Discord music bot made for testing discord-ytdl-core. Supports filters like bassboost, nightcore, echo, vaporwave etc.
JavaScript
8
star
25

simple-youtube-clone

Simple YouTube Clone
JavaScript
7
star
26

calendar

Simple JavaScript calendar library.
TypeScript
7
star
27

voice-recorder-example

discord.js v13 voice recorder example using dartjs framework
JavaScript
7
star
28

discord.hook

A module for Discord Webhooks written in JavaScript.
JavaScript
6
star
29

ecobot

[Outdated] Simple economy bot for discord written in discord.js.
JavaScript
6
star
30

MusicBoat

Discord music bot using discord-player
JavaScript
5
star
31

lavalink-static

Simple node module to download lavalink binary
JavaScript
5
star
32

memes

Simple module for deno to resolve memes from a subreddit.
TypeScript
5
star
33

ronbpost

πŸ“° Get latest post from Routine of Nepal banda
JavaScript
5
star
34

micro-docgen

[WIP] Simple documentation generator for TypeScript projects
TypeScript
4
star
35

reverbnation-scraper

Parse basic details of a song from reverbnation.com
JavaScript
4
star
36

liquid-express

Better Liquid template engine for express.js
JavaScript
4
star
37

click-it

lol
HTML
4
star
38

qbasic

QBasic compiler that runs on node.js
TypeScript
4
star
39

digital-logic

A collection of digital logic utilities
TypeScript
3
star
40

sk-portfolio

My personal website built with next.js and tailwindcss
TypeScript
3
star
41

text-to-speech

Simple text-to-speech
HTML
3
star
42

discord-raidmod

Simple, beginner friendly and easy-to-use discord.js spam moderation framework
TypeScript
3
star
43

discord.ss

Simple api wrapper for discord written in JavaScript.
JavaScript
3
star
44

cathy.js

AI chatbot based on AIML.
JavaScript
3
star
45

temperature

Simple package for deno to convert temperature.
TypeScript
3
star
46

datenp

Lightweight JavaScript library to convert Nepali and English dates
TypeScript
3
star
47

simple-typing-game

Super simple typing game
JavaScript
3
star
48

tsimport

A simple script for nodejs that allows imports of typescript file from javascript and vice versa
TypeScript
2
star
49

pokedex

Simple PokΓ©dex
JavaScript
2
star
50

hangman

2
star
51

canvaseno

Canvas API for deno
TypeScript
2
star
52

cathybot

Discord chatbot using cathy.js
JavaScript
2
star
53

simple-starboard

Simple starboard bot for discord.
JavaScript
2
star
54

snowflake107.github.io

Snowflake107
JavaScript
2
star
55

minichat

Mini chatbot client for Python based on AIML
Python
2
star
56

Disclyssia

A personal JavaScript Discord library made for my bot
JavaScript
2
star
57

discord.js-tutorial

Discord.js Tutorial
JavaScript
2
star
58

ticketbot

Ticket bot used in Dank Memer Official
JavaScript
2
star
59

Simple-Calc

Simple Calculator app for windows using Javascript & HTML.
JavaScript
2
star
60

fetch-country-flag

Simple package to fetch flag of any country by name.
TypeScript
2
star
61

devandromeda

Hey :)
2
star
62

skdhg

2
star
63

simple-discord-bot

Simple discord bot written in discord.js
JavaScript
2
star
64

number-generator

Simple number generator
HTML
1
star
65

random-sites

Random websites using html
JavaScript
1
star
66

discord-giveaways-enmap

Discord Giveaways framework using Enmap for storage.
JavaScript
1
star
67

player

I am testing something πŸ˜„
JavaScript
1
star
68

embedcord

A package for discord to build embeds like discord.js
JavaScript
1
star
69

discord-bot-template

A discord bot template with simple command handler.
JavaScript
1
star
70

html-testing

asdfasdf
HTML
1
star
71

collection

Utility data structure for Deno (Discord.js Collection).
TypeScript
1
star
72

portfolio

My personal website
JavaScript
1
star
73

open-eval

Eval untrusted and possibly malicious code.
JavaScript
1
star
74

guess-the-number

Super simple discord bot to play Guess The Number
JavaScript
1
star
75

DevAndromeda

Config files for my GitHub profile.
1
star
76

react-search-ui

React search ui design
TypeScript
1
star
77

kindadiscord

Super simple discord (not useful)
JavaScript
1
star
78

server-status-page

Simple server status page written in Next.js
JavaScript
1
star