Code Monkey home page Code Monkey logo

webflow-nft-components's Introduction

Mint button for Webflow/Wix/Wordpress

Add a mint button to your website without coding skills required.

⚑ Quick start

Use our new app to set up your button embed:
https://embed.buildship.xyz

Features

πŸ‘‰ No-code mint button for Webflow, Wix, WordPress with instructions
πŸ‘‰ Supports custom contract methods (mint, maxSupply, etc.)
πŸ‘‰ Supports non-verified contracts
πŸ‘‰ Pay to remove watermark
πŸ‘‰ Supports other chains (Polygon, Optimism, Arbitrum, etc.)
πŸ‘‰ Easy to use

Video guide

Mint button video guide

Text guide

This widget allows minting NFTs on your website.

To start, you need an Ethereum NFT contract. Create it via Buildship app, or test with an example contract.

ERC721Community contract by buildship.xyz is used by 400+ NFT drops with 5M$+ primary sales earned for creators. It uses ERC721A, allowing for 50-100% lower minting gas fees, costs ~10-20$ in gas to deploy, bullet-proof security and extensions like allow lists, mint passes, etc. Create your contract now

How to use it with Webflow?

⚑ Instructions for Wix/Wordpress/HTML & easy setup are available on embed.buildship.xyz

  1. Open Webflow website editor
  2. Create a new Embedded HTML code block (at least Basic site plan required)
  3. Copy & paste this code in Webflow Embed block
<script>
   CONTRACT_ADDRESS = "YOUR CONTRACT ADDRESS HERE"
   IS_TESTNET = false
   // if your contract is NOT VERIFIED on Etherscan
   // put here: CONTRACT_ABI = [{...}]
   // don't do anything if unsure
</script>
<script src="https://nftcomponents.vercel.app/static/js/main.js"></script>
<link href="https://nftcomponents.vercel.app/static/css/main.css" rel="stylesheet">
  1. If you have your Ethereum NFT contract
    βœ… Insert your contract address in CONTRACT_ADDRESS field
    βœ… Set IS_TESTNET to false or true depending on which network is the contract on: Ethereum Mainnet or Goerli Testnet
    βœ… Make sure it fits requirements from Custom smart contract requirements

If you don't have a contract, create it via Buildship app

Your contract should be verified on Etherscan. Otherwise you have to add CONTRACT_ABI = [{...}] line in the above code, with your full contract ABI inserted. If you have an error saying your ABI is too long, click here.

  1. Create a button with ID mint-button on your Webflow site

On the left side, press Add and find Button

image

Select your button, then on the right side, set Button id to mint-button

image

If you can't set an ID, you can set a button URL as mint-button or https://<your-website-url>/#mint-button

  1. You're done πŸŽ‰

Custom smart contract requirements

If you are using mint widget with a contract not deployed via https://app.buildship.xyz, it has to be:

  • verified on Etherscan
  • public price method outputting price in wei. It could be named price, cost or getPrice
  • public mint method accepting nTokens as parameter. Alternative names: mint, mintNFT or publicMint
  • public maxSupply method outputting collection size
  • public totalSupply method outputting total number of minted NFTs

If your contract doesn't fit the requirements, you can fork this repo and open a PR. Vercel will automatically deploy and build your PR and you'll be able to use the changed version.

Here's the code that handles this: src/mint/web3.js

Example for testing

<script>
   CONTRACT_ADDRESS = "0xb1db0dbad7a14370872a7e5327c8ad7c9951a661"
   IS_TESTNET = true
</script>
<script src="https://nftcomponents.vercel.app/static/js/main.js"></script>
<link href="https://nftcomponents.vercel.app/static/css/main.css" rel="stylesheet">

FAQ

I'm confused / it's not working, can you help me?

Yes, absolutely! You can contact us in Discord, or open a GitHub issue

How to add "Connect wallet" button?

Mint button will ask to connect wallet, so it's not necessary to add a "Connect wallet" button.

If you still want to do it, create a Webflow button with ID connect.

How to add a custom minted counter?

Just create two text elements and assign them:

  • minted-counter ID to display minted number
  • total-counter ID to display collection size

How to use this with Polygon, Binance, or other Ethereum-based networks?

It's easy! Set NETWORK_ID instead of IS_TESTNET in the code snippet

<script>
   CONTRACT_ADDRESS = "YOUR CONTRACT ADDRESS HERE"
   NETWORK_ID = 1
   // remove IS_TESTNET line
   ...
</script>
<script ...>
<link ...>

Some of the network IDs you might use:

  • Ethereum Mainnet: NETWORK_ID = 1
  • Ethereum Goerli Testnet: NETWORK_ID = 5
  • Polygon: NETWORK_ID = 137
  • Binance: NETWORK_ID = 56
  • For other IDs visit Chainlist

How to style minting dialog?

See the example here

How to hide minted counter from the dialog?

You need to set DEFAULTS.hideCounter to true

<script>
   CONTRACT_ADDRESS = "YOUR CONTRACT ADDRESS HERE"
   NETWORK_ID = 1
   DEFAULTS = {
       hideCounter: true
   }
   ...
</script>
<script ...>
<link ...>

What's all available customization?

Here's a list of all available parameters for customization. If you need help with this, message us in Discord

