-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8123aae
Showing
59 changed files
with
3,481 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"env": { | ||
"es2021": true, | ||
"node": true | ||
}, | ||
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": "2019", | ||
"sourceType": "module", | ||
"project": "./tsconfig.json" | ||
}, | ||
"plugins": ["@typescript-eslint"], | ||
"rules": { | ||
"indent": ["error", "tab"], | ||
"linebreak-style": ["error", "unix"], | ||
"quotes": ["error", "double"], | ||
"semi": ["error", "always"], | ||
"no-throw-literal": "error", | ||
"@typescript-eslint/no-unused-vars": "error", | ||
"@typescript-eslint/consistent-type-definitions": ["error", "type"], | ||
"@typescript-eslint/no-explicit-any": "error" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/node_modules | ||
/yarn-error.log | ||
/package-lock.json | ||
/dist | ||
/build | ||
/src/config.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx lint-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
16.14 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"semi": true, | ||
"singleQuote": false, | ||
"arrowParens": "always", | ||
"tabWidth": 4, | ||
"printWidth": 120 | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
<h1>Woka NFT Generator 🧙♂️</h1> | ||
<p> | ||
<img alt="Version" src="https://img.shields.io/badge/version-1.0.0-blue.svg?cacheSeconds=2592000" /> | ||
<a href="LICENSE.txt" target="_blank"> | ||
<img alt="License: AGPL--3.0" src="https://img.shields.io/badge/License-AGPL--3.0-yellow.svg" /> | ||
</a> | ||
</p> | ||
|
||
Easily generate your NFT collection from Wokas ! | ||
|
||
## Requirements | ||
|
||
- Node 16.14 < | ||
|
||
## Install | ||
|
||
```sh | ||
yarn install | ||
cp src/config.dist.ts src/config.ts | ||
``` | ||
|
||
## Demo | ||
|
||
Use the command below, after which the **/build** folder will appear with all the assets and metadata needed to create an NFT collection. | ||
|
||
```sh | ||
yarn run generate | ||
``` | ||
|
||
## Usage | ||
|
||
Delete all sample assets in the sub-directories of **/assets** folder and place your assets in the corresponding directories by layers. | ||
|
||
Configure the **/src/config.ts** file as needs : | ||
|
||
```ts | ||
import { Config } from "./guards/ConfigGuards"; | ||
|
||
const config: Config = { | ||
blockchain: { | ||
type: "ethereum", // ethereum|solana | ||
metadata: { | ||
/* Ethereum */ | ||
// Optional: Manage the NFT name | ||
name: { | ||
prefix: "My awesome Woka edition ", // Optional: NFT name prefix | ||
suffix: " wow !", // Optional: NFT name suffix | ||
}, | ||
description: "Awesome Woka", // Description of your NFT | ||
image: "ipfs://mylink/", // Base URI to your avatar files | ||
/* Avalanche */ | ||
/* | ||
name: { | ||
prefix: "My awesome Woka edition ", | ||
suffix: " wow !", | ||
}, | ||
description: "Awesome Woka", | ||
image: "ipfs://mylink/", | ||
*/ | ||
}, | ||
}, | ||
collection: { | ||
size: 10, // Number of NFTs to be created | ||
crop: { | ||
size: 512, // Optional: Resize of Woka in pixels to stick it above background (must be smaller than the background) | ||
marging: { | ||
// Optional: Add a margin to the woka in pixel | ||
left: 64, | ||
right: 64, | ||
top: 64, | ||
bottom: 64, | ||
}, | ||
}, | ||
rarity: { | ||
/** | ||
* Give a rarity to a part. | ||
* A table will be displayed after the generation to known how rare a part is. | ||
* | ||
* random: Allow random rarity to all parts. | ||
* delimiter: Allow a rarity by a # in the file name (example: my-body-is-ready#50.png), | ||
* if a file doesn't have a delimiter, the rarity will be set to 100. | ||
* none: Don't give a rarity. | ||
*/ | ||
method: "delimiter", | ||
/* random */ | ||
edges: { | ||
// Only on random & optional: Delimit the rarity | ||
min: 1, // Min rarity, cannot be under 1 | ||
max: 100, // Max rarity | ||
}, | ||
}, | ||
background: { | ||
/** | ||
* Optional: Method for adding a background (transparent by default) | ||
* image: Get a random background from the backgrounds folder. | ||
* linked: Use the background with the same name in the backgrounds folder. | ||
* color: Use a color. | ||
*/ | ||
method: "image", | ||
/*color: { | ||
hex: "#EACCFF", | ||
alpha: 1, | ||
},*/ | ||
}, | ||
}, | ||
}; | ||
|
||
export default config; | ||
``` | ||
|
||
Generate your collection with the next command : | ||
|
||
```sh | ||
yarn run generate | ||
``` | ||
|
||
All files needed for an NFT collection are generated in the **/build** folder. | ||
|
||
If you want to delete all the generated assets, you can do this: | ||
|
||
```sh | ||
yarn run reset | ||
``` | ||
|
||
## Author | ||
|
||
👤 **Nolway (Alexis Faizeau)** | ||
|
||
- Website: [alexis-faizeau.com](https://www.alexis-faizeau.com) | ||
- Github: [@Nolway](https://github.com/Nolway) | ||
- LinkedIn: [@alexis-faizeau](https://linkedin.com/in/alexis-faizeau) | ||
|
||
## Show your support | ||
|
||
Give a ⭐️ if this project helped you! | ||
|
||
## 📝 License | ||
|
||
Copyright © 2022 [Nolway(Alexis Faizeau)](https://github.com/Nolway).<br /> | ||
This project is [AGPL--3.0](LICENSE.txt) licensed. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ | ||
"name": "woka-nft-generator", | ||
"version": "1.0.0", | ||
"description": "Woka NFT Generator", | ||
"repository": "fdgd", | ||
"author": "Nolway (Alexis Faizeau)", | ||
"license": "AGPL-3.0", | ||
"scripts": { | ||
"dev": "tsc --watch", | ||
"generate": "ts-node ./src/generate.ts", | ||
"reset": "ts-node ./src/reset.ts", | ||
"lint": "eslint --ext .js,.ts .", | ||
"format": "prettier --ignore-path .gitignore --write \"**/*.+(js|ts|json)\"", | ||
"prepare": "husky install" | ||
}, | ||
"dependencies": { | ||
"chalk": "^4.1.2", | ||
"generic-type-guard": "^3.4.2", | ||
"pngjs": "^6.0.0", | ||
"sha1": "^1.1.1", | ||
"sharp": "^0.30.1", | ||
"ts-node": "^10.5.0" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^17.0.18", | ||
"@types/pngjs": "^6.0.1", | ||
"@types/sha1": "^1.1.3", | ||
"@types/sharp": "^0.29.5", | ||
"@typescript-eslint/eslint-plugin": "^5.12.0", | ||
"@typescript-eslint/parser": "^5.12.0", | ||
"eslint": "^8.9.0", | ||
"eslint-config-prettier": "^8.3.0", | ||
"husky": ">=6", | ||
"lint-staged": ">=10", | ||
"prettier": "^2.5.1", | ||
"typescript": "^4.5.5" | ||
}, | ||
"lint-staged": { | ||
"*.{js,ts}": [ | ||
"eslint --fix" | ||
], | ||
"*.{js|ts|json}": [ | ||
"prettier --write" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import { Config } from "./guards/ConfigGuards"; | ||
|
||
const config: Config = { | ||
blockchain: { | ||
type: "ethereum", // ethereum|solana | ||
metadata: { | ||
/* Ethereum */ | ||
// Optional: Manage the NFT name | ||
name: { | ||
prefix: "My awesome Woka edition ", // Optional: NFT name prefix | ||
suffix: " wow !", // Optional: NFT name suffix | ||
}, | ||
description: "Awesome Woka", // Description of your NFT | ||
image: "ipfs://mylink/", // Base URI to your avatar files | ||
/* Avalanche */ | ||
/* | ||
name: { | ||
prefix: "My awesome Woka edition ", | ||
suffix: " wow !", | ||
}, | ||
description: "Awesome Woka", | ||
image: "ipfs://mylink/", | ||
*/ | ||
}, | ||
}, | ||
collection: { | ||
size: 10, // Number of NFTs to be created | ||
crop: { | ||
size: 512, // Optional: Resize of Woka in pixels to stick it above background (must be smaller than the background) | ||
marging: { | ||
// Optional: Add a margin to the woka in pixel | ||
left: 64, | ||
right: 64, | ||
top: 64, | ||
bottom: 64, | ||
}, | ||
}, | ||
rarity: { | ||
/** | ||
* Give a rarity to a part. | ||
* A table will be displayed after the generation to known how rare a part is. | ||
* | ||
* random: Allow random rarity to all parts. | ||
* delimiter: Allow a rarity by a # in the file name (example: my-body-is-ready#50.png), | ||
* if a file doesn't have a delimiter, the rarity will be set to 100. | ||
* none: Don't give a rarity. | ||
*/ | ||
method: "delimiter", | ||
/* random */ | ||
edges: { | ||
// Only on random & optional: Delimit the rarity | ||
min: 1, // Min rarity, cannot be under 1 | ||
max: 100, // Max rarity | ||
}, | ||
}, | ||
background: { | ||
/** | ||
* Optional: Method for adding a background (transparent by default) | ||
* image: Get a random background from the backgrounds folder. | ||
* linked: Use the background with the same name in the backgrounds folder. | ||
* color: Use a color. | ||
*/ | ||
method: "image", | ||
/*color: { | ||
hex: "#EACCFF", | ||
alpha: 1, | ||
},*/ | ||
}, | ||
}, | ||
}; | ||
|
||
export default config; |
Oops, something went wrong.