• Stars
    star
    203
  • Rank 192,890 (Top 4 %)
  • Language
    TypeScript
  • Created over 4 years ago
  • Updated over 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-notification-bot

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

soundcloud-scraper

☁️ Get basic informations about a song from a SoundCloud URL
JavaScript
67
star
3

discord-ytdl-core

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

discord-tutorial-bot

Simple leveling bot for discord.
JavaScript
52
star
5

discord-ui-clone

Discord UI Clone in HTML
HTML
47
star
6

illustrator.js

JavaScript image processing library
TypeScript
41
star
7

scratch-for-discord

Desktop app for Scratch For Discord
TypeScript
39
star
8

GiveawayBoat

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

TikTok-Search

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

create-discord-app

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

youtube-together-bot

Discord bot to create YouTube Together Activity
JavaScript
23
star
12

discord.tsx

Create Discord.js components in JSX
TypeScript
20
star
13

downloader

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

emoji-api

Simple Emoji API.
TypeScript
16
star
15

camb-dict

Unofficial cambridge dictionary api
TypeScript
13
star
16

dankmemer.js

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

serverstats

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

node-xvdl

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

webview-native

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

jspiano

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

dartjs

Discord.js v12 voice polyfill
TypeScript
8
star
22

extractor

Some extractors for discord-player.
TypeScript
8
star
23

P74Y

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

simple-youtube-clone

Simple YouTube Clone
JavaScript
7
star
25

voice-recorder-example

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

calendar

Simple JavaScript calendar library.
TypeScript
7
star
27

discord.hook

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

ecobot

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

MusicBoat

Discord music bot using discord-player
JavaScript
5
star
30

lavalink-static

Simple node module to download lavalink binary
JavaScript
5
star
31

memes

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

ronbpost

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

micro-docgen

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

reverbnation-scraper

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

liquid-express

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

click-it

lol
HTML
4
star
37

qbasic

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

digital-logic

A collection of digital logic utilities
TypeScript
3
star
39

sk-portfolio

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

text-to-speech

Simple text-to-speech
HTML
3
star
41

cathy.js

AI chatbot based on AIML.
JavaScript
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

snowflake107.github.io

Snowflake107
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

minichat

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

Disclyssia

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

discord.js-tutorial

Discord.js Tutorial
JavaScript
2
star
57

ticketbot

Ticket bot used in Dank Memer Official
JavaScript
2
star
58

Simple-Calc

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

fetch-country-flag

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

devandromeda

Hey :)
2
star
61

skdhg

2
star
62

simple-discord-bot

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

number-generator

Simple number generator
HTML
1
star
64

guess-the-number

Super simple discord bot to play Guess The Number
JavaScript
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

embedcord

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

discord-bot-template

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

player

I am testing something πŸ˜„
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

DevAndromeda

Config files for my GitHub profile.
1
star
75

react-search-ui

React search ui design
TypeScript
1
star
76

server-status-page

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

kindadiscord

Super simple discord (not useful)
JavaScript
1
star