Skip to content
This repository has been archived by the owner on Oct 22, 2022. It is now read-only.

birdboat00/ajnor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ajnor

ajnor is an open-source creative-coding toolkit for JavaScript.

It is lightweight, functional and fast. It allows you to create your starry nightsky in squint.

Currently the following commands are supported:

  • Background (bg)
  • Rectangle (rect)
  • Circle (circle)
  • Arcs (arc)
  • Lines (line)
  • Polygons (poly)
  • Text (text)
  • BlendMode (bm)

Organic sketch, rectangles jumping around

Requirement

ajnor requires a browser that supports ECMAScript modules.

How to use

ajnor is lightweight and modular and is written in modern JavaScript.

Use it directly by downloading it from GitHub:

import { ... } from "/path/to/ajnor/mod.mjs"

or import it from jsDelivr:

import { ... } from "https://cdn.jsdelivr.net/gh/birdboat00/ajnor/src/mod.mjs"

Draw a rectangle:

import * as a from "../src/mod.mjs"

a.mksketch({
  size: a.szsquare(400),
  parent: "example",
  view: (cv) => {
    a.plot(cv, a.pipe(a.mkpen())
      .to(a.bg, { color: a.colblack() })
      .to(a.rect, { p: a.pt(20, 20), w: 360, h: 360, color: a.colwhite() }).value
    )
  }
})

Disclaimer

I just started working on this library and there is still a lot of work to be done. Feel free to help out!

License

ajnor is licensed under the 0BSD license.