1. Install ASCIIGround with NPM:
# NPM $ npm install asciiground
2. Or use the UMD build:
<script src="/dist/asciiground.umd.js"></script>
3. Create an HTML5 canvas element on your webpage:
<canvas id="example"></canvas>
4. Get the canvas element and instantiate ASCIIGround:
// TypeScript
import { ASCIIGround } from 'asciiground';
const canvas = document.getElementById('example') as HTMLCanvasElement;
const asciiGround = new ASCIIGround(canvas, {
// options here
});
asciiGround.init() // Browser
const canvas = document.getElementById('example')
const asciiGround = new ASCIIGround.default(canvas, {
// options here
})
asciiGround.init() 5. Create a fullpage ASCII background:
import { createFullPageBackground } from 'asciiground';
const matrix = createFullPageBackground({
// options here
}); 6. All possible configuration options.
/** Animation pattern type. */pattern: 'perlin' | 'wave' | 'rain' | 'static' | 'japan-rain' /** ASCII characters to use for rendering (from lightest to darkest). */characters: string[] /** Animation speed multiplier. */speed: number /** Font size in pixels. */fontSize?: number /** Font family. */fontFamily?: string /** Text color. */color?: string /** Background color. */backgroundColor?: string /** Direction of animation, if supported by the pattern. */direction?: 'left' | 'right' | 'up' | 'down' /** Horizontal wave amplitude (for wave pattern). */amplitudeX?: number /** Vertical wave amplitude (for wave pattern). */amplitudeY?: number /** Frequency of wave pattern. */frequency?: number /** Perlin noise scale factor. */noiseScale?: number /** Rain density (for rain/japan-rain patterns), 0-1. */rainDensity?: number /** Rain direction (for rain pattern). */rainDirection?: 'vertical' | 'diagonal-left' | 'diagonal-right'
The post Animated ASCII Backgrounds for Web Apps – ASCIIGround.js appeared first on CSS Script.
This article contains spoilers for The Boroughs Season 1, including the Season 1 finale.There goes…
In the new LEGO Batman: Legacy of the Dark Knight game, you play a "greatest…
The post Torneos Upgrades Multichannel Playout With Imagine’s Versio appeared first on TV News Check.
The post Fuse Media Taps iSpot As Official Measurement Provider For FAST & CTV Inventory…
The post Ross Video to Invest C$122.5 Million To Expand Manufacturing & R&D appeared first…
This website uses cookies.