Skip to content

timothybennette8/fac-it

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fac-it


ASCII to Factory Records colour code alphabet converter.

As designed by Peter Saville.

Takes a string of ASCII and encodes it as embeddable SVG and CSS.

fac-it demo

NPM package

Installation

npm i fac-it

Usage

Include in project

const fac-it = require("fac-it");

Available methods:

fac-it.encode()
  * @params {String} a string of ASCII
  * @returns {Array} an array of hex values 
fac-it.render()
  * @params {Array} an array of hex values - as returned by encode()
  * @params {Object} an options object - { type:String, size:String, direction:String } 
  * @returns {String} SVG or CSS code block of encoded string

The type option field should be "svg" or "css" depending on desired output, size denotes width of character in px, and direction can be either "row" or "column". The returned CSS is a flexbox, and as such responsive. The SVG is not, and will just generate on a single row/column.

Notes

  • Technically speaking, it's not ASCII - it's the 36 alphanumeric characters, whitespace, and the available symbols on my keyboard. Peep data.js for that stuff.

  • Props to scoliono for the far more elegant psaville

About

npm package to encode ASCII as Factory Records colour coded alphabet CSS and SVG elements.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published