GithubHelp home page GithubHelp logo

bvaughn / react-ascii-image Goto Github PK

View Code? Open in Web Editor NEW
17.0 3.0 4.0 811 KB

React component that displays image data as colored text

Home Page: https://bvaughn.github.io/react-ascii-image/

HTML 1.58% JavaScript 93.87% CSS 4.54%

react-ascii-image's Introduction

Demos available here: http://bvaughn.github.io/react-ascii-image/

Getting started

Install react-ascii-image using npm.

npm install react-ascii-image --save

ES6, CommonJS, and UMD builds are available with each distribution. For example:

import { AsciiImage } from 'react-ascii-image'

Alternately you can load a global-friendly UMD build:

<script src="path-to-react-ascii-image/dist/umd/react-ascii-image.js"></script>

Dependencies

React Virtualized has very few dependencies and most are managed by NPM automatically. However the following peer dependencies must be specified by your project in order to avoid version conflicts: react, react-addons-shallow-compare, and react-dom. NPM will not automatically install these for you but it will show you a warning message with instructions on how to install them.

Documentation

Prop Types

Property Required? Type Default Description
animated bool false Text should be animated.
animationInterval number 500ms Interval (in ms) of animation.
blockSize number 4 Interval sizes to use when sample pixel colors.
characterDensity number 1 Number of characters rendered per font block.
characters string ૱, Ǖ, ¤, ℥, Ω, ⚭, ⚮, ᵯ, ᵿ, §, ₯ Text (characters) to use when rendering the image.
fontSize number 8 Font size used for text image.
renderMode (inline-block | svg) inline-block Controls rendering method of text image.
url string URL of image (can be either remote URL or requireed data)

Examples

import React from 'react';
import ReactDOM from 'react-dom';
import { AsciiImage } from 'react-ascii-image';

// Could also be a string URL for remote images
const url = require('path/to/local/image.png')

ReactDOM.render(
  <AsciiImage url={url} />,
  document.getElementById('example')
);

Contributions

Use GitHub issues for requests.

I actively welcome pull requests.

Changelog

Changes are tracked in the changelog.

License

react-ascii-image is available under the MIT License.

react-ascii-image's People

Contributors

bvaughn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

react-ascii-image's Issues

CORS issue on the github page

When trying to got to the github page linked in the readme to check out a demo, the screen got blocked on loading.... I opened the console and...

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://crossorigin.me/https://images.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).

This probably won't help to solve the issue but might channel the anger away: https://codefor.life/FUCK-CORS-FUCKFUCKFUCKFUCK/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.