<script>
   CONTRACT_ADDRESS = "YOUR CONTRACT ADDRESS HERE"
   CONTRACT_ABI = []                   // needed for non-verified contracts only
   NETWORK_ID = 4                      // defaults to 1: Ethereum network
   IS_TESTNET = true                   // true defaults to 5: Goerli network
   MAX_PER_MINT = 5                    // max value of NFT quantity slider in the modal, default is 20
   DEFAULTS = {
      labels: {
          walletConnected: "Wallet connected", // label for wallet connected button
      },
      hideCounter: false,              // hide minted counter from the dialog. Default: true
      contractMethods: {
         mint: "myCustomMintMethod"    // defaults to "mint" or "publicMint"
      },
      publicMint: {
          price: 0.1                    // defaults to none, fetched automatically from smart-contract
      }
   }
   STYLES = {
      theme: "light",
      backgroundColor: "#ffffff",
      primaryColor: "#2986CC",
      primaryTextColor: "#1f1f1f",
      secondaryTextColor: "#9e9e9e",
      buttonTextColor: "#ffffff",
      corners: "rounded"
   }
</script>

Do you collect any data?

Anonymous data collected using Amplitude, so we can know how many users the widget has. The only thing we collect is website URL. If you want to opt out, set

<script>
...
DEFAULTS = { 
   analyticsOptOut: true
}
...
</script>

Can I add my own custom analytics?

Check out this guide: https://github.com/buildship-dev/webflow-nft-components/wiki/Custom-Analytics

Free Template

If that instruction was too complicated, check out our free clonable NFT website templates for Webflow

Roadmap

  • Fix issues with WalletConnect on mobile
  • Support for Coinbase Wallet
  • Guide for Wix
  • Guide for Wordpress
  • Guide for Squarespace
  • Native support for Ledger
  • Support for Magic Wallet
  • Support for gasless mints
  • Support for buying with credit card: MoonPay / CrossMint
  • Migrate to RainbowKit or ConnectKit
  • Migrate to ethers.js
  • Refactor code
  • "Disconnect wallet"
  • View wallet's NFTs via rainbow.me
  • Support for token-gating

Contributing

Fork the repo and clone it

git clone https://github.com/buildship-dev/webflow-nft-components.git

Install dependencies with yarn (node v14+ required)

yarn install

Start server on localhost:3000

yarn start

Push changes, open a PR in our repo, and you'll be able to test your changes immediately on nftcomponents-git-your-branch-name.vercel.app.

Leave a message in our Discord to discuss & review your PR faster!

webflow-nft-components's People

Contributors

caffeinum avatar facumartig avatar frynze avatar jeffxu1 avatar jonathanlevey avatar maravfe avatar theshadowagent avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

webflow-nft-components's Issues

Whitelist

Is there a way to have this work with whitelist sales? Creating separate sale times so that only people with the correct wallet address can buy during the whitelist sale and then when the contract enables public sale, everyone can buy?

total-counter-error

While using the testnet & example address; adding #total-quantity to a <span> returns function () { [native code] }

CONTRACT_ADDRESS = "0x8Fac2e25DFF0B248A19A66Ae8D530613c8Ff670B" IS_TESTNET = true

Minting Button doesn't work

It gets to signing in your wallet but then go es to a message on site saying to wait but nothing happens in the wallet.

Error adding CONTRACT_ABI: Custom code is over 10000 character limit

I am having issues adding the contract ABI to the code. When I add it, the custom code is over the 10000 character limit for webflow. Is there any way to call the abi from an external source like a CDN? something like this?

<script src="https://cdn.jsdelivr.net/gh/user/repo@version/file"></script>

I tried to just add this code with the correct user/rep@version/file and the mint button is not connecting to the contract and just sends me to the metamask website to download metamask.

Can't make it work for Celo network and (even the testnet)

I'm trying use ur code with the Celo Alfajores tesnet but i can't make it work. I got this error: Uncaught (in promise) TypeError: la.methods.getPrice is not a function at web3.js:24:35. But i included this function in my contract.

Issues with mobile mints

Some users have told us that they were not able to mine via mobile.

Either this page came up (see attachment), or the users were redirected to metamask, but then only a white blank page opened on metamask, without any request to mine.

I would appreciate any response.

image

only works with your contract

hello ,

i have it working fine with your contract but when i use any other contract on the test net which are all verfied it doesnt work ?. has it been limited just for your contract now

Connect whitelist Merkletree

How do I link my merkle tree whitelist? When I add the mint-whitelist button and try to mint with it, it says that the address is not whitelisted. How do I link my whitelist?

Rinkeby Test Network

Hi,

first of all, thank you for the great repo.

wanted to ask if everything works on the Rinkeby network (ID 4)? Or if I'm doing something wrong...

On the main network everything works fine.

Best

Add more style to dialog

We are testing using the code snippets you provided

Capture d’écran 2022-12-08 aΜ€ 17 43 43

This is the result,
Please enable us to to edit the strings, and colors also in Test mode. we want French text.
Thanks,

can't mint

I have a mint code of my own in Eth test

<script> CONTRACT_ADDRESS = "0x60CAA9F8F4Bb499BAa138a51012A7BeD45dD8b29" NETWORK_ID = 4 // place to put CONTRACT_ABI = [{...}] </script> <script src="https://cdn.nft-generator.art/js-sdk/v1.4.0/nft-art-generator-sdk/nft-art-generator-sdk.esm.js%22%3E"></script>

but still show error404

I try use the buildship test can to mint

CRONOS not supported ?

Hi,

I try to setup a project on CRONOS testnet (338), is it possible?

I have this error :
Uncaught (in promise) Error: You must provide the json interface of the contract when instantiating a contract object.

Thank you

Mint Button View

Every time I press the Mint button, this text appears on the button.

Is there a way not to display it? It doesn't look so good aesthetically.

Thanks in advance.

screen-github

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.