Skip to content

00impera/NFT-CARD-GENERATOR-RARITY

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”₯ NFT CARD GENERATOR PRO

Animated on-chain ready NFT card generator with flame black interface. Generate, customize, mint on Monad Mainnet, download PNG & video β€” all from one HTML file. No dependencies, no build tools, open directly in browser.

Monad HTML License


🌐 Live Demo

β†’ Open NFT Card Generator


✨ Features

  • 🎴 Animated NFT card with canvas rendering at 30 FPS
  • πŸ–ΌοΈ Drag & drop image upload (PNG, JPG, GIF, WEBP)
  • 🎨 12 neon lightning colors β€” toggle individually or use palette presets
  • ⚑ 4 palette presets: NEON / MATRIX (green/black) / MONO (white/grey/black) / FIRE
  • πŸ’ͺ 4 customizable power stats with live sliders (Attack, Defense, Speed, Magic)
  • ⭐ 6 rarity grades: SSS+ Mythic / SSS Legendary / SS Epic / S Rare / A Uncommon / B Common
  • πŸ’Ύ Download as PNG (full resolution 800Γ—1200)
  • 🎬 Download as animated WebM/MP4 video (5 seconds at 30 FPS)
  • 🌿 Mint on Monad Mainnet β€” sends 100 MON to owner wallet
  • πŸ”₯ Flame black interface with rising ember particles
  • ⚑ Every button vibrates on click
  • πŸ“± Fully responsive β€” works on mobile

πŸ—‚ File Structure

NFT-CARD-GENERATOR-PRO/
β”œβ”€β”€ index.html     # Complete app β€” single file, no dependencies
└── README.md

βš™οΈ All Functions

πŸ–ΌοΈ Image & Upload

Function Description
loadImage(file) Reads image via FileReader, sets img variable, auto-triggers generateCard()
Drag & drop dragover / dragleave / drop events on .upload-zone
File input change event on #imageInput β€” accepts image/*

🎨 Card Generation & Animation

Function Description
generateCard() Shows canvas, enables download buttons, starts animation loop
animate(ts) requestAnimationFrame loop β€” increments time, calls drawCard(), tracks FPS
drawCard() Full canvas render β€” background, orbs, image, floating icons, rarity badge, name panel, stat bars, watermark
drawStatBar(stat, y, cols, t) Draws one animated stat bar with shimmer effect
drawCornerAccents(col) Draws 4 glowing corner bracket decorations
roundRect(ctx, x, y, w, h, r) Canvas helper β€” draws rounded rectangle path

🎨 Colors & Palettes

Function Description
setPalette(name) Sets active colors from preset β€” 'neon' / 'matrix' / 'mono' / 'fire'
Color button toggle Click .color-btn to add/remove color from activeColors array

Palette presets:

Name Colors
neon Green, Cyan, Magenta, Yellow, Pink, Purple, Red, Blue
matrix Green, Lime, Dark green, White shades
mono White, Grey, Black shades
fire Red, Orange, Yellow, Gold shades

πŸ’Ύ Download PNG

Function Description
downloadCard() Pauses animation β†’ renders final frame β†’ canvas.toBlob() β†’ triggers download as {name}.png

Output: 800Γ—1200px PNG, named from NFT name field.


🎬 Download Video

Function Description
downloadVideo() Records 5-second canvas stream using MediaRecorder API

Details:

  • Tries MIME types in order: video/webm;codecs=vp9 β†’ video/webm;codecs=vp8 β†’ video/webm β†’ video/mp4
  • Records at 8 Mbps, 30 FPS
  • Shows red REC indicator with countdown timer
  • Shows progress bar during recording
  • Auto-downloads as {name}-animated.webm or .mp4
  • Requires Chrome or Firefox (Safari has limited MediaRecorder support)

🌿 Mint On-Chain β€” Monad Mainnet

Function Description
mintOnChain() Connects MetaMask β†’ switches to Monad β†’ sends 100 MON to owner β†’ polls for receipt β†’ auto-downloads PNG on success

Config:

