Skip to content

Generate pattern options code based on option values set in the demo controls panel. #19

@Eoic

Description

@Eoic

Show pattern creation and configuration object based on the values set in the demo controls panel so that a user could copy and paste the working implementation. For example,

const pattern = new PerlinNoisePattern({
    octaves: 4,
    frequency: 0.05,
    lacunarity: 2,
});

const ascii = new ASCIIGround()
    .init({
        canvas,
        pattern,
        {
            color: "#20FBCA",
            backgroundColor: "#FF00FA",
            characters: ["1", "+", "#", "-"],
        }
    })

Acceptance criteria:

  1. Code is shown and updated when control values change.
  2. There is a button to copy the generated code.
  3. Pressing the copy button alongside the code block copies the code to the clipboard.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requesthelp wantedExtra attention is needed

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions