Generative
  • Art on Bitcoin
  • LAUNCH YOUR GENERATIVE ART ON BITCOIN
    • Start a new project
    • Select creative libraries
    • Add traits
    • Add generative code
    • Publish the project!
  • LAUNCH YOUR ART ON BITCOIN
    • Submit your collection
    • Collection information
    • Pricing and publishing
    • Publish and share the project!
  • GENERATIVE WALLET
    • Install Generative Wallet
    • FAQs
  • Generative Ordinal Services
    • Step-by-step instructions
Powered by GitBook
On this page
  1. LAUNCH YOUR GENERATIVE ART ON BITCOIN

Add generative code

Now you can start adding your generative code into the index.html file.

index.html
// ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ Add your code here ↓↓↓↓↓↓↓↓↓↓↓↓↓↓

const container = document.createElement("div")
container.innerHTML = "<span>GM. I'm Seed #" + seed + "</span>";
document.body.prepend(container)

// ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ Add your code here ↑↑↑↑↑↑↑↑↑↑↑↑↑↑

In your code, instead of using Math.random() for random number generation, use the mathRand() function provided in the index.html file. mathRand() is a specific function that creates a random number based on an on-chain seed.

We suggest minifying your code to save on Bitcoin network fees.

PreviousAdd traitsNextPublish the project!

Last updated 2 years ago