const OWNER_ADDRESS = '0x592B35c8917eD36c39Ef73D0F5e92B0173560b2e';
const MONAD_CHAIN_ID = '0x8F'; // 143
const MINT_PRICE_WEI = '0x' + BigInt('100000000000000000000').toString(16); // 100 MON

Flow:

  1. eth_requestAccounts β€” connect wallet
  2. wallet_switchEthereumChain β€” switch to Monad (chain ID 143)
  3. wallet_addEthereumChain β€” adds Monad if not present
  4. eth_sendTransaction β€” sends 100 MON to owner address (gas: 21000)
  5. Polls eth_getTransactionReceipt every 2 seconds (max 60 attempts = 2 min)
  6. On success β†’ auto-downloads card PNG

⚑ Vibrate On Click

document.addEventListener('click', e => {
  const btn = e.target.closest('button, .color-btn, .upload-zone');
  if (!btn || btn.disabled) return;
  btn.classList.remove('vibrating');
  void btn.offsetWidth; // reflow to restart animation
  btn.classList.add('vibrating');
  btn.addEventListener('animationend', () => btn.classList.remove('vibrating'), { once: true });
});

Every button on the page vibrates when clicked β€” 10-step shake with translate + rotate + scale.


πŸ“Š Stats Display

Function Description
updatePreviewSize() Updates preview info bar β€” size (800Γ—1200) and LIVE/PAUSED status. Runs every 500ms via setInterval

🎴 Card Layout (800Γ—1200px)

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  ← Animated flame border + corner accents
β”‚                         β”‚
β”‚   [IMAGE AREA 720Γ—560]  β”‚  ← User image, shimmer overlay, floating icons
β”‚         ⭐ SS ⭐         β”‚  ← Rarity badge with pulse glow
β”‚                         β”‚
β”‚  NAME              #001 β”‚  ← Name panel (black bg)
β”‚       Edition: 1/100    β”‚
β”‚                         β”‚
β”‚  βš”οΈ ATTACK   β–ˆβ–ˆβ–ˆβ–ˆβ–‘  85  β”‚  ← Animated stat bars with shimmer
β”‚  πŸ›‘οΈ DEFENSE  β–ˆβ–ˆβ–ˆβ–‘β–‘  70  β”‚
β”‚  ⚑ SPEED    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  90  β”‚
β”‚  ✨ MAGIC    β–ˆβ–ˆβ–ˆβ–ˆβ–‘  75  β”‚
β”‚                         β”‚
β”‚    imperamonad.xyz      β”‚  ← Watermark
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ”§ How to Deploy

# Clone repo
git clone https://github.com/00impera/NFT-CARD-GENERATOR-PRO
cd NFT-CARD-GENERATOR-PRO

# No build needed β€” open directly
open index.html

# OR deploy to GitHub Pages
# Settings β†’ Pages β†’ Branch: main β†’ / (root) β†’ Save
# Live at: https://nftgeneratornft.nelutz2you.workers.dev/

🌿 Mint Configuration

To change mint price or owner address, edit these lines in index.html:

const OWNER_ADDRESS = '0x592B35c8917eD36c39Ef73D0F5e92B0173560b2e'; // ← your wallet
const MONAD_CHAIN_ID = '0x8F';                                        // ← 143 = Monad
const MINT_PRICE_WEI = '0x' + BigInt('100000000000000000000').toString(16); // ← 100 MON

To change price to 50 MON:

const MINT_PRICE_WEI = '0x' + BigInt('50000000000000000000').toString(16);

πŸ“± Browser Support

Browser Generate PNG Video Mint
Chrome βœ… βœ… βœ… βœ…
Firefox βœ… βœ… βœ… βœ…
Safari βœ… βœ… ⚠️ Limited βœ…
Mobile Chrome βœ… βœ… βœ… βœ…
Mobile Safari βœ… βœ… ❌ βœ…

πŸ“„ License

MIT β€” see LICENSE


Built on Monad Mainnet Β· Pure HTML/Canvas/JS Β· No dependencies

Releases

No releases published

Packages

 
 
 

Contributors

Languages