mirror of
https://github.com/lens-protocol/core.git
synced 2026-01-09 14:18:04 -05:00
Merge branch 'development' into deploy/v2.0.4-mainnet
This commit is contained in:
@@ -132,7 +132,7 @@
|
||||
"LensHandles": "0xe7E7EaD361f3AaCD73A61A9bD6C10cA17F38E945",
|
||||
"TokenHandleRegistryImpl": "0x52fa68D73C83df39B9a637F82361d9b70aAb74F4",
|
||||
"TokenHandleRegistry": "0xD4F2F33680FCCb36748FA9831851643781608844",
|
||||
"ModuleRegistryImpl": "0xeD935AcE8f82FcAB4cae41F240c3a4aE51931313",
|
||||
"ModuleRegistryImpl": "0xf6fDD7932219D64f267E4BfaF8d19774526d31D9",
|
||||
"ModuleRegistry": "0x1eD5983F0c883B96f7C35528a1e22EEA67DE3Ff9",
|
||||
"LensHubV2Impl": "0x176c2a1c54E8b028eeEC14bF0a059E354408FF47",
|
||||
"GovernanceContract": "0xB03B8801cF9D074Ea468aAA8eBd9B5EeD67Ac5B6",
|
||||
@@ -146,9 +146,9 @@
|
||||
"CollectPublicationActionImpl": "0xcc3f120f3d3bf860b910b228d2114f474b382c1d",
|
||||
"LitAccessControlImpl": "0x79dcA158B2A019EA2377f5989066a1ac0aC20e10",
|
||||
"LitAccessControl": "0x98a6C31E43b158198da95Ef1242faCA868424187",
|
||||
"ProfileTokenURI": "0xE01e1017Eb1D49Aa7034628cd2e3021536cdeBE5",
|
||||
"HandleTokenURI": "0x9632dC8eb31CEC8fcd166a99C1Da179716aE2E48",
|
||||
"FollowTokenURI": "0x07D8a9FEdef6DC7004b9ae0935eA178bFa8bBdF1",
|
||||
"ProfileTokenURI": "0xCCF77B802160326282F260bb6e275333fEA9E76C",
|
||||
"HandleTokenURI": "0x33b7C0692DD8267f936936C0A0f7079144d78B92",
|
||||
"FollowTokenURI": "0x1a4D3f97770925A14997B351C5cC3Cd47192a5B8"
|
||||
"PermissionlessCreatorImpl": "0x9f077d03DBf4aB8c68e181baA3308F3B12C52Ae8",
|
||||
"PermissionlessCreator": "0x0b5e6100243f793e480DE6088dE6bA70aA9f3872"
|
||||
},
|
||||
@@ -285,7 +285,9 @@
|
||||
"AnonymousProfileId": "3",
|
||||
"FollowTokenURI": "0xB9136f393861822cF2CAEa7E7062f6c71354d46f",
|
||||
"PermissionlessCreatorImpl": "0xBb841c444655558176aBf97993b7f653A2B24994",
|
||||
"PermissionlessCreator": "0xCb4FB63c3f13CB83cCD6F10E9e5F29eC250329Cc"
|
||||
"PermissionlessCreator": "0xCb4FB63c3f13CB83cCD6F10E9e5F29eC250329Cc",
|
||||
"FreeCreditsProvider": "0xC3161EeE3A055860125eE0b70412e4e4081852dD",
|
||||
"ProfileTokenURI": "0x19787A2E8b396077B99F381c39B2DB5781FF6D38"
|
||||
},
|
||||
"sandbox": {
|
||||
"chainId": 80001,
|
||||
|
||||
116
broadcast/DeployFollowTokenURI.s.sol/137/9352fad2-latest.json
Normal file
116
broadcast/DeployFollowTokenURI.s.sol/137/9352fad2-latest.json
Normal file
File diff suppressed because one or more lines are too long
116
broadcast/DeployFollowTokenURI.s.sol/137/run-1701453276.json
Normal file
116
broadcast/DeployFollowTokenURI.s.sol/137/run-1701453276.json
Normal file
File diff suppressed because one or more lines are too long
167
broadcast/DeployHandleTokenURI.s.sol/137/9352fad2-latest.json
Normal file
167
broadcast/DeployHandleTokenURI.s.sol/137/9352fad2-latest.json
Normal file
File diff suppressed because one or more lines are too long
167
broadcast/DeployHandleTokenURI.s.sol/137/run-1701466810.json
Normal file
167
broadcast/DeployHandleTokenURI.s.sol/137/run-1701466810.json
Normal file
File diff suppressed because one or more lines are too long
1901
broadcast/DeployProfileTokenURI.s.sol/137/9352fad2-latest.json
Normal file
1901
broadcast/DeployProfileTokenURI.s.sol/137/9352fad2-latest.json
Normal file
File diff suppressed because one or more lines are too long
1901
broadcast/DeployProfileTokenURI.s.sol/137/run-1701451447.json
Normal file
1901
broadcast/DeployProfileTokenURI.s.sol/137/run-1701451447.json
Normal file
File diff suppressed because one or more lines are too long
@@ -22,6 +22,8 @@ interface IModuleRegistry {
|
||||
|
||||
function isModuleRegisteredAs(address moduleAddress, uint256 moduleType) external view returns (bool);
|
||||
|
||||
function emitModuleMetadataRefresh(address moduleAddress) external;
|
||||
|
||||
// Currencies functions
|
||||
|
||||
function verifyErc20Currency(address currencyAddress) external returns (bool);
|
||||
|
||||
@@ -128,7 +128,7 @@ library HandleSVG {
|
||||
if (faceColor == FaceColors.GREEN) {
|
||||
return '#A0D170';
|
||||
} else if (faceColor == FaceColors.PEACH) {
|
||||
return '#FFD5D2';
|
||||
return '#FFD2DD';
|
||||
} else if (faceColor == FaceColors.PURPLE) {
|
||||
return '#EAD7FF';
|
||||
} else if (faceColor == FaceColors.BLUE) {
|
||||
@@ -140,7 +140,7 @@ library HandleSVG {
|
||||
|
||||
function getBaseGradients() internal pure returns (string memory) {
|
||||
return
|
||||
'<radialGradient id="green" cx="0" cy="0" r="1" gradientTransform="matrix(275 -275 362 362 0 275)" gradientUnits="userSpaceOnUse"><stop stop-color="#DFFFBF"/><stop offset="1" stop-color="#EFD"/></radialGradient><radialGradient id="peach" cx="0" cy="0" r="1" gradientTransform="matrix(275 -275 362 362 0 275)" gradientUnits="userSpaceOnUse"><stop stop-color="#FFDFDD"/><stop offset="1" stop-color="#FFF0EF"/></radialGradient><radialGradient id="purple" cx="0" cy="0" r="1" gradientTransform="matrix(275 -275 362 362 0 275)" gradientUnits="userSpaceOnUse"><stop stop-color="#F1E4FF"/><stop offset="1" stop-color="#F8F1FF"/></radialGradient><radialGradient id="blue" cx="0" cy="0" r="1" gradientTransform="matrix(275 -275 362 362 0 275)" gradientUnits="userSpaceOnUse"><stop stop-color="#E6EAFF"/><stop offset="1" stop-color="#EFF2FF"/></radialGradient>';
|
||||
'<radialGradient id="green" cx="0" cy="0" r="1" gradientTransform="matrix(275 -275 362 362 0 275)" gradientUnits="userSpaceOnUse"><stop stop-color="#DFFFBF" /><stop offset="1" stop-color="#EFD" /></radialGradient><radialGradient id="peach" cx="0" cy="0" r="1" gradientTransform="matrix(275 -275 362 362 0 275)" gradientUnits="userSpaceOnUse"><stop stop-color="#FFE7F0" /><stop offset="1" stop-color="#FFF3F8" /></radialGradient><radialGradient id="purple" cx="0" cy="0" r="1" gradientTransform="matrix(275 -275 362 362 0 275)" gradientUnits="userSpaceOnUse"><stop stop-color="#F1E4FF" /><stop offset="1" stop-color="#F8F1FF" /></radialGradient><radialGradient id="blue" cx="0" cy="0" r="1" gradientTransform="matrix(275 -275 362 362 0 275)" gradientUnits="userSpaceOnUse"><stop stop-color="#E6EAFF" /><stop offset="1" stop-color="#EFF2FF" /></radialGradient>';
|
||||
}
|
||||
|
||||
struct CharWidth {
|
||||
|
||||
@@ -7,13 +7,17 @@ import {BodyJacket} from './Body/BodyJacket.sol';
|
||||
import {BodyHoodie} from './Body/BodyHoodie.sol';
|
||||
import {BodyTanktop} from './Body/BodyTanktop.sol';
|
||||
import {BodyTShirt} from './Body/BodyTShirt.sol';
|
||||
import {BodyShibuya} from './Body/BodyShibuya.sol';
|
||||
|
||||
import {LensColors} from './LensColors.sol';
|
||||
|
||||
library Body {
|
||||
enum BodyVariants {
|
||||
HOODIE,
|
||||
JACKET,
|
||||
TANKTOP,
|
||||
TSHIRT
|
||||
TSHIRT,
|
||||
SHIBUYA
|
||||
}
|
||||
|
||||
enum BodyColors {
|
||||
@@ -21,7 +25,9 @@ library Body {
|
||||
LIGHT,
|
||||
DARK,
|
||||
PURPLE,
|
||||
BLUE
|
||||
BLUE,
|
||||
PINK,
|
||||
GOLD
|
||||
}
|
||||
|
||||
function getBody(
|
||||
@@ -50,6 +56,8 @@ library Body {
|
||||
return BodyTanktop.getBody(handsVariant);
|
||||
} else if (bodyVariant == BodyVariants.TSHIRT) {
|
||||
return BodyTShirt.getBody(handsVariant);
|
||||
} else if (bodyVariant == BodyVariants.SHIBUYA) {
|
||||
return BodyShibuya.getBody(handsVariant);
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
@@ -65,53 +73,61 @@ library Body {
|
||||
'<style>.bodyColor1 {fill: ',
|
||||
getPrimaryBodyColor(bodyVariant, bodyColor),
|
||||
'}.bodyColor2 {fill: ',
|
||||
getSecondaryBodyColor(bodyColor),
|
||||
getSecondaryBodyColor(bodyVariant, bodyColor),
|
||||
'}.handsColor {fill: ',
|
||||
Skin.getSkinColor(Skin.SkinColors(uint8(handsColor))),
|
||||
'}.jacketShirt {fill: ',
|
||||
bodyColor == BodyColors.GOLD ? LensColors.lightGold : LensColors.white,
|
||||
'}.bStr1 {stroke: #000;stroke-linecap: round;stroke-miterlimit: 10;}.bStr2 {stroke: #000;stroke-linecap: round;stroke-linejoin: round;}.bStr3 {stroke: #000;stroke-linecap: round;stroke-opacity: .1;stroke-width: 2;}</style>'
|
||||
);
|
||||
}
|
||||
|
||||
function getPrimaryBodyColor(BodyVariants bodyVariant, BodyColors bodyColor) public pure returns (string memory) {
|
||||
if (bodyColor == BodyColors.GREEN) {
|
||||
return '#F4FFDC';
|
||||
return LensColors.lightGreen;
|
||||
} else if (bodyColor == BodyColors.LIGHT) {
|
||||
return '#FFFFFF';
|
||||
return LensColors.white;
|
||||
} else if (bodyColor == BodyColors.DARK) {
|
||||
if (bodyVariant == BodyVariants.JACKET) {
|
||||
return '#EAEAEA';
|
||||
return LensColors.lightGray;
|
||||
} else if (bodyVariant == BodyVariants.SHIBUYA) {
|
||||
return LensColors.gray;
|
||||
} else {
|
||||
return '#575757';
|
||||
return LensColors.dark;
|
||||
}
|
||||
} else if (bodyColor == BodyColors.PURPLE) {
|
||||
if (bodyVariant == BodyVariants.HOODIE) {
|
||||
return '#EAD7FF';
|
||||
} else {
|
||||
return '#F3EAFF';
|
||||
}
|
||||
return LensColors.lightPurple;
|
||||
} else if (bodyColor == BodyColors.BLUE) {
|
||||
if (bodyVariant == BodyVariants.HOODIE) {
|
||||
return '#D9E0FF';
|
||||
} else {
|
||||
return '#ECF0FF';
|
||||
}
|
||||
return LensColors.lightBlue;
|
||||
} else if (bodyColor == BodyColors.PINK) {
|
||||
return LensColors.lightPink;
|
||||
} else if (bodyColor == BodyColors.GOLD) {
|
||||
return LensColors.lightGold;
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
}
|
||||
|
||||
// We don't need variant because this is only used in Jacket
|
||||
function getSecondaryBodyColor(BodyColors bodyColor) public pure returns (string memory) {
|
||||
function getSecondaryBodyColor(BodyVariants bodyVariant, BodyColors bodyColor) public pure returns (string memory) {
|
||||
if (bodyColor == BodyColors.GREEN) {
|
||||
return '#93A97D';
|
||||
return LensColors.darkGreen;
|
||||
} else if (bodyColor == BodyColors.LIGHT) {
|
||||
return '#EAEAEA';
|
||||
if (bodyVariant == BodyVariants.SHIBUYA) {
|
||||
return LensColors.gray;
|
||||
} else {
|
||||
return LensColors.lightGray;
|
||||
}
|
||||
} else if (bodyColor == BodyColors.DARK) {
|
||||
return '#575757';
|
||||
return LensColors.dark;
|
||||
} else if (bodyColor == BodyColors.PINK) {
|
||||
return LensColors.darkPink;
|
||||
} else if (bodyColor == BodyColors.PURPLE) {
|
||||
return '#EAD7FF';
|
||||
return LensColors.darkPurple;
|
||||
} else if (bodyColor == BodyColors.BLUE) {
|
||||
return '#D9E0FF';
|
||||
return LensColors.darkBlue;
|
||||
} else if (bodyColor == BodyColors.GOLD) {
|
||||
return LensColors.baseGold;
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
21
contracts/libraries/svgs/Profile/Body/BodyShibuya.sol
Normal file
21
contracts/libraries/svgs/Profile/Body/BodyShibuya.sol
Normal file
@@ -0,0 +1,21 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import {Hands} from '../Hands.sol';
|
||||
|
||||
library BodyShibuya {
|
||||
function getBody(Hands.HandsVariants handsVariant) public pure returns (string memory) {
|
||||
if (handsVariant == Hands.HandsVariants.HANDSDOWN) {
|
||||
return
|
||||
'<path class="handsColor" d="m55.9 209.2 13.9 6.7-4.5 17.8 2 12-3 5.8-8.4 1.4H44.4l-9.4-7.2 1.5-13.4 10.4-6.8 9-16.3Zm98.3 1-14 6.7 4.5 17.8-2 12 3 4.8 8.5 2.4h11.4l9.4-7.2-1.5-13.5-10.4-6.7-9-16.3Z"/><path class="bStr1" stroke-width="4" d="M55.9 209.4c-2.6 4.3-5.1 8.6-7.7 13.5a16.2 16.2 0 0 1-6 5.8 15 15 0 0 0-7 10.1 13.6 13.6 0 0 0 7.4 14.1c4.2 2 9.5 1.4 13.3-1.2"/><path class="bStr1" stroke-width="2" d="M57.8 247.6a11.2 11.2 0 0 1-5 4.8m99.4-4.8a11 11 0 0 0 5 4.8"/><path class="bStr1" stroke-width="4" d="M56 251.7a8 8 0 0 0 7.9 0 7.1 7.1 0 0 0 3.7-6.5m86.4-35.8c2.5 4.3 5 8.6 7.6 13.5 1.3 2.5 3.7 4.3 6.1 5.8a15 15 0 0 1 7 10.1c.9 5.6-2.2 11.6-7.4 14.1-4.2 2-9.6 1.4-13.3-1.2m-.2 0a8 8 0 0 1-7.8 0c-2.4-1.4-3.9-3.3-3.8-6"/><path class="bodyColor2" d="m68.8 187.6 20.5-5.6h29.5l20.5 5.6 10 8.2 5 7 5.5 11.8 3.7 4.2 2.9 4.7-7.7 6.2-13.3 3.8v8l-5 5.6-8.8 4.2-11.9 4.6-12.9 1.6H97L84.2 254l-13.6-7-6.5-5.7V233l-14.2-3.6-6.6-6.2 5.5-7.6 5.3-9.4 8.5-13.3 6.2-5.3Z"/><path class="bStr2" stroke-width="4" d="m65.2 233.5 6.7-24.6"/><path class="bodyColor1" d="M126.3 227.2c6 5.7 8.8 15.2 5.1 22.6l.3.7a64.3 64.3 0 0 1-53.4 0l.3-.7c-3.6-7.4-.9-17 5-22.6 6-5.7 11.8-7.7 21.4-7.7 9.6 0 15.4 2 21.3 7.7Z"/><path class="bStr2" stroke-width="3" d="M78.6 249.8c-3.6-7.4-.9-17 5-22.6 6-5.7 11.8-7.7 21.4-7.7m26.4 30.3c3.7-7.4 1-17-5-22.6-6-5.7-11.8-7.7-21.4-7.7"/><path class="bStr2" stroke-width="4" d="M69.4 187.8c-5.6 1.8-9.7 6.9-12.7 12.2-3 5.3-5 11.1-8.5 16.1a10.4 10.4 0 0 0-4.9 7.3c5.3 5.7 14 9 22.1 9.2-.7 3-1.5 6 0 8.5a16 16 0 0 0 5.5 6 67.4 67.4 0 0 0 34 10.4"/><path class="bStr2" stroke-width="4" d="M140.3 187.8c5.6 1.8 9.7 6.9 12.7 12.2 3 5.3 5 11.1 8.5 16.1 2.6 1.6 4.4 4.3 5 7.3-5.3 5.7-14.1 9-22.2 9.2.7 3 1.5 6 0 8.5-1.5 2.6-3 4.5-5.5 6a66.8 66.8 0 0 1-34 10.4m39.8-24-6.8-24.6"/><path stroke="#000" stroke-linecap="round" stroke-width="2" d="M49.3 216.5s2.3 2 4 3c1.8 1 5.5 2 5.5 2m101-5s-2.3 2-4 3c-1.8 1-5.5 2-5.5 2"/><path fill="#fff" fill-rule="evenodd" d="M125.5 205.3c7.4-1.4 14.7-8 17.5-15.8 0 0-7.2-3.8-12.2-5.2-9.9-2.8-25.6-1.5-25.6-1.5s-15.5-.7-24.8 1.5a86.5 86.5 0 0 0-13.6 5.2 25.4 25.4 0 0 0 17.5 15.8c6.2 1.3 12.9-.8 18-5.4a6.6 6.6 0 0 0 2.9-3.9 8.4 8.4 0 0 0 2.3 3.9 20.9 20.9 0 0 0 18 5.4Z" clip-rule="evenodd"/><path class="bStr2" stroke-width="3.5" d="M66.8 189.5a25.4 25.4 0 0 0 17.5 15.8c6.2 1.3 12.9-.8 18-5.4a25 25 0 0 0 2.6-2.8m38.1-7.6a25.4 25.4 0 0 1-17.5 15.8 20.9 20.9 0 0 1-18-5.4c-1-.9-1.8-1.8-2.6-2.8"/><path class="bStr2" stroke-width="2.5" d="M89.4 199.7a16 16 0 0 0 5-5.5M82 197.5c1.3-.8 2.4-2 3.1-3.4m35.1 5.6a16 16 0 0 1-5-5.5m12.4 3.3c-1.3-.8-2.4-2-3.1-3.4"/><path class="bStr2" stroke-width="4" d="M69.4 187.8s4.5-6.3 35.5-6.3 35.4 6.3 35.4 6.3"/></svg>';
|
||||
} else if (handsVariant == Hands.HandsVariants.PEACEDOUBLE) {
|
||||
return
|
||||
'<path class="bodyColor2" d="m68.8 187.6 20.5-5.6h29.5l20.5 5.6 10 8.2 5 7 5.5 11.8 4.3 4-7.4 5.9-13 4 1.7 5v8l-5 5.6-8.8 4.2-11.9 4.6-12.9 1.6H97L84.2 254l-13.6-7-6.5-5.7 3-13-13.7-2.8-7-5.3 2.4-4.7 5.3-9.4 8.5-13.3 6.2-5.3Z"/><path class="bStr2" stroke-width="4" d="m66.2 233.5 6.7-24.6"/><path class="bodyColor1" d="M126.3 227.2c6 5.7 8.8 15.2 5.1 22.6l.3.7a64.3 64.3 0 0 1-53.4 0l.3-.7c-3.6-7.4-.9-17 5-22.6 6-5.7 11.8-7.7 21.4-7.7 9.6 0 15.4 2 21.3 7.7Z"/><path class="bStr2" stroke-width="3" d="M78.6 249.8c-3.6-7.4-.9-17 5-22.6 6-5.7 11.8-7.7 21.4-7.7m26.4 30.3c3.7-7.4 1-17-5-22.6-6-5.7-11.8-7.7-21.4-7.7"/><path class="bStr2" stroke-width="4" d="M69.4 187.8c-5.6 1.8-9.7 6.9-12.7 12.2-3 5.3-5 11.1-8.5 16.1-2.6 1.6-2 1.2-2.5 4.1 4.5 5 21.8 7.9 21.8 7.9l-1.1 4.5s-1.5 7.4 0 10c1.5 2.5 2 3 4.5 4.5a67.4 67.4 0 0 0 34 10.4"/><path class="bStr2" stroke-width="4" d="M140.3 187.8c5.6 1.8 9.7 6.9 12.7 12.2 3 5.3 5 11.1 8.5 16.1 2.6 1.6 1.3 1.2 1.8 4.1-4.5 5-20.2 7.9-20.2 7.9l1.2 4.5c.7 3 1.5 6 0 8.5-1.5 2.6-3 4.5-5.5 6a66.8 66.8 0 0 1-34 10.4m39.8-24-6.8-24.6"/><path stroke="#000" stroke-linecap="round" stroke-width="2" d="M49.3 216.5s2.3 2 4 3c1.8 1 5.5 2 5.5 2m101-5s-2.3 2-4 3c-1.8 1-5.5 2-5.5 2"/><path fill="#fff" fill-rule="evenodd" d="M125.5 205.3c7.4-1.4 14.7-8 17.5-15.8 0 0-7.2-3.8-12.2-5.2-9.9-2.8-25.6-1.5-25.6-1.5s-15.5-.7-24.8 1.5a86.5 86.5 0 0 0-13.6 5.2 25.4 25.4 0 0 0 17.5 15.8c6.2 1.3 12.9-.8 18-5.4a6.6 6.6 0 0 0 2.9-3.9 8.4 8.4 0 0 0 2.3 3.9 20.9 20.9 0 0 0 18 5.4Z" clip-rule="evenodd"/><path class="bStr2" stroke-width="3.5" d="M66.8 189.5a25.4 25.4 0 0 0 17.5 15.8c6.2 1.3 12.9-.8 18-5.4a25 25 0 0 0 2.6-2.8m38.1-7.6a25.4 25.4 0 0 1-17.5 15.8 20.9 20.9 0 0 1-18-5.4c-1-.9-1.8-1.8-2.6-2.8"/><path class="bStr2" stroke-width="2.5" d="M89.4 199.7a16 16 0 0 0 5-5.5M82 197.5c1.3-.8 2.4-2 3.1-3.4m35.1 5.6a16 16 0 0 1-5-5.5m12.4 3.3c-1.3-.8-2.4-2-3.1-3.4"/><path class="bStr2" stroke-width="4" d="M69.4 187.8s4.5-6.3 35.5-6.3 35.4 6.3 35.4 6.3"/></svg>';
|
||||
} else if (handsVariant == Hands.HandsVariants.PEACESINGLE) {
|
||||
return
|
||||
'<path class="handsColor" d="m55.9 209.2 13.9 6.7-4.5 17.8 2 12-3 5.8-8.4 1.4H44.4l-9.4-7.2 1.5-13.4 10.4-6.8 9-16.3Z"/><path class="bStr1" stroke-width="4" d="M55.9 209.4c-2.6 4.3-5.1 8.6-7.7 13.5a16.2 16.2 0 0 1-6 5.8 15 15 0 0 0-7 10.1 13.6 13.6 0 0 0 7.4 14.1c4.2 2 9.5 1.4 13.3-1.2"/><path class="bStr1" stroke-width="2" d="M57.8 247.6a11.2 11.2 0 0 1-5 4.8"/><path class="bStr1" stroke-width="4" d="M56 251.7a8 8 0 0 0 7.9 0 7.1 7.1 0 0 0 3.7-6.5"/><path class="bodyColor2" d="m68.8 187.6 20.5-5.6h29.5l20.5 5.6 10 8.2 5 7 5.5 11.8 4.3 4-7.4 5.9-13 4 1.7 5v8l-5 5.6-8.8 4.2-11.9 4.6-12.9 1.6H97L84.2 254l-13.6-7-6.5-5.7V233l-14.2-3.6-6.6-6.2 5.5-7.6 5.3-9.4 8.5-13.3 6.2-5.3Z"/><path class="bStr2" stroke-width="4" d="m66.2 233.5 6.7-24.6"/><path class="bodyColor1" d="M126.3 227.2c6 5.7 8.8 15.2 5.1 22.6l.3.7a64.3 64.3 0 0 1-53.4 0l.3-.7c-3.6-7.4-.9-17 5-22.6 6-5.7 11.8-7.7 21.4-7.7 9.6 0 15.4 2 21.3 7.7Z"/><path class="bStr2" stroke-width="3" d="M78.6 249.8c-3.6-7.4-.9-17 5-22.6 6-5.7 11.8-7.7 21.4-7.7m26.4 30.3c3.7-7.4 1-17-5-22.6-6-5.7-11.8-7.7-21.4-7.7"/><path class="bStr2" stroke-width="4" d="M69.4 187.8c-5.6 1.8-9.7 6.9-12.7 12.2-3 5.3-5 11.1-8.5 16.1a10.4 10.4 0 0 0-4.9 7.3c5.3 5.7 15 9.1 23.1 9.2-.7 3-1.5 7.4 0 10 1.5 2.5 2 3 4.5 4.5a67.4 67.4 0 0 0 34 10.4"/><path class="bStr2" stroke-width="4" d="M140.3 187.8c5.6 1.8 9.7 6.9 12.7 12.2 3 5.3 5 11.1 8.5 16.1 2.6 1.6 1.3 1.2 1.8 4.1-4.5 5-20.2 7.9-20.2 7.9l1.2 4.5c.7 3 1.5 6 0 8.5-1.5 2.6-3 4.5-5.5 6a66.8 66.8 0 0 1-34 10.4m39.8-24-6.8-24.6"/><path stroke="#000" stroke-linecap="round" stroke-width="2" d="M49.3 216.5s2.3 2 4 3c1.8 1 5.5 2 5.5 2m101-5s-2.3 2-4 3c-1.8 1-5.5 2-5.5 2"/><path fill="#fff" fill-rule="evenodd" d="M125.5 205.3c7.4-1.4 14.7-8 17.5-15.8 0 0-7.2-3.8-12.2-5.2-9.9-2.8-25.6-1.5-25.6-1.5s-15.5-.7-24.8 1.5a86.5 86.5 0 0 0-13.6 5.2 25.4 25.4 0 0 0 17.5 15.8c6.2 1.3 12.9-.8 18-5.4a6.6 6.6 0 0 0 2.9-3.9 8.4 8.4 0 0 0 2.3 3.9 20.9 20.9 0 0 0 18 5.4Z" clip-rule="evenodd"/><path class="bStr2" stroke-width="3.5" d="M66.8 189.5a25.4 25.4 0 0 0 17.5 15.8c6.2 1.3 12.9-.8 18-5.4a25 25 0 0 0 2.6-2.8m38.1-7.6a25.4 25.4 0 0 1-17.5 15.8 20.9 20.9 0 0 1-18-5.4c-1-.9-1.8-1.8-2.6-2.8"/><path class="bStr2" stroke-width="2.5" d="M89.4 199.7a16 16 0 0 0 5-5.5M82 197.5c1.3-.8 2.4-2 3.1-3.4m35.1 5.6a16 16 0 0 1-5-5.5m12.4 3.3c-1.3-.8-2.4-2-3.1-3.4"/><path class="bStr2" stroke-width="4" d="M69.4 187.8s4.5-6.3 35.5-6.3 35.4 6.3 35.4 6.3"/></svg>';
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,22 +1,32 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import {LensColors} from './LensColors.sol';
|
||||
import {Skin} from './Helpers.sol';
|
||||
|
||||
library Face {
|
||||
enum FaceVariants {
|
||||
BUBBLEGUM,
|
||||
GRIN_TONGUE,
|
||||
GRIN,
|
||||
LAUGH,
|
||||
LOVE,
|
||||
OOPS,
|
||||
SLEEPY,
|
||||
SMILE_TEETH,
|
||||
SMILE,
|
||||
SMIRK,
|
||||
TONGUE,
|
||||
WINK,
|
||||
WOW_TONGUE,
|
||||
WOW
|
||||
// Face.sol
|
||||
BUBBLEGUM, // 0
|
||||
GRIN_TONGUE, // 1
|
||||
GRIN, // 2
|
||||
LAUGH, // 3
|
||||
LOVE, // 4
|
||||
OOPS, // 5
|
||||
SLEEPY, // 6
|
||||
SMILE_TEETH, // 7
|
||||
SMILE, // 8
|
||||
SMIRK, // 9
|
||||
TONGUE, // 10
|
||||
WINK, // 11
|
||||
// Face2.sol
|
||||
WOW_TONGUE, // 12
|
||||
WOW, // 13
|
||||
BABY, // 14
|
||||
KAWAII, // 15
|
||||
PIXIE, // 16
|
||||
TODDLER, // 17
|
||||
VAMP // 18
|
||||
}
|
||||
|
||||
enum FaceColors {
|
||||
@@ -24,122 +34,172 @@ library Face {
|
||||
GOLD
|
||||
}
|
||||
|
||||
// // We take the 2nd byte from the left for the headwear variant
|
||||
// uint8 variant = uint8((seed >> 240) & 0xFF) % 14;
|
||||
function getFace(FaceVariants faceVariant, FaceColors faceColor) external pure returns (string memory) {
|
||||
function getFace(
|
||||
FaceVariants faceVariant,
|
||||
FaceColors faceColor,
|
||||
Skin.SkinColors skinColor
|
||||
) external pure returns (string memory) {
|
||||
string memory faceSvgStart = string.concat(
|
||||
'<svg xmlns="http://www.w3.org/2000/svg" width="210" height="335" fill="none">',
|
||||
_getStyleTag(faceColor)
|
||||
_getStyleTag(faceColor, skinColor)
|
||||
);
|
||||
return string.concat(faceSvgStart, getFaceVariant(faceVariant));
|
||||
}
|
||||
|
||||
function getFaceVariant(FaceVariants faceVariant) internal pure returns (string memory) {
|
||||
if (faceVariant == FaceVariants.BUBBLEGUM) {
|
||||
// bubblegum
|
||||
return
|
||||
string.concat(
|
||||
faceSvgStart,
|
||||
'<path class="faceFillColor" fill-rule="evenodd" d="M94.1 139c.7-.4 1-1.1.8-1.8-1.4-3.7-4.5-6.2-8-6.2-5 0-8.9 4.7-8.9 10.4s4 10.4 8.8 10.4c3.5 0 6.5-2.4 8-5.8.3-.7-.1-1.5-.8-1.8l-3.6-1.5c-1-.4-1-1.8 0-2.2l3.7-1.6Zm20.8 2.4c0-5.7 4-10.4 8.8-10.4 3.7 0 7 2.7 8.2 6.5.3.7-.1 1.4-.8 1.7l-3 1.3c-1 .4-1 1.8 0 2.2l2.9 1.2c.7.3 1 1 .8 1.8-1.4 3.6-4.5 6.1-8 6.1-5 0-8.9-4.7-8.9-10.4Z" clip-rule="evenodd"/><path class="faceFillColor" fill-opacity=".12" d="M74.7 154.2a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm5.1 3a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.4Zm-4.5 1.9a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm55.4-3.4a1.5 1.5 0 1 1-2.5 1.4 1.5 1.5 0 0 1 2.5-1.4Zm5.1-3a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Zm-.6 4.9a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Z"/><circle cx="105" cy="161.581" r="3.466" class="faceFillColor"/><path class="faceStrokeColor" stroke-linecap="round" stroke-width="2.5" d="M99 166s1.7 3.2 6 3.2 6-3.2 6-3.2m0-8.8s-1.7-3.2-6-3.2-6 3.2-6 3.2"/><path fill="#FFCFEC" fill-opacity=".8" class="faceStrokeColor" stroke-width="2.75" d="M94.3 144.7A32 32 0 0 0 34.5 161 32 32 0 0 0 94 178l2.3-3.8a310 310 0 0 1 4-6.6l3-4a3.4 3.4 0 0 0 0-4l-2.2-3.2a51 51 0 0 1-3.4-5.7l-.9-1.7c-.8-1.4-1.5-2.9-2.4-4.3Z"/><circle cx="-1.289" cy="11.289" r="3.289" fill="#fff" fill-opacity=".45" transform="scale(-1 1) rotate(5 -1761 -904)"/><path fill="#fff" fill-opacity=".45" d="M87.3 150.8a4 4 0 0 1-7.4 3.4 14.7 14.7 0 0 0-7.3-8l-1.4-.8A2.5 2.5 0 0 1 70 142l.1-.3c.6-1.1 0-2.6-1.3-2.8-1.5-.2-2.8-.3-4.1-.2a1.5 1.5 0 0 1-.4-2.9 19.4 19.4 0 0 1 13.7 4c1 .5 1.8 1.2 2.8 2 2 1.8 3.7 4 4.7 5.7a34.4 34.4 0 0 1 1.6 3v.1h.1v.1"/></svg>'
|
||||
);
|
||||
'<path class="faceFillColor" fill-rule="evenodd" d="M94.1 139c.7-.4 1-1.1.8-1.8-1.4-3.7-4.5-6.2-8-6.2-5 0-8.9 4.7-8.9 10.4s4 10.4 8.8 10.4c3.5 0 6.5-2.4 8-5.8.3-.7-.1-1.5-.8-1.8l-3.6-1.5c-1-.4-1-1.8 0-2.2l3.7-1.6Zm20.8 2.4c0-5.7 4-10.4 8.8-10.4 3.7 0 7 2.7 8.2 6.5.3.7-.1 1.4-.8 1.7l-3 1.3c-1 .4-1 1.8 0 2.2l2.9 1.2c.7.3 1 1 .8 1.8-1.4 3.6-4.5 6.1-8 6.1-5 0-8.9-4.7-8.9-10.4Z" clip-rule="evenodd"/><path class="faceFillColor" fill-opacity=".12" d="M74.7 154.2a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm5.1 3a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.4Zm-4.5 1.9a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm55.4-3.4a1.5 1.5 0 1 1-2.5 1.4 1.5 1.5 0 0 1 2.5-1.4Zm5.1-3a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Zm-.6 4.9a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Z"/><circle cx="105" cy="161.581" r="3.466" class="faceFillColor"/><path class="faceStrokeColor" stroke-linecap="round" stroke-width="2.5" d="M99 166s1.7 3.2 6 3.2 6-3.2 6-3.2m0-8.8s-1.7-3.2-6-3.2-6 3.2-6 3.2"/><path fill="#FFCFEC" fill-opacity=".8" class="faceStrokeColor" stroke-width="2.75" d="M94.3 144.7A32 32 0 0 0 34.5 161 32 32 0 0 0 94 178l2.3-3.8a310 310 0 0 1 4-6.6l3-4a3.4 3.4 0 0 0 0-4l-2.2-3.2a51 51 0 0 1-3.4-5.7l-.9-1.7c-.8-1.4-1.5-2.9-2.4-4.3Z"/><circle cx="-1.289" cy="11.289" r="3.289" fill="#fff" fill-opacity=".45" transform="scale(-1 1) rotate(5 -1761 -904)"/><path fill="#fff" fill-opacity=".45" d="M87.3 150.8a4 4 0 0 1-7.4 3.4 14.7 14.7 0 0 0-7.3-8l-1.4-.8A2.5 2.5 0 0 1 70 142l.1-.3c.6-1.1 0-2.6-1.3-2.8-1.5-.2-2.8-.3-4.1-.2a1.5 1.5 0 0 1-.4-2.9 19.4 19.4 0 0 1 13.7 4c1 .5 1.8 1.2 2.8 2 2 1.8 3.7 4 4.7 5.7a34.4 34.4 0 0 1 1.6 3v.1h.1v.1"/></svg>';
|
||||
} else if (faceVariant == FaceVariants.GRIN_TONGUE) {
|
||||
// grin-tongue
|
||||
return
|
||||
string.concat(
|
||||
faceSvgStart,
|
||||
'<path class="faceFillColor" fill-opacity=".12" d="M74.7 154.2a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm5.1 3a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.4Zm-4.5 1.9a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm55.4-3.4a1.5 1.5 0 1 1-2.5 1.4 1.5 1.5 0 0 1 2.5-1.4Zm5.1-3a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Zm-.6 4.9a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Z"/><path class="faceStrokeColor" stroke-linecap="round" stroke-width="3.5" d="M130.8 145.9s-2.1-4.2-7.4-4.5a8.8 8.8 0 0 0-7.8 3.7m-36.4.8s2.1-4.2 7.4-4.5a8.8 8.8 0 0 1 7.8 3.7"/><path class="faceFillColor" d="M105 172c-15 0-20.6-8-18.6-13.6 1.4-4.1 6-6.4 10.4-5a35 35 0 0 0 8.2 1.6c2.3 0 6.3-1 8.2-1.6 4.3-1.4 9 .9 10.4 5 2 5.5-3.6 13.6-18.6 13.6Z"/><path class="faceStrokeColor" fill="#FFDFE7" stroke-width="2.75" d="M98.7 161.4h1.3l1.7.4 1 .3.8.2 1.5.2 1.5-.2.9-.2.9-.3a21.3 21.3 0 0 1 1.8-.3l1.2-.1c2.2.3 3.6 1.3 4.4 2.6a8 8 0 0 1 .7 5.2 11.1 11.1 0 0 1-11.4 9.4 11.1 11.1 0 0 1-11.4-9.4c-.4-2-.1-3.8.7-5.2.8-1.3 2.2-2.3 4.4-2.6Z"/><path fill="#F5C8D4" d="M106 163.8v7a1 1 0 0 1-2 0v-7l1 .2 1-.2Z"/></svg>'
|
||||
);
|
||||
'<path class="faceFillColor" fill-opacity=".12" d="M74.7 154.2a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm5.1 3a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.4Zm-4.5 1.9a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm55.4-3.4a1.5 1.5 0 1 1-2.5 1.4 1.5 1.5 0 0 1 2.5-1.4Zm5.1-3a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Zm-.6 4.9a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Z"/><path class="faceStrokeColor" stroke-linecap="round" stroke-width="3.5" d="M130.8 145.9s-2.1-4.2-7.4-4.5a8.8 8.8 0 0 0-7.8 3.7m-36.4.8s2.1-4.2 7.4-4.5a8.8 8.8 0 0 1 7.8 3.7"/><path class="faceFillColor" d="M105 172c-15 0-20.6-8-18.6-13.6 1.4-4.1 6-6.4 10.4-5a35 35 0 0 0 8.2 1.6c2.3 0 6.3-1 8.2-1.6 4.3-1.4 9 .9 10.4 5 2 5.5-3.6 13.6-18.6 13.6Z"/><path class="faceStrokeColor" fill="#FFDFE7" stroke-width="2.75" d="M98.7 161.4h1.3l1.7.4 1 .3.8.2 1.5.2 1.5-.2.9-.2.9-.3a21.3 21.3 0 0 1 1.8-.3l1.2-.1c2.2.3 3.6 1.3 4.4 2.6a8 8 0 0 1 .7 5.2 11.1 11.1 0 0 1-11.4 9.4 11.1 11.1 0 0 1-11.4-9.4c-.4-2-.1-3.8.7-5.2.8-1.3 2.2-2.3 4.4-2.6Z"/><path fill="#F5C8D4" d="M106 163.8v7a1 1 0 0 1-2 0v-7l1 .2 1-.2Z"/></svg>';
|
||||
} else if (faceVariant == FaceVariants.GRIN) {
|
||||
// grin
|
||||
return
|
||||
string.concat(
|
||||
faceSvgStart,
|
||||
'<path class="faceFillColor" fill-opacity=".12" d="M74.7 154.2a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm5.1 3a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.4Zm-4.5 1.9a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm55.4-3.4a1.5 1.5 0 1 1-2.5 1.4 1.5 1.5 0 0 1 2.5-1.4Zm5.1-3a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Zm-.6 4.9a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Z"/><path class="faceStrokeColor" stroke-linecap="round" stroke-width="3" d="M91 159s4.3 6 14 6 14-6 14-6"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M89 159c.8-.4 1.5-1 2-2m30 2c-.8-.4-1.5-1-2-2"/><path class="faceStrokeColor" stroke-linecap="round" stroke-width="3.5" d="M130.8 145.9s-2.1-4.2-7.4-4.5a8.8 8.8 0 0 0-7.8 3.7m-36.4.8s2.1-4.2 7.4-4.5a8.8 8.8 0 0 1 7.8 3.7"/></svg>'
|
||||
);
|
||||
'<path class="faceFillColor" fill-opacity=".12" d="M74.7 154.2a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm5.1 3a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.4Zm-4.5 1.9a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm55.4-3.4a1.5 1.5 0 1 1-2.5 1.4 1.5 1.5 0 0 1 2.5-1.4Zm5.1-3a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Zm-.6 4.9a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Z"/><path class="faceStrokeColor" stroke-linecap="round" stroke-width="3" d="M91 159s4.3 6 14 6 14-6 14-6"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M89 159c.8-.4 1.5-1 2-2m30 2c-.8-.4-1.5-1-2-2"/><path class="faceStrokeColor" stroke-linecap="round" stroke-width="3.5" d="M130.8 145.9s-2.1-4.2-7.4-4.5a8.8 8.8 0 0 0-7.8 3.7m-36.4.8s2.1-4.2 7.4-4.5a8.8 8.8 0 0 1 7.8 3.7"/></svg>';
|
||||
} else if (faceVariant == FaceVariants.LAUGH) {
|
||||
// laugh
|
||||
return
|
||||
string.concat(
|
||||
faceSvgStart,
|
||||
'<path class="faceStrokeColor" stroke-linecap="round" stroke-width="3.5" d="M130.8 143.9s-2.1-4.2-7.4-4.5a8.8 8.8 0 0 0-7.8 3.7m-36.4.8s2.1-4.2 7.4-4.5a8.8 8.8 0 0 1 7.8 3.7"/><path class="faceFillColor" d="M91 157.3c0-4.3 2-6 14-6s14 1.7 14 6-6.3 9.5-14 9.5-14-5.2-14-9.5Z"/><ellipse cx="105" cy="161.607" fill="#FFDFE7" rx="11.15" ry="3.626"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.176" d="M91 157c0-4.3 0-6 14-6s14 1.7 14 6c0 5.2-6.3 9.4-14 9.4s-14-4.2-14-9.4Z"/><path fill="#E3F7FF" d="M70.2 149.5c-2.5 1.1-5.6 1.3-7.6 3.3a5.5 5.5 0 1 0 7.8 7.8c2-2 2.2-5 3.3-7.6l1.4-3.3c.4-1-.6-2-1.6-1.6l-3.3 1.4Z"/><path class="faceStrokeColor" stroke-opacity=".1" stroke-width="2.5" d="M61.7 151.9a6.8 6.8 0 1 0 9.6 9.6 10 10 0 0 0 2.3-4.1l.4-1.5.8-2.4 1.5-3.3c.8-2-1.2-4.1-3.3-3.2l-3.3 1.4-2.4.8-1.5.4a9.5 9.5 0 0 0-4 2.3Z"/><path fill="#E3F7FF" d="M139.8 149.5c2.5 1.1 5.6 1.3 7.6 3.3a5.5 5.5 0 1 1-7.8 7.8c-2-2-2.2-5-3.3-7.6l-1.4-3.3c-.4-1 .6-2 1.6-1.6l3.3 1.4Z"/><path class="faceStrokeColor" stroke-opacity=".1" stroke-width="2.5" d="M148.3 151.9a6.8 6.8 0 0 1-9.6 9.6 10 10 0 0 1-2.3-4.1 50.4 50.4 0 0 1-.4-1.5l-.8-2.4-1.5-3.3c-.8-2 1.2-4.1 3.3-3.2l3.3 1.4 2.4.8 1.5.4c1.4.5 2.9 1.1 4 2.3Z"/></svg>'
|
||||
);
|
||||
'<path class="faceStrokeColor" stroke-linecap="round" stroke-width="3.5" d="M130.8 143.9s-2.1-4.2-7.4-4.5a8.8 8.8 0 0 0-7.8 3.7m-36.4.8s2.1-4.2 7.4-4.5a8.8 8.8 0 0 1 7.8 3.7"/><path class="faceFillColor" d="M91 157.3c0-4.3 2-6 14-6s14 1.7 14 6-6.3 9.5-14 9.5-14-5.2-14-9.5Z"/><ellipse cx="105" cy="161.607" fill="#FFDFE7" rx="11.15" ry="3.626"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.176" d="M91 157c0-4.3 0-6 14-6s14 1.7 14 6c0 5.2-6.3 9.4-14 9.4s-14-4.2-14-9.4Z"/><path fill="#E3F7FF" d="M70.2 149.5c-2.5 1.1-5.6 1.3-7.6 3.3a5.5 5.5 0 1 0 7.8 7.8c2-2 2.2-5 3.3-7.6l1.4-3.3c.4-1-.6-2-1.6-1.6l-3.3 1.4Z"/><path class="faceStrokeColor" stroke-opacity=".1" stroke-width="2.5" d="M61.7 151.9a6.8 6.8 0 1 0 9.6 9.6 10 10 0 0 0 2.3-4.1l.4-1.5.8-2.4 1.5-3.3c.8-2-1.2-4.1-3.3-3.2l-3.3 1.4-2.4.8-1.5.4a9.5 9.5 0 0 0-4 2.3Z"/><path fill="#E3F7FF" d="M139.8 149.5c2.5 1.1 5.6 1.3 7.6 3.3a5.5 5.5 0 1 1-7.8 7.8c-2-2-2.2-5-3.3-7.6l-1.4-3.3c-.4-1 .6-2 1.6-1.6l3.3 1.4Z"/><path class="faceStrokeColor" stroke-opacity=".1" stroke-width="2.5" d="M148.3 151.9a6.8 6.8 0 0 1-9.6 9.6 10 10 0 0 1-2.3-4.1 50.4 50.4 0 0 1-.4-1.5l-.8-2.4-1.5-3.3c-.8-2 1.2-4.1 3.3-3.2l3.3 1.4 2.4.8 1.5.4c1.4.5 2.9 1.1 4 2.3Z"/></svg>';
|
||||
} else if (faceVariant == FaceVariants.LOVE) {
|
||||
// love
|
||||
return
|
||||
string.concat(
|
||||
faceSvgStart,
|
||||
'<path class="faceFillColor" d="M91 160.3c0-4.3 2-6 14-6s14 1.7 14 6-6.3 9.5-14 9.5-14-5.2-14-9.5Z"/><ellipse cx="105" cy="164.607" fill="#FFDFE7" rx="11.15" ry="3.626"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.176" d="M91 160c0-4.3 0-6 14-6s14 1.7 14 6c0 5.2-6.3 9.4-14 9.4s-14-4.2-14-9.4Z"/><path class="faceStrokeColor" fill="#FF88A5" stroke-width="3" d="M94.2 130.8a7.7 7.7 0 0 0-2.7-1.3 7.6 7.6 0 0 0-5.8.7 7.7 7.7 0 0 0-2.2 1.9 7.7 7.7 0 0 0-2.7-1.3 7.6 7.6 0 0 0-3-.2 7.6 7.6 0 0 0-2.7.9 7.7 7.7 0 0 0-2.3 2 7.6 7.6 0 0 0-1 1.7 7.2 7.2 0 0 0-.5 1.9 7.3 7.3 0 0 0 1.4 5.5A7.3 7.3 0 0 0 74 144l9.3 7.1a3.5 3.5 0 0 0 4.9-.6l7.2-9.2a7.2 7.2 0 0 0 1.6-5.6 7.4 7.4 0 0 0-.5-1.8 7.8 7.8 0 0 0-1-1.7 7.3 7.3 0 0 0-1.4-1.5Zm43.3 2.6a7.6 7.6 0 0 0-5.1-2.8 7.6 7.6 0 0 0-3 .2 7.7 7.7 0 0 0-2.6 1.3 7.7 7.7 0 0 0-2.3-2 7.6 7.6 0 0 0-2.8-.8 7.6 7.6 0 0 0-3 .2 7.7 7.7 0 0 0-2.6 1.3 7.6 7.6 0 0 0-1.5 1.4 7.2 7.2 0 0 0-1 1.8 7.8 7.8 0 0 0-.4 1.9 7.8 7.8 0 0 0 .5 3.8 7.3 7.3 0 0 0 1 1.7l7.3 9.2a3.5 3.5 0 0 0 4.9.6l9.3-7.1a7.6 7.6 0 0 0 1.4-1.5 7.2 7.2 0 0 0 1-1.7 7.8 7.8 0 0 0 .4-1.9 7.4 7.4 0 0 0 0-2 7.8 7.8 0 0 0-.5-1.8 7.3 7.3 0 0 0-1-1.8Z"/><path class="faceFillColor" fill-opacity=".12" d="M74.7 154.2a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm5.1 3a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.4Zm-4.5 1.9a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm55.4-3.4a1.5 1.5 0 1 1-2.5 1.4 1.5 1.5 0 0 1 2.5-1.4Zm5.1-3a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Zm-.6 4.9a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Z"/><path fill="#E3F7FF" d="M54.9 135.7c1 2.7 3.1 5.1 3.1 8a5.7 5.7 0 0 1-11.3 0c0-2.9 2-5.3 3.1-8l1.4-3.4c.4-1 1.9-1 2.3 0l1.4 3.4Z"/><path class="faceStrokeColor" stroke-opacity=".1" stroke-width="2.5" d="M52.4 150.6a7 7 0 0 0 6.9-7c0-1.7-.7-3.2-1.3-4.5a51 51 0 0 0-.8-1.5l-1.2-2.3-1.3-3.5a2.5 2.5 0 0 0-4.7 0l-1.3 3.5-1.2 2.3a51 51 0 0 0-.8 1.5c-.6 1.3-1.3 2.8-1.3 4.6a7 7 0 0 0 7 6.9Z"/></svg>'
|
||||
);
|
||||
'<path class="faceFillColor" d="M91 160.3c0-4.3 2-6 14-6s14 1.7 14 6-6.3 9.5-14 9.5-14-5.2-14-9.5Z"/><ellipse cx="105" cy="164.607" fill="#FFDFE7" rx="11.15" ry="3.626"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.176" d="M91 160c0-4.3 0-6 14-6s14 1.7 14 6c0 5.2-6.3 9.4-14 9.4s-14-4.2-14-9.4Z"/><path class="faceStrokeColor" fill="#FF88A5" stroke-width="3" d="M94.2 130.8a7.7 7.7 0 0 0-2.7-1.3 7.6 7.6 0 0 0-5.8.7 7.7 7.7 0 0 0-2.2 1.9 7.7 7.7 0 0 0-2.7-1.3 7.6 7.6 0 0 0-3-.2 7.6 7.6 0 0 0-2.7.9 7.7 7.7 0 0 0-2.3 2 7.6 7.6 0 0 0-1 1.7 7.2 7.2 0 0 0-.5 1.9 7.3 7.3 0 0 0 1.4 5.5A7.3 7.3 0 0 0 74 144l9.3 7.1a3.5 3.5 0 0 0 4.9-.6l7.2-9.2a7.2 7.2 0 0 0 1.6-5.6 7.4 7.4 0 0 0-.5-1.8 7.8 7.8 0 0 0-1-1.7 7.3 7.3 0 0 0-1.4-1.5Zm43.3 2.6a7.6 7.6 0 0 0-5.1-2.8 7.6 7.6 0 0 0-3 .2 7.7 7.7 0 0 0-2.6 1.3 7.7 7.7 0 0 0-2.3-2 7.6 7.6 0 0 0-2.8-.8 7.6 7.6 0 0 0-3 .2 7.7 7.7 0 0 0-2.6 1.3 7.6 7.6 0 0 0-1.5 1.4 7.2 7.2 0 0 0-1 1.8 7.8 7.8 0 0 0-.4 1.9 7.8 7.8 0 0 0 .5 3.8 7.3 7.3 0 0 0 1 1.7l7.3 9.2a3.5 3.5 0 0 0 4.9.6l9.3-7.1a7.6 7.6 0 0 0 1.4-1.5 7.2 7.2 0 0 0 1-1.7 7.8 7.8 0 0 0 .4-1.9 7.4 7.4 0 0 0 0-2 7.8 7.8 0 0 0-.5-1.8 7.3 7.3 0 0 0-1-1.8Z"/><path class="faceFillColor" fill-opacity=".12" d="M74.7 154.2a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm5.1 3a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.4Zm-4.5 1.9a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm55.4-3.4a1.5 1.5 0 1 1-2.5 1.4 1.5 1.5 0 0 1 2.5-1.4Zm5.1-3a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Zm-.6 4.9a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Z"/><path fill="#E3F7FF" d="M54.9 135.7c1 2.7 3.1 5.1 3.1 8a5.7 5.7 0 0 1-11.3 0c0-2.9 2-5.3 3.1-8l1.4-3.4c.4-1 1.9-1 2.3 0l1.4 3.4Z"/><path class="faceStrokeColor" stroke-opacity=".1" stroke-width="2.5" d="M52.4 150.6a7 7 0 0 0 6.9-7c0-1.7-.7-3.2-1.3-4.5a51 51 0 0 0-.8-1.5l-1.2-2.3-1.3-3.5a2.5 2.5 0 0 0-4.7 0l-1.3 3.5-1.2 2.3a51 51 0 0 0-.8 1.5c-.6 1.3-1.3 2.8-1.3 4.6a7 7 0 0 0 7 6.9Z"/></svg>';
|
||||
} else if (faceVariant == FaceVariants.OOPS) {
|
||||
// oops
|
||||
return
|
||||
string.concat(
|
||||
faceSvgStart,
|
||||
'<ellipse cx="86.917" cy="142.271" fill="#fff" rx="9.917" ry="10.271"/><ellipse class="faceFillColor" cx="86.917" cy="142.272" rx="6.43" ry="6.66"/><ellipse cx="123.083" cy="142.271" fill="#fff" rx="9.917" ry="10.271"/><ellipse class="faceFillColor" cx="123.083" cy="142.272" rx="6.43" ry="6.66"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3" d="M96 158h18"/><ellipse cx="9" cy="7.271" fill="#fff" fill-opacity=".45" rx="9" ry="7.271" transform="matrix(-1 0 0 1 86 149)"/><ellipse cx="9" cy="7.271" fill="#fff" fill-opacity=".45" rx="9" ry="7.271" transform="matrix(-1 0 0 1 142 149)"/></svg>'
|
||||
);
|
||||
'<ellipse cx="86.917" cy="142.271" fill="#fff" rx="9.917" ry="10.271"/><ellipse class="faceFillColor" cx="86.917" cy="142.272" rx="6.43" ry="6.66"/><ellipse cx="123.083" cy="142.271" fill="#fff" rx="9.917" ry="10.271"/><ellipse class="faceFillColor" cx="123.083" cy="142.272" rx="6.43" ry="6.66"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3" d="M96 158h18"/><ellipse cx="9" cy="7.271" fill="#fff" fill-opacity=".45" rx="9" ry="7.271" transform="matrix(-1 0 0 1 86 149)"/><ellipse cx="9" cy="7.271" fill="#fff" fill-opacity=".45" rx="9" ry="7.271" transform="matrix(-1 0 0 1 142 149)"/></svg>';
|
||||
} else if (faceVariant == FaceVariants.SLEEPY) {
|
||||
// sleepy
|
||||
return
|
||||
string.concat(
|
||||
faceSvgStart,
|
||||
'<path class="faceFillColor" fill-opacity=".12" d="M74.7 154.2a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm5.1 3a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.4Zm-4.5 1.9a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm55.4-3.4a1.5 1.5 0 1 1-2.5 1.4 1.5 1.5 0 0 1 2.5-1.4Zm5.1-3a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Zm-.6 4.9a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Z"/><path class="faceFillColor faceStrokeColor" stroke-width=".105" d="M126.4 154.4h-6a1.1 1.1 0 0 0 0 2.3h3c.2 0 .3.3.2.4l-4.3 5.2a1.4 1.4 0 0 0 1 2.3h6.6a1.1 1.1 0 0 0 0-2.3h-3.7a.3.3 0 0 1-.2-.4l4.4-5.2a1.4 1.4 0 0 0-1-2.3Z"/><path class="faceFillColor faceStrokeColor" stroke-width=".211" d="m134.4 149.2-4.5 1a1 1 0 0 0 .4 1.8l2-.5a.2.2 0 0 1 .3.3l-2.3 4.5a1.1 1.1 0 0 0 1.2 1.6l5-1a1 1 0 0 0-.5-1.9l-2.6.6a.2.2 0 0 1-.2-.3l2.4-4.5a1.1 1.1 0 0 0-1.2-1.6Z"/><path class="faceFillColor faceStrokeColor" stroke-width=".316" d="m143 152-3.4.8a.8.8 0 1 0 .3 1.5l1.5-.3.1.1-1.7 3.3a1 1 0 0 0 1 1.4l3.7-.8a.8.8 0 0 0-.3-1.6l-1.9.4a.1.1 0 0 1-.1-.2l1.7-3.2a1 1 0 0 0-1-1.4Z"/><path class="faceStrokeColor" stroke-linecap="round" stroke-width="3.5" d="M130.8 143s-2.3 4-7.6 4-7.6-4-7.6-4M79 143s2.3 4 7.6 4 7.6-4 7.6-4"/><path class="faceFillColor" d="M114 160c0 3-4 4.2-9 4.2s-9-1.2-9-4.1c0-3 4-6.5 9-6.5s9 3.6 9 6.5Z"/><path fill="#fff" d="M98 154.6h14v1.9c0 1.2-1 2.1-2.1 2.1H100a2.1 2.1 0 0 1-2.1-2.1v-1.9Z"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.176" d="M114 160c0 3-4 4.2-9 4.2s-9-1.2-9-4.1c0-3 4-6.5 9-6.5s9 3.6 9 6.5Z"/></svg>'
|
||||
);
|
||||
'<path class="faceFillColor" fill-opacity=".12" d="M74.7 154.2a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm5.1 3a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.4Zm-4.5 1.9a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm55.4-3.4a1.5 1.5 0 1 1-2.5 1.4 1.5 1.5 0 0 1 2.5-1.4Zm5.1-3a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Zm-.6 4.9a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Z"/><path class="faceFillColor faceStrokeColor" stroke-width=".105" d="M126.4 154.4h-6a1.1 1.1 0 0 0 0 2.3h3c.2 0 .3.3.2.4l-4.3 5.2a1.4 1.4 0 0 0 1 2.3h6.6a1.1 1.1 0 0 0 0-2.3h-3.7a.3.3 0 0 1-.2-.4l4.4-5.2a1.4 1.4 0 0 0-1-2.3Z"/><path class="faceFillColor faceStrokeColor" stroke-width=".211" d="m134.4 149.2-4.5 1a1 1 0 0 0 .4 1.8l2-.5a.2.2 0 0 1 .3.3l-2.3 4.5a1.1 1.1 0 0 0 1.2 1.6l5-1a1 1 0 0 0-.5-1.9l-2.6.6a.2.2 0 0 1-.2-.3l2.4-4.5a1.1 1.1 0 0 0-1.2-1.6Z"/><path class="faceFillColor faceStrokeColor" stroke-width=".316" d="m143 152-3.4.8a.8.8 0 1 0 .3 1.5l1.5-.3.1.1-1.7 3.3a1 1 0 0 0 1 1.4l3.7-.8a.8.8 0 0 0-.3-1.6l-1.9.4a.1.1 0 0 1-.1-.2l1.7-3.2a1 1 0 0 0-1-1.4Z"/><path class="faceStrokeColor" stroke-linecap="round" stroke-width="3.5" d="M130.8 143s-2.3 4-7.6 4-7.6-4-7.6-4M79 143s2.3 4 7.6 4 7.6-4 7.6-4"/><path class="faceFillColor" d="M114 160c0 3-4 4.2-9 4.2s-9-1.2-9-4.1c0-3 4-6.5 9-6.5s9 3.6 9 6.5Z"/><path fill="#fff" d="M98 154.6h14v1.9c0 1.2-1 2.1-2.1 2.1H100a2.1 2.1 0 0 1-2.1-2.1v-1.9Z"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.176" d="M114 160c0 3-4 4.2-9 4.2s-9-1.2-9-4.1c0-3 4-6.5 9-6.5s9 3.6 9 6.5Z"/></svg>';
|
||||
} else if (faceVariant == FaceVariants.SMILE_TEETH) {
|
||||
// smile-teeth
|
||||
return
|
||||
string.concat(
|
||||
faceSvgStart,
|
||||
'<path class="faceStrokeColor" stroke-linecap="round" stroke-width="3.5" d="M77.2 142s2.5-4.2 8.4-4.5c6-.4 8.9 3.5 8.9 3.5m38.3 1s-2.5-4.2-8.4-4.5c-6-.4-8.9 3.5-8.9 3.5"/><ellipse cx="9" cy="7.271" fill="#fff" fill-opacity=".45" rx="9" ry="7.271" transform="matrix(-1 0 0 1 80 145)"/><ellipse cx="9" cy="7.271" fill="#fff" fill-opacity=".45" rx="9" ry="7.271" transform="matrix(-1 0 0 1 148 145)"/><path fill="#fff" d="M105.2 150.4c-2.6 0-5.9-1.3-8.6-1.4-2.7 0-5.6.3-7.8 1.5-3.8 2-5.5 6-4.5 9.6.9 3.6 4.1 6.6 8 8.4 4 1.8 8 2.5 12.6 2.5"/><path fill="#fff" d="M105.2 150.4c2.8 0 5.5-1.3 8.2-1.4 2.7-.1 5.6.3 7.8 1.5 3.8 2 5.5 6 4.5 9.6-.9 3.6-4.1 6.6-8 8.4a31 31 0 0 1-12.8 2.5"/><path class="faceFillColor" d="M86.7 154.3a2 2 0 0 0-.4 1l.3.9c.2.3.3.7.3 1 0 .4-.1 1-.3 1.3l-.6 1c-.1.4-.2.8 0 1-.5-.3-.7-.9-.8-1.4-.2-.5-.3-1-.3-1.6 0-.6.1-1.2.4-1.8.4-.5.7-1.2 1.4-1.4Zm36.6 0c.1.2.4.6.4 1l-.3.9a2 2 0 0 0-.3 1c0 .4.1 1 .3 1.3l.6 1v1c.5-.3.7-.9.8-1.4.2-.5.3-1 .3-1.6a4 4 0 0 0-.5-1.8c-.3-.5-.6-1.2-1.3-1.4Z"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3" d="M105.2 150.4c-2.6 0-5.9-1.3-8.6-1.4-2.7 0-5.6.3-7.8 1.5-3.8 2-5.5 6-4.5 9.6.9 3.6 4.1 6.6 8 8.4 4 1.8 8 2.5 12.6 2.5"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3" d="M105.2 150.4c2.8 0 5.5-1.3 8.2-1.4 2.7-.1 5.6.3 7.8 1.5 3.8 2 5.5 6 4.5 9.6-.9 3.6-4.1 6.6-8 8.4a31 31 0 0 1-12.8 2.5"/><path class="faceStrokeColor" stroke-linecap="round" stroke-width="2" d="m93 159 3 1 2.4.3a2 2 0 0 0 1.9-1l.1-.4c.3-.4.9-.3 1 .1l.4 2.8c.1.5.8.5.9 0v0a1.8 1.8 0 0 1 1.7-1.2h4.7"/></svg>'
|
||||
);
|
||||
'<path class="faceStrokeColor" stroke-linecap="round" stroke-width="3.5" d="M77.2 142s2.5-4.2 8.4-4.5c6-.4 8.9 3.5 8.9 3.5m38.3 1s-2.5-4.2-8.4-4.5c-6-.4-8.9 3.5-8.9 3.5"/><ellipse cx="9" cy="7.271" fill="#fff" fill-opacity=".45" rx="9" ry="7.271" transform="matrix(-1 0 0 1 80 145)"/><ellipse cx="9" cy="7.271" fill="#fff" fill-opacity=".45" rx="9" ry="7.271" transform="matrix(-1 0 0 1 148 145)"/><path fill="#fff" d="M105.2 150.4c-2.6 0-5.9-1.3-8.6-1.4-2.7 0-5.6.3-7.8 1.5-3.8 2-5.5 6-4.5 9.6.9 3.6 4.1 6.6 8 8.4 4 1.8 8 2.5 12.6 2.5"/><path fill="#fff" d="M105.2 150.4c2.8 0 5.5-1.3 8.2-1.4 2.7-.1 5.6.3 7.8 1.5 3.8 2 5.5 6 4.5 9.6-.9 3.6-4.1 6.6-8 8.4a31 31 0 0 1-12.8 2.5"/><path class="faceFillColor" d="M86.7 154.3a2 2 0 0 0-.4 1l.3.9c.2.3.3.7.3 1 0 .4-.1 1-.3 1.3l-.6 1c-.1.4-.2.8 0 1-.5-.3-.7-.9-.8-1.4-.2-.5-.3-1-.3-1.6 0-.6.1-1.2.4-1.8.4-.5.7-1.2 1.4-1.4Zm36.6 0c.1.2.4.6.4 1l-.3.9a2 2 0 0 0-.3 1c0 .4.1 1 .3 1.3l.6 1v1c.5-.3.7-.9.8-1.4.2-.5.3-1 .3-1.6a4 4 0 0 0-.5-1.8c-.3-.5-.6-1.2-1.3-1.4Z"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3" d="M105.2 150.4c-2.6 0-5.9-1.3-8.6-1.4-2.7 0-5.6.3-7.8 1.5-3.8 2-5.5 6-4.5 9.6.9 3.6 4.1 6.6 8 8.4 4 1.8 8 2.5 12.6 2.5"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3" d="M105.2 150.4c2.8 0 5.5-1.3 8.2-1.4 2.7-.1 5.6.3 7.8 1.5 3.8 2 5.5 6 4.5 9.6-.9 3.6-4.1 6.6-8 8.4a31 31 0 0 1-12.8 2.5"/><path class="faceStrokeColor" stroke-linecap="round" stroke-width="2" d="m93 159 3 1 2.4.3a2 2 0 0 0 1.9-1l.1-.4c.3-.4.9-.3 1 .1l.4 2.8c.1.5.8.5.9 0v0a1.8 1.8 0 0 1 1.7-1.2h4.7"/></svg>';
|
||||
} else if (faceVariant == FaceVariants.SMILE) {
|
||||
// smile
|
||||
return
|
||||
string.concat(
|
||||
faceSvgStart,
|
||||
'<path class="faceStrokeColor" stroke-linecap="round" stroke-width="3" d="M91 159s4.3 6 14 6 14-6 14-6"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M89 159c.8-.4 1.5-1 2-2m30 2c-.8-.4-1.5-1-2-2"/><path class="faceFillColor" fill-rule="evenodd" d="M94.1 139c.7-.4 1-1.1.8-1.8-1.4-3.7-4.5-6.2-8-6.2-5 0-8.9 4.7-8.9 10.4s4 10.4 8.8 10.4c3.5 0 6.5-2.4 8-5.8.3-.7-.1-1.5-.8-1.8l-3.6-1.5c-1-.4-1-1.8 0-2.2l3.7-1.6Zm20.8 2.4c0-5.7 4-10.4 8.8-10.4 3.7 0 7 2.7 8.2 6.5.3.7-.1 1.4-.8 1.7l-3 1.3c-1 .4-1 1.8 0 2.2l2.9 1.2c.7.3 1 1 .8 1.8-1.4 3.6-4.5 6.1-8 6.1-5 0-8.9-4.7-8.9-10.4Z" clip-rule="evenodd"/><path class="faceFillColor" fill-opacity=".12" d="M74.7 154.2a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm5.1 3a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.4Zm-4.5 1.9a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm55.4-3.4a1.5 1.5 0 1 1-2.5 1.4 1.5 1.5 0 0 1 2.5-1.4Zm5.1-3a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Zm-.6 4.9a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Z"/></svg>'
|
||||
);
|
||||
'<path class="faceStrokeColor" stroke-linecap="round" stroke-width="3" d="M91 159s4.3 6 14 6 14-6 14-6"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M89 159c.8-.4 1.5-1 2-2m30 2c-.8-.4-1.5-1-2-2"/><path class="faceFillColor" fill-rule="evenodd" d="M94.1 139c.7-.4 1-1.1.8-1.8-1.4-3.7-4.5-6.2-8-6.2-5 0-8.9 4.7-8.9 10.4s4 10.4 8.8 10.4c3.5 0 6.5-2.4 8-5.8.3-.7-.1-1.5-.8-1.8l-3.6-1.5c-1-.4-1-1.8 0-2.2l3.7-1.6Zm20.8 2.4c0-5.7 4-10.4 8.8-10.4 3.7 0 7 2.7 8.2 6.5.3.7-.1 1.4-.8 1.7l-3 1.3c-1 .4-1 1.8 0 2.2l2.9 1.2c.7.3 1 1 .8 1.8-1.4 3.6-4.5 6.1-8 6.1-5 0-8.9-4.7-8.9-10.4Z" clip-rule="evenodd"/><path class="faceFillColor" fill-opacity=".12" d="M74.7 154.2a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm5.1 3a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.4Zm-4.5 1.9a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm55.4-3.4a1.5 1.5 0 1 1-2.5 1.4 1.5 1.5 0 0 1 2.5-1.4Zm5.1-3a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Zm-.6 4.9a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Z"/></svg>';
|
||||
} else if (faceVariant == FaceVariants.SMIRK) {
|
||||
// smirk
|
||||
return
|
||||
string.concat(
|
||||
faceSvgStart,
|
||||
'<path class="faceFillColor" fill-opacity=".12" d="M74.7 154.2a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm5.1 3a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.4Zm-4.5 1.9a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm55.4-3.4a1.5 1.5 0 1 1-2.5 1.4 1.5 1.5 0 0 1 2.5-1.4Zm5.1-3a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Zm-.6 4.9a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Z"/><path fill="#fff" d="M73.9 139.8a11.7 11.7 0 0 0 0 1.1c0 5.6 4 11.2 10.2 11.2 6.3 0 10.4-5.6 10.4-11.2v-1.1H73.8Z"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.5" d="M73 140.7s4.7-.9 11.1-.9c6.4 0 11.2.9 11.2.9"/><path class="faceFillColor" d="M77.7 139.5a9.8 9.8 0 0 0 0 .8c0 4 2.5 8.1 6.4 8.1 4 0 6.5-4 6.5-8v-1h-13Z"/><path fill="#fff" d="M135.8 139.8v1.1c0 5.6-4 11.2-10.3 11.2-6.2 0-10.3-5.6-10.3-11.2v-1.1h20.6Z"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.5" d="M136.6 140.7s-4.7-.9-11-.9c-6.5 0-11.2.9-11.2.9"/><path class="faceFillColor" d="M132 139.5v.8c0 4-2.6 8.1-6.5 8.1s-6.4-4-6.4-8v-1H132Z"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.156" d="M90 160a31.3 31.3 0 0 0 20 2.4"/></svg>'
|
||||
);
|
||||
'<path class="faceFillColor" fill-opacity=".12" d="M74.7 154.2a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm5.1 3a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.4Zm-4.5 1.9a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm55.4-3.4a1.5 1.5 0 1 1-2.5 1.4 1.5 1.5 0 0 1 2.5-1.4Zm5.1-3a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Zm-.6 4.9a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Z"/><path fill="#fff" d="M73.9 139.8a11.7 11.7 0 0 0 0 1.1c0 5.6 4 11.2 10.2 11.2 6.3 0 10.4-5.6 10.4-11.2v-1.1H73.8Z"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.5" d="M73 140.7s4.7-.9 11.1-.9c6.4 0 11.2.9 11.2.9"/><path class="faceFillColor" d="M77.7 139.5a9.8 9.8 0 0 0 0 .8c0 4 2.5 8.1 6.4 8.1 4 0 6.5-4 6.5-8v-1h-13Z"/><path fill="#fff" d="M135.8 139.8v1.1c0 5.6-4 11.2-10.3 11.2-6.2 0-10.3-5.6-10.3-11.2v-1.1h20.6Z"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.5" d="M136.6 140.7s-4.7-.9-11-.9c-6.5 0-11.2.9-11.2.9"/><path class="faceFillColor" d="M132 139.5v.8c0 4-2.6 8.1-6.5 8.1s-6.4-4-6.4-8v-1H132Z"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.156" d="M90 160a31.3 31.3 0 0 0 20 2.4"/></svg>';
|
||||
} else if (faceVariant == FaceVariants.TONGUE) {
|
||||
// tongue
|
||||
return
|
||||
string.concat(
|
||||
faceSvgStart,
|
||||
'<path class="faceFillColor" fill-opacity=".12" d="M74.7 154.2a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm5.1 3a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.4Zm-4.5 1.9a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm55.4-3.4a1.5 1.5 0 1 1-2.5 1.4 1.5 1.5 0 0 1 2.5-1.4Zm5.1-3a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Zm-.6 4.9a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Z"/><path class="faceFillColor" fill-rule="evenodd" d="M94.1 139c.7-.4 1-1.1.8-1.8-1.4-3.7-4.5-6.2-8-6.2-5 0-8.9 4.7-8.9 10.4s4 10.4 8.8 10.4c3.5 0 6.5-2.4 8-5.8.3-.7-.1-1.5-.8-1.8l-3.6-1.5c-1-.4-1-1.8 0-2.2l3.7-1.6Zm20.8 2.4c0-5.7 4-10.4 8.8-10.4 3.7 0 7 2.7 8.2 6.5.3.7-.1 1.4-.8 1.7l-3 1.3c-1 .4-1 1.8 0 2.2l2.9 1.2c.7.3 1 1 .8 1.8-1.4 3.6-4.5 6.1-8 6.1-5 0-8.9-4.7-8.9-10.4Z" clip-rule="evenodd"/><path class="faceFillColor" d="M105 172c-15 0-20.6-8-18.6-13.6 1.4-4.1 6-6.4 10.4-5a35 35 0 0 0 8.2 1.6c2.3 0 6.3-1 8.2-1.6 4.3-1.4 9 .9 10.4 5 2 5.5-3.6 13.6-18.6 13.6Z"/><path class="faceStrokeColor" fill="#FFDFE7" stroke-width="2.75" d="M98.7 161.4h1.3l1.7.4 1 .3.8.2 1.5.2 1.5-.2.9-.2.9-.3a21.3 21.3 0 0 1 1.8-.3l1.2-.1c2.2.3 3.6 1.3 4.4 2.6a8 8 0 0 1 .7 5.2 11.1 11.1 0 0 1-11.4 9.4 11.1 11.1 0 0 1-11.4-9.4c-.4-2-.1-3.8.7-5.2.8-1.3 2.2-2.3 4.4-2.6Z"/><path fill="#F5C8D4" d="M106 163.8v7a1 1 0 0 1-2 0v-7l1 .2 1-.2Z"/></svg>'
|
||||
);
|
||||
'<path class="faceFillColor" fill-opacity=".12" d="M74.7 154.2a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm5.1 3a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.4Zm-4.5 1.9a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm55.4-3.4a1.5 1.5 0 1 1-2.5 1.4 1.5 1.5 0 0 1 2.5-1.4Zm5.1-3a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Zm-.6 4.9a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Z"/><path class="faceFillColor" fill-rule="evenodd" d="M94.1 139c.7-.4 1-1.1.8-1.8-1.4-3.7-4.5-6.2-8-6.2-5 0-8.9 4.7-8.9 10.4s4 10.4 8.8 10.4c3.5 0 6.5-2.4 8-5.8.3-.7-.1-1.5-.8-1.8l-3.6-1.5c-1-.4-1-1.8 0-2.2l3.7-1.6Zm20.8 2.4c0-5.7 4-10.4 8.8-10.4 3.7 0 7 2.7 8.2 6.5.3.7-.1 1.4-.8 1.7l-3 1.3c-1 .4-1 1.8 0 2.2l2.9 1.2c.7.3 1 1 .8 1.8-1.4 3.6-4.5 6.1-8 6.1-5 0-8.9-4.7-8.9-10.4Z" clip-rule="evenodd"/><path class="faceFillColor" d="M105 172c-15 0-20.6-8-18.6-13.6 1.4-4.1 6-6.4 10.4-5a35 35 0 0 0 8.2 1.6c2.3 0 6.3-1 8.2-1.6 4.3-1.4 9 .9 10.4 5 2 5.5-3.6 13.6-18.6 13.6Z"/><path class="faceStrokeColor" fill="#FFDFE7" stroke-width="2.75" d="M98.7 161.4h1.3l1.7.4 1 .3.8.2 1.5.2 1.5-.2.9-.2.9-.3a21.3 21.3 0 0 1 1.8-.3l1.2-.1c2.2.3 3.6 1.3 4.4 2.6a8 8 0 0 1 .7 5.2 11.1 11.1 0 0 1-11.4 9.4 11.1 11.1 0 0 1-11.4-9.4c-.4-2-.1-3.8.7-5.2.8-1.3 2.2-2.3 4.4-2.6Z"/><path fill="#F5C8D4" d="M106 163.8v7a1 1 0 0 1-2 0v-7l1 .2 1-.2Z"/></svg>';
|
||||
} else if (faceVariant == FaceVariants.WINK) {
|
||||
// wink
|
||||
return
|
||||
string.concat(
|
||||
faceSvgStart,
|
||||
'<path class="faceStrokeColor" stroke-linecap="round" stroke-width="3" d="M91 159s4.3 6 14 6 14-6 14-6"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M89 159c.8-.4 1.5-1 2-2m30 2c-.8-.4-1.5-1-2-2"/><path class="faceFillColor" fill-opacity=".12" d="M74.7 154.2a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm5.1 3a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.4Zm-4.5 1.9a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm55.4-3.4a1.5 1.5 0 1 1-2.5 1.4 1.5 1.5 0 0 1 2.5-1.4Zm5.1-3a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Zm-.6 4.9a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Z"/><path class="faceFillColor" fill-rule="evenodd" d="M94.1 139c.7-.4 1-1.1.8-1.8-1.4-3.7-4.5-6.2-8-6.2-5 0-8.9 4.7-8.9 10.4s4 10.4 8.8 10.4c3.5 0 6.5-2.4 8-5.8.3-.7-.1-1.5-.8-1.8l-3.6-1.5c-1-.4-1-1.8 0-2.2l3.7-1.6Z" clip-rule="evenodd"/><path class="faceStrokeColor" stroke-linecap="round" stroke-width="4" d="M130 142.4s-2-2-6.5-2-6.5 2-6.5 2"/><path class="faceStrokeColor" stroke-linecap="round" stroke-width="4" d="M128.8 136.5s-2.7-1-6.7 1-5 4.6-5 4.6"/></svg>'
|
||||
);
|
||||
} else if (faceVariant == FaceVariants.WOW_TONGUE) {
|
||||
// wow-tongue
|
||||
return
|
||||
string.concat(
|
||||
faceSvgStart,
|
||||
'<path class="faceFillColor" fill-opacity=".12" d="M74.7 154.2a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm5.1 3a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.4Zm-4.5 1.9a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm55.4-3.4a1.5 1.5 0 1 1-2.5 1.4 1.5 1.5 0 0 1 2.5-1.4Zm5.1-3a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Zm-.6 4.9a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Z"/><ellipse class="faceFillColor" cx="86.825" cy="140.298" rx="9.825" ry="11.298"/><path fill="#fff" fill-rule="evenodd" d="M88.9 133.3a.6.6 0 0 1 1.1 0l1.2 2.7a.6.6 0 0 0 .3.4l1.4.6a.6.6 0 0 1 0 1.2l-1.4.7a.6.6 0 0 0-.3.3L90 142a.6.6 0 0 1-1.1 0l-1.2-2.7a.6.6 0 0 0-.3-.3l-1.4-.7a.6.6 0 0 1 0-1.2l1.4-.6a.6.6 0 0 0 .3-.4l1.2-2.7ZM84 141a.4.4 0 0 1 .7 0l.7 1.8a.4.4 0 0 0 .2.2l1 .4c.3.2.3.6 0 .8l-1 .4a.4.4 0 0 0-.2.2l-.7 1.8a.4.4 0 0 1-.7 0l-.8-1.8a.4.4 0 0 0-.2-.2l-1-.4a.4.4 0 0 1 0-.8l1-.4a.4.4 0 0 0 .2-.2l.8-1.8Zm-3.3-4.8a.4.4 0 0 1 .8 0l.2.6.2.3h.2a.4.4 0 0 1 0 .8H82a.4.4 0 0 0-.2.3l-.2.6a.4.4 0 0 1-.8 0l-.2-.6a.4.4 0 0 0-.2-.2l-.2-.1a.4.4 0 0 1 0-.8h.2a.4.4 0 0 0 .2-.3l.2-.6Z" clip-rule="evenodd"/><ellipse class="faceFillColor" cx="9.825" cy="11.298" rx="9.825" ry="11.298" transform="matrix(-1 0 0 1 133 129)"/><path fill="#fff" fill-rule="evenodd" d="M121.1 133.3a.6.6 0 0 0-1.1 0l-1.2 2.7a.6.6 0 0 1-.3.4l-1.4.6a.6.6 0 0 0 0 1.2l1.4.7a.6.6 0 0 1 .3.3l1.2 2.7a.6.6 0 0 0 1.1 0l1.2-2.7a.6.6 0 0 1 .3-.3l1.4-.7a.6.6 0 0 0 0-1.2l-1.4-.6a.6.6 0 0 1-.3-.4l-1.2-2.7Zm4.8 7.6a.4.4 0 0 0-.7 0l-.7 1.8a.4.4 0 0 1-.2.2l-1 .4a.4.4 0 0 0 0 .8l1 .4a.4.4 0 0 1 .2.2l.7 1.8c.1.3.6.3.7 0l.8-1.8a.4.4 0 0 1 .2-.2l1-.4a.4.4 0 0 0 0-.8l-1-.4a.4.4 0 0 1-.2-.2l-.8-1.8Zm3.3-4.8a.4.4 0 0 0-.8 0l-.2.6a.4.4 0 0 1-.2.3h-.2a.4.4 0 0 0 0 .8h.2a.4.4 0 0 1 .2.3l.2.6c.2.3.6.3.8 0l.2-.6a.4.4 0 0 1 .2-.2l.2-.1a.4.4 0 0 0 0-.8h-.2a.4.4 0 0 1-.2-.3l-.2-.6Z" clip-rule="evenodd"/><path class="faceFillColor" d="M105 172c-15 0-20.6-8-18.6-13.6 1.4-4.1 6-6.4 10.4-5a35 35 0 0 0 8.2 1.6c2.3 0 6.3-1 8.2-1.6 4.3-1.4 9 .9 10.4 5 2 5.5-3.6 13.6-18.6 13.6Z"/><path class="faceStrokeColor" fill="#FFDFE7" stroke-width="2.75" d="M98.7 161.4h1.3l1.7.4 1 .3.8.2 1.5.2 1.5-.2.9-.2.9-.3a21.3 21.3 0 0 1 1.8-.3l1.2-.1c2.2.3 3.6 1.3 4.4 2.6a8 8 0 0 1 .7 5.2 11.1 11.1 0 0 1-11.4 9.4 11.1 11.1 0 0 1-11.4-9.4c-.4-2-.1-3.8.7-5.2.8-1.3 2.2-2.3 4.4-2.6Z"/><path fill="#F5C8D4" d="M106 163.8v7a1 1 0 0 1-2 0v-7l1 .2 1-.2Z"/></svg>'
|
||||
);
|
||||
} else if (faceVariant == FaceVariants.WOW) {
|
||||
// wow
|
||||
return
|
||||
string.concat(
|
||||
faceSvgStart,
|
||||
'<path class="faceFillColor" fill-opacity=".12" d="M74.7 154.2a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm5.1 3a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.4Zm-4.5 1.9a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm55.4-3.4a1.5 1.5 0 1 1-2.5 1.4 1.5 1.5 0 0 1 2.5-1.4Zm5.1-3a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Zm-.6 4.9a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Z"/><ellipse class="faceFillColor" cx="86.825" cy="140.298" rx="9.825" ry="11.298"/><path fill="#fff" fill-rule="evenodd" d="M88.9 133.3a.6.6 0 0 1 1.1 0l1.2 2.7a.6.6 0 0 0 .3.4l1.4.6a.6.6 0 0 1 0 1.2l-1.4.7a.6.6 0 0 0-.3.3L90 142a.6.6 0 0 1-1.1 0l-1.2-2.7a.6.6 0 0 0-.3-.3l-1.4-.7a.6.6 0 0 1 0-1.2l1.4-.6a.6.6 0 0 0 .3-.4l1.2-2.7ZM84 141a.4.4 0 0 1 .7 0l.7 1.8a.4.4 0 0 0 .2.2l1 .4c.3.2.3.6 0 .8l-1 .4a.4.4 0 0 0-.2.2l-.7 1.8a.4.4 0 0 1-.7 0l-.8-1.8a.4.4 0 0 0-.2-.2l-1-.4a.4.4 0 0 1 0-.8l1-.4a.4.4 0 0 0 .2-.2l.8-1.8Zm-3.3-4.8a.4.4 0 0 1 .8 0l.2.6.2.3h.2a.4.4 0 0 1 0 .8H82a.4.4 0 0 0-.2.3l-.2.6a.4.4 0 0 1-.8 0l-.2-.6a.4.4 0 0 0-.2-.2l-.2-.1a.4.4 0 0 1 0-.8h.2a.4.4 0 0 0 .2-.3l.2-.6Z" clip-rule="evenodd"/><ellipse class="faceFillColor" cx="9.825" cy="11.298" rx="9.825" ry="11.298" transform="matrix(-1 0 0 1 133 129)"/><path fill="#fff" fill-rule="evenodd" d="M121.1 133.3a.6.6 0 0 0-1.1 0l-1.2 2.7a.6.6 0 0 1-.3.4l-1.4.6a.6.6 0 0 0 0 1.2l1.4.7a.6.6 0 0 1 .3.3l1.2 2.7a.6.6 0 0 0 1.1 0l1.2-2.7a.6.6 0 0 1 .3-.3l1.4-.7a.6.6 0 0 0 0-1.2l-1.4-.6a.6.6 0 0 1-.3-.4l-1.2-2.7Zm4.8 7.6a.4.4 0 0 0-.7 0l-.7 1.8a.4.4 0 0 1-.2.2l-1 .4a.4.4 0 0 0 0 .8l1 .4a.4.4 0 0 1 .2.2l.7 1.8c.1.3.6.3.7 0l.8-1.8a.4.4 0 0 1 .2-.2l1-.4a.4.4 0 0 0 0-.8l-1-.4a.4.4 0 0 1-.2-.2l-.8-1.8Zm3.3-4.8a.4.4 0 0 0-.8 0l-.2.6a.4.4 0 0 1-.2.3h-.2a.4.4 0 0 0 0 .8h.2a.4.4 0 0 1 .2.3l.2.6c.2.3.6.3.8 0l.2-.6a.4.4 0 0 1 .2-.2l.2-.1a.4.4 0 0 0 0-.8h-.2a.4.4 0 0 1-.2-.3l-.2-.6Z" clip-rule="evenodd"/><path class="faceFillColor" d="M114 160c0 3-4 4.2-9 4.2s-9-1.2-9-4.1c0-3 4-6.5 9-6.5s9 3.6 9 6.5Z"/><path fill="#fff" d="M98 154.6h14v1.9c0 1.2-1 2.1-2.1 2.1H100a2.1 2.1 0 0 1-2.1-2.1v-1.9Z"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.176" d="M114 160c0 3-4 4.2-9 4.2s-9-1.2-9-4.1c0-3 4-6.5 9-6.5s9 3.6 9 6.5Z"/></svg>'
|
||||
);
|
||||
'<path class="faceStrokeColor" stroke-linecap="round" stroke-width="3" d="M91 159s4.3 6 14 6 14-6 14-6"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M89 159c.8-.4 1.5-1 2-2m30 2c-.8-.4-1.5-1-2-2"/><path class="faceFillColor" fill-opacity=".12" d="M74.7 154.2a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm5.1 3a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.4Zm-4.5 1.9a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm55.4-3.4a1.5 1.5 0 1 1-2.5 1.4 1.5 1.5 0 0 1 2.5-1.4Zm5.1-3a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Zm-.6 4.9a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Z"/><path class="faceFillColor" fill-rule="evenodd" d="M94.1 139c.7-.4 1-1.1.8-1.8-1.4-3.7-4.5-6.2-8-6.2-5 0-8.9 4.7-8.9 10.4s4 10.4 8.8 10.4c3.5 0 6.5-2.4 8-5.8.3-.7-.1-1.5-.8-1.8l-3.6-1.5c-1-.4-1-1.8 0-2.2l3.7-1.6Z" clip-rule="evenodd"/><path class="faceStrokeColor" stroke-linecap="round" stroke-width="4" d="M130 142.4s-2-2-6.5-2-6.5 2-6.5 2"/><path class="faceStrokeColor" stroke-linecap="round" stroke-width="4" d="M128.8 136.5s-2.7-1-6.7 1-5 4.6-5 4.6"/></svg>';
|
||||
} else {
|
||||
return Face2.getFaceVariant(faceVariant);
|
||||
}
|
||||
}
|
||||
|
||||
function _getStyleTag(FaceColors faceColor, Skin.SkinColors skinColor) internal pure returns (string memory) {
|
||||
return
|
||||
string.concat(
|
||||
'<style>.faceStrokeColor{stroke:',
|
||||
faceColor == FaceColors.GOLD ? LensColors.darkGold : LensColors.black,
|
||||
'} .faceFillColor{fill:',
|
||||
faceColor == FaceColors.GOLD ? LensColors.darkGold : LensColors.black,
|
||||
'} .skinColorBase{fill:',
|
||||
_getBaseColor(skinColor),
|
||||
'} .skinColorLight{fill:',
|
||||
_getLightColor(skinColor),
|
||||
'} .skinColorDark{fill:',
|
||||
_getDarkColor(skinColor),
|
||||
'} .mouthOverlay{fill:',
|
||||
faceColor == FaceColors.GOLD ? LensColors.darkGold : LensColors.black,
|
||||
'}</style>'
|
||||
);
|
||||
}
|
||||
|
||||
function _getBaseColor(Skin.SkinColors color) internal pure returns (string memory) {
|
||||
if (color == Skin.SkinColors.GREEN) {
|
||||
return LensColors.baseGreen;
|
||||
} else if (color == Skin.SkinColors.PINK) {
|
||||
return LensColors.basePink;
|
||||
} else if (color == Skin.SkinColors.PURPLE) {
|
||||
return LensColors.basePurple;
|
||||
} else if (color == Skin.SkinColors.BLUE) {
|
||||
return LensColors.baseBlue;
|
||||
} else if (color == Skin.SkinColors.GOLD) {
|
||||
return LensColors.baseGold;
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
}
|
||||
|
||||
function _getStyleTag(FaceColors faceColor) internal pure returns (string memory) {
|
||||
if (faceColor == FaceColors.GOLD) {
|
||||
return '<style>.faceStrokeColor{stroke: #B96326} .faceFillColor{fill: #B96326}</style>';
|
||||
function _getLightColor(Skin.SkinColors color) internal pure returns (string memory) {
|
||||
if (color == Skin.SkinColors.GREEN) {
|
||||
return LensColors.lightGreen;
|
||||
} else if (color == Skin.SkinColors.PINK) {
|
||||
return LensColors.lightPink;
|
||||
} else if (color == Skin.SkinColors.PURPLE) {
|
||||
return LensColors.lightPurple;
|
||||
} else if (color == Skin.SkinColors.BLUE) {
|
||||
return LensColors.lightBlue;
|
||||
} else if (color == Skin.SkinColors.GOLD) {
|
||||
return LensColors.lightGold;
|
||||
} else {
|
||||
return '<style>.faceStrokeColor{stroke: #000} .faceFillColor{fill: #000}</style>';
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
}
|
||||
|
||||
function _getDarkColor(Skin.SkinColors color) internal pure returns (string memory) {
|
||||
if (color == Skin.SkinColors.GREEN) {
|
||||
return LensColors.darkGreen;
|
||||
} else if (color == Skin.SkinColors.PINK) {
|
||||
return LensColors.darkPink;
|
||||
} else if (color == Skin.SkinColors.PURPLE) {
|
||||
return LensColors.darkPurple;
|
||||
} else if (color == Skin.SkinColors.BLUE) {
|
||||
return LensColors.darkBlue;
|
||||
} else if (color == Skin.SkinColors.GOLD) {
|
||||
return LensColors.darkGold;
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
library Face2 {
|
||||
function getFaceVariant(Face.FaceVariants faceVariant) external pure returns (string memory) {
|
||||
if (faceVariant == Face.FaceVariants.WOW_TONGUE) {
|
||||
// wow-tongue
|
||||
return
|
||||
'<path class="faceFillColor" fill-opacity=".12" d="M74.7 154.2a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm5.1 3a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.4Zm-4.5 1.9a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm55.4-3.4a1.5 1.5 0 1 1-2.5 1.4 1.5 1.5 0 0 1 2.5-1.4Zm5.1-3a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Zm-.6 4.9a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Z"/><ellipse class="faceFillColor" cx="86.825" cy="140.298" rx="9.825" ry="11.298"/><path fill="#fff" fill-rule="evenodd" d="M88.9 133.3a.6.6 0 0 1 1.1 0l1.2 2.7a.6.6 0 0 0 .3.4l1.4.6a.6.6 0 0 1 0 1.2l-1.4.7a.6.6 0 0 0-.3.3L90 142a.6.6 0 0 1-1.1 0l-1.2-2.7a.6.6 0 0 0-.3-.3l-1.4-.7a.6.6 0 0 1 0-1.2l1.4-.6a.6.6 0 0 0 .3-.4l1.2-2.7ZM84 141a.4.4 0 0 1 .7 0l.7 1.8a.4.4 0 0 0 .2.2l1 .4c.3.2.3.6 0 .8l-1 .4a.4.4 0 0 0-.2.2l-.7 1.8a.4.4 0 0 1-.7 0l-.8-1.8a.4.4 0 0 0-.2-.2l-1-.4a.4.4 0 0 1 0-.8l1-.4a.4.4 0 0 0 .2-.2l.8-1.8Zm-3.3-4.8a.4.4 0 0 1 .8 0l.2.6.2.3h.2a.4.4 0 0 1 0 .8H82a.4.4 0 0 0-.2.3l-.2.6a.4.4 0 0 1-.8 0l-.2-.6a.4.4 0 0 0-.2-.2l-.2-.1a.4.4 0 0 1 0-.8h.2a.4.4 0 0 0 .2-.3l.2-.6Z" clip-rule="evenodd"/><ellipse class="faceFillColor" cx="9.825" cy="11.298" rx="9.825" ry="11.298" transform="matrix(-1 0 0 1 133 129)"/><path fill="#fff" fill-rule="evenodd" d="M121.1 133.3a.6.6 0 0 0-1.1 0l-1.2 2.7a.6.6 0 0 1-.3.4l-1.4.6a.6.6 0 0 0 0 1.2l1.4.7a.6.6 0 0 1 .3.3l1.2 2.7a.6.6 0 0 0 1.1 0l1.2-2.7a.6.6 0 0 1 .3-.3l1.4-.7a.6.6 0 0 0 0-1.2l-1.4-.6a.6.6 0 0 1-.3-.4l-1.2-2.7Zm4.8 7.6a.4.4 0 0 0-.7 0l-.7 1.8a.4.4 0 0 1-.2.2l-1 .4a.4.4 0 0 0 0 .8l1 .4a.4.4 0 0 1 .2.2l.7 1.8c.1.3.6.3.7 0l.8-1.8a.4.4 0 0 1 .2-.2l1-.4a.4.4 0 0 0 0-.8l-1-.4a.4.4 0 0 1-.2-.2l-.8-1.8Zm3.3-4.8a.4.4 0 0 0-.8 0l-.2.6a.4.4 0 0 1-.2.3h-.2a.4.4 0 0 0 0 .8h.2a.4.4 0 0 1 .2.3l.2.6c.2.3.6.3.8 0l.2-.6a.4.4 0 0 1 .2-.2l.2-.1a.4.4 0 0 0 0-.8h-.2a.4.4 0 0 1-.2-.3l-.2-.6Z" clip-rule="evenodd"/><path class="faceFillColor" d="M105 172c-15 0-20.6-8-18.6-13.6 1.4-4.1 6-6.4 10.4-5a35 35 0 0 0 8.2 1.6c2.3 0 6.3-1 8.2-1.6 4.3-1.4 9 .9 10.4 5 2 5.5-3.6 13.6-18.6 13.6Z"/><path class="faceStrokeColor" fill="#FFDFE7" stroke-width="2.75" d="M98.7 161.4h1.3l1.7.4 1 .3.8.2 1.5.2 1.5-.2.9-.2.9-.3a21.3 21.3 0 0 1 1.8-.3l1.2-.1c2.2.3 3.6 1.3 4.4 2.6a8 8 0 0 1 .7 5.2 11.1 11.1 0 0 1-11.4 9.4 11.1 11.1 0 0 1-11.4-9.4c-.4-2-.1-3.8.7-5.2.8-1.3 2.2-2.3 4.4-2.6Z"/><path fill="#F5C8D4" d="M106 163.8v7a1 1 0 0 1-2 0v-7l1 .2 1-.2Z"/></svg>';
|
||||
} else if (faceVariant == Face.FaceVariants.WOW) {
|
||||
// wow
|
||||
return
|
||||
'<path class="faceFillColor" fill-opacity=".12" d="M74.7 154.2a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm5.1 3a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.4Zm-4.5 1.9a1.5 1.5 0 1 1-2.5-1.5 1.5 1.5 0 0 1 2.5 1.5Zm55.4-3.4a1.5 1.5 0 1 1-2.5 1.4 1.5 1.5 0 0 1 2.5-1.4Zm5.1-3a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Zm-.6 4.9a1.5 1.5 0 1 1-2.5 1.5 1.5 1.5 0 0 1 2.5-1.5Z"/><ellipse class="faceFillColor" cx="86.825" cy="140.298" rx="9.825" ry="11.298"/><path fill="#fff" fill-rule="evenodd" d="M88.9 133.3a.6.6 0 0 1 1.1 0l1.2 2.7a.6.6 0 0 0 .3.4l1.4.6a.6.6 0 0 1 0 1.2l-1.4.7a.6.6 0 0 0-.3.3L90 142a.6.6 0 0 1-1.1 0l-1.2-2.7a.6.6 0 0 0-.3-.3l-1.4-.7a.6.6 0 0 1 0-1.2l1.4-.6a.6.6 0 0 0 .3-.4l1.2-2.7ZM84 141a.4.4 0 0 1 .7 0l.7 1.8a.4.4 0 0 0 .2.2l1 .4c.3.2.3.6 0 .8l-1 .4a.4.4 0 0 0-.2.2l-.7 1.8a.4.4 0 0 1-.7 0l-.8-1.8a.4.4 0 0 0-.2-.2l-1-.4a.4.4 0 0 1 0-.8l1-.4a.4.4 0 0 0 .2-.2l.8-1.8Zm-3.3-4.8a.4.4 0 0 1 .8 0l.2.6.2.3h.2a.4.4 0 0 1 0 .8H82a.4.4 0 0 0-.2.3l-.2.6a.4.4 0 0 1-.8 0l-.2-.6a.4.4 0 0 0-.2-.2l-.2-.1a.4.4 0 0 1 0-.8h.2a.4.4 0 0 0 .2-.3l.2-.6Z" clip-rule="evenodd"/><ellipse class="faceFillColor" cx="9.825" cy="11.298" rx="9.825" ry="11.298" transform="matrix(-1 0 0 1 133 129)"/><path fill="#fff" fill-rule="evenodd" d="M121.1 133.3a.6.6 0 0 0-1.1 0l-1.2 2.7a.6.6 0 0 1-.3.4l-1.4.6a.6.6 0 0 0 0 1.2l1.4.7a.6.6 0 0 1 .3.3l1.2 2.7a.6.6 0 0 0 1.1 0l1.2-2.7a.6.6 0 0 1 .3-.3l1.4-.7a.6.6 0 0 0 0-1.2l-1.4-.6a.6.6 0 0 1-.3-.4l-1.2-2.7Zm4.8 7.6a.4.4 0 0 0-.7 0l-.7 1.8a.4.4 0 0 1-.2.2l-1 .4a.4.4 0 0 0 0 .8l1 .4a.4.4 0 0 1 .2.2l.7 1.8c.1.3.6.3.7 0l.8-1.8a.4.4 0 0 1 .2-.2l1-.4a.4.4 0 0 0 0-.8l-1-.4a.4.4 0 0 1-.2-.2l-.8-1.8Zm3.3-4.8a.4.4 0 0 0-.8 0l-.2.6a.4.4 0 0 1-.2.3h-.2a.4.4 0 0 0 0 .8h.2a.4.4 0 0 1 .2.3l.2.6c.2.3.6.3.8 0l.2-.6a.4.4 0 0 1 .2-.2l.2-.1a.4.4 0 0 0 0-.8h-.2a.4.4 0 0 1-.2-.3l-.2-.6Z" clip-rule="evenodd"/><path class="faceFillColor" d="M114 160c0 3-4 4.2-9 4.2s-9-1.2-9-4.1c0-3 4-6.5 9-6.5s9 3.6 9 6.5Z"/><path fill="#fff" d="M98 154.6h14v1.9c0 1.2-1 2.1-2.1 2.1H100a2.1 2.1 0 0 1-2.1-2.1v-1.9Z"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.176" d="M114 160c0 3-4 4.2-9 4.2s-9-1.2-9-4.1c0-3 4-6.5 9-6.5s9 3.6 9 6.5Z"/></svg>';
|
||||
} else if (faceVariant == Face.FaceVariants.BABY) {
|
||||
// baby
|
||||
return
|
||||
'<path fill="#fff" d="M113 161.9c1.9 2 3 4.6 3 7.6a11 11 0 0 1-22 .1v-.1a11 11 0 0 1 11-11c3.2 0 6 1.3 8 3.4Zm-2.3 7.6c0-1-.2-2-.6-2.8-1-1.9-3-3.1-5.1-3.1a5.8 5.8 0 0 0-5.7 5.9c0 3.2 2.5 5.8 5.7 5.8s5.7-2.6 5.7-5.8Z"/><path class="skinColorDark" d="M109.6 167a8.8 8.8 0 0 1-9.3 0l-.5-.1c1-2 3-3.3 5.2-3.3 2.3 0 4 1.2 5 3l-.4.3ZM97 161.9l-.2-1.8A8.2 8.2 0 1 1 113 162a11 11 0 0 0-16 0Z"/><path class="skinColorLight" d="M96.8 160.1c0 .6 0 1.2.2 1.8a11 11 0 0 0-3 7.7h-1a14.8 14.8 0 0 1-7.3-8.5c-1-3.6-.4-7.9 2-10.8a14 14 0 0 1 8.5-4.4c3.2-.6 5-.7 8.8-.7 3.8 0 5.6 0 8.8.6 3.2.6 6.3 2 8.4 4.4 2.5 3 3.2 7.2 2 10.9a14.8 14.8 0 0 1-7.2 8.5h-1v-.1c0-3-1.1-5.6-3-7.6l.2-1.8a8.2 8.2 0 1 0-16.4 0Z"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3" d="M109.6 166a8.8 8.8 0 0 1-9.3 0"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="m97 161.9-.2-1.8A8.2 8.2 0 1 1 113 162"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3" d="M94 169.6v-.1a11 11 0 0 1 11-11 11 11 0 0 1 11 11v0a11 11 0 0 1-22 .1Z"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3" d="M110 166.7c.5.8.7 1.8.7 2.8 0 3.2-2.5 5.8-5.7 5.8a5.8 5.8 0 0 1-5.7-5.8 5.8 5.8 0 0 1 5.7-5.9c2.3 0 4 1.2 5 3Zm-17 3a14.8 14.8 0 0 1-7.3-8.6c-1-3.6-.4-7.9 2-10.8a14 14 0 0 1 8.5-4.4c3.2-.6 5-.7 8.8-.7"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M101.2 172.7c1.2.7 6 .6 8 0"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3" d="M117 169.6a15 15 0 0 0 7.3-8.5c1-3.7.4-8-2-10.9a14 14 0 0 0-8.5-4.4 48 48 0 0 0-8.8-.6"/><path class="skinColorLight" d="M99.5 157.6h11v7.9h-11z"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M98.7 161.6a4 4 0 0 1 4-4h4.6a4 4 0 0 1 4 4v0a4 4 0 0 1-4 4h-4.6a4 4 0 0 1-4-4v0Z"/><circle class="faceFillColor" cx="87.3" cy="135.5" r="4.7"/><circle class="faceFillColor" cx="122.7" cy="135.5" r="4.7"/><path fill="#fff" fill-opacity=".5" d="M78 158.2c-.7 3-4.6 4.6-8.8 3.7-4.1-1-7-4-6.3-7 .7-3 4.6-4.7 8.7-3.7 4.2.9 7 4 6.4 7Zm54 0c.7 3 4.6 4.6 8.7 3.7 4.2-1 7-4 6.3-7-.6-3-4.5-4.7-8.7-3.7-4.1.9-7 4-6.3 7Z"/></svg>';
|
||||
} else if (faceVariant == Face.FaceVariants.KAWAII) {
|
||||
// kawaii
|
||||
return
|
||||
'<path class="faceFillColor" d="M114.3 138.3c1.8 0 3.3 2 3.3 4.6 0 2.6-1.5 4.6-3.3 4.6-1.8 0-3.3-2-3.3-4.6 0-2.5 1.5-4.6 3.3-4.6Zm-18.5 0c1.8 0 3.2 2 3.2 4.6 0 2.6-1.4 4.6-3.2 4.6-1.9 0-3.3-2-3.3-4.6 0-2.5 1.4-4.6 3.3-4.6Z"/><path fill="#fff" d="M136.9 139.5c2 7.4-.4 15-7.2 19.3-7.5 4.7-20.2 4.5-24.6-3.8h-.1c-4.4 8.3-17.1 8.5-24.6 3.8a17 17 0 0 1-7.2-19.3 17 17 0 0 1 15-13c8-1 16.8 4.7 16.8 11.7 0-7 9-12.7 16.8-11.7a17 17 0 0 1 15 13Zm-19.3 3.4c0-2.5-1.5-4.6-3.3-4.6-1.8 0-3.3 2-3.3 4.6 0 2.6 1.5 4.6 3.3 4.6 1.8 0 3.3-2 3.3-4.6ZM99 143c0-2.5-1.4-4.6-3.2-4.6-1.9 0-3.3 2-3.3 4.6 0 2.6 1.4 4.6 3.3 4.6 1.8 0 3.2-2 3.2-4.6Z"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3" d="M105 138.1c0-7-9-12.6-16.8-11.7a17 17 0 0 0-15 13c-2 7.5.3 15 7.1 19.3 7.5 4.8 20.2 4.6 24.6-3.8"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M92.4 142.9c0-2.6 1.5-4.6 3.3-4.6 1.8 0 3.3 2 3.3 4.6 0 2.5-1.5 4.6-3.3 4.6-1.8 0-3.3-2-3.3-4.6Z"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3" d="M105 138.1c0-7 8.9-12.6 16.8-11.7a17 17 0 0 1 15 13c2 7.5-.4 15-7.1 19.3-7.5 4.8-20.2 4.6-24.6-3.8"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M117.6 142.9c0-2.6-1.5-4.6-3.3-4.6-1.8 0-3.3 2-3.3 4.6 0 2.5 1.5 4.6 3.3 4.6 1.8 0 3.3-2 3.3-4.6Z"/><path class="faceStrokeColor" stroke-linecap="round" stroke-width="2.5" d="m87.9 122 .5 4m-8.7-.6 2 2.7m15.2-3.8-1.6 3m26.8-5.3-.5 4m8.8-.6-2 2.7m-15.2-3.8 1.6 3"/><path fill="#fff" fill-opacity=".5" d="M80 167.2c-.7 3-4.6 4.6-8.7 3.7-4.2-1-7-4-6.4-7 .7-3 4.6-4.7 8.8-3.7 4.1.9 7 4 6.3 7Zm50 0c.7 3 4.6 4.6 8.7 3.7 4.2-1 7-4 6.4-7-.7-3-4.6-4.7-8.8-3.7-4.1.9-7 4-6.3 7Z"/><path class="faceStrokeColor" stroke-linecap="round" stroke-width="3" d="M90.5 167.7s4.5 5.1 14.6 5.1c10 0 14.5-5.1 14.5-5.1"/></svg>';
|
||||
} else if (faceVariant == Face.FaceVariants.PIXIE) {
|
||||
// pixie
|
||||
return
|
||||
'<path fill="#fff" fill-opacity=".3" d="M105 121.4c-6.4 0-14.3-4-21-4.3-6.6-.4-13.5.9-19.1 4.6a29.3 29.3 0 0 0-11 29.8 39.8 39.8 0 0 0 19.8 25.7 59.8 59.8 0 0 0 30.5 7.8"/><path fill="#fff" fill-opacity=".3" d="M105 121.4c7 0 13.4-4 20-4.3 6.7-.4 13.6.9 19.2 4.6a29.3 29.3 0 0 1 11 29.8 39.8 39.8 0 0 1-19.8 25.7 62.1 62.1 0 0 1-31.2 7.8"/><path class="faceStrokeColor" stroke-width="2.8" d="M105 121.4c-6.4 0-14.3-4-21-4.3-6.6-.4-13.5.9-19.1 4.6a29.3 29.3 0 0 0-11 29.8 39.8 39.8 0 0 0 19.8 25.7 59.8 59.8 0 0 0 30.5 7.8"/><path class="faceStrokeColor" stroke-width="2.8" d="M105 121.4c7 0 13.4-4 20-4.3 6.7-.4 13.6.9 19.2 4.6a29.3 29.3 0 0 1 11 29.8 39.8 39.8 0 0 1-19.8 25.7 62.1 62.1 0 0 1-31.2 7.8"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3" d="M105 121.4c-6.4 0-14.3-4-21-4.3-6.6-.4-13.5.9-19.1 4.6a29.3 29.3 0 0 0-11 29.8 39.8 39.8 0 0 0 19.8 25.7 59.8 59.8 0 0 0 30.5 7.8"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3" d="M105 121.4c7 0 13.4-4 20-4.3 6.7-.4 13.6.9 19.2 4.6a29.3 29.3 0 0 1 11 29.8 39.8 39.8 0 0 1-19.8 25.7 62.1 62.1 0 0 1-31.2 7.8"/><path class="faceFillColor" fill-opacity=".5" d="M71.9 158.7h2.2v2.2h-2.2zm0 2.2h2.2v2.2h-2.2zm-2.2 2.2h2.2v2.2h-2.2zm2.2 0h2.2v2.2h-2.2z"/><path class="faceFillColor" fill-opacity=".5" d="M74.1 163.1h2.2v2.2h-2.2zm-4.4-4.4h2.2v2.2h-2.2zm0 2.2h2.2v2.2h-2.2zm4.4 0h2.2v2.2h-2.2zm-6.6 0h2.2v2.2h-2.2zm6.6-2.2h2.2v2.2h-2.2zm2.2 2.2h2.2v2.2h-2.2zm58.1-2.2h2.2v2.2h-2.2zm0 2.2h2.2v2.2h-2.2zm-2.2 2.2h2.2v2.2h-2.2zm2.2 0h2.2v2.2h-2.2zm2.2 0h2.2v2.2h-2.2zm-4.4-4.4h2.2v2.2h-2.2zm0 2.2h2.2v2.2h-2.2zm4.4 0h2.2v2.2h-2.2zm-6.6 0h2.2v2.2H130zm6.6-2.2h2.2v2.2h-2.2zm2.2 2.2h2.2v2.2h-2.2z"/><path class="faceFillColor" d="M96 158.7h2.2v2.2H96zm2.2 0h2.2v2.2h-2.2zm2.2 2.2h2.2v2.2h-2.2z"/><path class="faceFillColor" d="M102.6 160.9h2.2v2.2h-2.2zm2.2 0h2.2v2.2h-2.2zm2.2 0h2.2v2.2H107zm2.2-2.2h2.2v2.2h-2.2zm2.2 0h2.2v2.2h-2.2zm-23-5.5h2.2v2.2h-2.2zm-2.2-11h2.2v2.2h-2.2zm-2.2 3.3h2.2v2.2H84zm0 2.2h2.2v2.2H84zm8.8 0H95v2.2h-2.2zm-8.8 2.2h2.2v2.2H84zm8.8 0H95v2.2h-2.2zm-6.6-5.5h6.6v3.3h-6.6z"/><path class="faceFillColor" d="M86.2 147.7h6.6v2.2h-6.6zm0 2.2h6.6v3.3h-6.6zm6.6-4.4H95v2.2h-2.2zm-4.4-3.3h2.2v2.2h-2.2zm2.2 0h2.2v2.2h-2.2zm-4.4 11h2.2v2.2h-2.2zm4.4 0h2.2v2.2h-2.2zm28.5 0h2.2v2.2h-2.2zm-2.2-11h2.2v2.2h-2.2zm-2.2 3.3h2.2v2.2h-2.2zm0 2.2h2.2v2.2h-2.2zm8.8 0h2.2v2.2h-2.2zm-8.8 2.2h2.2v2.2h-2.2zm8.8 0h2.2v2.2h-2.2zm-6.6-5.5h6.6v3.3h-6.6z"/><path class="faceFillColor" d="M116.9 147.7h6.6v2.2h-6.6zm0 2.2h6.6v3.3h-6.6zm6.6-4.4h2.2v2.2h-2.2zm-4.4-3.3h2.2v2.2h-2.2zm2.2 0h2.2v2.2h-2.2zm-4.4 11h2.2v2.2h-2.2zm4.4 0h2.2v2.2h-2.2z"/></svg>';
|
||||
} else if (faceVariant == Face.FaceVariants.TODDLER) {
|
||||
// toddler
|
||||
return
|
||||
'<path class="faceStrokeColor" stroke-linecap="round" stroke-width="3" d="M93 154.5s3.7 5.2 12 5.2 12-5.2 12-5.2"/><circle class="faceFillColor" cx="87.6" cy="142.4" r="4.6"/><circle class="faceFillColor" cx="122.4" cy="142.4" r="4.6"/><path fill="#fff" fill-opacity=".5" d="M78 156.2c-.7 3-4.6 4.6-8.8 3.7-4.1-1-7-4-6.3-7 .7-3 4.6-4.7 8.7-3.7 4.2.9 7 4 6.4 7Zm54 0c.7 3 4.6 4.6 8.7 3.7 4.2-1 7-4 6.3-7-.6-3-4.5-4.7-8.7-3.7-4.1.9-7 4-6.3 7Z"/></svg>';
|
||||
} else if (faceVariant == Face.FaceVariants.VAMP) {
|
||||
// vamp
|
||||
return
|
||||
'<path fill="#fff" fill-opacity=".5" d="M138.7 137.2c-.7 3 2 6.2 6.2 7.2 4.1 1 8-.6 8.8-3.5.7-3-2.1-6.2-6.2-7.2-4.2-1-8.1.6-8.8 3.5Zm-67.4 0c.7 3-2 6.2-6.2 7.2-4.1 1-8-.6-8.8-3.5-.7-3 2.1-6.2 6.2-7.2 4.2-1 8.1.6 8.8 3.5Z"/><path class="faceStrokeColor" stroke-linecap="round" stroke-width="3.5" d="M77 133s2.5-4.2 8.7-4.5A11 11 0 0 1 95 132m38 1s-2.5-4.2-8.7-4.5a11 11 0 0 0-9.3 3.6"/><path class="skinColorBase" d="M105.4 142.4c-4.6 0-10.1-2.2-14.8-2.4-4.7-.2-9.6.5-13.5 2.6a14.7 14.7 0 0 0-7.7 16.5c1.6 6.1 7.1 11.3 13.9 14.3 6.8 3 13.7 4.3 21.5 4.3"/><path class="skinColorBase" d="M105.4 142.4c4.8 0 9.3-2.2 14-2.4 4.7-.2 9.6.5 13.5 2.6a14.7 14.7 0 0 1 7.7 16.5c-1.6 6.1-7.1 11.3-13.9 14.3a54 54 0 0 1-22 4.3"/><path class="mouthOverlay" fill-opacity=".6" d="M105.4 142.4c-4.6 0-10.1-2.2-14.8-2.4-4.7-.2-9.6.5-13.5 2.6a14.7 14.7 0 0 0-7.7 16.5c1.6 6.1 7.1 11.3 13.9 14.3 6.8 3 13.7 4.3 21.5 4.3"/><path class="mouthOverlay" fill-opacity=".6" d="M105.4 142.4c4.8 0 9.3-2.2 14-2.4 4.7-.2 9.6.5 13.5 2.6a14.7 14.7 0 0 1 7.7 16.5c-1.6 6.1-7.1 11.3-13.9 14.3a54 54 0 0 1-22 4.3"/><path fill="#fff" class="faceStrokeColor" stroke-linejoin="round" stroke-width="2" d="m79 141.9 8.4-2.2s12.9 2.2 18 2.2 18.5-2.2 18.5-2.2l7.1 2.2a7 7 0 0 1 2 5.9c-.5 1.7-1 3.4-2 5l-1 1.6a1.8 1.8 0 0 1-3.2 0l-2.9-5c-5.8.3-13.2.6-18.9.6-5.7 0-13.1-.3-19-.6l-2.8 5a1.8 1.8 0 0 1-3.2 0l-1-1.7c-1-1.5-1.5-3.2-1.9-5A7 7 0 0 1 79 142Z"/><path fill="#FFDFE7" class="faceStrokeColor" stroke-width="2" d="M127 172.7c0 1.9-9.9 4.1-22 4.1a64 64 0 0 1-22-4c0-3.7 9.9-9 22-9s22 5.3 22 9Z"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3" d="M105.4 142.4c-4.6 0-10.1-2.2-14.8-2.4-4.7-.2-9.6.5-13.5 2.6a14.7 14.7 0 0 0-7.7 16.5c1.6 6.1 7.1 11.3 13.9 14.3 6.8 3 13.7 4.3 21.5 4.3"/><path class="faceStrokeColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3" d="M105.4 142.4c4.8 0 9.3-2.2 14-2.4 4.7-.2 9.6.5 13.5 2.6a14.7 14.7 0 0 1 7.7 16.5c-1.6 6.1-7.1 11.3-13.9 14.3a54 54 0 0 1-22 4.3"/><path class="faceStrokeColor" stroke-linecap="round" stroke-opacity=".1" stroke-width="2" d="M105 163.7v6.3"/></svg>';
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ library Hands {
|
||||
|
||||
enum HandsColors {
|
||||
GREEN,
|
||||
PINK,
|
||||
PURPLE,
|
||||
BLUE,
|
||||
GOLD
|
||||
@@ -51,7 +52,7 @@ library Hands {
|
||||
}
|
||||
|
||||
function _getRightHand(Body.BodyVariants bodyVariant) internal pure returns (string memory) {
|
||||
if (bodyVariant == Body.BodyVariants.HOODIE) {
|
||||
if (bodyVariant == Body.BodyVariants.HOODIE || bodyVariant == Body.BodyVariants.SHIBUYA) {
|
||||
return
|
||||
'<path class="handsColor" d="M180.8 202.2c.1.4-.5 3.7-2.3 7-1.1 2-2.7 4.2-4.8 5.5-5.6 3.6-10 3.5-17 1.9a25 25 0 0 1-11.9-6.7 17.5 17.5 0 0 1-3.6-6c-.6-1.6.3-3.8-.5-5.3-1.9-3.2.5-6.9.5-6.9l2-4.6 3.4-3.5c0-3 .4-5.4 0-11.7-.4-7.3-1-10.1 0-12.5 3.1-7.7 12.8-6.6 15.7 0 .8 1.9.6 7.8.6 7.8v15l4-15s1.7-7 3-8.6a7.8 7.8 0 0 1 14.2 4.2c.3 2.5-.7 4.7-3 11.6l-3.2 9.3c5.1 2.4 8.4 10.9 3.6 17.7l-.7.8Z"/><path class="armColor" d="M164.4 219.5c-1.2 1.8-2.1 5.2-3.6 7-4.3 4.9-14.5 1.4-14.5 1.4l-.2-4.5-1.5-2.5v-3.5l1.7-4.5s2.6 1.4 8.1 2.6c6 1.6 16.7 1 16.7 1s-2.5-3-5.4.7c-1 1.3 1 1.2-1.3 2.3Z"/><path class="hLine3" d="M149.6 202.6h.8c1.6 0 3.5-.4 5.3-1 5.3-2.1 10.2-6.8 6.3-12.9a7 7 0 0 0-6.1-3.2c-3.3.3-4.6 2.3-8 2.8m-1.2-4.7c0-3 0-5.3-.5-11.6-.5-7.3-1-10.2 0-12.5 3-7.7 12.7-7 15.5-.4.8 1.9 1 8.4 1 8.4v14.9m15.2 1.3 3.3-9.3c2.2-7 3.2-9 2.9-11.6-.9-8.2-10.4-9.6-14.7-3.8a40 40 0 0 0-2.8 8.3l-4 15m18.2 20 .7-1c4.8-6.7 1.5-15.2-3.6-17.6"/><path class="hLine3" d="M180.8 202.2c.1.4-.5 3.7-2.3 7-1.1 2-2.7 4.2-4.8 5.5-5.6 3.6-14.7 3.2-22.7 0"/><path class="hLine4" d="M165.6 218c-3 11-16.3 13-22.3 7.4"/><path class="hLine3" d="M146.6 183.6c-2.7.6-6.7 7.7-6 15 1.6 13.8 10.8 16.9 16 17.9m8.5-15.6c2 3.4 11.5 7 17-.5"/>';
|
||||
} else if (bodyVariant == Body.BodyVariants.JACKET) {
|
||||
@@ -69,7 +70,7 @@ library Hands {
|
||||
}
|
||||
|
||||
function _getLeftHand(Body.BodyVariants bodyVariant) internal pure returns (string memory) {
|
||||
if (bodyVariant == Body.BodyVariants.HOODIE) {
|
||||
if (bodyVariant == Body.BodyVariants.HOODIE || bodyVariant == Body.BodyVariants.SHIBUYA) {
|
||||
return
|
||||
'<path class="handsColor" d="M28.3 202.2c0 .4.5 3.7 2.3 7 1.2 2 2.7 4.2 4.9 5.5 5.5 3.6 10 3.5 16.9 1.9a25 25 0 0 0 11.9-6.7c1.8-1.8 2.7-3.9 3.6-6 .7-1.6-.3-3.8.6-5.3 1.8-3.2-.6-6.9-.6-6.9l-2-4.6-3.4-3.5c0-3-.4-5.4 0-11.7.5-7.3 1-10.1 0-12.5-3-7.7-12.8-6.6-15.7 0-.7 1.9-.5 7.8-.5 7.8v15l-4-15s-1.8-7-3-8.6a7.8 7.8 0 0 0-14.3 4.2c-.2 2.5.7 4.7 3 11.6l3.2 9.3c-5 2.4-8.4 10.9-3.5 17.7l.6.8Z"/><path class="armColor" d="M44.8 219.5c1 1.8 2 5.2 3.5 7 4.3 4.9 14.5 1.4 14.5 1.4l.3-4.5 1.5-2.5v-3.5l-1.8-4.5s-2.6 1.4-8.1 2.6c-6 1.6-16.6 1-16.6 1s2.4-3 5.4.7c1 1.3-1.1 1.2 1.3 2.3Z"/><path class="hLine3" d="M59.5 202.6a15.7 15.7 0 0 1-6-1c-5.4-2.1-10.3-6.8-6.4-12.9a7 7 0 0 1 6.1-3.2c3.4.3 4.7 2.3 8 2.8m1.2-4.7c0-3 .1-5.3.5-11.6.5-7.3 1-10.2 0-12.5-3-7.7-12.7-7-15.5-.4a39 39 0 0 0-.9 8.4v14.9m-15.3 1.3-3.2-9.3c-2.3-7-3.2-9-3-11.6.9-8.2 10.4-9.6 14.7-3.8 1.2 1.6 2.9 8.3 2.9 8.3l3.9 15m-18.2 20a12 12 0 0 1-.6-1c-5-6.7-1.6-15.2 3.5-17.6"/><path class="hLine3" d="M28.3 202.2c0 .4.5 3.7 2.3 7 1.2 2 2.7 4.2 4.9 5.5 5.5 3.6 14.6 3.2 22.6 0"/><path class="hLine4" d="M43.6 218c3 11 16.9 13 22.9 7.4"/><path class="hLine3" d="M62.5 183.6c2.8.6 6.7 7.7 6 15-1.5 13.8-10.8 16.9-16 17.9m-8.4-15.6c-2.1 3.4-11.5 7-17-.5"/>';
|
||||
} else if (bodyVariant == Body.BodyVariants.JACKET) {
|
||||
@@ -101,6 +102,7 @@ library Hands {
|
||||
);
|
||||
}
|
||||
|
||||
// Arm or sleeve color (depends on which clothing on body)
|
||||
function _getArmColor(
|
||||
HandsColors handsColor,
|
||||
Body.BodyVariants bodyVariant,
|
||||
@@ -113,7 +115,9 @@ library Hands {
|
||||
} else if (bodyVariant == Body.BodyVariants.TANKTOP) {
|
||||
return Skin.getSkinColor(Skin.SkinColors(uint8(handsColor)));
|
||||
} else if (bodyVariant == Body.BodyVariants.JACKET) {
|
||||
return Body.getSecondaryBodyColor(bodyColor);
|
||||
return Body.getSecondaryBodyColor(bodyVariant, bodyColor);
|
||||
} else if (bodyVariant == Body.BodyVariants.SHIBUYA) {
|
||||
return Body.getSecondaryBodyColor(bodyVariant, bodyColor);
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import {Skin} from "./Helpers.sol";
|
||||
import {Skin} from './Helpers.sol';
|
||||
|
||||
library Head {
|
||||
enum HeadColors {
|
||||
GREEN,
|
||||
PINK,
|
||||
PURPLE,
|
||||
BLUE,
|
||||
GOLD
|
||||
|
||||
@@ -5,7 +5,6 @@ import {Helpers} from './Helpers.sol';
|
||||
import {HeadwearBeanie} from './Headwear/HeadwearBeanie.sol';
|
||||
import {HeadwearHat} from './Headwear/HeadwearHat.sol';
|
||||
import {HeadwearIcecream} from './Headwear/HeadwearIcecream.sol';
|
||||
import {HeadwearLeafs} from './Headwear/HeadwearLeafs.sol';
|
||||
import {HeadwearPlants} from './Headwear/HeadwearPlants.sol';
|
||||
import {HeadwearSparkles} from './Headwear/HeadwearSparkles.sol';
|
||||
import {HeadwearCrown} from './Headwear/HeadwearCrown.sol';
|
||||
@@ -14,13 +13,22 @@ import {HeadwearGlasses} from './Headwear/HeadwearGlasses.sol';
|
||||
import {HeadwearMushroom} from './Headwear/HeadwearMushroom.sol';
|
||||
import {HeadwearNightcap} from './Headwear/HeadwearNightcap.sol';
|
||||
import {HeadwearPartyhat} from './Headwear/HeadwearPartyhat.sol';
|
||||
import {HeadwearBear} from './Headwear/HeadwearBear.sol';
|
||||
import {HeadwearBee} from './Headwear/HeadwearBee.sol';
|
||||
import {HeadwearBirdie} from './Headwear/HeadwearBirdie.sol';
|
||||
import {HeadwearBrains} from './Headwear/HeadwearBrains.sol';
|
||||
import {HeadwearBull} from './Headwear/HeadwearBull.sol';
|
||||
import {HeadwearEarrings} from './Headwear/HeadwearEarrings.sol';
|
||||
import {HeadwearLotus} from './Headwear/HeadwearLotus.sol';
|
||||
import {HeadwearMajor} from './Headwear/HeadwearMajor.sol';
|
||||
import {HeadwearScout} from './Headwear/HeadwearScout.sol';
|
||||
import {HeadwearShaman} from './Headwear/HeadwearShaman.sol';
|
||||
|
||||
library Headwear {
|
||||
enum HeadwearVariants {
|
||||
NONE,
|
||||
BEANIE,
|
||||
HAT,
|
||||
LEAFS,
|
||||
PLANTS,
|
||||
SPARKLES,
|
||||
CROWN,
|
||||
@@ -29,14 +37,22 @@ library Headwear {
|
||||
MUSHROOM,
|
||||
NIGHTCAP,
|
||||
PARTYHAT,
|
||||
BEAR,
|
||||
BEE,
|
||||
BIRDIE,
|
||||
BRAINS,
|
||||
BULL,
|
||||
EARRINGS,
|
||||
LOTUS,
|
||||
MAJOR,
|
||||
SCOUT,
|
||||
SHAMAN,
|
||||
ICECREAM
|
||||
}
|
||||
|
||||
enum HeadwearColors {
|
||||
NONE,
|
||||
GREEN,
|
||||
LIGHT,
|
||||
DARK,
|
||||
PURPLE,
|
||||
BLUE,
|
||||
PINK,
|
||||
@@ -82,13 +98,6 @@ library Headwear {
|
||||
uint8(type(HeadwearIcecream.IcecreamColors).max)
|
||||
);
|
||||
return HeadwearIcecream.getIcecream(icecreamColor);
|
||||
} else if (variant == HeadwearVariants.LEAFS) {
|
||||
HeadwearLeafs.LeafsColors leafsColor = isGold
|
||||
? HeadwearLeafs.LeafsColors.GOLD
|
||||
: HeadwearLeafs.LeafsColors(
|
||||
Helpers.getColor(seed, Helpers.ComponentBytes.HEADWEAR) % uint8(type(HeadwearLeafs.LeafsColors).max)
|
||||
);
|
||||
return HeadwearLeafs.getLeafs(leafsColor);
|
||||
} else if (variant == HeadwearVariants.PLANTS) {
|
||||
HeadwearPlants.PlantsColors plantsColor = isGold
|
||||
? HeadwearPlants.PlantsColors.GOLD
|
||||
@@ -100,7 +109,7 @@ library Headwear {
|
||||
} else if (variant == HeadwearVariants.SPARKLES) {
|
||||
return
|
||||
HeadwearSparkles.getSparkles(
|
||||
isGold ? HeadwearSparkles.SparklesColors.GOLD : HeadwearSparkles.SparklesColors.LIGHT
|
||||
isGold ? HeadwearSparkles.SparklesColors.GOLD : HeadwearSparkles.SparklesColors.NONE
|
||||
);
|
||||
} else if (variant == HeadwearVariants.CROWN) {
|
||||
HeadwearCrown.CrownColors crownColor = isGold
|
||||
@@ -149,6 +158,80 @@ library Headwear {
|
||||
uint8(type(HeadwearPartyhat.PartyhatColors).max)
|
||||
);
|
||||
return HeadwearPartyhat.getPartyhat(partyhatColor);
|
||||
} else if (variant == HeadwearVariants.BEAR) {
|
||||
HeadwearBear.BearColors bearColor = isGold
|
||||
? HeadwearBear.BearColors.GOLD
|
||||
: HeadwearBear.BearColors(
|
||||
Helpers.getColor(seed, Helpers.ComponentBytes.HEADWEAR) % uint8(type(HeadwearBear.BearColors).max)
|
||||
);
|
||||
return HeadwearBear.getBear(bearColor);
|
||||
} else if (variant == HeadwearVariants.BEE) {
|
||||
HeadwearBee.BeeColors beeColor = isGold
|
||||
? HeadwearBee.BeeColors.GOLD
|
||||
: HeadwearBee.BeeColors(
|
||||
Helpers.getColor(seed, Helpers.ComponentBytes.HEADWEAR) % uint8(type(HeadwearBee.BeeColors).max)
|
||||
);
|
||||
return HeadwearBee.getBee(beeColor);
|
||||
} else if (variant == HeadwearVariants.BIRDIE) {
|
||||
HeadwearBirdie.BirdieColors birdieColor = isGold
|
||||
? HeadwearBirdie.BirdieColors.GOLD
|
||||
: HeadwearBirdie.BirdieColors(
|
||||
Helpers.getColor(seed, Helpers.ComponentBytes.HEADWEAR) %
|
||||
uint8(type(HeadwearBirdie.BirdieColors).max)
|
||||
);
|
||||
return HeadwearBirdie.getBirdie(birdieColor);
|
||||
} else if (variant == HeadwearVariants.BRAINS) {
|
||||
HeadwearBrains.BrainsColors brainsColor = isGold
|
||||
? HeadwearBrains.BrainsColors.GOLD
|
||||
: HeadwearBrains.BrainsColors(
|
||||
Helpers.getColor(seed, Helpers.ComponentBytes.HEADWEAR) %
|
||||
uint8(type(HeadwearBrains.BrainsColors).max)
|
||||
);
|
||||
return HeadwearBrains.getBrains(brainsColor);
|
||||
} else if (variant == HeadwearVariants.BULL) {
|
||||
HeadwearBull.BullColors bullColor = isGold
|
||||
? HeadwearBull.BullColors.GOLD
|
||||
: HeadwearBull.BullColors(
|
||||
Helpers.getColor(seed, Helpers.ComponentBytes.HEADWEAR) % uint8(type(HeadwearBull.BullColors).max)
|
||||
);
|
||||
return HeadwearBull.getBull(bullColor);
|
||||
} else if (variant == HeadwearVariants.EARRINGS) {
|
||||
HeadwearEarrings.EarringsColors earringsColor = isGold
|
||||
? HeadwearEarrings.EarringsColors.GOLD
|
||||
: HeadwearEarrings.EarringsColors(
|
||||
Helpers.getColor(seed, Helpers.ComponentBytes.HEADWEAR) %
|
||||
uint8(type(HeadwearEarrings.EarringsColors).max)
|
||||
);
|
||||
return HeadwearEarrings.getEarrings(earringsColor);
|
||||
} else if (variant == HeadwearVariants.LOTUS) {
|
||||
HeadwearLotus.LotusColors lotusColor = isGold
|
||||
? HeadwearLotus.LotusColors.GOLD
|
||||
: HeadwearLotus.LotusColors(
|
||||
Helpers.getColor(seed, Helpers.ComponentBytes.HEADWEAR) % uint8(type(HeadwearLotus.LotusColors).max)
|
||||
);
|
||||
return HeadwearLotus.getLotus(lotusColor);
|
||||
} else if (variant == HeadwearVariants.MAJOR) {
|
||||
HeadwearMajor.MajorColors majorColor = isGold
|
||||
? HeadwearMajor.MajorColors.GOLD
|
||||
: HeadwearMajor.MajorColors(
|
||||
Helpers.getColor(seed, Helpers.ComponentBytes.HEADWEAR) % uint8(type(HeadwearMajor.MajorColors).max)
|
||||
);
|
||||
return HeadwearMajor.getMajor(majorColor);
|
||||
} else if (variant == HeadwearVariants.SCOUT) {
|
||||
HeadwearScout.ScoutColors scoutColor = isGold
|
||||
? HeadwearScout.ScoutColors.GOLD
|
||||
: HeadwearScout.ScoutColors(
|
||||
Helpers.getColor(seed, Helpers.ComponentBytes.HEADWEAR) % uint8(type(HeadwearScout.ScoutColors).max)
|
||||
);
|
||||
return HeadwearScout.getScout(scoutColor);
|
||||
} else if (variant == HeadwearVariants.SHAMAN) {
|
||||
HeadwearShaman.ShamanColors shamanColor = isGold
|
||||
? HeadwearShaman.ShamanColors.GOLD
|
||||
: HeadwearShaman.ShamanColors(
|
||||
Helpers.getColor(seed, Helpers.ComponentBytes.HEADWEAR) %
|
||||
uint8(type(HeadwearShaman.ShamanColors).max)
|
||||
);
|
||||
return HeadwearShaman.getShaman(shamanColor);
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
|
||||
@@ -2,13 +2,14 @@
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import {Headwear} from 'contracts/libraries/svgs/Profile/Headwear.sol';
|
||||
import {LensColors} from 'contracts/libraries/svgs/Profile/LensColors.sol';
|
||||
|
||||
library HeadwearBeanie {
|
||||
enum BeanieColors {
|
||||
GREEN,
|
||||
LIGHT,
|
||||
DARK,
|
||||
PINK,
|
||||
PURPLE,
|
||||
BLUE,
|
||||
GOLD
|
||||
}
|
||||
|
||||
@@ -39,15 +40,15 @@ library HeadwearBeanie {
|
||||
|
||||
function _getBeanieColor(BeanieColors beanieColor) internal pure returns (string memory) {
|
||||
if (beanieColor == BeanieColors.GREEN) {
|
||||
return '#F4FFDC';
|
||||
} else if (beanieColor == BeanieColors.LIGHT) {
|
||||
return '#FFFFFF';
|
||||
} else if (beanieColor == BeanieColors.DARK) {
|
||||
return '#575757';
|
||||
return LensColors.lightGreen;
|
||||
} else if (beanieColor == BeanieColors.PINK) {
|
||||
return LensColors.lightPink;
|
||||
} else if (beanieColor == BeanieColors.BLUE) {
|
||||
return LensColors.lightBlue;
|
||||
} else if (beanieColor == BeanieColors.PURPLE) {
|
||||
return '#F3EAFF';
|
||||
return LensColors.lightPurple;
|
||||
} else if (beanieColor == BeanieColors.GOLD) {
|
||||
return '#FFEE93';
|
||||
return LensColors.lightGold;
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
@@ -56,10 +57,10 @@ library HeadwearBeanie {
|
||||
function _getHeadwearColor(BeanieColors beanieColor) internal pure returns (Headwear.HeadwearColors) {
|
||||
if (beanieColor == BeanieColors.GREEN) {
|
||||
return Headwear.HeadwearColors.GREEN;
|
||||
} else if (beanieColor == BeanieColors.LIGHT) {
|
||||
return Headwear.HeadwearColors.LIGHT;
|
||||
} else if (beanieColor == BeanieColors.DARK) {
|
||||
return Headwear.HeadwearColors.DARK;
|
||||
} else if (beanieColor == BeanieColors.PINK) {
|
||||
return Headwear.HeadwearColors.PINK;
|
||||
} else if (beanieColor == BeanieColors.BLUE) {
|
||||
return Headwear.HeadwearColors.BLUE;
|
||||
} else if (beanieColor == BeanieColors.PURPLE) {
|
||||
return Headwear.HeadwearColors.PURPLE;
|
||||
} else if (beanieColor == BeanieColors.GOLD) {
|
||||
|
||||
73
contracts/libraries/svgs/Profile/Headwear/HeadwearBear.sol
Normal file
73
contracts/libraries/svgs/Profile/Headwear/HeadwearBear.sol
Normal file
@@ -0,0 +1,73 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import {Headwear} from 'contracts/libraries/svgs/Profile/Headwear.sol';
|
||||
import {LensColors} from 'contracts/libraries/svgs/Profile/LensColors.sol';
|
||||
|
||||
library HeadwearBear {
|
||||
enum BearColors {
|
||||
GREEN,
|
||||
PINK,
|
||||
PURPLE,
|
||||
BLUE,
|
||||
GOLD
|
||||
}
|
||||
|
||||
function getBear(
|
||||
BearColors bearColor
|
||||
) external pure returns (string memory, Headwear.HeadwearVariants, Headwear.HeadwearColors) {
|
||||
return (
|
||||
string.concat(
|
||||
'<svg xmlns="http://www.w3.org/2000/svg" width="250" height="335" x="-18.6" fill="none">',
|
||||
_getBearStyle(bearColor),
|
||||
'<path class="headwearColorL" d="M205.8 92.3a35 35 0 0 0 14.5 13.8c-9.6-3.6-23-5.1-41.4-8-18-2.8-36.8-3.7-55.2-3.7-18.5 0-37.2.9-55.2 3.7-18.4 2.9-31.8 4.4-41.5 8a34.4 34.4 0 0 0 14.5-13.8c3-5.5 13.6-21 13.6-21S58.6 51.9 71.7 46c15.1-6.7 28 3.6 28 3.6s17.5-2.4 24-2.4c6.4 0 23.9 2.4 23.9 2.4s14.8-10.9 30.2-3.6c11.7 3.6 14.5 25.4 14.5 25.4s10.6 15.4 13.5 21Z"/><path class="headwearColorL" d="M241.2 115.7c2.6 2.8 4.3 6.6 3.6 10.4.5-3.3-2.7-5.8-5.7-7.3-8.7-4.6-18.3-3.4-27.9-5.6-28.8-6.5-61-10-87.5-10-26.6 0-58.8 3.5-87.6 10-9.6 2.2-19.3 2.6-28 7.1-3 1.5-6 2.6-5.5 5.8-.8-3.7.7-7.9 3.3-10.6 2.5-2.6 9-4.6 21-8.7 9.7-3.3 23.2-4.8 41.6-7.4a374.7 374.7 0 0 1 110.4 0c18.3 2.6 31.9 3.8 41.6 7 12 4.2 18.2 6.8 20.7 9.3Z"/><path class="hwStr1" stroke-width="4" d="M123.7 104.5c-26.6 0-58.8 2.9-87.6 7.9a140 140 0 0 0-27.9 7.1c-3 1.2-6.1 3.1-5.6 5.7.3 1.5 5 5.3 19.2 7.2m101.9-27.9c26.5 0 58.7 2.9 87.5 7.9a140 140 0 0 1 28 7.1c2.9 1.2 6 3.1 5.6 5.7-.4 1.5-5 5.3-19.3 7.2"/><path class="hwStr1" stroke-width="4" d="M2.6 123.1s0 0 0 0c-.8-3 1-6.2 3.6-8.4 2.5-2 8.7-5.3 20.8-8.6m217.8 17s0 0 0 0c.7-3-1-6.2-3.6-8.4-2.5-2-8.7-5.3-20.9-8.6"/><path class="headwearColorL" d="M4.5 124.7c-2-2.6 17.4-7.4 17.4-7.4s-1.3 4-1.8 6.8c-.3 2.3-.4 6-.4 6s-12-1.3-15.2-5.4Zm238.4 0c2-2.6-17.4-7.4-17.4-7.4s1.3 4 1.7 6.8c.4 2.3.5 6 .5 6s12-1.3 15.2-5.4Z"/><path fill="#000" fill-opacity=".3" d="M4.5 124.7c-2-2.6 17.4-7.4 17.4-7.4s-1.3 4-1.8 6.8c-.3 2.3-.4 6-.4 6s-12-1.3-15.2-5.4Zm238.4 0c2-2.6-17.4-7.4-17.4-7.4s1.3 4 1.7 6.8c.4 2.3.5 6 .5 6s12-1.3 15.2-5.4Z"/><path class="hwStr1" stroke-width="3" d="M27 106.6c9.7-2.7 23.1-5.4 41.5-7.5a476 476 0 0 1 110.4 0c18.3 2.1 31.8 4.8 41.4 7.5"/><path stroke="#000" stroke-dasharray="9 9" stroke-linecap="round" stroke-linejoin="round" stroke-opacity=".2" stroke-width="2.5" d="M37.5 98.7c8.3-1.8 18.5-3.5 31-5a476 476 0 0 1 110.4 0c12.9 1.5 23.4 3.3 31.8 5.1"/><path class="headwearColorB" d="M172.6 53.5a27 27 0 0 1 10.8 13.8c-8.9-4.8-18-9-27.5-12.4 4.2-4.3 11.5-4.4 16.7-1.4Z"/><path fill="#000" d="M98.6 60a2.1 2.1 0 1 1 0 4.1 2.1 2.1 0 0 1 0-4.2Z"/><path class="headwearColorB" d="M74.8 53.5c5.2-3 12.4-2.9 16.6 1.4C82 58.3 72.8 62.5 64 67.3a26.5 26.5 0 0 1 10.8-13.8Z"/><path class="hwStr1" stroke-width="3" d="M64 67.3c8.8-4.8 18-9 27.4-12.4-4.2-4.3-11.4-4.4-16.6-1.4-5.2 3-8.7 8.3-10.8 13.8Z"/><path class="hwStr1" stroke-width="4" d="M27 106s0 0 0 0a34.4 34.4 0 0 0 14.5-13.7c3-5.5 5.4-11.4 9.2-16.2 1.5-1.8 3.1-3.4 4.9-4.9A27.5 27.5 0 0 1 70.4 46a27.5 27.5 0 0 1 29 3.8 60 60 0 0 1 24-4m97 60.3s0 0 0 0a34.4 34.4 0 0 1-14.6-13.8c-3-5.5-5.3-11.4-9.2-16.2a33 33 0 0 0-4.7-4.7c.3-10.3-5.6-21-15-25.4a27.5 27.5 0 0 0-29 3.8 60 60 0 0 0-24-4"/><path class="hwStr1" stroke-width="3" d="M183.4 67.3c-8.9-4.8-18-9-27.5-12.4 4.2-4.3 11.5-4.4 16.7-1.4a27 27 0 0 1 10.8 13.8Z"/><path fill="#fff" d="M123.7 68c1.1-.9 2.3-1.7 3-2.6.2-.3.4-.6.4-1 0-.6-1-1.3-1.6-1.4-.6-.2-1.2-.1-1.8-.1h-1.9c-.6.2-1.5.9-1.5 1.5 0 .4.2.7.4 1 .7.9 1.8 1.7 3 2.5Zm15.1 3.7c.5 3.2-2 6.3-5 7.6a22 22 0 0 1-9.6 1h-1c-3.3.2-6.7.2-9.7-1-3-1.3-5.5-4.4-5-7.6a7 7 0 0 1 4.3-5.2 11 11 0 0 1 3.8-6.4c2-1.6 4.4-2.5 7-2.6h.2c2.5.1 5 1 7 2.6a11 11 0 0 1 3.7 6.4 7 7 0 0 1 4.3 5.2Z"/><path class="headwearColorB" d="M127 64.4c0 .4-.1.7-.4 1-.6.9-1.8 1.7-3 2.5-1-.8-2.2-1.6-2.9-2.5-.2-.3-.4-.6-.4-1 0-.6.9-1.3 1.5-1.4.7-.2 1.2-.1 1.9-.1h1.8c.6.2 1.6.9 1.6 1.5Z"/><path class="hwStr1" stroke-width="4" d="M96.5 64a2.1 2.1 0 1 1 4.2 0 2.1 2.1 0 0 1-4.2 0Z"/><path class="hwStr1" stroke-width="3" d="M123.5 57.5c-2.5.1-5 1-6.9 2.6a11 11 0 0 0-3.8 6.4 7 7 0 0 0-4.3 5.2c-.5 3.2 2 6.3 5 7.6 3 1.2 6.4 1.2 9.6 1"/><path class="hwStr1" stroke-width="3" d="M123.7 73.7c-2.1.8-4.9-.3-6-2.2m6-8.6h-1.9c-.6.2-1.5.9-1.5 1.5 0 .4.2.7.4 1 .7.9 1.8 1.7 3 2.5"/><path fill="#000" class="hwStr1" stroke-width="4" d="M150.8 64a2.1 2.1 0 1 0-4.2 0 2.1 2.1 0 0 0 4.2 0Z"/><path class="hwStr1" stroke-width="3" d="M123.8 57.5c2.5.1 5 1 7 2.6a11 11 0 0 1 3.7 6.4 7 7 0 0 1 4.3 5.2c.5 3.2-2 6.3-5 7.6a22 22 0 0 1-9.6 1"/><path class="hwStr1" stroke-width="3" d="M123.7 62.9h1.8c.6.2 1.6.9 1.6 1.5 0 .4-.2.7-.5 1-.6.9-1.8 1.7-3 2.5v5.8c2.2.8 5-.3 6-2.2"/></svg>'
|
||||
),
|
||||
Headwear.HeadwearVariants.BEAR,
|
||||
_getHeadwearColor(bearColor)
|
||||
);
|
||||
}
|
||||
|
||||
function _getBearStyle(BearColors bearColor) internal pure returns (string memory) {
|
||||
(string memory lightColor, string memory baseColor) = _getBearColor(bearColor);
|
||||
return
|
||||
string.concat(
|
||||
'<style>.headwearColorL { fill:',
|
||||
lightColor,
|
||||
'}.headwearColorB { fill:',
|
||||
baseColor,
|
||||
'}.hwStr1 {stroke: #000;stroke-linecap: round;stroke-linejoin: round;}</style>'
|
||||
);
|
||||
}
|
||||
|
||||
function _getBearColor(BearColors bearColor) internal pure returns (string memory, string memory) {
|
||||
if (bearColor == BearColors.GREEN) {
|
||||
return (LensColors.lightGreen, LensColors.baseGreen);
|
||||
} else if (bearColor == BearColors.PURPLE) {
|
||||
return (LensColors.lightPurple, LensColors.basePurple);
|
||||
} else if (bearColor == BearColors.BLUE) {
|
||||
return (LensColors.lightBlue, LensColors.baseBlue);
|
||||
} else if (bearColor == BearColors.PINK) {
|
||||
return (LensColors.lightPink, LensColors.basePink);
|
||||
} else if (bearColor == BearColors.GOLD) {
|
||||
return (LensColors.lightGold, LensColors.baseGold);
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
}
|
||||
|
||||
function _getHeadwearColor(BearColors bearColor) internal pure returns (Headwear.HeadwearColors) {
|
||||
if (bearColor == BearColors.GREEN) {
|
||||
return Headwear.HeadwearColors.GREEN;
|
||||
} else if (bearColor == BearColors.PURPLE) {
|
||||
return Headwear.HeadwearColors.PURPLE;
|
||||
} else if (bearColor == BearColors.BLUE) {
|
||||
return Headwear.HeadwearColors.BLUE;
|
||||
} else if (bearColor == BearColors.PINK) {
|
||||
return Headwear.HeadwearColors.PINK;
|
||||
} else if (bearColor == BearColors.GOLD) {
|
||||
return Headwear.HeadwearColors.GOLD;
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
}
|
||||
}
|
||||
73
contracts/libraries/svgs/Profile/Headwear/HeadwearBee.sol
Normal file
73
contracts/libraries/svgs/Profile/Headwear/HeadwearBee.sol
Normal file
@@ -0,0 +1,73 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import {Headwear} from 'contracts/libraries/svgs/Profile/Headwear.sol';
|
||||
import {LensColors} from 'contracts/libraries/svgs/Profile/LensColors.sol';
|
||||
|
||||
library HeadwearBee {
|
||||
enum BeeColors {
|
||||
GREEN,
|
||||
PINK,
|
||||
PURPLE,
|
||||
BLUE,
|
||||
GOLD
|
||||
}
|
||||
|
||||
function getBee(
|
||||
BeeColors beeColor
|
||||
) external pure returns (string memory, Headwear.HeadwearVariants, Headwear.HeadwearColors) {
|
||||
return (
|
||||
string.concat(
|
||||
'<svg xmlns="http://www.w3.org/2000/svg" width="210" height="335" fill="none">',
|
||||
_getBeeStyle(beeColor),
|
||||
'<path class="headwearColorB" d="m158.7 77 .3.3a35.6 35.6 0 0 1-8 5.6l-.1-.9c0-7-2.3-14-6.6-19.5v-.2c2.5-.7 4.9-1.8 7-3.3 4.3 4.8 7 10.3 7.4 18Z"/><path class="headwearColorL" d="M151 82.9a37 37 0 0 1-9.1 3l-.2-1.3c0-8-3-16.1-8.2-22.2l-.7-.3a21 21 0 0 1 8-2.6h.6a27 27 0 0 1-.6 3.4c1.2-.1 2.3-.3 3.4-.6v.2A31.8 31.8 0 0 1 151 82v.9Z"/><path class="headwearColorB" d="m141.7 84.6.2 1.3c-2 .3-4 .3-6 0a16 16 0 0 1-5.4-1.9l1.8-.2c.7-5.9-1-12-4.6-16.6l-.4-.3a21 21 0 0 1 5.5-4.8l.7.3a34.2 34.2 0 0 1 8.2 22.2Z"/><path class="headwearColorL" d="M130.5 84c-2.2-1.2-4-3-5.2-5.1a11.2 11.2 0 0 1-1.1-7.7h.5a19 19 0 0 1 2.6-4.3l.4.3a22.6 22.6 0 0 1 4.6 16.6l-1.8.2Z"/><path fill="#fff" d="M140.9 59.5a19.6 19.6 0 0 0-13.6 7.4 19 19 0 0 0-2.6 4.3h-.5a9.2 9.2 0 0 1 2.3-4.5 8.4 8.4 0 0 1-3-9.7 10 10 0 0 1 7.8-6.3 13 13 0 0 1 10 2.9c0-4.2.1-8.4 2.5-11.4l1.4-1.4.3.2a18 18 0 0 0-3.6 10.4c-.2 2.7-.2 5.4-.5 8.2h-.5Z"/><path fill="#fff" d="m140.8 62.9.6-3.3c.3-2.8.3-5.5.5-8.2a18 18 0 0 1 3.6-10.4l-.3-.2a9.2 9.2 0 0 1 9.7-1c3.3 1.8 5 5.6 4.5 9.2h-.3a21.7 21.7 0 0 1-18.3 13.9Z"/><path class="headwearColorL" d="M159 50.5c3.3.7 6 2.5 7.5 5.1 1.5 2.6 1.7 5.7 1 8.6-.6 2.8-2 5.5-3.8 7.9a35 35 0 0 1-4.7 5.2l-.3-.4c-.4-7.6-3-13.1-7.4-18a21 21 0 0 0 7.8-10l.3.1-.3 1.5Zm2.7 8.9c.1-.5-.6-1.4-1.1-1-.5.2-.6 1-.2 1.3.3.4 1.1.2 1.3-.3Z"/><path class="hwStr1" stroke-width="4" d="M49.9 86.4a15.2 15.2 0 0 1 .4-5.3m2.7-5.3 2.4-3.8m5.2-4c1-1 2.4-1.8 3.8-2.3m7-1.2c1.3-.4 2.8-.3 4.1 0m7.3 2.5 3.5 2.1m7 4 4 2m7.5 1.3c1.8.4 3.6.6 5.4.5m48.8.4a35 35 0 0 0 4.7-5.2c1.7-2.4 3.2-5 3.8-8 .7-2.8.5-6-1-8.5a11 11 0 0 0-7.4-5.1l.3-1.5a9.2 9.2 0 0 0-4.5-9.2 9.2 9.2 0 0 0-11.1 2.4c-2.4 3-2.5 7.2-2.5 11.4a13 13 0 0 0-10-2.9c-3.5.6-6.7 3-7.9 6.3a8.4 8.4 0 0 0 3.1 9.7 9.2 9.2 0 0 0-2.3 4.5c-.6 2.5-.2 5.4 1 7.7 1.3 2.2 3.1 3.9 5.3 5.1a16 16 0 0 0 5.4 1.9c2 .3 4 .3 6 0a28.2 28.2 0 0 0 9-3c3-1.5 5.7-3.4 8.1-5.6Z"/><path class="hwStr1" stroke-width="3" d="m145.6 40.8-.1.2a18 18 0 0 0-3.6 10.4c-.2 2.7-.2 5.4-.5 8.2a27 27 0 0 1-.6 3.3 21.9 21.9 0 0 0 18.3-14m-34.4 22.3a20.4 20.4 0 0 1 16.2-11.7"/><path class="hwStr1" stroke-width="3" d="M142 61.3c3.6-3.2 6.4-7.2 8.4-11.5M131.2 58c1.5 1 3.2 1.7 5 2.1m-8.5 7.1a22.6 22.6 0 0 1 4.6 16.6m1.2-21.4a34.2 34.2 0 0 1 8.2 22.2m2.6-22.1a31.8 31.8 0 0 1 6.6 19.5m.4-23s0 0 0 0c4.3 4.8 7 10.3 7.4 18"/><path fill="#000" d="M160.6 58.3c-.5.3-.6 1-.2 1.4.3.4 1.1.2 1.3-.3.1-.5-.6-1.4-1.1-1Z"/><path class="hwStr1" stroke-width="3" d="M160.6 58.3c-.5.3-.6 1-.2 1.4.3.4 1.1.2 1.3-.3.1-.5-.6-1.4-1.1-1Z"/></svg>'
|
||||
),
|
||||
Headwear.HeadwearVariants.BEE,
|
||||
_getHeadwearColor(beeColor)
|
||||
);
|
||||
}
|
||||
|
||||
function _getBeeStyle(BeeColors beeColor) internal pure returns (string memory) {
|
||||
(string memory lightColor, string memory baseColor) = _getBeeColor(beeColor);
|
||||
return
|
||||
string.concat(
|
||||
'<style>.headwearColorL { fill:',
|
||||
lightColor,
|
||||
'}.headwearColorB { fill:',
|
||||
baseColor,
|
||||
'}.hwStr1 {stroke: #000;stroke-linecap: round;stroke-linejoin: round;}</style>'
|
||||
);
|
||||
}
|
||||
|
||||
function _getBeeColor(BeeColors beeColor) internal pure returns (string memory, string memory) {
|
||||
if (beeColor == BeeColors.GREEN) {
|
||||
return (LensColors.lightGreen, LensColors.baseGreen);
|
||||
} else if (beeColor == BeeColors.PURPLE) {
|
||||
return (LensColors.lightPurple, LensColors.basePurple);
|
||||
} else if (beeColor == BeeColors.BLUE) {
|
||||
return (LensColors.lightBlue, LensColors.baseBlue);
|
||||
} else if (beeColor == BeeColors.PINK) {
|
||||
return (LensColors.lightPink, LensColors.basePink);
|
||||
} else if (beeColor == BeeColors.GOLD) {
|
||||
return (LensColors.lightGold, LensColors.baseGold);
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
}
|
||||
|
||||
function _getHeadwearColor(BeeColors beeColor) internal pure returns (Headwear.HeadwearColors) {
|
||||
if (beeColor == BeeColors.GREEN) {
|
||||
return Headwear.HeadwearColors.GREEN;
|
||||
} else if (beeColor == BeeColors.PURPLE) {
|
||||
return Headwear.HeadwearColors.PURPLE;
|
||||
} else if (beeColor == BeeColors.BLUE) {
|
||||
return Headwear.HeadwearColors.BLUE;
|
||||
} else if (beeColor == BeeColors.PINK) {
|
||||
return Headwear.HeadwearColors.PINK;
|
||||
} else if (beeColor == BeeColors.GOLD) {
|
||||
return Headwear.HeadwearColors.GOLD;
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
}
|
||||
}
|
||||
73
contracts/libraries/svgs/Profile/Headwear/HeadwearBirdie.sol
Normal file
73
contracts/libraries/svgs/Profile/Headwear/HeadwearBirdie.sol
Normal file
@@ -0,0 +1,73 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import {Headwear} from 'contracts/libraries/svgs/Profile/Headwear.sol';
|
||||
import {LensColors} from 'contracts/libraries/svgs/Profile/LensColors.sol';
|
||||
|
||||
library HeadwearBirdie {
|
||||
enum BirdieColors {
|
||||
GREEN,
|
||||
PINK,
|
||||
PURPLE,
|
||||
BLUE,
|
||||
GOLD
|
||||
}
|
||||
|
||||
function getBirdie(
|
||||
BirdieColors birdieColor
|
||||
) external pure returns (string memory, Headwear.HeadwearVariants, Headwear.HeadwearColors) {
|
||||
return (
|
||||
string.concat(
|
||||
'<svg xmlns="http://www.w3.org/2000/svg" width="210" height="335" fill="none">',
|
||||
_getBirdieStyle(birdieColor),
|
||||
'<path fill="#fff" d="M130.8 106.3c.3 6.9-2.9 11.5-7.2 13.8a62.3 62.3 0 0 1-18 2.2c-6.4 0-12.2-.5-18-2.2-4.2-2.3-7.4-7-7-13.8.1-6 3.5-11.8 8-15.7a27 27 0 0 1 17-5.9 27 27 0 0 1 17 5.9c4.6 4 8 9.7 8.2 15.7Z"/><path class="headwearColorB" d="M110.6 26.7a6.7 6.7 0 0 1-4.8 6.6h-.3a6.7 6.7 0 0 1-4.7-6.6 7.3 7.3 0 0 1 4.9-6.5c2.7.9 4.8 3.6 4.9 6.5Z"/><path class="headwearColorL" d="M105.8 33.3a14.8 14.8 0 0 1 12.9 7.5c1 1.8 1.4 3.8 1.4 5.8l.2 15.5c9 2.7 17.3 9.5 21.8 17.7a28 28 0 0 1 0 27 30.4 30.4 0 0 1-18.4 13.3c4.2-2.3 7.4-7 7.1-13.8-.2-6-3.6-11.8-8.1-15.7a27 27 0 0 0-17-5.9 27 27 0 0 0-17 5.9c-4.6 4-8 9.7-8.2 15.7-.3 6.9 3 11.5 7.2 13.8l-2.4-.7a30.4 30.4 0 0 1-16-12.7 28 28 0 0 1 0-26.9c4.4-8.2 12.8-15 21.7-17.7l.2-15.5c0-2 .5-4 1.5-5.8a14.4 14.4 0 0 1 12.8-7.5h.3Z"/><path class="hwStr1" stroke-width="4" d="M105.5 33.3h.2m0-13.1a7.3 7.3 0 0 0-5 6.5 6.7 6.7 0 0 0 4.8 6.6"/><path class="hwStr1" stroke-width="3" d="M87.7 120.1c-4.3-2.3-7.5-7-7.2-13.8.2-6 3.6-11.8 8.2-15.7a27 27 0 0 1 17-5.9"/><path class="hwStr1" stroke-width="4" d="M105.8 33.3h-.1m0-13.1c2.7.9 4.8 3.6 4.9 6.5a6.7 6.7 0 0 1-4.8 6.6"/><path class="hwStr1" stroke-width="4" d="M105.7 33.3h-.2a14.4 14.4 0 0 0-12.8 7.5c-1 1.8-1.4 3.8-1.5 5.8v8.9c-.1 3.9-2.7 7.2-6.2 9a38.1 38.1 0 0 0-15.7 15.3 28 28 0 0 0 0 27A30.4 30.4 0 0 0 87.6 120a62.3 62.3 0 0 0 18 2.2m0-89h.1a14.8 14.8 0 0 1 12.9 7.5c1 1.8 1.4 3.8 1.4 5.8l.1 8.9c0 3.9 2.7 7.2 6.1 9A38.2 38.2 0 0 1 142 79.7a28 28 0 0 1 0 27 30.4 30.4 0 0 1-18.4 13.3 62.3 62.3 0 0 1-18 2.2"/><path class="hwStr1" stroke-width="3" d="M123.7 120.1c4.2-2.3 7.4-7 7.1-13.8-.2-6-3.6-11.8-8.1-15.7a27 27 0 0 0-17-5.9"/><path class="headwearColorB" d="m111.8 53.3-.3.3-5.9 3.4-6-3.4-.2-.3c2-1.7 4-3.1 6.2-4.7 2.2 1.6 4.2 3 6.2 4.7Z"/><path class="headwearColorB" d="M105.6 63.6c-2.4-2.7-5-6.5-7.1-9.5l1-.8.2.3 6 3.4 5.8-3.4.3-.3 1 .8c-2.1 3-4.8 6.8-7.2 9.5Z"/><path class="hwStr1" stroke-width="3" d="M108 50.4a4 4 0 0 0-4.8 0l-3.8 2.9v0c-.5.4-.6 1.2-.2 1.8a94 94 0 0 0 6.4 8.5"/><path class="hwStr1" stroke-width="3" d="M103.2 50.4a4 4 0 0 1 4.8 0l3.8 2.9v0c.5.4.6 1.2.2 1.8a93 93 0 0 1-6.4 8.5"/><path class="hwStr1" stroke-width="2.5" d="m99.7 53.6 6 3.4 5.8-3.4"/><circle cx="99.7" cy="45.1" r="2" fill="#000"/><circle cx="111.7" cy="45.1" r="2" fill="#000"/></svg>'
|
||||
),
|
||||
Headwear.HeadwearVariants.BIRDIE,
|
||||
_getHeadwearColor(birdieColor)
|
||||
);
|
||||
}
|
||||
|
||||
function _getBirdieStyle(BirdieColors birdieColor) internal pure returns (string memory) {
|
||||
(string memory lightColor, string memory baseColor) = _getBirdieColor(birdieColor);
|
||||
return
|
||||
string.concat(
|
||||
'<style>.headwearColorL { fill:',
|
||||
lightColor,
|
||||
'}.headwearColorB { fill:',
|
||||
baseColor,
|
||||
'}.hwStr1 {stroke: #000;stroke-linecap: round;stroke-linejoin: round;}</style>'
|
||||
);
|
||||
}
|
||||
|
||||
function _getBirdieColor(BirdieColors birdieColor) internal pure returns (string memory, string memory) {
|
||||
if (birdieColor == BirdieColors.GREEN) {
|
||||
return (LensColors.lightGreen, LensColors.baseGreen);
|
||||
} else if (birdieColor == BirdieColors.PURPLE) {
|
||||
return (LensColors.lightPurple, LensColors.basePurple);
|
||||
} else if (birdieColor == BirdieColors.BLUE) {
|
||||
return (LensColors.lightBlue, LensColors.baseBlue);
|
||||
} else if (birdieColor == BirdieColors.PINK) {
|
||||
return (LensColors.lightPink, LensColors.basePink);
|
||||
} else if (birdieColor == BirdieColors.GOLD) {
|
||||
return (LensColors.lightGold, LensColors.baseGold);
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
}
|
||||
|
||||
function _getHeadwearColor(BirdieColors birdieColor) internal pure returns (Headwear.HeadwearColors) {
|
||||
if (birdieColor == BirdieColors.GREEN) {
|
||||
return Headwear.HeadwearColors.GREEN;
|
||||
} else if (birdieColor == BirdieColors.PURPLE) {
|
||||
return Headwear.HeadwearColors.PURPLE;
|
||||
} else if (birdieColor == BirdieColors.BLUE) {
|
||||
return Headwear.HeadwearColors.BLUE;
|
||||
} else if (birdieColor == BirdieColors.PINK) {
|
||||
return Headwear.HeadwearColors.PINK;
|
||||
} else if (birdieColor == BirdieColors.GOLD) {
|
||||
return Headwear.HeadwearColors.GOLD;
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
}
|
||||
}
|
||||
70
contracts/libraries/svgs/Profile/Headwear/HeadwearBrains.sol
Normal file
70
contracts/libraries/svgs/Profile/Headwear/HeadwearBrains.sol
Normal file
@@ -0,0 +1,70 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import {Headwear} from 'contracts/libraries/svgs/Profile/Headwear.sol';
|
||||
import {LensColors} from 'contracts/libraries/svgs/Profile/LensColors.sol';
|
||||
|
||||
library HeadwearBrains {
|
||||
enum BrainsColors {
|
||||
GREEN,
|
||||
PINK,
|
||||
PURPLE,
|
||||
BLUE,
|
||||
GOLD
|
||||
}
|
||||
|
||||
function getBrains(
|
||||
BrainsColors brainsColor
|
||||
) external pure returns (string memory, Headwear.HeadwearVariants, Headwear.HeadwearColors) {
|
||||
return (
|
||||
string.concat(
|
||||
'<svg xmlns="http://www.w3.org/2000/svg" width="210" height="335" fill="none">',
|
||||
_getBrainsStyle(brainsColor),
|
||||
'<path fill="#fff" d="M150.3 95.3c.5 3.3-.6 6.7-3.2 8.7a13 13 0 0 1-3.4 2 213 213 0 0 1-38.6 3.6h-.2c-9.7 0-33.8-1.7-38.6-3.6a13 13 0 0 1-3.4-2 9.2 9.2 0 0 1-3.2-8.7l.6-3c.3 1.1 2 2 4.5 2.7a63 63 0 0 0 9.5 1.6A406.9 406.9 0 0 0 105 98h.2a407.3 407.3 0 0 0 30.6-1.3c3.7-.4 7-1 9.5-1.6 2.5-.7 4.2-1.6 4.6-2.7l.5 3Z"/><path class="headwearColorL" d="M138 81.1c4 3.2 6.6 8 7 13l.2.9a62 62 0 0 1-9.5 1.6v-.8a19 19 0 0 0-4.9-8.6l-1 .5c-3.4 1.9-6.1 5-7.3 8.8v1c-7.1.4-13.8.4-17.4.4h-.2c-3.6 0-10.3 0-17.5-.3v-1.1a15 15 0 0 0-7.2-8.8l-1-.5a19 19 0 0 0-4.8 8.6v.8c-3.8-.4-7.2-1-9.6-1.6l.2-1c.4-5 3-9.7 7-12.9a13.5 13.5 0 0 1 11.7-15v.3c.3 1.8.2 3.7-.2 5.7h.4a17 17 0 0 1 7.7 9.4h.2a21 21 0 0 1 12.1-.2h2.2a21 21 0 0 1 12.1.1h.2c1.3-3.8 4-7.3 7.7-9.3h.4c-.4-2-.5-3.9-.3-5.7v-.3c3.7.6 6.9 2.4 9 5a14 14 0 0 1 2.9 10Z"/><path class="headwearColorL" d="m135.6 95.8.1.8c-4 .5-8.7.8-13.1 1v-1.1a15 15 0 0 1 7.2-8.8l1-.5a19 19 0 0 1 4.8 8.6Zm-30.7-33h.2a20.7 20.7 0 0 1 20.8 3.3h.4v.3c-.3 1.8-.2 3.7.2 5.7h-.4a17 17 0 0 0-7.7 9.4h-.2a21 21 0 0 0-12.1-.2h-2.2a21 21 0 0 0-12.1.1h-.2c-1.3-3.8-4-7.3-7.7-9.3h-.4c.4-2 .5-3.9.3-5.7v-.3h.3c5.4-4.9 14.1-6 20.8-3.3ZM87.5 96.5v1c-4.5-.1-9-.4-13.2-.9v-.8a19 19 0 0 1 4.9-8.6l1 .5c3.4 1.9 6 5 7.3 8.8Z"/><path class="hwStr1" stroke-width="4" d="M65 94a18.5 18.5 0 0 1 9.5-14.6"/><path class="hwStr1" stroke-width="4" d="M72 81.1a13.5 13.5 0 0 1 11.7-15h.4c5.4-4.9 14.1-6 20.8-3.3h-.2m-9.8 7.4a16 16 0 0 0 10 3.1"/><path class="hwStr1" stroke-width="4" d="M83.8 66.4c.2 1.8.1 3.7-.3 5.7l-3.3 3.2M84 72a17.2 17.2 0 0 1 8.5 13.5"/><path class="hwStr1" stroke-width="4" d="M91.8 81.4a21 21 0 0 1 12.1 0M97 90.2a12 12 0 0 0-3.4 6.5m-6.1-.2c-1.2-3.7-3.9-7-7.3-8.8"/><path class="hwStr1" stroke-width="4" d="M85.5 82.8a19 19 0 0 0-11.1 13M145 94a18.5 18.5 0 0 0-9.5-14.6"/><path class="hwStr1" stroke-width="4" d="M138 81.1a13.6 13.6 0 0 0-12.1-15c-5.4-4.9-14-6-20.8-3.3h.2m9.8 7.4a16 16 0 0 1-10 3.1"/><path class="hwStr1" stroke-width="4" d="M126.2 66.4c-.2 1.8-.1 3.7.3 5.7l3.3 3.2M126 72a17.3 17.3 0 0 0-8.5 13.5"/><path class="hwStr1" stroke-width="4" d="M118.2 81.4a21 21 0 0 0-12.1 0m6.9 8.8c1.7 1.7 3 4 3.4 6.5m6.1-.2c1.2-3.7 3.9-7 7.3-8.8"/><path class="hwStr1" stroke-width="4" d="M124.5 82.8a19 19 0 0 1 11.1 13m-30.5-33V98"/><path fill="#000" fill-rule="evenodd" d="M149.8 90.3a2 2 0 0 1 1.9 1.5v.4h.1v.4h.1v.3l.1.1.1.3v.3l.2.2c.6 4.2-.7 8.5-3.8 11.3a14 14 0 0 1-4 2.5c-5.2 2.2-14.3 4.5-39.4 4.5-25.1 0-34.4-2.3-39.5-4.5a12.4 12.4 0 0 1-7.4-15.2l.1-.5a2 2 0 0 1 3.8-.2l.6.5 2.6 1c2.3.6 5.6 1.1 9.2 1.5a413.5 413.5 0 0 0 48 1 171.8 171.8 0 0 0 22.2-2.5l2.6-1 .6-.5a2 2 0 0 1 1.9-1.3ZM61.6 96a8.3 8.3 0 0 0 5.5 7.9c4.4 1.8 13 4.1 38 4.1s33.4-2.3 37.8-4.1c1-.5 2-1.1 3-1.9a8.3 8.3 0 0 0 2.5-6l-2.6.9-.6-2 .6 2c-2.7.7-6.1 1.3-9.8 1.7-4.2.5-8.9.8-13.3 1l-.1-2v2a409.2 409.2 0 0 1-35.2 0v-2 2c-4.5-.2-9.1-.5-13.3-1l.2-2-.2 2A64.8 64.8 0 0 1 61.6 96Z" clip-rule="evenodd"/><g clip-path="url(#a)"><path fill="#fff" fill-opacity=".3" d="M104.7 47c-25 0-45.4 17.7-45.4 39.3 0 2.3.3 4 .7 6 .3 1.1 2 2 4.5 2.7a63 63 0 0 0 9.5 1.6 415.4 415.4 0 0 0 61.4 0c3.8-.4 7-1 9.6-1.6 2.5-.7 4.1-1.6 4.5-2.7.4-2 .6-3.7.6-6 0-21.6-20.3-39.2-45.4-39.2Z"/></g><path stroke="#000" stroke-width="4" d="M60.2 92.9c-.4-2.1-.6-4.3-.6-6.6 0-21.6 20.3-39.2 45.4-39.2 25 0 45.4 17.6 45.4 39.2 0 2.3-.2 4.5-.6 6.6"/><path class="hwStr1" stroke-width="4" d="M60.3 92.3c.3 1.1 2 2 4.5 2.7a63 63 0 0 0 9.5 1.6 415.4 415.4 0 0 0 61.4 0c3.7-.4 7-1 9.5-1.6 2.5-.7 4.2-1.6 4.6-2.7"/><path stroke="#000" stroke-opacity=".3" stroke-width="2" d="M61.6 101.2s16.2 3.4 43.4 3.4 43.4-3.4 43.4-3.4"/><defs><clipPath id="a"><path fill="#fff" d="M59.3 47h90.8v51H59.3z"/></clipPath></defs></svg>'
|
||||
),
|
||||
Headwear.HeadwearVariants.BRAINS,
|
||||
_getHeadwearColor(brainsColor)
|
||||
);
|
||||
}
|
||||
|
||||
function _getBrainsStyle(BrainsColors brainsColor) internal pure returns (string memory) {
|
||||
return
|
||||
string.concat(
|
||||
'<style>.headwearColorL { fill:',
|
||||
_getBrainsColor(brainsColor),
|
||||
'}.hwStr1 {stroke: #000;stroke-linecap: round;stroke-linejoin: round;}</style>'
|
||||
);
|
||||
}
|
||||
|
||||
function _getBrainsColor(BrainsColors brainsColor) internal pure returns (string memory) {
|
||||
if (brainsColor == BrainsColors.GREEN) {
|
||||
return LensColors.lightGreen;
|
||||
} else if (brainsColor == BrainsColors.PURPLE) {
|
||||
return LensColors.lightPurple;
|
||||
} else if (brainsColor == BrainsColors.BLUE) {
|
||||
return LensColors.lightBlue;
|
||||
} else if (brainsColor == BrainsColors.PINK) {
|
||||
return LensColors.lightPink;
|
||||
} else if (brainsColor == BrainsColors.GOLD) {
|
||||
return LensColors.lightGold;
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
}
|
||||
|
||||
function _getHeadwearColor(BrainsColors brainsColor) internal pure returns (Headwear.HeadwearColors) {
|
||||
if (brainsColor == BrainsColors.GREEN) {
|
||||
return Headwear.HeadwearColors.GREEN;
|
||||
} else if (brainsColor == BrainsColors.PURPLE) {
|
||||
return Headwear.HeadwearColors.PURPLE;
|
||||
} else if (brainsColor == BrainsColors.BLUE) {
|
||||
return Headwear.HeadwearColors.BLUE;
|
||||
} else if (brainsColor == BrainsColors.PINK) {
|
||||
return Headwear.HeadwearColors.PINK;
|
||||
} else if (brainsColor == BrainsColors.GOLD) {
|
||||
return Headwear.HeadwearColors.GOLD;
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
}
|
||||
}
|
||||
73
contracts/libraries/svgs/Profile/Headwear/HeadwearBull.sol
Normal file
73
contracts/libraries/svgs/Profile/Headwear/HeadwearBull.sol
Normal file
@@ -0,0 +1,73 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import {Headwear} from 'contracts/libraries/svgs/Profile/Headwear.sol';
|
||||
import {LensColors} from 'contracts/libraries/svgs/Profile/LensColors.sol';
|
||||
|
||||
library HeadwearBull {
|
||||
enum BullColors {
|
||||
GREEN,
|
||||
PINK,
|
||||
PURPLE,
|
||||
BLUE,
|
||||
GOLD
|
||||
}
|
||||
|
||||
function getBull(
|
||||
BullColors bullColor
|
||||
) external pure returns (string memory, Headwear.HeadwearVariants, Headwear.HeadwearColors) {
|
||||
return (
|
||||
string.concat(
|
||||
'<svg xmlns="http://www.w3.org/2000/svg" width="250" height="335" x="-18.6" fill="none">',
|
||||
_getBullStyle(bullColor),
|
||||
'<path class="headwearColorL" d="M203.8 88.7s11.1 15 16.5 17.4c-9.6-3.6-23-5.1-41.4-8-18-2.8-36.8-3.7-55.2-3.7-18.5 0-37.2.9-55.2 3.7-18.4 2.9-31.8 4.4-41.5 8 5.4-2.4 16.7-17.6 16.7-17.6S35.2 76.2 41 69c6-7.6 20.7-2.9 20.7-2.9S91.8 49.6 104.9 48a141 141 0 0 1 37.5 0c13.1 1.7 42 17.8 42 17.8s16.5-3.8 21.8 3c6.9 8.6-2.4 20-2.4 20Z"/><path class="headwearColorL" d="M241.2 115.7c2.6 2.8 4.3 6.6 3.6 10.4.5-3.3-2.7-5.8-5.7-7.3-8.7-4.6-18.3-3.4-27.9-5.6-28.8-6.5-61-10-87.5-10-26.6 0-58.8 3.5-87.6 10-9.6 2.2-19.3 2.6-28 7.1-3 1.5-6 2.6-5.5 5.8-.8-3.7.7-7.9 3.3-10.6 2.5-2.6 9-4.6 21-8.7 9.7-3.3 23.2-4.8 41.6-7.4a374.7 374.7 0 0 1 110.4 0c18.3 2.6 31.9 3.8 41.6 7 12 4.2 18.2 6.8 20.7 9.3Z"/><path class="hwStr1" stroke-width="4" d="M123.7 104.5c-26.6 0-58.8 2.9-87.6 7.9a140 140 0 0 0-27.9 7.1c-3 1.2-6.1 3.1-5.6 5.7.3 1.5 5 5.3 19.2 7.2M27 106s0 0 0 0a34.4 34.4 0 0 0 16.5-17.6m80.2 16.1c26.5 0 58.7 2.9 87.5 7.9a140 140 0 0 1 28 7.1c2.9 1.2 6 3.1 5.6 5.7-.4 1.5-5 5.3-19.3 7.2"/><path class="hwStr1" stroke-width="4" d="M2.6 123.1s0 0 0 0c-.8-3 1-6.2 3.6-8.4 2.5-2 8.7-5.3 20.8-8.6m217.8 17s0 0 0 0c.7-3-1-6.2-3.6-8.4-2.5-2-8.7-5.3-20.9-8.6m.1-.1s0 0 0 0A34.4 34.4 0 0 1 204 88.7"/><path class="headwearColorL" d="M4.5 124.7c-2-2.6 17.4-7.4 17.4-7.4s-1.3 4-1.8 6.8c-.3 2.3-.4 6-.4 6s-12-1.3-15.2-5.4Zm238.4 0c2-2.6-17.4-7.4-17.4-7.4s1.3 4 1.7 6.8c.4 2.3.5 6 .5 6s12-1.3 15.2-5.4Z"/><path fill="#000" fill-opacity=".3" d="M4.5 124.7c-2-2.6 17.4-7.4 17.4-7.4s-1.3 4-1.8 6.8c-.3 2.3-.4 6-.4 6s-12-1.3-15.2-5.4Zm238.4 0c2-2.6-17.4-7.4-17.4-7.4s1.3 4 1.7 6.8c.4 2.3.5 6 .5 6s12-1.3 15.2-5.4Z"/><path class="hwStr1" stroke-width="3" d="M27 106.6c9.7-2.7 23.1-5.4 41.5-7.5a476 476 0 0 1 110.4 0c18.3 2.1 31.8 4.8 41.4 7.5"/><path stroke="#000" stroke-dasharray="9 9" stroke-linecap="round" stroke-linejoin="round" stroke-opacity=".2" stroke-width="2.5" d="M37.5 98.7c8.3-1.8 18.5-3.5 31-5a476 476 0 0 1 110.4 0c12.9 1.5 23.4 3.3 31.8 5.1"/><path fill="#fff" d="m184.4 66.2-.4.7c-5 1.4-10.7.7-15.2-1.9a19 19 0 0 1-9.3-12.5 34.3 34.3 0 0 0 16.9-30 35 35 0 0 1 8 43.7ZM71 22.5a34.4 34.4 0 0 0 16.8 30A19 19 0 0 1 78.6 65a20.4 20.4 0 0 1-15.2 2l-.4-.8c-4-7.1-5.3-15.3-4-23.1a35 35 0 0 1 12-20.6Z"/><path class="hwStr1" stroke-width="4" d="M88.7 51.8a98 98 0 0 1 34.7-5.3M63 66.2l.4.7c5 1.4 10.6.7 15.2-1.9 4.5-2.6 8-7 9.2-12.5l-1-.6A34.4 34.4 0 0 1 71 22.5a35 35 0 0 0-8 43.7Z"/><path class="hwStr1" stroke-width="3" d="M71.6 59a25 25 0 0 0 11.3-9m-12.2-6.7c1.7 0 3.5-.4 5-1.3M64 43.6h1.7"/><path class="hwStr1" stroke-width="4" d="M158.6 51.8a98 98 0 0 0-34.7-5.3m35.6 6a34.3 34.3 0 0 0 16.9-30 35 35 0 0 1 7.6 44.4c-5 1.4-10.7.7-15.2-1.9a19 19 0 0 1-9.3-12.5Z"/><path class="hwStr1" stroke-width="3" d="M175.7 59a24.8 24.8 0 0 1-11.3-9m12.3-6.7a10 10 0 0 1-5.1-1.3m11.7 1.6h-1.6"/><path fill="#000" class="hwStr1" stroke-width="4" d="M96.7 64a2.1 2.1 0 1 1 4.2 0 2.1 2.1 0 0 1-4.2 0Zm54 0a2.1 2.1 0 1 0-4.2 0 2.1 2.1 0 0 0 4.2 0Z"/><path fill="#fff" d="M133.9 66.9c2.2 1.2 3.2 4.1 2.6 6.6a8.4 8.4 0 0 1-5 5.4c-2.4 1-5.2.7-7.8.7-2.7 0-5.5.3-7.8-.7-2.4-1-4.4-3-5-5.4-.7-2.5.3-5.4 2.6-6.6 1.5-.8 3.3-.8 5-.7 1.7.2 3.3.3 5 .3h.3a50 50 0 0 0 5-.3c1.8-.1 3.6-.1 5 .7Zm-4.3 7.5c.2-.2.3-.4.3-.7a2 2 0 0 0-.2-.7l-.5-1c-.3-.2-.6-.3-1-.3-.3 0-.5.3-.6.5v.7a2 2 0 0 0 1 1.4c.2.2.7.3 1 0Zm-9.8-1.5v-.7c-.2-.2-.4-.5-.7-.5-.4 0-.7.1-1 .4-.2.2-.3.6-.4.9a2 2 0 0 0-.2.7c0 .3 0 .5.2.7.3.2.8.1 1.1 0 .5-.4 1-1 1-1.5Z"/><path class="hwStr1" stroke-width="3" d="M123.6 66.5a50 50 0 0 1-5.1-.3 8.6 8.6 0 0 0-5 .7c-2.3 1.2-3.3 4.1-2.6 6.6a8.4 8.4 0 0 0 5 5.4c2.3 1 5.1.7 7.8.7"/><path class="hwStr1" stroke-width="3" d="M119 71.7a1 1 0 0 0-.8.4c-.3.2-.4.6-.5.9a2 2 0 0 0-.2.7c0 .3 0 .5.2.7.3.2.8.1 1.1 0 .5-.4 1-1 1-1.5v-.7c-.2-.2-.4-.5-.7-.5Zm4.8-5.2a50 50 0 0 0 5-.3c1.8-.1 3.6-.1 5 .7 2.3 1.2 3.3 4.1 2.7 6.6a8.4 8.4 0 0 1-5 5.4c-2.4 1-5.2.7-7.8.7"/><path class="hwStr1" stroke-width="3" d="M128.3 71.7c.3 0 .6.1.9.4l.5.9.2.7c0 .3 0 .5-.3.7-.3.2-.8.1-1 0-.6-.4-1-1-1-1.5v-.7c.1-.2.3-.5.7-.5Z"/><path class="hwStr1" stroke-width="4" d="M43.3 88.2S33 77.2 40.8 69c7.6-8 15.2-2.4 21.2-3m142.3 22.1s10-11 2.3-19c-7.6-8.2-15.3-2.5-21.3-3.2"/><path class="headwearColorB" d="M46 72.8a8 8 0 0 1 8.6-2.4c-3.7 3.3-6.7 7-9 11.3a7.5 7.5 0 0 1 .4-8.9Z"/><path class="hwStr1" stroke-width="2.5" d="M45.7 81.7a40 40 0 0 1 8.9-11.3 8 8 0 0 0-8.6 2.4 7.4 7.4 0 0 0-.3 8.9Z"/><path class="headwearColorB" d="M201.3 72.8a8 8 0 0 0-8.5-2.4c3.6 3.3 6.6 7 8.9 11.3a7.5 7.5 0 0 0-.4-8.9Z"/><path class="hwStr1" stroke-width="2.5" d="M201.7 81.7c-2.3-4.2-5.3-8-9-11.3 3-1 6.6 0 8.6 2.4s2.3 6.2.4 8.9Z"/></svg>'
|
||||
),
|
||||
Headwear.HeadwearVariants.BULL,
|
||||
_getHeadwearColor(bullColor)
|
||||
);
|
||||
}
|
||||
|
||||
function _getBullStyle(BullColors bullColor) internal pure returns (string memory) {
|
||||
(string memory lightColor, string memory baseColor) = _getBullColor(bullColor);
|
||||
return
|
||||
string.concat(
|
||||
'<style>.headwearColorL { fill:',
|
||||
lightColor,
|
||||
'}.headwearColorB { fill:',
|
||||
baseColor,
|
||||
'}.hwStr1 {stroke: #000;stroke-linecap: round;stroke-linejoin: round;}</style>'
|
||||
);
|
||||
}
|
||||
|
||||
function _getBullColor(BullColors bullColor) internal pure returns (string memory, string memory) {
|
||||
if (bullColor == BullColors.GREEN) {
|
||||
return (LensColors.lightGreen, LensColors.baseGreen);
|
||||
} else if (bullColor == BullColors.PURPLE) {
|
||||
return (LensColors.lightPurple, LensColors.basePurple);
|
||||
} else if (bullColor == BullColors.BLUE) {
|
||||
return (LensColors.lightBlue, LensColors.baseBlue);
|
||||
} else if (bullColor == BullColors.PINK) {
|
||||
return (LensColors.lightPink, LensColors.basePink);
|
||||
} else if (bullColor == BullColors.GOLD) {
|
||||
return (LensColors.lightGold, LensColors.baseGold);
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
}
|
||||
|
||||
function _getHeadwearColor(BullColors bullColor) internal pure returns (Headwear.HeadwearColors) {
|
||||
if (bullColor == BullColors.GREEN) {
|
||||
return Headwear.HeadwearColors.GREEN;
|
||||
} else if (bullColor == BullColors.PURPLE) {
|
||||
return Headwear.HeadwearColors.PURPLE;
|
||||
} else if (bullColor == BullColors.BLUE) {
|
||||
return Headwear.HeadwearColors.BLUE;
|
||||
} else if (bullColor == BullColors.PINK) {
|
||||
return Headwear.HeadwearColors.PINK;
|
||||
} else if (bullColor == BullColors.GOLD) {
|
||||
return Headwear.HeadwearColors.GOLD;
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,12 +2,14 @@
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import {Headwear} from 'contracts/libraries/svgs/Profile/Headwear.sol';
|
||||
import {LensColors} from 'contracts/libraries/svgs/Profile/LensColors.sol';
|
||||
|
||||
library HeadwearCrown {
|
||||
enum CrownColors {
|
||||
GREEN,
|
||||
PURPLE,
|
||||
BLUE,
|
||||
PINK,
|
||||
GOLD
|
||||
}
|
||||
|
||||
@@ -39,13 +41,15 @@ library HeadwearCrown {
|
||||
|
||||
function _getCrownColor(CrownColors crownColor) internal pure returns (string memory, string memory) {
|
||||
if (crownColor == CrownColors.GREEN) {
|
||||
return ('#F4FFDC', '#A0D170');
|
||||
return (LensColors.lightGreen, LensColors.baseGreen);
|
||||
} else if (crownColor == CrownColors.PURPLE) {
|
||||
return ('#F9F4FF', '#EAD7FF');
|
||||
return (LensColors.lightPurple, LensColors.basePurple);
|
||||
} else if (crownColor == CrownColors.BLUE) {
|
||||
return ('#F4F6FF', '#D9E0FF');
|
||||
return (LensColors.lightBlue, LensColors.baseBlue);
|
||||
} else if (crownColor == CrownColors.PINK) {
|
||||
return (LensColors.lightPink, LensColors.basePink);
|
||||
} else if (crownColor == CrownColors.GOLD) {
|
||||
return ('#FFEE93', '#FFCD3D');
|
||||
return (LensColors.lightGold, LensColors.baseGold);
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
@@ -58,6 +62,8 @@ library HeadwearCrown {
|
||||
return Headwear.HeadwearColors.PURPLE;
|
||||
} else if (crownColor == CrownColors.BLUE) {
|
||||
return Headwear.HeadwearColors.BLUE;
|
||||
} else if (crownColor == CrownColors.PINK) {
|
||||
return Headwear.HeadwearColors.PINK;
|
||||
} else if (crownColor == CrownColors.GOLD) {
|
||||
return Headwear.HeadwearColors.GOLD;
|
||||
} else {
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import {Headwear} from 'contracts/libraries/svgs/Profile/Headwear.sol';
|
||||
import {LensColors} from 'contracts/libraries/svgs/Profile/LensColors.sol';
|
||||
|
||||
library HeadwearEarrings {
|
||||
enum EarringsColors {
|
||||
GREEN,
|
||||
PINK,
|
||||
PURPLE,
|
||||
BLUE,
|
||||
GOLD
|
||||
}
|
||||
|
||||
function getEarrings(
|
||||
EarringsColors earringsColor
|
||||
) external pure returns (string memory, Headwear.HeadwearVariants, Headwear.HeadwearColors) {
|
||||
return (
|
||||
string.concat(
|
||||
'<svg xmlns="http://www.w3.org/2000/svg" width="250" height="335" x="-1.5" fill="none">',
|
||||
_getEarringsStyle(earringsColor),
|
||||
'<path class="headwearColorL" d="m26 165.5.5.9c-5 4.9-9 10-13.7 14.5L1.7 163.6l.3-.4c3.5 2 8 4.1 12 5.4 5-.7 8.2-2.2 12-3Z"/><path fill="#000" fill-opacity=".2" d="m26 165.5.5.9c-5 4.9-9 10-13.7 14.5L1.7 163.6l.3-.4c3.5 2 8 4.1 12 5.4 5-.7 8.2-2.2 12-3Z"/><path class="headwearColorL" d="M15.4 148.1c5.1 8 6.5 10.4 10.6 17.4-3.8 1-7 2.4-12 3.1a72 72 0 0 1-12-5.4c4.6-5.3 9-10.2 13.4-15Z"/><path fill="#000" d="M15.7 149.3a2.6 2.6 0 1 0 0-5.2 2.6 2.6 0 0 0 0 5.2Z"/><path class="hwStr1" stroke-width="2" d="M15.7 149.3a2.6 2.6 0 1 0 0-5.2 2.6 2.6 0 0 0 0 5.2Z"/><path class="hwStr1" stroke-width="3" d="M15.4 148.1 2 163.2l-.3.4 11 17.3c4.8-4.5 8.8-9.6 13.8-14.5l-.5-.9c-4-7-5.5-9.4-10.6-17.4Z"/><path class="hwStr1" stroke-width="2.5" d="M2 163.2c3.5 2 8 4.1 12 5.4 5-.7 8.2-2.2 12-3"/><path class="headwearColorL" d="m187.4 165.5-.5.9c5 4.9 9 10 13.7 14.5l11-17.3-.2-.4c-3.5 2-8 4.1-12.1 5.4-5-.7-8.1-2.2-12-3Z"/><path fill="#000" fill-opacity=".2" d="m187.4 165.5-.5.9c5 4.9 9 10 13.7 14.5l11-17.3-.2-.4c-3.5 2-8 4.1-12.1 5.4-5-.7-8.1-2.2-12-3Z"/><path class="headwearColorL" d="M197.9 148.1c-5 8-6.5 10.4-10.5 17.4 3.8 1 7 2.4 11.9 3.1a72 72 0 0 0 12-5.4c-4.6-5.3-9-10.2-13.4-15Z"/><path fill="#000" d="M197.7 149.3a2.6 2.6 0 1 1 0-5.2 2.6 2.6 0 0 1 0 5.2Z"/><path class="hwStr1" stroke-width="2" d="M197.7 149.3a2.6 2.6 0 1 1 0-5.2 2.6 2.6 0 0 1 0 5.2Z"/><path class="hwStr1" stroke-width="3" d="m197.9 148.1 13.5 15.1c0 .2.2.3.3.4l-11.1 17.3c-4.7-4.5-8.7-9.6-13.7-14.5l.5-.9c4-7 5.4-9.4 10.5-17.4Z"/><path class="hwStr1" stroke-width="2.5" d="M211.4 163.2c-3.5 2-8 4.1-12.1 5.4-5-.7-8.1-2.2-12-3"/></svg>'
|
||||
),
|
||||
Headwear.HeadwearVariants.EARRINGS,
|
||||
_getHeadwearColor(earringsColor)
|
||||
);
|
||||
}
|
||||
|
||||
function _getEarringsStyle(EarringsColors earringsColor) internal pure returns (string memory) {
|
||||
return
|
||||
string.concat(
|
||||
'<style>.headwearColorL { fill:',
|
||||
_getEarringsColor(earringsColor),
|
||||
'}.hwStr1 {stroke: #000;stroke-linecap: round;stroke-linejoin: round;}</style>'
|
||||
);
|
||||
}
|
||||
|
||||
function _getEarringsColor(EarringsColors earringsColor) internal pure returns (string memory) {
|
||||
if (earringsColor == EarringsColors.GREEN) {
|
||||
return LensColors.lightGreen;
|
||||
} else if (earringsColor == EarringsColors.PURPLE) {
|
||||
return LensColors.lightPurple;
|
||||
} else if (earringsColor == EarringsColors.BLUE) {
|
||||
return LensColors.lightBlue;
|
||||
} else if (earringsColor == EarringsColors.PINK) {
|
||||
return LensColors.lightPink;
|
||||
} else if (earringsColor == EarringsColors.GOLD) {
|
||||
return LensColors.lightGold;
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
}
|
||||
|
||||
function _getHeadwearColor(EarringsColors earringsColor) internal pure returns (Headwear.HeadwearColors) {
|
||||
if (earringsColor == EarringsColors.GREEN) {
|
||||
return Headwear.HeadwearColors.GREEN;
|
||||
} else if (earringsColor == EarringsColors.PURPLE) {
|
||||
return Headwear.HeadwearColors.PURPLE;
|
||||
} else if (earringsColor == EarringsColors.BLUE) {
|
||||
return Headwear.HeadwearColors.BLUE;
|
||||
} else if (earringsColor == EarringsColors.PINK) {
|
||||
return Headwear.HeadwearColors.PINK;
|
||||
} else if (earringsColor == EarringsColors.GOLD) {
|
||||
return Headwear.HeadwearColors.GOLD;
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,10 +2,12 @@
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import {Headwear} from 'contracts/libraries/svgs/Profile/Headwear.sol';
|
||||
import {LensColors} from 'contracts/libraries/svgs/Profile/LensColors.sol';
|
||||
|
||||
library HeadwearFloral {
|
||||
enum FloralColors {
|
||||
GREEN,
|
||||
PINK,
|
||||
PURPLE,
|
||||
BLUE,
|
||||
GOLD
|
||||
@@ -13,7 +15,7 @@ library HeadwearFloral {
|
||||
|
||||
function getFloral(
|
||||
FloralColors floralColor
|
||||
) internal pure returns (string memory, Headwear.HeadwearVariants, Headwear.HeadwearColors) {
|
||||
) external pure returns (string memory, Headwear.HeadwearVariants, Headwear.HeadwearColors) {
|
||||
return (
|
||||
string.concat(
|
||||
'<svg xmlns="http://www.w3.org/2000/svg" width="210" height="335" fill="none">',
|
||||
@@ -39,13 +41,15 @@ library HeadwearFloral {
|
||||
|
||||
function _getFloralColor(FloralColors floralColor) internal pure returns (string memory, string memory) {
|
||||
if (floralColor == FloralColors.GREEN) {
|
||||
return ('#F4FFDC', '#A0D170');
|
||||
return (LensColors.lightGreen, LensColors.baseGreen);
|
||||
} else if (floralColor == FloralColors.PURPLE) {
|
||||
return ('#F9F4FF', '#EAD7FF');
|
||||
return (LensColors.lightPurple, LensColors.basePurple);
|
||||
} else if (floralColor == FloralColors.BLUE) {
|
||||
return ('#F4F6FF', '#D9E0FF');
|
||||
return (LensColors.lightBlue, LensColors.baseBlue);
|
||||
} else if (floralColor == FloralColors.PINK) {
|
||||
return (LensColors.lightPink, LensColors.basePink);
|
||||
} else if (floralColor == FloralColors.GOLD) {
|
||||
return ('#FFEE93', '#FFCD3D');
|
||||
return (LensColors.lightGold, LensColors.baseGold);
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
@@ -58,6 +62,8 @@ library HeadwearFloral {
|
||||
return Headwear.HeadwearColors.PURPLE;
|
||||
} else if (floralColor == FloralColors.BLUE) {
|
||||
return Headwear.HeadwearColors.BLUE;
|
||||
} else if (floralColor == FloralColors.PINK) {
|
||||
return Headwear.HeadwearColors.PINK;
|
||||
} else if (floralColor == FloralColors.GOLD) {
|
||||
return Headwear.HeadwearColors.GOLD;
|
||||
} else {
|
||||
|
||||
@@ -2,10 +2,12 @@
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import {Headwear} from 'contracts/libraries/svgs/Profile/Headwear.sol';
|
||||
import {LensColors} from 'contracts/libraries/svgs/Profile/LensColors.sol';
|
||||
|
||||
library HeadwearGlasses {
|
||||
enum GlassesColors {
|
||||
GREEN,
|
||||
PINK,
|
||||
PURPLE,
|
||||
BLUE,
|
||||
GOLD
|
||||
@@ -13,7 +15,7 @@ library HeadwearGlasses {
|
||||
|
||||
function getGlasses(
|
||||
GlassesColors glassesColor
|
||||
) internal pure returns (string memory, Headwear.HeadwearVariants, Headwear.HeadwearColors) {
|
||||
) external pure returns (string memory, Headwear.HeadwearVariants, Headwear.HeadwearColors) {
|
||||
return (
|
||||
string.concat(
|
||||
'<svg xmlns="http://www.w3.org/2000/svg" width="210" height="335" fill="none">',
|
||||
@@ -26,26 +28,20 @@ library HeadwearGlasses {
|
||||
}
|
||||
|
||||
function _getGlassesStyle(GlassesColors glassesColor) internal pure returns (string memory) {
|
||||
(string memory primaryColor, string memory secondaryColor) = _getGlassesColor(glassesColor);
|
||||
return
|
||||
string.concat(
|
||||
'<style>.glassesColor1 { fill:',
|
||||
primaryColor,
|
||||
'}.glassesColor2 { fill:',
|
||||
secondaryColor,
|
||||
'}</style>'
|
||||
);
|
||||
return string.concat('<style>.glassesColor1 { fill:', _getGlassesColor(glassesColor), '}</style>');
|
||||
}
|
||||
|
||||
function _getGlassesColor(GlassesColors glassesColor) internal pure returns (string memory, string memory) {
|
||||
function _getGlassesColor(GlassesColors glassesColor) internal pure returns (string memory) {
|
||||
if (glassesColor == GlassesColors.GREEN) {
|
||||
return ('#F4FFDC', '#A0D170');
|
||||
return LensColors.lightGreen;
|
||||
} else if (glassesColor == GlassesColors.PURPLE) {
|
||||
return ('#F9F4FF', '#EAD7FF');
|
||||
return LensColors.lightPurple;
|
||||
} else if (glassesColor == GlassesColors.BLUE) {
|
||||
return ('#F4F6FF', '#D9E0FF');
|
||||
return LensColors.lightBlue;
|
||||
} else if (glassesColor == GlassesColors.PINK) {
|
||||
return LensColors.lightPink;
|
||||
} else if (glassesColor == GlassesColors.GOLD) {
|
||||
return ('#FFEE93', '#FFCD3D');
|
||||
return LensColors.lightGold;
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
@@ -58,6 +54,8 @@ library HeadwearGlasses {
|
||||
return Headwear.HeadwearColors.PURPLE;
|
||||
} else if (glassesColor == GlassesColors.BLUE) {
|
||||
return Headwear.HeadwearColors.BLUE;
|
||||
} else if (glassesColor == GlassesColors.PINK) {
|
||||
return Headwear.HeadwearColors.PINK;
|
||||
} else if (glassesColor == GlassesColors.GOLD) {
|
||||
return Headwear.HeadwearColors.GOLD;
|
||||
} else {
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import {Headwear} from 'contracts/libraries/svgs/Profile/Headwear.sol';
|
||||
import {LensColors} from 'contracts/libraries/svgs/Profile/LensColors.sol';
|
||||
|
||||
library HeadwearHat {
|
||||
enum HatColors {
|
||||
GREEN,
|
||||
LIGHT,
|
||||
DARK,
|
||||
PINK,
|
||||
BLUE,
|
||||
PURPLE,
|
||||
GOLD
|
||||
@@ -17,7 +17,7 @@ library HeadwearHat {
|
||||
// uint8 color = uint8((seed >> 152) & 0xFF) % 5;
|
||||
function getHat(
|
||||
HatColors hatColor
|
||||
) internal pure returns (string memory, Headwear.HeadwearVariants, Headwear.HeadwearColors) {
|
||||
) external pure returns (string memory, Headwear.HeadwearVariants, Headwear.HeadwearColors) {
|
||||
return (
|
||||
string.concat(
|
||||
'<svg xmlns="http://www.w3.org/2000/svg" width="210" height="335" fill="none">',
|
||||
@@ -43,17 +43,15 @@ library HeadwearHat {
|
||||
|
||||
function _getHatColor(HatColors hatColor) internal pure returns (string memory, string memory) {
|
||||
if (hatColor == HatColors.GREEN) {
|
||||
return ('#A0B884', '#F4FFDC');
|
||||
} else if (hatColor == HatColors.LIGHT) {
|
||||
return ('#EAEAEA', '#FFFFFF');
|
||||
} else if (hatColor == HatColors.DARK) {
|
||||
return ('#DBDBDB', '#575757');
|
||||
return (LensColors.darkGreen, LensColors.lightGreen);
|
||||
} else if (hatColor == HatColors.PINK) {
|
||||
return (LensColors.darkPink, LensColors.lightPink);
|
||||
} else if (hatColor == HatColors.BLUE) {
|
||||
return ('#F3EAFF', '#EAD7FF');
|
||||
return (LensColors.darkBlue, LensColors.lightBlue);
|
||||
} else if (hatColor == HatColors.PURPLE) {
|
||||
return ('#ECF0FF', '#D9E0FF');
|
||||
return (LensColors.darkPurple, LensColors.lightPurple);
|
||||
} else if (hatColor == HatColors.GOLD) {
|
||||
return ('#FFCF3D', '#FFEE93');
|
||||
return (LensColors.baseGold, LensColors.lightGold);
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
@@ -62,10 +60,8 @@ library HeadwearHat {
|
||||
function _getHeadwearColor(HatColors hatColor) internal pure returns (Headwear.HeadwearColors) {
|
||||
if (hatColor == HatColors.GREEN) {
|
||||
return Headwear.HeadwearColors.GREEN;
|
||||
} else if (hatColor == HatColors.LIGHT) {
|
||||
return Headwear.HeadwearColors.LIGHT;
|
||||
} else if (hatColor == HatColors.DARK) {
|
||||
return Headwear.HeadwearColors.DARK;
|
||||
} else if (hatColor == HatColors.PINK) {
|
||||
return Headwear.HeadwearColors.PINK;
|
||||
} else if (hatColor == HatColors.BLUE) {
|
||||
return Headwear.HeadwearColors.BLUE;
|
||||
} else if (hatColor == HatColors.PURPLE) {
|
||||
|
||||
@@ -2,10 +2,12 @@
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import {Headwear} from 'contracts/libraries/svgs/Profile/Headwear.sol';
|
||||
import {LensColors} from 'contracts/libraries/svgs/Profile/LensColors.sol';
|
||||
|
||||
library HeadwearIcecream {
|
||||
enum IcecreamColors {
|
||||
GREEN,
|
||||
PINK,
|
||||
BLUE,
|
||||
PURPLE,
|
||||
GOLD
|
||||
@@ -27,13 +29,15 @@ library HeadwearIcecream {
|
||||
|
||||
function _getIcecreamColor(IcecreamColors icecreamColor) internal pure returns (string memory) {
|
||||
if (icecreamColor == IcecreamColors.GREEN) {
|
||||
return '#A0D170';
|
||||
return LensColors.baseGreen;
|
||||
} else if (icecreamColor == IcecreamColors.PINK) {
|
||||
return LensColors.basePink;
|
||||
} else if (icecreamColor == IcecreamColors.PURPLE) {
|
||||
return '#EAD7FF';
|
||||
return LensColors.basePurple;
|
||||
} else if (icecreamColor == IcecreamColors.BLUE) {
|
||||
return '#D9E0FF';
|
||||
return LensColors.baseBlue;
|
||||
} else if (icecreamColor == IcecreamColors.GOLD) {
|
||||
return '#FFCD3D';
|
||||
return LensColors.baseGold;
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
@@ -42,6 +46,8 @@ library HeadwearIcecream {
|
||||
function _getHeadwearColor(IcecreamColors icecreamColor) internal pure returns (Headwear.HeadwearColors) {
|
||||
if (icecreamColor == IcecreamColors.GREEN) {
|
||||
return Headwear.HeadwearColors.GREEN;
|
||||
} else if (icecreamColor == IcecreamColors.PINK) {
|
||||
return Headwear.HeadwearColors.PINK;
|
||||
} else if (icecreamColor == IcecreamColors.PURPLE) {
|
||||
return Headwear.HeadwearColors.PURPLE;
|
||||
} else if (icecreamColor == IcecreamColors.BLUE) {
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import {Headwear} from 'contracts/libraries/svgs/Profile/Headwear.sol';
|
||||
|
||||
library HeadwearLeafs {
|
||||
enum LeafsColors {
|
||||
GREEN,
|
||||
BLUE,
|
||||
PURPLE,
|
||||
GOLD
|
||||
}
|
||||
|
||||
// // we take the 15th byte from the left for hat color
|
||||
// uint8 color = uint8((seed >> 136) & 0xFF) % 3;
|
||||
function getLeafs(
|
||||
LeafsColors leafsColor
|
||||
) internal pure returns (string memory, Headwear.HeadwearVariants, Headwear.HeadwearColors) {
|
||||
// leafs (4 colors: green, purple, blue, gold)
|
||||
return (
|
||||
string.concat(
|
||||
'<svg xmlns="http://www.w3.org/2000/svg" width="210" height="335" fill="none">',
|
||||
_getLeafsStyle(leafsColor),
|
||||
'<g clip-path="url(#a)"><path class="hwcolor" d="m40.4 87.2 1.7 3.3s3.3.3 5.4.7c2.3.5 5.8 1.9 5.8 1.9h.7l-2.1-4.6-4.5-3.9-6.8-.1-.2 2.7Z"/><path class="hwline35" d="M40.5 92c-1-2.8-1.4-5.8-1.1-8.8a19.2 19.2 0 0 1 18 14"/><path class="line25" d="m45.4 89.2 3.5 4"/><path class="hwcolor" d="M66.9 102.4s0-8.5 2.2-14c.1-.3.6-.7.6-.7l-.6-3.8-2.4-2.6-4.5-2.8-7.9-3.3L53 85.4s1.2 7.8 5 9.8l8.9 7.2Z"/><path class="hwline35" d="M57.6 97.2a28.7 28.7 0 0 1-3.6-23c3 2.3 6.8 3.5 10.2 5.4 3.4 1.9 6.5 4.8 6.8 8.4"/><path class="hwline3" d="M60 86.7c1.5 5.2 4.5 10 8.4 13.6"/><path class="hwcolor" d="M84.6 193.7c5.3 1 13.6 2 13.6 2l1.4 1-1.4 4.3-6 7.9-6.5 3.6-8.6 2.5-4-5.6-3.3-7.4-.3-8.8 2.3-2.6s7.8 2 12.8 3Z"/><path class="hwcolor" d="m69.7 189.9-4.6-1.5-1.8-.7-5 4.3-2.7 7.4 1 6h14l-1.8-5.5.9-10Z"/><path class="hwline35" d="M70.9 188.8c-3 3.8-2.6 9.3-.8 13.8 1.7 4.5 4.7 8.5 6.5 13A44.7 44.7 0 0 0 92 209a19 19 0 0 0 8.2-14"/><path class="hwline3" d="M85 192.4a71.4 71.4 0 0 1-4.7 13"/><path class="hwcolor" d="m41 185.9 9.9-3.2 4.7 2c2 .9 5.1 2 5.1 2l-2.7 5.4h-2l-7.2-.3-8-6Z"/><path class="hwline35" d="M70.6 206.1c-4.4 0-8.8-.2-13.3-.4a15.8 15.8 0 0 1 0-11c1.3-3.4 4-6.4 7.2-8.2"/><path class="hwline3" d="M68 194a21.8 21.8 0 0 0-5 4.4"/><path class="hwline35" d="M57.5 193.1c-7.2.7-14.6-2.6-18.5-8.3 3.9-.2 7.7-1.5 10.9-3.7"/><path class="line25" d="M52 186.6c2.3.2 4.7-.2 6.8-1.1"/></g><g clip-path="url(#b)"><path class="hwcolor" d="m169.4 87.2-1.7 3.3s-3.3.3-5.4.7c-2.3.5-5.7 1.9-5.7 1.9h-.7l2-4.6 4.6-3.9 6.8-.1.1 2.7Z"/><path class="hwline35" d="M169.3 92c1-2.8 1.4-5.8 1.2-8.8a19.2 19.2 0 0 0-18 14"/><path class="line25" d="m164.5 89.2-3.6 4"/><path class="hwcolor" d="M143 102.4s0-8.5-2.2-14l-.6-.7.6-3.8 2.4-2.6 4.4-2.8 8-3.3 1.3 10.2s-1.2 7.8-5 9.8c-.6.3-9 7.2-9 7.2Z"/><path class="hwline35" d="M152.2 97.2a28.7 28.7 0 0 0 3.7-23c-3 2.3-6.9 3.5-10.2 5.4-3.4 1.9-6.6 4.8-6.8 8.4"/><path class="hwline3" d="M149.8 86.7a29.5 29.5 0 0 1-8.4 13.6"/><path class="hwcolor" d="M125.2 193.7c-5.2 1-13.6 2-13.6 2l-1.4 1 1.4 4.3 6 7.9 6.5 3.6 8.7 2.5 4-5.6 3.2-7.4.3-8.8-2.3-2.6s-7.7 2-12.8 3Z"/><path class="hwcolor" d="m140.2 190 4.5-1.6 1.8-.7 5 4.3 2.8 7.4-1 6h-14.1l1.8-5.5-.8-9.8Z"/><path class="hwline35" d="M139 188.8c3 3.8 2.6 9.3.8 13.8s-4.7 8.5-6.6 13a44.7 44.7 0 0 1-15.4-6.5 19 19 0 0 1-8.2-14"/><path class="hwline3" d="M124.8 192.4c1.2 4.4 2.8 8.8 4.8 13"/><path class="hwcolor" d="m168.9 185.9-9.9-3.2-4.7 2c-2 1-5.1 2.1-5.1 2.1l2.7 5.3h1.8l7.2-.3 8-6Z"/><path class="hwline35" d="M139.3 206.1c4.4 0 8.8-.2 13.2-.4a15.8 15.8 0 0 0-7.2-19.2"/><path class="hwline3" d="M142 194c1.8 1.3 3.5 2.7 4.9 4.4"/><path class="hwline35" d="M152.4 193.1c7.2.7 14.6-2.6 18.5-8.3-4-.2-7.7-1.5-11-3.7"/><path class="line25" d="M157.8 186.6c-2.3.2-4.6-.2-6.8-1.1"/></g></svg>'
|
||||
),
|
||||
Headwear.HeadwearVariants.LEAFS,
|
||||
_getHeadwearColor(leafsColor)
|
||||
);
|
||||
}
|
||||
|
||||
function _getLeafsStyle(LeafsColors leafsColor) internal pure returns (string memory) {
|
||||
return
|
||||
string.concat(
|
||||
'<style>.hwcolor { fill: ',
|
||||
_getLeafsColor(leafsColor),
|
||||
' }.hwline25 {stroke: black; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.5}.hwline3 {stroke: black; stroke-linecap: round; stroke-linejoin: round; stroke-width: 3}.hwline35 {stroke: black; stroke-linecap: round; stroke-linejoin: round; stroke-width: 3.5}</style>'
|
||||
);
|
||||
}
|
||||
|
||||
function _getLeafsColor(LeafsColors leafsColor) internal pure returns (string memory) {
|
||||
if (leafsColor == LeafsColors.GREEN) {
|
||||
return '#A0D170';
|
||||
} else if (leafsColor == LeafsColors.PURPLE) {
|
||||
return '#EAD7FF';
|
||||
} else if (leafsColor == LeafsColors.BLUE) {
|
||||
return '#D9E0FF';
|
||||
} else if (leafsColor == LeafsColors.GOLD) {
|
||||
return '#FBD159';
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
}
|
||||
|
||||
function _getHeadwearColor(LeafsColors leafsColor) internal pure returns (Headwear.HeadwearColors) {
|
||||
if (leafsColor == LeafsColors.GREEN) {
|
||||
return Headwear.HeadwearColors.GREEN;
|
||||
} else if (leafsColor == LeafsColors.PURPLE) {
|
||||
return Headwear.HeadwearColors.PURPLE;
|
||||
} else if (leafsColor == LeafsColors.BLUE) {
|
||||
return Headwear.HeadwearColors.BLUE;
|
||||
} else if (leafsColor == LeafsColors.GOLD) {
|
||||
return Headwear.HeadwearColors.GOLD;
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
}
|
||||
}
|
||||
73
contracts/libraries/svgs/Profile/Headwear/HeadwearLotus.sol
Normal file
73
contracts/libraries/svgs/Profile/Headwear/HeadwearLotus.sol
Normal file
@@ -0,0 +1,73 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import {Headwear} from 'contracts/libraries/svgs/Profile/Headwear.sol';
|
||||
import {LensColors} from 'contracts/libraries/svgs/Profile/LensColors.sol';
|
||||
|
||||
library HeadwearLotus {
|
||||
enum LotusColors {
|
||||
GREEN,
|
||||
PINK,
|
||||
PURPLE,
|
||||
BLUE,
|
||||
GOLD
|
||||
}
|
||||
|
||||
function getLotus(
|
||||
LotusColors lotusColor
|
||||
) external pure returns (string memory, Headwear.HeadwearVariants, Headwear.HeadwearColors) {
|
||||
return (
|
||||
string.concat(
|
||||
'<svg xmlns="http://www.w3.org/2000/svg" width="210" height="335" fill="none">',
|
||||
_getLotusStyle(lotusColor),
|
||||
'<path class="headwearColorL" d="M169.2 68.6c2 0 3.5 1.8 3.5 3.8A35 35 0 0 1 161.9 97a39.6 39.6 0 0 1-30.8 9.3 28 28 0 0 0 4.8-3.7c2.2-2 2-5 .3-7.4a53.9 53.9 0 0 0-11.6-12 64.7 64.7 0 0 1 44.6-14.6Z"/><path class="headwearColorL" d="M161 49.4c1 6.2-.2 12.8-2.8 18.7l.1.8c-7.3.8-14.4 2.9-21 6l-.3-1a49.6 49.6 0 0 0-26.2-11.4v-.3a89.4 89.4 0 0 1 45.6-16.6 4.4 4.4 0 0 1 4.6 3.8Z"/><path class="headwearColorB" d="m137 74 .3 1a60 60 0 0 0-12.7 8.2 38.1 38.1 0 0 0-18.6-8.8h-.2c-3.7 0-11.3 3.1-18.6 8.8-4.2-3.6-9-6.6-14-8.9l1.6-.4a49.6 49.6 0 0 1 31-11.7h.2a49.6 49.6 0 0 1 31 11.7Z"/><path class="headwearColorL" d="M136.2 95.2c1.7 2.4 1.9 5.4-.3 7.4a32 32 0 0 1-4.8 3.7 47.5 47.5 0 0 1-25.1 6.5h-.2c-8.5 0-17.7-1.8-25.1-6.5a32 32 0 0 1-4.8-3.7c-2.2-2-2-5-.3-7.4a53 53 0 0 1 11.6-12 38.1 38.1 0 0 1 18.6-8.8h.2c3.7 0 11.3 3.1 18.6 8.8a53 53 0 0 1 11.6 12ZM106 39c4.8 0 14.6 8.4 18.6 15-4.8 2.3-9.4 5-13.7 8.2v.3a41.4 41.4 0 0 0-9.9 0v-.3c-4.4-3.1-9-5.9-13.8-8.2 4-6.6 13.8-15 18.6-15h.2Z"/><path class="headwearColorL" d="M101 62.2v.3c-9.6 1-19 5.3-26.2 11.4l-1.6.4A64.6 64.6 0 0 0 53.5 69l.1-.8a34.6 34.6 0 0 1-2.9-18.7 4.4 4.4 0 0 1 4.7-3.8 87.2 87.2 0 0 1 45.5 16.6Z"/><path class="headwearColorL" d="M87.2 83.2a54.3 54.3 0 0 0-11.6 12c-1.7 2.4-1.9 5.4.3 7.4a32 32 0 0 0 4.8 3.7A39.5 39.5 0 0 1 49.9 97a35 35 0 0 1-10.8-24.6c0-2 1.5-3.7 3.5-3.8a66 66 0 0 1 30.6 5.7c5 2.3 9.8 5.3 14 8.9Z"/><path class="hwStr1" stroke-width="4" d="M105.8 112.8c-8.5 0-17.7-1.8-25.1-6.5a32 32 0 0 1-4.8-3.7c-2.2-2-2-5-.3-7.4a53 53 0 0 1 11.6-12 38.1 38.1 0 0 1 18.6-8.8"/><path class="hwStr1" stroke-width="4" d="M87.2 83.2a64.6 64.6 0 0 0-44.6-14.6c-2 0-3.5 1.8-3.5 3.8A35 35 0 0 0 50 97c7.6 7 20.5 11 30.8 9.3m-6-32.3a49.6 49.6 0 0 1 31-11.8m-4.8 0a88.6 88.6 0 0 0-45.6-16.6 4.4 4.4 0 0 0-4.7 3.8c-.9 6.2.3 12.8 2.9 18.7"/><path class="hwStr1" stroke-width="4" d="M87.2 54c4-6.6 13.8-15 18.6-15m0 73.8h.2c8.5 0 17.6-1.8 25.1-6.5a32 32 0 0 0 4.8-3.7c2.2-2 2-5 .3-7.4a53.9 53.9 0 0 0-11.6-12 38.1 38.1 0 0 0-18.6-8.8"/><path class="hwStr1" stroke-width="4" d="M124.6 83.2a64.7 64.7 0 0 1 44.6-14.6c2 0 3.5 1.8 3.5 3.8A35 35 0 0 1 161.9 97a39.6 39.6 0 0 1-30.8 9.3M137 74a49.6 49.6 0 0 0-31-11.8m4.9 0a89.4 89.4 0 0 1 45.5-16.6 4.4 4.4 0 0 1 4.6 3.8c1 6.2-.2 12.8-2.8 18.7"/><path class="hwStr1" stroke-width="4" d="M124.6 54c-4-6.6-13.8-15-18.6-15"/><path class="hwStr1" stroke-opacity=".1" stroke-width="3" d="M105.9 88.3v24.5"/><path class="hwStr1" stroke-opacity=".1" stroke-width="2.5" d="M105.9 51.4v11.5"/><path class="hwStr1" stroke-opacity=".1" stroke-width="3" d="M68.2 60.2s3.7 3.5 6.4 5.3c2.2 1.4 5.9 3.2 5.9 3.2m62.5-8.5s-3.7 3.5-6.4 5.3a62 62 0 0 1-6 3.2m-77 19.4s2.4 6 6.1 10.5c5.4 6.7 17.5 8.8 17.5 8.8m81-19.3s-2.4 6-6.1 10.5c-5.4 6.7-17.5 8.8-17.5 8.8"/></svg>'
|
||||
),
|
||||
Headwear.HeadwearVariants.LOTUS,
|
||||
_getHeadwearColor(lotusColor)
|
||||
);
|
||||
}
|
||||
|
||||
function _getLotusStyle(LotusColors lotusColor) internal pure returns (string memory) {
|
||||
(string memory lightColor, string memory baseColor) = _getLotusColor(lotusColor);
|
||||
return
|
||||
string.concat(
|
||||
'<style>.headwearColorL { fill:',
|
||||
lightColor,
|
||||
'}.headwearColorB { fill:',
|
||||
baseColor,
|
||||
'}.hwStr1 {stroke: #000;stroke-linecap: round;stroke-linejoin: round;}</style>'
|
||||
);
|
||||
}
|
||||
|
||||
function _getLotusColor(LotusColors lotusColor) internal pure returns (string memory, string memory) {
|
||||
if (lotusColor == LotusColors.GREEN) {
|
||||
return (LensColors.lightGreen, LensColors.baseGreen);
|
||||
} else if (lotusColor == LotusColors.PURPLE) {
|
||||
return (LensColors.lightPurple, LensColors.basePurple);
|
||||
} else if (lotusColor == LotusColors.BLUE) {
|
||||
return (LensColors.lightBlue, LensColors.baseBlue);
|
||||
} else if (lotusColor == LotusColors.PINK) {
|
||||
return (LensColors.lightPink, LensColors.basePink);
|
||||
} else if (lotusColor == LotusColors.GOLD) {
|
||||
return (LensColors.lightGold, LensColors.baseGold);
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
}
|
||||
|
||||
function _getHeadwearColor(LotusColors lotusColor) internal pure returns (Headwear.HeadwearColors) {
|
||||
if (lotusColor == LotusColors.GREEN) {
|
||||
return Headwear.HeadwearColors.GREEN;
|
||||
} else if (lotusColor == LotusColors.PURPLE) {
|
||||
return Headwear.HeadwearColors.PURPLE;
|
||||
} else if (lotusColor == LotusColors.BLUE) {
|
||||
return Headwear.HeadwearColors.BLUE;
|
||||
} else if (lotusColor == LotusColors.PINK) {
|
||||
return Headwear.HeadwearColors.PINK;
|
||||
} else if (lotusColor == LotusColors.GOLD) {
|
||||
return Headwear.HeadwearColors.GOLD;
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
}
|
||||
}
|
||||
70
contracts/libraries/svgs/Profile/Headwear/HeadwearMajor.sol
Normal file
70
contracts/libraries/svgs/Profile/Headwear/HeadwearMajor.sol
Normal file
@@ -0,0 +1,70 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import {Headwear} from 'contracts/libraries/svgs/Profile/Headwear.sol';
|
||||
import {LensColors} from 'contracts/libraries/svgs/Profile/LensColors.sol';
|
||||
|
||||
library HeadwearMajor {
|
||||
enum MajorColors {
|
||||
GREEN,
|
||||
PINK,
|
||||
PURPLE,
|
||||
BLUE,
|
||||
GOLD
|
||||
}
|
||||
|
||||
function getMajor(
|
||||
MajorColors majorColor
|
||||
) external pure returns (string memory, Headwear.HeadwearVariants, Headwear.HeadwearColors) {
|
||||
return (
|
||||
string.concat(
|
||||
'<svg xmlns="http://www.w3.org/2000/svg" width="250" height="335" x="-14" fill="none">',
|
||||
_getMajorStyle(majorColor),
|
||||
'<path fill="#000" d="M35.8 160.6 21.6 157l6.6 5.9 11 2.3-3.4-4.6Zm166.1 0L216 157l-6.6 5.9-11 2.3 3.5-4.6Z"/><path class="hwStr1" stroke-width="4" d="M75.5 192.9c4.2-1.2 8.8-2.5 13-3.1m73.5 3.1a94.6 94.6 0 0 0-13-3.1"/><path class="headwearColorB" fill-rule="evenodd" d="M148.4 191.2h-.2l-.6.2a178 178 0 0 1-9.7 2.2c-6 1.2-13.4 2.4-19.2 2.4a104 104 0 0 1-19.1-2.4 206.5 206.5 0 0 1-9.6-2.2l-.6-.1h-.7l-1 .1a51.5 51.5 0 0 0-5.8 1.4h-.3l-.5.2.4.2a14.3 14.3 0 0 0 .7.2 61.4 61.4 0 0 0 9.5 2.6 126 126 0 0 0 64-2.8h.2l.5-.2-.5-.1-.3-.1-.9-.2a72.3 72.3 0 0 0-6.2-1.4Zm7.5 2v-.2.2Zm-74.4 0v-.2.2Zm7.7-2v.2-.2Z" clip-rule="evenodd"/><path fill="#000" fill-opacity=".3" fill-rule="evenodd" d="M148.4 191.2h-.2l-.6.2a178 178 0 0 1-9.7 2.2c-6 1.2-13.4 2.4-19.2 2.4a104 104 0 0 1-19.1-2.4 206.5 206.5 0 0 1-9.6-2.2l-.6-.1h-.7l-1 .1a51.5 51.5 0 0 0-5.8 1.4h-.3l-.5.2.4.2a14.3 14.3 0 0 0 .7.2 61.4 61.4 0 0 0 9.5 2.6 126 126 0 0 0 64-2.8h.2l.5-.2-.5-.1-.3-.1-.9-.2a72.3 72.3 0 0 0-6.2-1.4Zm7.5 2v-.2.2Zm-74.4 0v-.2.2Zm7.7-2v.2-.2Z" clip-rule="evenodd"/><path fill="#fff" fill-opacity=".3" d="M75 192.9a124.3 124.3 0 0 1-44-23.7c-12.8-11.2-23.5-25-22.6-42a49.4 49.4 0 0 1 24-38.3c13-7.1 29.9-7 42.8.4a50.7 50.7 0 0 1 16.4-23 43 43 0 0 1 27-8.6 43 43 0 0 1 27 8.6 50.7 50.7 0 0 1 16.5 23c13-7.4 29.7-7.5 42.8-.4a49.4 49.4 0 0 1 24 38.3c.9 17-9.8 30.8-22.6 42a124.3 124.3 0 0 1-44.2 23.7 100 100 0 0 1-21.4 5.9A135.6 135.6 0 0 1 75 193v-.1Z"/><path class="hwStr1" stroke-width="4" d="M90 197.3c-5-1-10-2.6-14.7-4.4A124.4 124.4 0 0 1 31.1 169a99 99 0 0 1-9.6-9.6 46 46 0 0 1-13-32.5c.5-7.6 3.4-15.6 7.8-22.6a46 46 0 0 1 16.2-15.6c13.1-7.2 29.9-7 42.9.4a50.7 50.7 0 0 1 16.4-23 43 43 0 0 1 27-8.6 43 43 0 0 1 27 8.5 50.7 50.7 0 0 1 16.4 23.1c13-7.4 29.8-7.6 42.9-.4a46 46 0 0 1 16.2 15.6c4.4 7 7.3 15 7.7 22.6a45.6 45.6 0 0 1-13 32.5 99 99 0 0 1-9.6 9.6 124.4 124.4 0 0 1-44.1 23.8 100 100 0 0 1-21.5 5.8 135.6 135.6 0 0 1-50.8-1.4Z"/><path fill="#fff" d="M90 197.3c-5-1-10-2.6-14.7-4.4A124.4 124.4 0 0 1 31.1 169a99 99 0 0 1-9.6-9.6s38 20.7 97.3 20.7 97.2-20.7 97.2-20.7a99 99 0 0 1-9.6 9.6 124.4 124.4 0 0 1-44.1 23.8 100 100 0 0 1-21.5 5.8 135.6 135.6 0 0 1-50.8-1.4Z"/><path class="hwStr1" stroke-width="4" d="M90 197.3c-5-1-10-2.6-14.7-4.4A124.4 124.4 0 0 1 31.1 169a99 99 0 0 1-9.6-9.6s38 20.7 97.3 20.7 97.2-20.7 97.2-20.7a99 99 0 0 1-9.6 9.6 124.4 124.4 0 0 1-44.1 23.8 100 100 0 0 1-21.5 5.8 135.6 135.6 0 0 1-50.8-1.4Z"/><path class="hwStr1" stroke-opacity=".3" stroke-width="3" d="M49 180.5c11.7 3.6 28.6 7.7 48.2 9.6m91.2-9.8c-12 3.7-29.3 8-49.6 9.9"/><circle class="headwearColorB" cx="118.3" cy="192.3" r="2.7"/><circle cx="118.3" cy="192.3" r="2.7" stroke="#000" stroke-width="2.5"/><circle class="headwearColorB" cx="106.7" cy="191.8" r="2.2"/><circle cx="106.7" cy="191.8" r="2.2" stroke="#000" stroke-width="2.5"/><circle class="headwearColorB" cx="129.9" cy="191.8" r="2.2"/><circle cx="129.9" cy="191.8" r="2.2" stroke="#000" stroke-width="2.5"/><path fill="#fff" d="M3.2 115.6h7.5s-2 5.2-2 13.5 2 13.5 2 13.5H3.2s-2-4.2-2-13.5 2-13.5 2-13.5Z"/><path class="hwStr1" stroke-width="4" d="M3.1 118.8c.4-2 2.2-3.2 4.2-3.2h3.4S9 120.8 9 129.1s1.8 13.5 1.8 13.5H7.3c-2 0-3.8-1.3-4.2-3.2a56.1 56.1 0 0 1 .1-20.6Z"/><path fill="#fff" d="M234.1 115.6h-7.5s2 5.2 2 13.5-2 13.5-2 13.5h7.5s2-4.2 2-13.5-2-13.5-2-13.5Z"/><path class="hwStr1" stroke-width="4" d="M234.2 118.8c-.4-2-2.1-3.2-4.1-3.2h-3.5s1.8 5.2 1.8 13.5-1.8 13.5-1.8 13.5h3.5c2 0 3.7-1.3 4.1-3.2a51.6 51.6 0 0 0 0-20.6Z"/><path stroke="#000" stroke-linecap="round" stroke-width="4" d="M9 116V93.4M228.4 116V93.4"/><circle cx="8.9" cy="91" r="4.7" fill="#fff"/><circle cx="8.9" cy="91" r="6.7" stroke="#000" stroke-width="4"/><circle cx="228.4" cy="91" r="4.7" fill="#fff"/><circle cx="228.4" cy="91" r="6.7" stroke="#000" stroke-width="4"/></svg>'
|
||||
),
|
||||
Headwear.HeadwearVariants.MAJOR,
|
||||
_getHeadwearColor(majorColor)
|
||||
);
|
||||
}
|
||||
|
||||
function _getMajorStyle(MajorColors majorColor) internal pure returns (string memory) {
|
||||
return
|
||||
string.concat(
|
||||
'<style>.headwearColorB { fill:',
|
||||
_getMajorColor(majorColor),
|
||||
'}.hwStr1 {stroke: #000;stroke-linecap: round;stroke-linejoin: round;}</style>'
|
||||
);
|
||||
}
|
||||
|
||||
function _getMajorColor(MajorColors majorColor) internal pure returns (string memory) {
|
||||
if (majorColor == MajorColors.GREEN) {
|
||||
return LensColors.baseGreen;
|
||||
} else if (majorColor == MajorColors.PURPLE) {
|
||||
return LensColors.basePurple;
|
||||
} else if (majorColor == MajorColors.BLUE) {
|
||||
return LensColors.baseBlue;
|
||||
} else if (majorColor == MajorColors.PINK) {
|
||||
return LensColors.basePink;
|
||||
} else if (majorColor == MajorColors.GOLD) {
|
||||
return LensColors.baseGold;
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
}
|
||||
|
||||
function _getHeadwearColor(MajorColors majorColor) internal pure returns (Headwear.HeadwearColors) {
|
||||
if (majorColor == MajorColors.GREEN) {
|
||||
return Headwear.HeadwearColors.GREEN;
|
||||
} else if (majorColor == MajorColors.PURPLE) {
|
||||
return Headwear.HeadwearColors.PURPLE;
|
||||
} else if (majorColor == MajorColors.BLUE) {
|
||||
return Headwear.HeadwearColors.BLUE;
|
||||
} else if (majorColor == MajorColors.PINK) {
|
||||
return Headwear.HeadwearColors.PINK;
|
||||
} else if (majorColor == MajorColors.GOLD) {
|
||||
return Headwear.HeadwearColors.GOLD;
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import {Headwear} from 'contracts/libraries/svgs/Profile/Headwear.sol';
|
||||
import {LensColors} from 'contracts/libraries/svgs/Profile/LensColors.sol';
|
||||
|
||||
library HeadwearMushroom {
|
||||
enum MushroomColors {
|
||||
@@ -47,24 +48,23 @@ library HeadwearMushroom {
|
||||
MushroomColors mushroomColor
|
||||
) internal pure returns (string memory, string memory) {
|
||||
if (mushroomColor == MushroomColors.GOLD) {
|
||||
return ('#fff', '#B96326');
|
||||
return (LensColors.white, LensColors.darkGold);
|
||||
} else {
|
||||
(string memory primaryColor, ) = _getMushroomColor(mushroomColor);
|
||||
return (primaryColor, '#000');
|
||||
return (LensColors.white, LensColors.black);
|
||||
}
|
||||
}
|
||||
|
||||
function _getMushroomColor(MushroomColors mushroomColor) internal pure returns (string memory, string memory) {
|
||||
if (mushroomColor == MushroomColors.GREEN) {
|
||||
return ('#F4FFDC', '#A0D170');
|
||||
return (LensColors.lightGreen, LensColors.baseGreen);
|
||||
} else if (mushroomColor == MushroomColors.PURPLE) {
|
||||
return ('#F3EAFF', '#EAD7FF');
|
||||
return (LensColors.lightPurple, LensColors.basePurple);
|
||||
} else if (mushroomColor == MushroomColors.BLUE) {
|
||||
return ('#ECF0FF', '#D9E0FF');
|
||||
return (LensColors.lightBlue, LensColors.baseBlue);
|
||||
} else if (mushroomColor == MushroomColors.PINK) {
|
||||
return ('#FFE7F0', '#FFD2DD');
|
||||
return (LensColors.lightPink, LensColors.basePink);
|
||||
} else if (mushroomColor == MushroomColors.GOLD) {
|
||||
return ('#FFEE93', '#F8C944');
|
||||
return (LensColors.lightGold, LensColors.baseGold);
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
|
||||
@@ -2,10 +2,12 @@
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import {Headwear} from 'contracts/libraries/svgs/Profile/Headwear.sol';
|
||||
import {LensColors} from 'contracts/libraries/svgs/Profile/LensColors.sol';
|
||||
|
||||
library HeadwearNightcap {
|
||||
enum NightcapColors {
|
||||
GREEN,
|
||||
PINK,
|
||||
PURPLE,
|
||||
BLUE,
|
||||
GOLD
|
||||
@@ -13,7 +15,7 @@ library HeadwearNightcap {
|
||||
|
||||
function getNightcap(
|
||||
NightcapColors nightcapColor
|
||||
) internal pure returns (string memory, Headwear.HeadwearVariants, Headwear.HeadwearColors) {
|
||||
) external pure returns (string memory, Headwear.HeadwearVariants, Headwear.HeadwearColors) {
|
||||
return (
|
||||
string.concat(
|
||||
'<svg xmlns="http://www.w3.org/2000/svg" width="210" height="335" fill="none">',
|
||||
@@ -26,26 +28,20 @@ library HeadwearNightcap {
|
||||
}
|
||||
|
||||
function _getNightcapStyle(NightcapColors nightcapColor) internal pure returns (string memory) {
|
||||
(string memory primaryColor, string memory secondaryColor) = _getNightcapColor(nightcapColor);
|
||||
return
|
||||
string.concat(
|
||||
'<style>.nightcapColor1 { fill:',
|
||||
primaryColor,
|
||||
'}.nightcapColor2 { fill:',
|
||||
secondaryColor,
|
||||
'}</style>'
|
||||
);
|
||||
return string.concat('<style>.nightcapColor1 { fill:', _getNightcapColor(nightcapColor), '}</style>');
|
||||
}
|
||||
|
||||
function _getNightcapColor(NightcapColors nightcapColor) internal pure returns (string memory, string memory) {
|
||||
function _getNightcapColor(NightcapColors nightcapColor) internal pure returns (string memory) {
|
||||
if (nightcapColor == NightcapColors.GREEN) {
|
||||
return ('#F4FFDC', '#A0D170');
|
||||
return LensColors.lightGreen;
|
||||
} else if (nightcapColor == NightcapColors.PINK) {
|
||||
return LensColors.lightPink;
|
||||
} else if (nightcapColor == NightcapColors.PURPLE) {
|
||||
return ('#F9F4FF', '#EAD7FF');
|
||||
return LensColors.lightPurple;
|
||||
} else if (nightcapColor == NightcapColors.BLUE) {
|
||||
return ('#F4F6FF', '#D9E0FF');
|
||||
return LensColors.lightBlue;
|
||||
} else if (nightcapColor == NightcapColors.GOLD) {
|
||||
return ('#FFEE93', '#FFCD3D');
|
||||
return LensColors.lightGold;
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
@@ -54,6 +50,8 @@ library HeadwearNightcap {
|
||||
function _getHeadwearColor(NightcapColors nightcapColor) internal pure returns (Headwear.HeadwearColors) {
|
||||
if (nightcapColor == NightcapColors.GREEN) {
|
||||
return Headwear.HeadwearColors.GREEN;
|
||||
} else if (nightcapColor == NightcapColors.PINK) {
|
||||
return Headwear.HeadwearColors.PINK;
|
||||
} else if (nightcapColor == NightcapColors.PURPLE) {
|
||||
return Headwear.HeadwearColors.PURPLE;
|
||||
} else if (nightcapColor == NightcapColors.BLUE) {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import {Headwear} from 'contracts/libraries/svgs/Profile/Headwear.sol';
|
||||
import {LensColors} from 'contracts/libraries/svgs/Profile/LensColors.sol';
|
||||
|
||||
library HeadwearPartyhat {
|
||||
enum PartyhatColors {
|
||||
@@ -14,7 +15,7 @@ library HeadwearPartyhat {
|
||||
|
||||
function getPartyhat(
|
||||
PartyhatColors partyhatColor
|
||||
) internal pure returns (string memory, Headwear.HeadwearVariants, Headwear.HeadwearColors) {
|
||||
) external pure returns (string memory, Headwear.HeadwearVariants, Headwear.HeadwearColors) {
|
||||
return (
|
||||
string.concat(
|
||||
'<svg xmlns="http://www.w3.org/2000/svg" width="211" height="335" fill="none">',
|
||||
@@ -35,22 +36,22 @@ library HeadwearPartyhat {
|
||||
'}.partyhatColor2 { fill:',
|
||||
secondaryColor,
|
||||
'}.partyhatSparkles { stroke:',
|
||||
partyhatColor == PartyhatColors.GOLD ? '#B96326' : '#000',
|
||||
partyhatColor == PartyhatColors.GOLD ? LensColors.darkGold : LensColors.black,
|
||||
';stroke-linecap: round;stroke-linejoin: round;stroke-width: 4}</style>'
|
||||
);
|
||||
}
|
||||
|
||||
function _getPartyhatColor(PartyhatColors partyhatColor) internal pure returns (string memory, string memory) {
|
||||
if (partyhatColor == PartyhatColors.GREEN) {
|
||||
return ('#F4FFDC', '#A0D170');
|
||||
return (LensColors.lightGreen, LensColors.baseGreen);
|
||||
} else if (partyhatColor == PartyhatColors.PURPLE) {
|
||||
return ('#F3EAFF', '#EAD7FF');
|
||||
return (LensColors.lightPurple, LensColors.basePurple);
|
||||
} else if (partyhatColor == PartyhatColors.BLUE) {
|
||||
return ('#ECF0FF', '#D9E0FF');
|
||||
return (LensColors.lightBlue, LensColors.baseBlue);
|
||||
} else if (partyhatColor == PartyhatColors.PINK) {
|
||||
return ('#FFE7F0', '#FFD2DD');
|
||||
return (LensColors.lightPink, LensColors.basePink);
|
||||
} else if (partyhatColor == PartyhatColors.GOLD) {
|
||||
return ('#FFEE93', '#F8C944');
|
||||
return (LensColors.lightGold, LensColors.baseGold);
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
|
||||
@@ -2,10 +2,12 @@
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import {Headwear} from 'contracts/libraries/svgs/Profile/Headwear.sol';
|
||||
import {LensColors} from 'contracts/libraries/svgs/Profile/LensColors.sol';
|
||||
|
||||
library HeadwearPlants {
|
||||
enum PlantsColors {
|
||||
GREEN,
|
||||
PINK,
|
||||
BLUE,
|
||||
PURPLE,
|
||||
GOLD
|
||||
@@ -29,27 +31,25 @@ library HeadwearPlants {
|
||||
}
|
||||
|
||||
function _getPlantsStyle(PlantsColors plantsColor) internal pure returns (string memory) {
|
||||
(string memory leafsColor1, string memory leafsColor2) = _getPlantsColor(plantsColor);
|
||||
|
||||
return
|
||||
string.concat(
|
||||
'<style>.color1 { fill: ',
|
||||
leafsColor1,
|
||||
' }.color2 { fill: ',
|
||||
leafsColor2,
|
||||
' }.hwline3 {stroke: black; stroke-linecap: round; stroke-linejoin: round; stroke-width: 3}.hwline4 {stroke: black; stroke-linecap: round; stroke-linejoin: round; stroke-width: 4}</style>'
|
||||
_getPlantsColor(plantsColor),
|
||||
'}.color2{fill:#fff}.hwline3 {stroke: black; stroke-linecap: round; stroke-linejoin: round; stroke-width: 3}.hwline4 {stroke: black; stroke-linecap: round; stroke-linejoin: round; stroke-width: 4}</style>'
|
||||
);
|
||||
}
|
||||
|
||||
function _getPlantsColor(PlantsColors plantsColor) internal pure returns (string memory, string memory) {
|
||||
function _getPlantsColor(PlantsColors plantsColor) internal pure returns (string memory) {
|
||||
if (plantsColor == PlantsColors.GREEN) {
|
||||
return ('#A0D170', '#FFF');
|
||||
return LensColors.baseGreen;
|
||||
} else if (plantsColor == PlantsColors.PINK) {
|
||||
return LensColors.basePink;
|
||||
} else if (plantsColor == PlantsColors.PURPLE) {
|
||||
return ('#EAD7FF', '#FFF');
|
||||
return LensColors.basePurple;
|
||||
} else if (plantsColor == PlantsColors.BLUE) {
|
||||
return ('#D9E0FF', '#FFF');
|
||||
return LensColors.baseBlue;
|
||||
} else if (plantsColor == PlantsColors.GOLD) {
|
||||
return ('#FFCD3D', '#FFF');
|
||||
return LensColors.baseGold;
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
@@ -58,6 +58,8 @@ library HeadwearPlants {
|
||||
function _getHeadwearColor(PlantsColors plantsColor) internal pure returns (Headwear.HeadwearColors) {
|
||||
if (plantsColor == PlantsColors.GREEN) {
|
||||
return Headwear.HeadwearColors.GREEN;
|
||||
} else if (plantsColor == PlantsColors.PINK) {
|
||||
return Headwear.HeadwearColors.PINK;
|
||||
} else if (plantsColor == PlantsColors.PURPLE) {
|
||||
return Headwear.HeadwearColors.PURPLE;
|
||||
} else if (plantsColor == PlantsColors.BLUE) {
|
||||
|
||||
73
contracts/libraries/svgs/Profile/Headwear/HeadwearScout.sol
Normal file
73
contracts/libraries/svgs/Profile/Headwear/HeadwearScout.sol
Normal file
@@ -0,0 +1,73 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import {Headwear} from 'contracts/libraries/svgs/Profile/Headwear.sol';
|
||||
import {LensColors} from 'contracts/libraries/svgs/Profile/LensColors.sol';
|
||||
|
||||
library HeadwearScout {
|
||||
enum ScoutColors {
|
||||
GREEN,
|
||||
PINK,
|
||||
PURPLE,
|
||||
BLUE,
|
||||
GOLD
|
||||
}
|
||||
|
||||
function getScout(
|
||||
ScoutColors scoutColor
|
||||
) external pure returns (string memory, Headwear.HeadwearVariants, Headwear.HeadwearColors) {
|
||||
return (
|
||||
string.concat(
|
||||
'<svg xmlns="http://www.w3.org/2000/svg" width="250" height="335" x="-18.6" fill="none">',
|
||||
_getScoutStyle(scoutColor),
|
||||
'<path class="headwearColorL" d="M205.8 92.3a35 35 0 0 0 14.5 13.8c-9.6-3.6-23-5.1-41.4-8-18-2.8-36.8-3.7-55.2-3.7-18.5 0-37.2.9-55.2 3.7-18.4 2.9-31.8 4.4-41.5 8a34.4 34.4 0 0 0 14.5-13.8c3-5.5 5.4-11.4 9.2-16.2 4.5-5.5 10.6-9 16.8-12a124.5 124.5 0 0 1 56.2-12.3A124.5 124.5 0 0 1 179.9 64c6.1 3 12.2 6.5 16.7 12 3.9 4.8 6.3 10.7 9.2 16.2Z"/><path class="headwearColorB" d="M142.4 52.9c-6-.8-12.3-1.1-18.7-1.1 0-6.5 2.8-14 8.4-17.6a29 29 0 0 1 19.3-4c1 4.4 1.8 9 .7 13.3a13 13 0 0 1-9.7 9.4Zm-27.1-18.7c5.5 3.7 8.4 11.1 8.4 17.6-6.5 0-12.7.3-18.8 1-4.4-.6-8.6-5-9.7-9.3a30 30 0 0 1 .7-13.3 29 29 0 0 1 19.4 4Z"/><path class="headwearColorL" d="M241.2 115.7c2.6 2.8 4.3 6.6 3.6 10.4.5-3.3-2.7-5.8-5.7-7.3-8.7-4.6-18.3-3.4-27.9-5.6-28.8-6.5-61-10-87.5-10-26.6 0-58.8 3.5-87.6 10-9.6 2.2-19.3 2.6-28 7.1-3 1.5-6 2.6-5.5 5.8-.8-3.7.7-7.9 3.3-10.6 2.5-2.6 9-4.6 21-8.7 9.7-3.3 23.2-4.8 41.6-7.4a374.7 374.7 0 0 1 110.4 0c18.3 2.6 31.9 3.8 41.6 7 12 4.2 18.2 6.8 20.7 9.3Z"/><path class="hwStr1" stroke-width="4" d="M123.7 104.5c-26.6 0-58.8 2.9-87.6 7.9a140 140 0 0 0-27.9 7.1c-3 1.2-6.1 3.1-5.6 5.7.3 1.5 5 5.3 19.2 7.2M27 106s0 0 0 0a34.4 34.4 0 0 0 14.5-13.7c3-5.5 5.4-11.4 9.2-16.2a46.4 46.4 0 0 1 16.8-12 124.6 124.6 0 0 1 56.2-12.3"/><path class="hwStr1" stroke-width="4" d="M105 52.9c-4.5-.7-8.7-5-9.8-9.4a30 30 0 0 1 .7-13.3 29 29 0 0 1 19.4 4c5.5 3.7 8.4 11.1 8.4 17.6"/><path class="hwStr1" stroke-width="3" d="M107.4 42c4 1.8 7.3 5.3 9 9.5"/><path class="hwStr1" stroke-width="4" d="M123.7 104.5c26.5 0 58.7 2.9 87.5 7.9a140 140 0 0 1 28 7.1c2.9 1.2 6 3.1 5.6 5.7-.4 1.5-5 5.3-19.3 7.2"/><path class="hwStr1" stroke-width="4" d="M2.6 123.1s0 0 0 0c-.8-3 1-6.2 3.6-8.4 2.5-2 8.7-5.3 20.8-8.6m217.8 17s0 0 0 0c.7-3-1-6.2-3.6-8.4-2.5-2-8.7-5.3-20.9-8.6m.1-.1s0 0 0 0a34.4 34.4 0 0 1-14.6-13.7c-3-5.5-5.3-11.4-9.2-16.2a46.4 46.4 0 0 0-16.8-12 124.6 124.6 0 0 0-56.1-12.3"/><path class="hwStr1" stroke-width="4" d="M142.4 52.9a13 13 0 0 0 9.7-9.4c1-4.3.4-8.9-.7-13.3a29 29 0 0 0-19.3 4c-5.6 3.7-8.4 11.1-8.4 17.6"/><path class="hwStr1" stroke-width="3" d="M140 42a17.1 17.1 0 0 0-9 9.5"/><path class="headwearColorL" d="M4.5 124.7c-2-2.6 17.4-7.4 17.4-7.4s-1.3 4-1.8 6.8c-.3 2.3-.4 6-.4 6s-12-1.3-15.2-5.4Zm238.4 0c2-2.6-17.4-7.4-17.4-7.4s1.3 4 1.7 6.8c.4 2.3.5 6 .5 6s12-1.3 15.2-5.4Z"/><path fill="#000" fill-opacity=".3" d="M4.5 124.7c-2-2.6 17.4-7.4 17.4-7.4s-1.3 4-1.8 6.8c-.3 2.3-.4 6-.4 6s-12-1.3-15.2-5.4Zm238.4 0c2-2.6-17.4-7.4-17.4-7.4s1.3 4 1.7 6.8c.4 2.3.5 6 .5 6s12-1.3 15.2-5.4Z"/><path fill="#fff" d="M130.7 67.7c-.1.2-.4 0-.4-.1v-.7c-.2-8.4-13-8.4-13.3 0v.7c0 .2-.2.3-.4.1l-.4-.4c-6.2-5.8-15.2 3.2-9.4 9.3l.5.5c7 7 16.4 7 16.4 7s9.4 0 16.4-7l.4-.5c5.8-6.1-3.2-15.1-9.4-9.3l-.4.4Z"/><path stroke="#000" stroke-linecap="square" stroke-linejoin="round" stroke-width="3" d="M130.7 67.7v0c-.1.2-.4 0-.4-.1v0-.7c-.2-8.4-13-8.4-13.3 0v.7c0 .2-.2.3-.4.1v0l-.4-.4c-6.2-5.8-15.2 3.2-9.4 9.3l.5.5c7 7 16.4 7 16.4 7s9.4 0 16.4-7l.4-.5c5.8-6.1-3.2-15.1-9.4-9.3l-.4.4Z"/><path class="hwStr1" stroke-width="3" d="M27 106.6c9.7-2.7 23.1-5.4 41.5-7.5a476 476 0 0 1 110.4 0c18.3 2.1 31.8 4.8 41.4 7.5"/><path stroke="#000" stroke-dasharray="9 9" stroke-linecap="round" stroke-linejoin="round" stroke-opacity=".2" stroke-width="2.5" d="M37.5 98.7c8.3-1.8 18.5-3.5 31-5a476 476 0 0 1 110.4 0c12.9 1.5 23.4 3.3 31.8 5.1"/><path class="headwearColorL" fill-rule="evenodd" d="m30.6 113.6.9 1.5c9.6 13 8.5 26 6.1 38.4l-1.3 6.4c-2 10.2-4 19.7-1.6 29.2l.4 1.3a2 2 0 0 1-1.6 2.5l-4.3.7a2 2 0 0 1-2.3-1.4l-.4-1.7c-2.8-11-.5-22 1.7-32.2l1.2-5.9c2.3-12 3-23-5-33.6l-2.2-3 8.4-2.2Z" clip-rule="evenodd"/><path stroke="#000" stroke-linecap="round" stroke-width="3" d="m26 187.4 8-1.5"/><path class="hwStr1" stroke-width="3" d="m30.6 113.6.9 1.5c9.6 13 8.5 26 6.1 38.4l-1.3 6.4c-2 10.2-4 19.7-1.6 29.2l.4 1.3a2 2 0 0 1-1.6 2.5l-4.3.7a2 2 0 0 1-2.3-1.4l-.4-1.7c-2.8-11-.5-22 1.7-32.2l1.2-5.9c2.3-12 3-23-5-33.6l-2.2-3 8.4-2.2Z" clip-rule="evenodd"/><path fill="#000" fill-opacity=".2" d="m33.8 186.6-7.9 1.5 1.5 6h3.8l4-2.1-1.4-5.4Z"/><path class="headwearColorL" fill-rule="evenodd" d="m216.7 113.6-.8 1.5c-9.7 13-8.6 26-6.2 38.4l1.3 6.4c2.1 10.2 4 19.7 1.6 29.2l-.3 1.3a2 2 0 0 0 1.6 2.5l4.2.7c1 .2 2-.4 2.3-1.4l.4-1.7c2.8-11 .5-22-1.6-32.2l-1.2-5.9c-2.3-12-3-23 5-33.6l2.2-3-8.5-2.2Z" clip-rule="evenodd"/><path stroke="#000" stroke-linecap="round" stroke-width="3" d="m221.4 187.4-8-1.5"/><path class="hwStr1" stroke-width="3" d="m216.7 113.6-.8 1.5c-9.7 13-8.6 26-6.2 38.4l1.3 6.4c2.1 10.2 4 19.7 1.6 29.2l-.3 1.3a2 2 0 0 0 1.6 2.5l4.2.7c1 .2 2-.4 2.3-1.4l.4-1.7c2.8-11 .5-22-1.6-32.2l-1.2-5.9c-2.3-12-3-23 5-33.6l2.2-3-8.5-2.2Z" clip-rule="evenodd"/><path fill="#000" fill-opacity=".2" d="m213.5 186.6 7.9 1.5-1.5 6h-3.8l-3.9-2.1 1.3-5.4Z"/></svg>'
|
||||
),
|
||||
Headwear.HeadwearVariants.SCOUT,
|
||||
_getHeadwearColor(scoutColor)
|
||||
);
|
||||
}
|
||||
|
||||
function _getScoutStyle(ScoutColors scoutColor) internal pure returns (string memory) {
|
||||
(string memory lightColor, string memory baseColor) = _getScoutColor(scoutColor);
|
||||
return
|
||||
string.concat(
|
||||
'<style>.headwearColorL { fill:',
|
||||
lightColor,
|
||||
'}.headwearColorB { fill:',
|
||||
baseColor,
|
||||
'}.hwStr1 {stroke: #000;stroke-linecap: round;stroke-linejoin: round;}</style>'
|
||||
);
|
||||
}
|
||||
|
||||
function _getScoutColor(ScoutColors scoutColor) internal pure returns (string memory, string memory) {
|
||||
if (scoutColor == ScoutColors.GREEN) {
|
||||
return (LensColors.lightGreen, LensColors.baseGreen);
|
||||
} else if (scoutColor == ScoutColors.PURPLE) {
|
||||
return (LensColors.lightPurple, LensColors.basePurple);
|
||||
} else if (scoutColor == ScoutColors.BLUE) {
|
||||
return (LensColors.lightBlue, LensColors.baseBlue);
|
||||
} else if (scoutColor == ScoutColors.PINK) {
|
||||
return (LensColors.lightPink, LensColors.basePink);
|
||||
} else if (scoutColor == ScoutColors.GOLD) {
|
||||
return (LensColors.lightGold, LensColors.baseGold);
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
}
|
||||
|
||||
function _getHeadwearColor(ScoutColors scoutColor) internal pure returns (Headwear.HeadwearColors) {
|
||||
if (scoutColor == ScoutColors.GREEN) {
|
||||
return Headwear.HeadwearColors.GREEN;
|
||||
} else if (scoutColor == ScoutColors.PURPLE) {
|
||||
return Headwear.HeadwearColors.PURPLE;
|
||||
} else if (scoutColor == ScoutColors.BLUE) {
|
||||
return Headwear.HeadwearColors.BLUE;
|
||||
} else if (scoutColor == ScoutColors.PINK) {
|
||||
return Headwear.HeadwearColors.PINK;
|
||||
} else if (scoutColor == ScoutColors.GOLD) {
|
||||
return Headwear.HeadwearColors.GOLD;
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
}
|
||||
}
|
||||
73
contracts/libraries/svgs/Profile/Headwear/HeadwearShaman.sol
Normal file
73
contracts/libraries/svgs/Profile/Headwear/HeadwearShaman.sol
Normal file
File diff suppressed because one or more lines are too long
@@ -2,10 +2,11 @@
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import {Headwear} from 'contracts/libraries/svgs/Profile/Headwear.sol';
|
||||
import {LensColors} from 'contracts/libraries/svgs/Profile/LensColors.sol';
|
||||
|
||||
library HeadwearSparkles {
|
||||
enum SparklesColors {
|
||||
LIGHT,
|
||||
NONE,
|
||||
GOLD
|
||||
}
|
||||
|
||||
@@ -34,18 +35,18 @@ library HeadwearSparkles {
|
||||
}
|
||||
|
||||
function _getSparklesColor(SparklesColors sparklesColor) internal pure returns (string memory) {
|
||||
if (sparklesColor == SparklesColors.LIGHT) {
|
||||
return '#000';
|
||||
if (sparklesColor == SparklesColors.NONE) {
|
||||
return LensColors.black;
|
||||
} else if (sparklesColor == SparklesColors.GOLD) {
|
||||
return '#B96326';
|
||||
return LensColors.darkGold;
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
}
|
||||
|
||||
function _getHeadwearColor(SparklesColors sparklesColor) internal pure returns (Headwear.HeadwearColors) {
|
||||
if (sparklesColor == SparklesColors.LIGHT) {
|
||||
return Headwear.HeadwearColors.LIGHT;
|
||||
if (sparklesColor == SparklesColors.NONE) {
|
||||
return Headwear.HeadwearColors.NONE;
|
||||
} else if (sparklesColor == SparklesColors.GOLD) {
|
||||
return Headwear.HeadwearColors.GOLD;
|
||||
} else {
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import {LensColors} from './LensColors.sol';
|
||||
|
||||
library Helpers {
|
||||
enum ComponentBytes {
|
||||
BACKGROUND,
|
||||
@@ -32,6 +34,7 @@ library Helpers {
|
||||
library Background {
|
||||
enum BackgroundColors {
|
||||
GREEN,
|
||||
PINK,
|
||||
PURPLE,
|
||||
BLUE,
|
||||
GOLD
|
||||
@@ -40,6 +43,8 @@ library Background {
|
||||
function getBackgroundColor(BackgroundColors backgroundColor) internal pure returns (string memory) {
|
||||
if (backgroundColor == BackgroundColors.GREEN) {
|
||||
return '#green';
|
||||
} else if (backgroundColor == BackgroundColors.PINK) {
|
||||
return '#pink';
|
||||
} else if (backgroundColor == BackgroundColors.PURPLE) {
|
||||
return '#purple';
|
||||
} else if (backgroundColor == BackgroundColors.BLUE) {
|
||||
@@ -55,6 +60,7 @@ library Background {
|
||||
library Skin {
|
||||
enum SkinColors {
|
||||
GREEN,
|
||||
PINK,
|
||||
PURPLE,
|
||||
BLUE,
|
||||
GOLD
|
||||
@@ -62,13 +68,15 @@ library Skin {
|
||||
|
||||
function getSkinColor(SkinColors skinColor) internal pure returns (string memory) {
|
||||
if (skinColor == SkinColors.GREEN) {
|
||||
return '#A0D170';
|
||||
return LensColors.baseGreen;
|
||||
} else if (skinColor == SkinColors.PINK) {
|
||||
return LensColors.basePink;
|
||||
} else if (skinColor == SkinColors.PURPLE) {
|
||||
return '#EAD7FF';
|
||||
return LensColors.basePurple;
|
||||
} else if (skinColor == SkinColors.BLUE) {
|
||||
return '#D9E0FF';
|
||||
return LensColors.baseBlue;
|
||||
} else if (skinColor == SkinColors.GOLD) {
|
||||
return '#F8C944';
|
||||
return LensColors.baseGold;
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import {LensColors} from './LensColors.sol';
|
||||
|
||||
library Legs {
|
||||
enum LegColors {
|
||||
GREEN,
|
||||
PINK,
|
||||
PURPLE,
|
||||
BLUE,
|
||||
DARK,
|
||||
LIGHT
|
||||
LIGHT,
|
||||
GOLD
|
||||
}
|
||||
|
||||
// // we take the 6th byte from the left for leg color
|
||||
@@ -25,11 +31,19 @@ library Legs {
|
||||
|
||||
function _getLegColorHex(LegColors legColor) internal pure returns (string memory, string memory) {
|
||||
if (legColor == LegColors.GREEN) {
|
||||
return ('#93A97D', '#F4FFDC');
|
||||
return (LensColors.darkGreen, LensColors.lightGreen);
|
||||
} else if (legColor == LegColors.PURPLE) {
|
||||
return (LensColors.darkPurple, LensColors.lightPurple);
|
||||
} else if (legColor == LegColors.BLUE) {
|
||||
return (LensColors.darkBlue, LensColors.lightBlue);
|
||||
} else if (legColor == LegColors.PINK) {
|
||||
return (LensColors.darkPink, LensColors.lightPink);
|
||||
} else if (legColor == LegColors.DARK) {
|
||||
return ('#575757', '#DBDBDB');
|
||||
return (LensColors.dark, LensColors.gray);
|
||||
} else if (legColor == LegColors.LIGHT) {
|
||||
return ('#EAEAEA', '#FFFFFF');
|
||||
return (LensColors.lightGray, LensColors.white);
|
||||
} else if (legColor == LegColors.GOLD) {
|
||||
return (LensColors.baseGold, LensColors.lightGold);
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
|
||||
33
contracts/libraries/svgs/Profile/LensColors.sol
Normal file
33
contracts/libraries/svgs/Profile/LensColors.sol
Normal file
@@ -0,0 +1,33 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
library LensColors {
|
||||
string constant baseGreen = '#A0D170';
|
||||
string constant basePink = '#FFD2DD';
|
||||
string constant basePurple = '#EAD7FF';
|
||||
string constant baseBlue = '#D9E0FF';
|
||||
string constant baseGold = '#F8C944';
|
||||
|
||||
string constant lightGreen = '#F4FFDC';
|
||||
string constant lightPink = '#FFE7F0';
|
||||
string constant lightPurple = '#F3EAFF';
|
||||
string constant lightBlue = '#ECF0FF';
|
||||
string constant lightGold = '#FFEE93';
|
||||
|
||||
string constant darkGreen = '#93A97D';
|
||||
string constant darkPink = '#EAAEC7';
|
||||
string constant darkPurple = '#C3B3D5';
|
||||
string constant darkBlue = '#ACB5DD';
|
||||
string constant darkGold = '#B96326';
|
||||
|
||||
string constant dark = '#575757';
|
||||
string constant gray = '#DBDBDB';
|
||||
string constant lightGray = '#EAEAEA';
|
||||
string constant white = '#FFF';
|
||||
string constant black = '#000';
|
||||
|
||||
string constant tears = '#E3F7FF';
|
||||
string constant heartEyes = '#FF88A5';
|
||||
string constant tongue = '#FFDFE7';
|
||||
string constant bubbleGum = '#FFCFEC';
|
||||
}
|
||||
@@ -3,8 +3,11 @@ pragma solidity ^0.8.0;
|
||||
|
||||
import {Body} from './Body.sol';
|
||||
|
||||
import {LensColors} from './LensColors.sol';
|
||||
|
||||
library Logo {
|
||||
enum LogoVariants {
|
||||
NONE,
|
||||
HAPPY,
|
||||
HEART,
|
||||
LENS,
|
||||
@@ -13,10 +16,12 @@ library Logo {
|
||||
|
||||
enum LogoColors {
|
||||
GREEN,
|
||||
PINK,
|
||||
PURPLE,
|
||||
BLUE,
|
||||
LIGHT,
|
||||
DARK
|
||||
GOLD,
|
||||
NONE
|
||||
}
|
||||
|
||||
function getLogo(
|
||||
@@ -25,12 +30,14 @@ library Logo {
|
||||
Body.BodyVariants bodyVariant,
|
||||
Body.BodyColors bodyColor
|
||||
) public pure returns (string memory) {
|
||||
if (logoVariant == LogoVariants.NONE) {
|
||||
return '';
|
||||
}
|
||||
|
||||
// Don't display Light & Dark Logos on non-Light & non-Dark bodies
|
||||
if (bodyColor != Body.BodyColors.LIGHT && bodyColor != Body.BodyColors.DARK) {
|
||||
if (logoColor == LogoColors.LIGHT) {
|
||||
logoColor = LogoColors.BLUE;
|
||||
} else if (logoColor == LogoColors.DARK) {
|
||||
logoColor = LogoColors.PURPLE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +49,8 @@ library Logo {
|
||||
return getLogoTshirtTanktop(logoVariant, logoColor);
|
||||
} else if (bodyVariant == Body.BodyVariants.JACKET) {
|
||||
return getLogoJacket(logoVariant, logoColor);
|
||||
} else if (bodyVariant == Body.BodyVariants.SHIBUYA) {
|
||||
return ''; // No logo for Shibuya
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
@@ -151,15 +160,17 @@ library Logo {
|
||||
|
||||
function _getLogoColor(LogoColors logoColor) internal pure returns (string memory) {
|
||||
if (logoColor == LogoColors.GREEN) {
|
||||
return '#A0D170';
|
||||
return LensColors.baseGreen;
|
||||
} else if (logoColor == LogoColors.PINK) {
|
||||
return LensColors.basePink;
|
||||
} else if (logoColor == LogoColors.PURPLE) {
|
||||
return '#EAD7FF';
|
||||
return LensColors.basePurple;
|
||||
} else if (logoColor == LogoColors.BLUE) {
|
||||
return '#D9E0FF';
|
||||
return LensColors.baseBlue;
|
||||
} else if (logoColor == LogoColors.LIGHT) {
|
||||
return '#EAEAEA';
|
||||
} else if (logoColor == LogoColors.DARK) {
|
||||
return '#DBDBDB';
|
||||
return LensColors.lightGray;
|
||||
} else if (logoColor == LogoColors.GOLD) {
|
||||
return LensColors.baseGold;
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
|
||||
@@ -47,9 +47,9 @@ library ProfileSVG {
|
||||
'<path fill="url(',
|
||||
Background.getBackgroundColor(chosenElements.backgroundColor),
|
||||
')" d="M0 0h275v415H0z"/></g>',
|
||||
'<svg xmlns="http://www.w3.org/2000/svg" width="210" height="335" fill="none" id="container" x="52" viewBox="0 0 260 415" >',
|
||||
'<svg xmlns="http://www.w3.org/2000/svg" width="250" height="335" fill="none" id="container" x="32" viewBox="0 0 260 415" >',
|
||||
_generateSvgElements(chosenElements, headwearSvg),
|
||||
'</svg><defs><radialGradient id="green" cx="0" cy="0" r="1" gradientTransform="matrix(275 -275 362 362 0 275)" gradientUnits="userSpaceOnUse"><stop stop-color="#DFFFBF"/><stop offset="1" stop-color="#EFD"/></radialGradient><radialGradient id="purple" cx="0" cy="0" r="1" gradientTransform="matrix(275 -275 362 362 0 275)" gradientUnits="userSpaceOnUse"><stop stop-color="#F1E4FF"/><stop offset="1" stop-color="#F8F1FF"/></radialGradient><radialGradient id="blue" cx="0" cy="0" r="1" gradientTransform="matrix(275 -275 362 362 0 275)" gradientUnits="userSpaceOnUse"><stop stop-color="#E6EAFF"/><stop offset="1" stop-color="#EFF2FF"/></radialGradient><radialGradient id="yellow" cx="0" cy="0" r="1" gradientTransform="matrix(275 -275 362 362 0 275)" gradientUnits="userSpaceOnUse"><stop stop-color="#FFE7A5"/><stop offset="1" stop-color="#FFF2CE"/></radialGradient></defs></svg>'
|
||||
'</svg><defs><radialGradient id="green" cx="0" cy="0" r="1" gradientTransform="matrix(275 -275 362 362 0 275)" gradientUnits="userSpaceOnUse"><stop stop-color="#DFFFBF"/><stop offset="1" stop-color="#EFD"/></radialGradient><radialGradient id="pink" cx="0" cy="0" r="1" gradientTransform="matrix(275 -275 362 362 0 275)" gradientUnits="userSpaceOnUse"><stop stop-color="#FFE7F0"/><stop offset="1" stop-color="#FFF3F8"/></radialGradient><radialGradient id="purple" cx="0" cy="0" r="1" gradientTransform="matrix(275 -275 362 362 0 275)" gradientUnits="userSpaceOnUse"><stop stop-color="#F1E4FF"/><stop offset="1" stop-color="#F8F1FF"/></radialGradient><radialGradient id="blue" cx="0" cy="0" r="1" gradientTransform="matrix(275 -275 362 362 0 275)" gradientUnits="userSpaceOnUse"><stop stop-color="#E6EAFF"/><stop offset="1" stop-color="#EFF2FF"/></radialGradient><radialGradient id="yellow" cx="0" cy="0" r="1" gradientTransform="matrix(275 -275 362 362 0 275)" gradientUnits="userSpaceOnUse"><stop stop-color="#FFE7A5"/><stop offset="1" stop-color="#FFF2CE"/></radialGradient></defs></svg>'
|
||||
);
|
||||
}
|
||||
|
||||
@@ -57,36 +57,40 @@ library ProfileSVG {
|
||||
string memory traits;
|
||||
{
|
||||
traits = string.concat(
|
||||
_getTrait(chosenElements.backgroundColor),
|
||||
_getTrait(chosenElements.skinColor),
|
||||
_getTrait(chosenElements.legColor),
|
||||
_getTrait(chosenElements.shoeColor),
|
||||
_getTrait(chosenElements.handsVariant),
|
||||
_getTrait(chosenElements.bodyVariant),
|
||||
_getTrait(chosenElements.bodyColor)
|
||||
_getTrait(chosenElements.backgroundColor), // Background
|
||||
_getTrait(chosenElements.skinColor), // Color
|
||||
_getTrait(chosenElements.legColor), // Pants
|
||||
_getTrait(chosenElements.shoeColor), // Sneakers
|
||||
_getTrait(chosenElements.handsVariant), // Hands
|
||||
_getTrait(chosenElements.bodyVariant), // Clothing
|
||||
_getTrait(chosenElements.bodyColor) // Clothing Color
|
||||
);
|
||||
}
|
||||
return
|
||||
string.concat(
|
||||
traits,
|
||||
_getTrait(chosenElements.logoVariant),
|
||||
_getTrait(chosenElements.logoColor),
|
||||
_getTrait(chosenElements.faceVariant), // Doesn't have an ending comma
|
||||
_getTrait(chosenElements.headwearVariant), // The rest has comma in the beginning
|
||||
_getTrait(chosenElements.headwearColor)
|
||||
_getTrait(chosenElements.faceVariant), // Mood - Doesn't have an ending comma
|
||||
_getTrait(chosenElements.logoVariant), // Clothing Logo - Has comma at the beginning
|
||||
_getTrait(chosenElements.logoColor), // Clothing Logo Color - Has comma at the beginning
|
||||
_getTrait(chosenElements.headwearVariant), // Headwear - Has comma at the beginning
|
||||
_getTrait(chosenElements.headwearColor) // Headwear Color - Has comma at the beginning
|
||||
);
|
||||
}
|
||||
|
||||
function _getTrait(Background.BackgroundColors backgroundColor) internal pure returns (string memory) {
|
||||
string memory stringBackgroundColor;
|
||||
if (backgroundColor == Background.BackgroundColors.GREEN) {
|
||||
stringBackgroundColor = 'Green';
|
||||
stringBackgroundColor = 'green';
|
||||
} else if (backgroundColor == Background.BackgroundColors.PINK) {
|
||||
stringBackgroundColor = 'pink';
|
||||
} else if (backgroundColor == Background.BackgroundColors.PURPLE) {
|
||||
stringBackgroundColor = 'Purple';
|
||||
stringBackgroundColor = 'purple';
|
||||
} else if (backgroundColor == Background.BackgroundColors.BLUE) {
|
||||
stringBackgroundColor = 'Blue';
|
||||
stringBackgroundColor = 'blue';
|
||||
} else if (backgroundColor == Background.BackgroundColors.GOLD) {
|
||||
stringBackgroundColor = 'Gold';
|
||||
stringBackgroundColor = 'gold';
|
||||
} else {
|
||||
revert();
|
||||
}
|
||||
return string.concat('{"trait_type":"Background","value":"', stringBackgroundColor, '"},');
|
||||
}
|
||||
@@ -94,49 +98,75 @@ library ProfileSVG {
|
||||
function _getTrait(Skin.SkinColors skinColor) internal pure returns (string memory) {
|
||||
string memory stringSkinColor;
|
||||
if (skinColor == Skin.SkinColors.GREEN) {
|
||||
stringSkinColor = 'Green';
|
||||
stringSkinColor = 'forest';
|
||||
} else if (skinColor == Skin.SkinColors.PINK) {
|
||||
stringSkinColor = 'blush';
|
||||
} else if (skinColor == Skin.SkinColors.PURPLE) {
|
||||
stringSkinColor = 'Purple';
|
||||
stringSkinColor = 'berry';
|
||||
} else if (skinColor == Skin.SkinColors.BLUE) {
|
||||
stringSkinColor = 'Blue';
|
||||
stringSkinColor = 'ice';
|
||||
} else if (skinColor == Skin.SkinColors.GOLD) {
|
||||
stringSkinColor = 'Gold';
|
||||
stringSkinColor = 'gold';
|
||||
} else {
|
||||
revert();
|
||||
}
|
||||
return string.concat('{"trait_type":"Skin","value":"', stringSkinColor, '"},');
|
||||
return string.concat('{"trait_type":"Color","value":"', stringSkinColor, '"},');
|
||||
}
|
||||
|
||||
function _getTrait(Legs.LegColors legColor) internal pure returns (string memory) {
|
||||
string memory stringLegColor;
|
||||
if (legColor == Legs.LegColors.GREEN) {
|
||||
stringLegColor = 'Green';
|
||||
stringLegColor = 'green';
|
||||
} else if (legColor == Legs.LegColors.DARK) {
|
||||
stringLegColor = 'Dark';
|
||||
stringLegColor = 'dark';
|
||||
} else if (legColor == Legs.LegColors.LIGHT) {
|
||||
stringLegColor = 'Light';
|
||||
stringLegColor = 'light';
|
||||
} else if (legColor == Legs.LegColors.PURPLE) {
|
||||
stringLegColor = 'purple';
|
||||
} else if (legColor == Legs.LegColors.BLUE) {
|
||||
stringLegColor = 'blue';
|
||||
} else if (legColor == Legs.LegColors.PINK) {
|
||||
stringLegColor = 'pink';
|
||||
} else if (legColor == Legs.LegColors.GOLD) {
|
||||
stringLegColor = 'gold';
|
||||
} else {
|
||||
revert();
|
||||
}
|
||||
return string.concat('{"trait_type":"Legs","value":"', stringLegColor, '"},');
|
||||
return string.concat('{"trait_type":"Pants","value":"', stringLegColor, '"},');
|
||||
}
|
||||
|
||||
function _getTrait(Shoes.ShoeColors shoeColor) internal pure returns (string memory) {
|
||||
string memory stringShoeColor;
|
||||
if (shoeColor == Shoes.ShoeColors.GREEN) {
|
||||
stringShoeColor = 'Green';
|
||||
stringShoeColor = 'green';
|
||||
} else if (shoeColor == Shoes.ShoeColors.DARK) {
|
||||
stringShoeColor = 'Dark';
|
||||
stringShoeColor = 'dark';
|
||||
} else if (shoeColor == Shoes.ShoeColors.LIGHT) {
|
||||
stringShoeColor = 'Light';
|
||||
stringShoeColor = 'light';
|
||||
} else if (shoeColor == Shoes.ShoeColors.PURPLE) {
|
||||
stringShoeColor = 'purple';
|
||||
} else if (shoeColor == Shoes.ShoeColors.BLUE) {
|
||||
stringShoeColor = 'blue';
|
||||
} else if (shoeColor == Shoes.ShoeColors.PINK) {
|
||||
stringShoeColor = 'pink';
|
||||
} else if (shoeColor == Shoes.ShoeColors.GOLD) {
|
||||
stringShoeColor = 'gold';
|
||||
} else {
|
||||
revert();
|
||||
}
|
||||
return string.concat('{"trait_type":"Shoes","value":"', stringShoeColor, '"},');
|
||||
return string.concat('{"trait_type":"Sneakers","value":"', stringShoeColor, '"},');
|
||||
}
|
||||
|
||||
function _getTrait(Hands.HandsVariants handsVariant) internal pure returns (string memory) {
|
||||
string memory stringHandsVariant;
|
||||
if (handsVariant == Hands.HandsVariants.HANDSDOWN) {
|
||||
return '';
|
||||
stringHandsVariant = 'chilling';
|
||||
} else if (handsVariant == Hands.HandsVariants.PEACEDOUBLE) {
|
||||
stringHandsVariant = 'Double Peace';
|
||||
stringHandsVariant = 'double peace';
|
||||
} else if (handsVariant == Hands.HandsVariants.PEACESINGLE) {
|
||||
stringHandsVariant = 'Peace';
|
||||
stringHandsVariant = 'peace';
|
||||
} else {
|
||||
revert();
|
||||
}
|
||||
return string.concat('{"trait_type":"Hands","value":"', stringHandsVariant, '"},');
|
||||
}
|
||||
@@ -144,125 +174,177 @@ library ProfileSVG {
|
||||
function _getTrait(Body.BodyVariants bodyVariant) internal pure returns (string memory) {
|
||||
string memory stringBodyVariant;
|
||||
if (bodyVariant == Body.BodyVariants.HOODIE) {
|
||||
stringBodyVariant = 'Hoodie';
|
||||
stringBodyVariant = 'hoodie';
|
||||
} else if (bodyVariant == Body.BodyVariants.JACKET) {
|
||||
stringBodyVariant = 'Jacket';
|
||||
stringBodyVariant = 'varsity';
|
||||
} else if (bodyVariant == Body.BodyVariants.TANKTOP) {
|
||||
stringBodyVariant = 'Tanktop';
|
||||
stringBodyVariant = 'tank';
|
||||
} else if (bodyVariant == Body.BodyVariants.TSHIRT) {
|
||||
stringBodyVariant = 'Tshirt';
|
||||
stringBodyVariant = 'tee';
|
||||
} else if (bodyVariant == Body.BodyVariants.SHIBUYA) {
|
||||
stringBodyVariant = 'shibuya';
|
||||
} else {
|
||||
revert();
|
||||
}
|
||||
return string.concat('{"trait_type":"Body","value":"', stringBodyVariant, '"},');
|
||||
return string.concat('{"trait_type":"Clothing","value":"', stringBodyVariant, '"},');
|
||||
}
|
||||
|
||||
function _getTrait(Body.BodyColors bodyColor) internal pure returns (string memory) {
|
||||
string memory stringBodyColor;
|
||||
if (bodyColor == Body.BodyColors.GREEN) {
|
||||
stringBodyColor = 'Green';
|
||||
stringBodyColor = 'green';
|
||||
} else if (bodyColor == Body.BodyColors.LIGHT) {
|
||||
stringBodyColor = 'Light';
|
||||
stringBodyColor = 'light';
|
||||
} else if (bodyColor == Body.BodyColors.DARK) {
|
||||
stringBodyColor = 'Dark';
|
||||
stringBodyColor = 'dark';
|
||||
} else if (bodyColor == Body.BodyColors.PURPLE) {
|
||||
stringBodyColor = 'Purple';
|
||||
stringBodyColor = 'purple';
|
||||
} else if (bodyColor == Body.BodyColors.BLUE) {
|
||||
stringBodyColor = 'Blue';
|
||||
stringBodyColor = 'blue';
|
||||
} else if (bodyColor == Body.BodyColors.PINK) {
|
||||
stringBodyColor = 'pink';
|
||||
} else if (bodyColor == Body.BodyColors.GOLD) {
|
||||
stringBodyColor = 'gold';
|
||||
} else {
|
||||
revert();
|
||||
}
|
||||
return string.concat('{"trait_type":"Body Color","value":"', stringBodyColor, '"},');
|
||||
return string.concat('{"trait_type":"Clothing Color","value":"', stringBodyColor, '"},');
|
||||
}
|
||||
|
||||
function _getTrait(Logo.LogoVariants logoVariant) internal pure returns (string memory) {
|
||||
string memory stringLogoVariant;
|
||||
if (logoVariant == Logo.LogoVariants.HAPPY) {
|
||||
stringLogoVariant = 'Happy';
|
||||
stringLogoVariant = 'happy';
|
||||
} else if (logoVariant == Logo.LogoVariants.HEART) {
|
||||
stringLogoVariant = 'Heart';
|
||||
stringLogoVariant = 'heart';
|
||||
} else if (logoVariant == Logo.LogoVariants.LENS) {
|
||||
stringLogoVariant = 'Lens';
|
||||
stringLogoVariant = 'lens';
|
||||
} else if (logoVariant == Logo.LogoVariants.PEACE) {
|
||||
stringLogoVariant = 'Peace';
|
||||
stringLogoVariant = 'peace';
|
||||
} else if (logoVariant == Logo.LogoVariants.NONE) {
|
||||
stringLogoVariant = 'none';
|
||||
} else {
|
||||
revert();
|
||||
}
|
||||
return string.concat('{"trait_type":"Logo","value":"', stringLogoVariant, '"},');
|
||||
return string.concat(',{"trait_type":"Clothing Logo","value":"', stringLogoVariant, '"}');
|
||||
}
|
||||
|
||||
function _getTrait(Logo.LogoColors logoColor) internal pure returns (string memory) {
|
||||
string memory stringLogoColor;
|
||||
if (logoColor == Logo.LogoColors.GREEN) {
|
||||
stringLogoColor = 'Green';
|
||||
stringLogoColor = 'green';
|
||||
} else if (logoColor == Logo.LogoColors.PINK) {
|
||||
stringLogoColor = 'pink';
|
||||
} else if (logoColor == Logo.LogoColors.PURPLE) {
|
||||
stringLogoColor = 'Purple';
|
||||
stringLogoColor = 'purple';
|
||||
} else if (logoColor == Logo.LogoColors.BLUE) {
|
||||
stringLogoColor = 'Blue';
|
||||
stringLogoColor = 'blue';
|
||||
} else if (logoColor == Logo.LogoColors.LIGHT) {
|
||||
stringLogoColor = 'Light';
|
||||
} else if (logoColor == Logo.LogoColors.DARK) {
|
||||
stringLogoColor = 'Dark';
|
||||
stringLogoColor = 'light';
|
||||
} else if (logoColor == Logo.LogoColors.GOLD) {
|
||||
stringLogoColor = 'gold';
|
||||
} else if (logoColor == Logo.LogoColors.NONE) {
|
||||
return '';
|
||||
} else {
|
||||
revert();
|
||||
}
|
||||
return string.concat('{"trait_type":"Logo Color","value":"', stringLogoColor, '"},');
|
||||
return string.concat(',{"trait_type":"Clothing Logo Color","value":"', stringLogoColor, '"}');
|
||||
}
|
||||
|
||||
function _getTrait(Face.FaceVariants faceVariant) internal pure returns (string memory) {
|
||||
string memory stringFaceVariant;
|
||||
if (faceVariant == Face.FaceVariants.BUBBLEGUM) {
|
||||
stringFaceVariant = 'Bubblegum';
|
||||
stringFaceVariant = 'bubble gum';
|
||||
} else if (faceVariant == Face.FaceVariants.GRIN_TONGUE) {
|
||||
stringFaceVariant = 'Grin Tongue';
|
||||
stringFaceVariant = 'silly';
|
||||
} else if (faceVariant == Face.FaceVariants.GRIN) {
|
||||
stringFaceVariant = 'Grin';
|
||||
stringFaceVariant = 'happy';
|
||||
} else if (faceVariant == Face.FaceVariants.LAUGH) {
|
||||
stringFaceVariant = 'Laugh';
|
||||
stringFaceVariant = 'lol';
|
||||
} else if (faceVariant == Face.FaceVariants.LOVE) {
|
||||
stringFaceVariant = 'Love';
|
||||
stringFaceVariant = 'in love';
|
||||
} else if (faceVariant == Face.FaceVariants.OOPS) {
|
||||
stringFaceVariant = 'Oops';
|
||||
stringFaceVariant = 'oops';
|
||||
} else if (faceVariant == Face.FaceVariants.SLEEPY) {
|
||||
stringFaceVariant = 'Sleepy';
|
||||
stringFaceVariant = 'zzz';
|
||||
} else if (faceVariant == Face.FaceVariants.SMILE_TEETH) {
|
||||
stringFaceVariant = 'Smile Teeth';
|
||||
stringFaceVariant = 'cheesin';
|
||||
} else if (faceVariant == Face.FaceVariants.SMILE) {
|
||||
stringFaceVariant = 'Smile';
|
||||
stringFaceVariant = 'OG';
|
||||
} else if (faceVariant == Face.FaceVariants.SMIRK) {
|
||||
stringFaceVariant = 'Smirk';
|
||||
stringFaceVariant = 'slick';
|
||||
} else if (faceVariant == Face.FaceVariants.TONGUE) {
|
||||
stringFaceVariant = 'Tongue';
|
||||
stringFaceVariant = 'playful';
|
||||
} else if (faceVariant == Face.FaceVariants.WINK) {
|
||||
stringFaceVariant = 'Wink';
|
||||
stringFaceVariant = 'wink';
|
||||
} else if (faceVariant == Face.FaceVariants.WOW_TONGUE) {
|
||||
stringFaceVariant = 'Wow Tongue';
|
||||
stringFaceVariant = 'excited';
|
||||
} else if (faceVariant == Face.FaceVariants.WOW) {
|
||||
stringFaceVariant = 'Wow';
|
||||
stringFaceVariant = 'lucy';
|
||||
} else if (faceVariant == Face.FaceVariants.BABY) {
|
||||
stringFaceVariant = 'baby';
|
||||
} else if (faceVariant == Face.FaceVariants.KAWAII) {
|
||||
stringFaceVariant = 'kawaii';
|
||||
} else if (faceVariant == Face.FaceVariants.PIXIE) {
|
||||
stringFaceVariant = 'pixie';
|
||||
} else if (faceVariant == Face.FaceVariants.TODDLER) {
|
||||
stringFaceVariant = 'toddler';
|
||||
} else if (faceVariant == Face.FaceVariants.VAMP) {
|
||||
stringFaceVariant = 'vamp';
|
||||
} else {
|
||||
revert();
|
||||
}
|
||||
return string.concat('{"trait_type":"Face","value":"', stringFaceVariant, '"}');
|
||||
return string.concat('{"trait_type":"Mood","value":"', stringFaceVariant, '"}');
|
||||
}
|
||||
|
||||
function _getTrait(Headwear.HeadwearVariants headwearVariant) internal pure returns (string memory) {
|
||||
string memory stringHeadwearVariant;
|
||||
if (headwearVariant == Headwear.HeadwearVariants.NONE) {
|
||||
return '';
|
||||
stringHeadwearVariant = 'none';
|
||||
} else if (headwearVariant == Headwear.HeadwearVariants.BEANIE) {
|
||||
stringHeadwearVariant = 'Beanie';
|
||||
stringHeadwearVariant = 'brrr';
|
||||
} else if (headwearVariant == Headwear.HeadwearVariants.HAT) {
|
||||
stringHeadwearVariant = 'Hat';
|
||||
} else if (headwearVariant == Headwear.HeadwearVariants.LEAFS) {
|
||||
stringHeadwearVariant = 'Leafs';
|
||||
stringHeadwearVariant = 'cap';
|
||||
} else if (headwearVariant == Headwear.HeadwearVariants.PLANTS) {
|
||||
stringHeadwearVariant = 'Plants';
|
||||
stringHeadwearVariant = 'lily';
|
||||
} else if (headwearVariant == Headwear.HeadwearVariants.SPARKLES) {
|
||||
stringHeadwearVariant = 'Sparkles';
|
||||
stringHeadwearVariant = 'sparkle';
|
||||
} else if (headwearVariant == Headwear.HeadwearVariants.CROWN) {
|
||||
stringHeadwearVariant = 'Crown';
|
||||
stringHeadwearVariant = 'king';
|
||||
} else if (headwearVariant == Headwear.HeadwearVariants.FLORAL) {
|
||||
stringHeadwearVariant = 'Floral';
|
||||
stringHeadwearVariant = 'queen';
|
||||
} else if (headwearVariant == Headwear.HeadwearVariants.GLASSES) {
|
||||
stringHeadwearVariant = 'Glasses';
|
||||
stringHeadwearVariant = 'shady';
|
||||
} else if (headwearVariant == Headwear.HeadwearVariants.MUSHROOM) {
|
||||
stringHeadwearVariant = 'Mushroom';
|
||||
stringHeadwearVariant = 'mushie';
|
||||
} else if (headwearVariant == Headwear.HeadwearVariants.NIGHTCAP) {
|
||||
stringHeadwearVariant = 'Nightcap';
|
||||
stringHeadwearVariant = 'gn';
|
||||
} else if (headwearVariant == Headwear.HeadwearVariants.PARTYHAT) {
|
||||
stringHeadwearVariant = 'Partyhat';
|
||||
stringHeadwearVariant = 'birthday';
|
||||
} else if (headwearVariant == Headwear.HeadwearVariants.ICECREAM) {
|
||||
stringHeadwearVariant = 'Icecream';
|
||||
stringHeadwearVariant = 'sweet';
|
||||
} else if (headwearVariant == Headwear.HeadwearVariants.BEAR) {
|
||||
stringHeadwearVariant = 'bear';
|
||||
} else if (headwearVariant == Headwear.HeadwearVariants.BEE) {
|
||||
stringHeadwearVariant = 'bee';
|
||||
} else if (headwearVariant == Headwear.HeadwearVariants.BIRDIE) {
|
||||
stringHeadwearVariant = 'birdie';
|
||||
} else if (headwearVariant == Headwear.HeadwearVariants.BRAINS) {
|
||||
stringHeadwearVariant = 'brains';
|
||||
} else if (headwearVariant == Headwear.HeadwearVariants.BULL) {
|
||||
stringHeadwearVariant = 'bull';
|
||||
} else if (headwearVariant == Headwear.HeadwearVariants.EARRINGS) {
|
||||
stringHeadwearVariant = 'earrings';
|
||||
} else if (headwearVariant == Headwear.HeadwearVariants.LOTUS) {
|
||||
stringHeadwearVariant = 'lotus';
|
||||
} else if (headwearVariant == Headwear.HeadwearVariants.MAJOR) {
|
||||
stringHeadwearVariant = 'major lenny';
|
||||
} else if (headwearVariant == Headwear.HeadwearVariants.SCOUT) {
|
||||
stringHeadwearVariant = 'scout';
|
||||
} else if (headwearVariant == Headwear.HeadwearVariants.SHAMAN) {
|
||||
stringHeadwearVariant = 'shaman';
|
||||
} else {
|
||||
revert();
|
||||
}
|
||||
return string.concat(',{"trait_type":"Headwear","value":"', stringHeadwearVariant, '"}');
|
||||
}
|
||||
@@ -272,17 +354,17 @@ library ProfileSVG {
|
||||
if (headwearColor == Headwear.HeadwearColors.NONE) {
|
||||
return '';
|
||||
} else if (headwearColor == Headwear.HeadwearColors.GREEN) {
|
||||
stringHeadwearColor = 'Green';
|
||||
} else if (headwearColor == Headwear.HeadwearColors.LIGHT) {
|
||||
stringHeadwearColor = 'Light';
|
||||
} else if (headwearColor == Headwear.HeadwearColors.DARK) {
|
||||
stringHeadwearColor = 'Dark';
|
||||
stringHeadwearColor = 'green';
|
||||
} else if (headwearColor == Headwear.HeadwearColors.PURPLE) {
|
||||
stringHeadwearColor = 'Purple';
|
||||
stringHeadwearColor = 'purple';
|
||||
} else if (headwearColor == Headwear.HeadwearColors.BLUE) {
|
||||
stringHeadwearColor = 'Blue';
|
||||
stringHeadwearColor = 'blue';
|
||||
} else if (headwearColor == Headwear.HeadwearColors.PINK) {
|
||||
stringHeadwearColor = 'pink';
|
||||
} else if (headwearColor == Headwear.HeadwearColors.GOLD) {
|
||||
stringHeadwearColor = 'Gold';
|
||||
stringHeadwearColor = 'gold';
|
||||
} else {
|
||||
revert();
|
||||
}
|
||||
return string.concat(',{"trait_type":"Headwear Color","value":"', stringHeadwearColor, '"}');
|
||||
}
|
||||
@@ -304,13 +386,17 @@ library ProfileSVG {
|
||||
uint8(Helpers.getColor(seed, Helpers.ComponentBytes.SKIN)) % uint8(type(Skin.SkinColors).max)
|
||||
);
|
||||
|
||||
chosenElements.legColor = Legs.LegColors(
|
||||
uint8(Helpers.getColor(seed, Helpers.ComponentBytes.LEGS)) % (uint8(type(Legs.LegColors).max) + 1)
|
||||
);
|
||||
chosenElements.legColor = isGold
|
||||
? Legs.LegColors.GOLD
|
||||
: Legs.LegColors(
|
||||
uint8(Helpers.getColor(seed, Helpers.ComponentBytes.LEGS)) % uint8(type(Legs.LegColors).max)
|
||||
);
|
||||
|
||||
chosenElements.shoeColor = Shoes.ShoeColors(
|
||||
uint8(Helpers.getColor(seed, Helpers.ComponentBytes.SHOES)) % (uint8(type(Shoes.ShoeColors).max) + 1)
|
||||
);
|
||||
chosenElements.shoeColor = isGold
|
||||
? Shoes.ShoeColors.GOLD
|
||||
: Shoes.ShoeColors(
|
||||
uint8(Helpers.getColor(seed, Helpers.ComponentBytes.SHOES)) % uint8(type(Shoes.ShoeColors).max)
|
||||
);
|
||||
|
||||
chosenElements.handsVariant = Hands.HandsVariants(
|
||||
uint8(Helpers.getVariant(seed, Helpers.ComponentBytes.HANDS)) % (uint8(type(Hands.HandsVariants).max) + 1)
|
||||
@@ -320,17 +406,27 @@ library ProfileSVG {
|
||||
uint8(Helpers.getVariant(seed, Helpers.ComponentBytes.BODY)) % (uint8(type(Body.BodyVariants).max) + 1)
|
||||
);
|
||||
|
||||
chosenElements.bodyColor = Body.BodyColors(
|
||||
uint8(Helpers.getColor(seed, Helpers.ComponentBytes.BODY)) % (uint8(type(Body.BodyColors).max) + 1)
|
||||
);
|
||||
chosenElements.bodyColor = isGold
|
||||
? Body.BodyColors.GOLD
|
||||
: Body.BodyColors(
|
||||
uint8(Helpers.getColor(seed, Helpers.ComponentBytes.BODY)) % uint8(type(Body.BodyColors).max)
|
||||
);
|
||||
|
||||
chosenElements.logoVariant = Logo.LogoVariants(
|
||||
uint8(Helpers.getVariant(seed, Helpers.ComponentBytes.LOGO)) % (uint8(type(Logo.LogoVariants).max) + 1)
|
||||
);
|
||||
chosenElements.logoVariant = chosenElements.bodyVariant == Body.BodyVariants.SHIBUYA
|
||||
? Logo.LogoVariants.NONE
|
||||
: Logo.LogoVariants(
|
||||
uint8(Helpers.getVariant(seed, Helpers.ComponentBytes.LOGO)) % (uint8(type(Logo.LogoVariants).max) + 1)
|
||||
);
|
||||
|
||||
chosenElements.logoColor = Logo.LogoColors(
|
||||
uint8(Helpers.getColor(seed, Helpers.ComponentBytes.LOGO)) % (uint8(type(Logo.LogoColors).max) + 1)
|
||||
);
|
||||
if (chosenElements.logoVariant == Logo.LogoVariants.NONE) {
|
||||
chosenElements.logoColor = Logo.LogoColors.NONE;
|
||||
} else {
|
||||
chosenElements.logoColor = isGold
|
||||
? Logo.LogoColors.GOLD
|
||||
: Logo.LogoColors(
|
||||
uint8(Helpers.getColor(seed, Helpers.ComponentBytes.LOGO)) % uint8(Logo.LogoColors.GOLD)
|
||||
);
|
||||
}
|
||||
|
||||
chosenElements.faceVariant = Face.FaceVariants(
|
||||
uint8(Helpers.getVariant(seed, Helpers.ComponentBytes.FACE)) % (uint8(type(Face.FaceVariants).max) + 1)
|
||||
@@ -367,11 +463,12 @@ library ProfileSVG {
|
||||
chosenElements.bodyColor
|
||||
),
|
||||
Head.getHead(Head.HeadColors(uint8(chosenElements.skinColor))),
|
||||
headwearSvg,
|
||||
Face.getFace(
|
||||
chosenElements.faceVariant,
|
||||
chosenElements.isGold ? Face.FaceColors.GOLD : Face.FaceColors.NORMAL
|
||||
chosenElements.isGold ? Face.FaceColors.GOLD : Face.FaceColors.NORMAL,
|
||||
chosenElements.skinColor
|
||||
),
|
||||
headwearSvg,
|
||||
Hands.getHands(
|
||||
chosenElements.handsVariant,
|
||||
Hands.HandsColors(uint8(chosenElements.skinColor)),
|
||||
|
||||
@@ -1,35 +1,47 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import {LensColors} from './LensColors.sol';
|
||||
|
||||
library Shoes {
|
||||
enum ShoeColors {
|
||||
GREEN,
|
||||
PINK,
|
||||
PURPLE,
|
||||
BLUE,
|
||||
DARK,
|
||||
LIGHT
|
||||
LIGHT,
|
||||
GOLD
|
||||
}
|
||||
|
||||
// // we take the 7th byte from the left for shoes color
|
||||
// uint8 color = uint8((seed >> 200) & 0xFF) % 3;
|
||||
function getShoes(ShoeColors shoeColor) external pure returns (string memory) {
|
||||
(string memory shoeColorHex1, string memory shoeColorHex2) = _getShoeColorHex(shoeColor);
|
||||
|
||||
return
|
||||
string.concat(
|
||||
'<svg xmlns="http://www.w3.org/2000/svg" width="210" height="335" fill="none"><style>.shColor1{fill:',
|
||||
shoeColorHex1,
|
||||
';}.shColor2{fill:',
|
||||
shoeColorHex2,
|
||||
';}.shStroke{stroke:#000;stroke-linecap:round;stroke-miterlimit:10;}</style><path class="shColor1" d="M75.4 281.7c1-.2 3.3 3.7 13.8 4 9.7.2 15.8-4.9 15.8-4.9s6.1 5 15.8 4.9c10.5-.3 12.7-4.2 13.6-4 2.9.4 7.2 3 6 6.4 3.7 4 6 8.4 7.4 14.2l.1.4.2 2c0-.4-.5 4.8-.8 4.6a19.3 19.3 0 0 0-9-3c-6.8.7-15.7 2-18.3 7.8-1.7 3.6-2.5 4.2-2 5.7-4.6-1-6.3-2-9.8-5.1-.5-.5-2.8-2.5-3.2-3.6-.5 1-2.6 3.1-3.1 3.6-3.7 3.1-4.5 4-9.2 5.1.4-1.5-1.4-2.1-3-5.7-2.7-5.8-10.5-7-17.4-7.7-2.5-.3-6.7 1.6-9 2.9-.3.2-1.4-5.1-1.4-4.7 0-.8.1-1.6.3-2.3a29.2 29.2 0 0 1 8.1-14.2c-1.3-3.3 2.2-6 5.1-6.4Z"/><path class="shColor2" d="m148.5 304.5 2.2 11c.6 2 .6 2.2-.8 4.6-1 1.5-7.1 9-21.2 9.4-14.5.6-21.8-5.6-23-7.5l-.1-9.2c.4 1 3.4 2.3 4 2.7 3.5 3.1 6.7 5.2 11.4 6.3l2 .2c6 1.2 11.6-1.5 16.8-4.6 2.9-1.6 5.4-2 7-4.6 1-1.9 2-4 2-6.4 0-.7-.2-1.3-.3-2ZM61.5 304.5l-2.2 11c-.6 2-.6 2.2.8 4.6 1 1.5 7.1 9 21.2 9.4 14.5.6 21.8-5.6 23-7.5l.1-9.2c-.4 1-3.4 2.3-4 2.7-3.5 3.1-6.7 5.2-11.4 6.3l-2 .2c-6 1.2-11.6-1.5-16.8-4.6-2.9-1.6-5.4-2-7-4.6-1-1.9-2-4-2-6.4 0-.7.2-1.3.3-2Z"/><path class="shColor2" d="M146.9 310.7a9.2 9.2 0 0 1-3.1 4.8c-2 2-5 4-8 4.8-5.3 1.5-10.8 2.9-15.8.4l-2.5-1.3c0-1.5 2.2-4.3 4.5-7.1a17.8 17.8 0 0 1 16.3-6c2.3.5 5.4.5 7 2.1.2.3 1.6 1.9 1.6 2.3ZM63.5 310.7a9.2 9.2 0 0 0 3.1 4.8c2 2 5 4 8 4.8 5.3 1.5 10.8 2.9 15.8.4l2.5-1.3c0-1.5-2.2-4.3-4.5-7.1a17.8 17.8 0 0 0-16.3-6c-2.3.5-5.4.5-7 2.1-.2.3-1.6 1.9-1.6 2.3Z"/><path class="shStroke" stroke-width="3" d="M105 321.8v-25"/><path class="shStroke" stroke-width="2" d="M98 293c2.5.2 5.2-.5 7-2"/><path class="shStroke" stroke-width="2.5" d="M74.8 281.6a24 24 0 0 0 29.8-.7"/><path class="shStroke" stroke-width="3" d="M62.6 310.4c4.4 6.7 12.4 11 20.5 11.2 8.2.1 16.3-3.8 21-10.3"/><path class="shStroke" stroke-width="2" d="M92.4 319.2a19.4 19.4 0 0 0-12-11.8c-5.7-1.8-12.1-1-17 2.2"/><path class="shStroke" stroke-width="4" d="M74 280.8a9.4 9.4 0 0 0-4 9.4c-5 4.3-8 11-8 17.7 0 1.4-.8 2.8-1.6 4-.6.9-1 2-1 3l-.2 1.7a9 9 0 0 0 2.9 7 31.3 31.3 0 0 0 41.7-1m32.3-41.8a9.5 9.5 0 0 1 4 9.4c5 4.3 8 11 8 17.7 0 1.4.8 2.8 1.5 4 .6.9 1 2 1.1 3l.2 1.7a9 9 0 0 1-3 7 31.3 31.3 0 0 1-41.6-1"/><path class="shStroke" stroke-width="2" d="M112 293c-2.5.2-5.2-.5-7-2"/><path class="shStroke" stroke-width="2.5" d="M135.3 281.6a24.7 24.7 0 0 1-30.2-.7"/><path class="shStroke" stroke-width="3" d="M147.4 310.4a25.6 25.6 0 0 1-20.5 11.2c-8.1.1-16.3-3.8-21-10.3"/><path class="shStroke" stroke-width="2" d="M117.6 319.2c2-5.5 6.5-10 12.1-11.8 5.6-1.8 12-1 17 2.2"/><path class="shColor2" d="M76.6 295.2a4 4 0 0 1 4.3-3c3.4.3 6.7 1.2 9.9 2.6 1.7.8 2.6 2.7 2.1 4.6l-.3 1.2c-.6 2-2.9 3.1-4.8 2.3a26 26 0 0 0-8.5-2.3 3.4 3.4 0 0 1-3-4.2l.3-1.2ZM133.5 295.2a4 4 0 0 0-4.3-3c-3.4.3-6.7 1.2-9.9 2.6a3.9 3.9 0 0 0-2.1 4.6l.3 1.2c.6 2 2.9 3.1 4.8 2.3a26 26 0 0 1 8.5-2.3 3.4 3.4 0 0 0 3-4.2l-.3-1.2Z"/><path class="shStroke" stroke-width="2" d="M76.6 295.2a4 4 0 0 1 4.3-3v0c3.4.3 6.7 1.2 9.9 2.6v0c1.7.8 2.6 2.7 2.1 4.6l-.3 1.2c-.6 2-2.9 3.1-4.8 2.3v0a26 26 0 0 0-8.5-2.3v0a3.4 3.4 0 0 1-3-4.2l.3-1.2ZM133.5 295.2a4 4 0 0 0-4.3-3v0c-3.4.3-6.7 1.2-9.9 2.6v0a3.9 3.9 0 0 0-2.1 4.6l.3 1.2c.6 2 2.9 3.1 4.8 2.3v0a26 26 0 0 1 8.5-2.3v0a3.4 3.4 0 0 0 3-4.2l-.3-1.2Z"/></svg>'
|
||||
_getShoeColorHex(shoeColor),
|
||||
';}.shColor2 {fill:',
|
||||
shoeColor == ShoeColors.GOLD ? LensColors.lightGold : LensColors.white,
|
||||
';}.shStroke{stroke:#000;stroke-linecap:round;stroke-miterlimit:10;}</style><path class="shColor1" d="M75.4 281.7c1-.2 3.3 3.7 13.8 4 9.7.2 15.8-4.9 15.8-4.9s6.1 5 15.8 4.9c10.5-.3 12.7-4.2 13.6-4 2.9.4 7.2 3 6 6.4 3.7 4 6 8.4 7.4 14.2l.1.4.2 2c0-.4-.5 4.8-.8 4.6a19.3 19.3 0 0 0-9-3c-6.8.7-15.7 2-18.3 7.8-1.7 3.6-2.5 4.2-2 5.7-4.6-1-6.3-2-9.8-5.1-.5-.5-2.8-2.5-3.2-3.6-.5 1-2.6 3.1-3.1 3.6-3.7 3.1-4.5 4-9.2 5.1.4-1.5-1.4-2.1-3-5.7-2.7-5.8-10.5-7-17.4-7.7-2.5-.3-6.7 1.6-9 2.9-.3.2-1.4-5.1-1.4-4.7 0-.8.1-1.6.3-2.3a29.2 29.2 0 0 1 8.1-14.2c-1.3-3.3 2.2-6 5.1-6.4Z" /><path class="shColor2" d="m148.5 304.5 2.2 11c.6 2 .6 2.2-.8 4.6-1 1.5-7.1 9-21.2 9.4-14.5.6-21.8-5.6-23-7.5l-.1-9.2c.4 1 3.4 2.3 4 2.7 3.5 3.1 6.7 5.2 11.4 6.3l2 .2c6 1.2 11.6-1.5 16.8-4.6 2.9-1.6 5.4-2 7-4.6 1-1.9 2-4 2-6.4 0-.7-.2-1.3-.3-2ZM61.5 304.5l-2.2 11c-.6 2-.6 2.2.8 4.6 1 1.5 7.1 9 21.2 9.4 14.5.6 21.8-5.6 23-7.5l.1-9.2c-.4 1-3.4 2.3-4 2.7-3.5 3.1-6.7 5.2-11.4 6.3l-2 .2c-6 1.2-11.6-1.5-16.8-4.6-2.9-1.6-5.4-2-7-4.6-1-1.9-2-4-2-6.4 0-.7.2-1.3.3-2Z" /><path class="shColor2" d="M146.9 310.7a9.2 9.2 0 0 1-3.1 4.8c-2 2-5 4-8 4.8-5.3 1.5-10.8 2.9-15.8.4l-2.5-1.3c0-1.5 2.2-4.3 4.5-7.1a17.8 17.8 0 0 1 16.3-6c2.3.5 5.4.5 7 2.1.2.3 1.6 1.9 1.6 2.3ZM63.5 310.7a9.2 9.2 0 0 0 3.1 4.8c2 2 5 4 8 4.8 5.3 1.5 10.8 2.9 15.8.4l2.5-1.3c0-1.5-2.2-4.3-4.5-7.1a17.8 17.8 0 0 0-16.3-6c-2.3.5-5.4.5-7 2.1-.2.3-1.6 1.9-1.6 2.3Z" /><path class="shStroke" stroke-width="3" d="M105 321.8v-25" /><path class="shStroke" stroke-width="2" d="M98 293c2.5.2 5.2-.5 7-2" /><path class="shStroke" stroke-width="2.5" d="M74.8 281.6a24 24 0 0 0 29.8-.7" /><path class="shStroke" stroke-width="3" d="M62.6 310.4c4.4 6.7 12.4 11 20.5 11.2 8.2.1 16.3-3.8 21-10.3" /><path class="shStroke" stroke-width="2" d="M92.4 319.2a19.4 19.4 0 0 0-12-11.8c-5.7-1.8-12.1-1-17 2.2" /><path class="shStroke" stroke-width="4" d="M74 280.8a9.4 9.4 0 0 0-4 9.4c-5 4.3-8 11-8 17.7 0 1.4-.8 2.8-1.6 4-.6.9-1 2-1 3l-.2 1.7a9 9 0 0 0 2.9 7 31.3 31.3 0 0 0 41.7-1m32.3-41.8a9.5 9.5 0 0 1 4 9.4c5 4.3 8 11 8 17.7 0 1.4.8 2.8 1.5 4 .6.9 1 2 1.1 3l.2 1.7a9 9 0 0 1-3 7 31.3 31.3 0 0 1-41.6-1" /><path class="shStroke" stroke-width="2" d="M112 293c-2.5.2-5.2-.5-7-2" /><path class="shStroke" stroke-width="2.5" d="M135.3 281.6a24.7 24.7 0 0 1-30.2-.7" /><path class="shStroke" stroke-width="3" d="M147.4 310.4a25.6 25.6 0 0 1-20.5 11.2c-8.1.1-16.3-3.8-21-10.3" /><path class="shStroke" stroke-width="2" d="M117.6 319.2c2-5.5 6.5-10 12.1-11.8 5.6-1.8 12-1 17 2.2" /><path class="shColor2" d="M76.6 295.2a4 4 0 0 1 4.3-3c3.4.3 6.7 1.2 9.9 2.6 1.7.8 2.6 2.7 2.1 4.6l-.3 1.2c-.6 2-2.9 3.1-4.8 2.3a26 26 0 0 0-8.5-2.3 3.4 3.4 0 0 1-3-4.2l.3-1.2ZM133.5 295.2a4 4 0 0 0-4.3-3c-3.4.3-6.7 1.2-9.9 2.6a3.9 3.9 0 0 0-2.1 4.6l.3 1.2c.6 2 2.9 3.1 4.8 2.3a26 26 0 0 1 8.5-2.3 3.4 3.4 0 0 0 3-4.2l-.3-1.2Z" /><path class="shStroke" stroke-width="2" d="M76.6 295.2a4 4 0 0 1 4.3-3v0c3.4.3 6.7 1.2 9.9 2.6v0c1.7.8 2.6 2.7 2.1 4.6l-.3 1.2c-.6 2-2.9 3.1-4.8 2.3v0a26 26 0 0 0-8.5-2.3v0a3.4 3.4 0 0 1-3-4.2l.3-1.2ZM133.5 295.2a4 4 0 0 0-4.3-3v0c-3.4.3-6.7 1.2-9.9 2.6v0a3.9 3.9 0 0 0-2.1 4.6l.3 1.2c.6 2 2.9 3.1 4.8 2.3v0a26 26 0 0 1 8.5-2.3v0a3.4 3.4 0 0 0 3-4.2l-.3-1.2Z" /></svg>'
|
||||
);
|
||||
}
|
||||
|
||||
function _getShoeColorHex(ShoeColors shoeColor) internal pure returns (string memory, string memory) {
|
||||
function _getShoeColorHex(ShoeColors shoeColor) internal pure returns (string memory) {
|
||||
if (shoeColor == ShoeColors.GREEN) {
|
||||
return ('#93A97D', '#F4FFDC');
|
||||
return LensColors.darkGreen;
|
||||
} else if (shoeColor == ShoeColors.PURPLE) {
|
||||
return LensColors.darkPurple;
|
||||
} else if (shoeColor == ShoeColors.BLUE) {
|
||||
return LensColors.darkBlue;
|
||||
} else if (shoeColor == ShoeColors.PINK) {
|
||||
return LensColors.darkPink;
|
||||
} else if (shoeColor == ShoeColors.DARK) {
|
||||
return ('#575757', '#DBDBDB');
|
||||
return LensColors.dark;
|
||||
} else if (shoeColor == ShoeColors.LIGHT) {
|
||||
return ('#EAEAEA', '#FFFFFF');
|
||||
return LensColors.lightGray;
|
||||
} else if (shoeColor == ShoeColors.GOLD) {
|
||||
return LensColors.baseGold;
|
||||
} else {
|
||||
revert(); // Avoid warnings.
|
||||
}
|
||||
|
||||
21
contracts/misc/FreeCreditsProvider.sol
Normal file
21
contracts/misc/FreeCreditsProvider.sol
Normal file
@@ -0,0 +1,21 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
pragma solidity ^0.8.15;
|
||||
|
||||
import {PermissionlessCreator} from 'contracts/misc/PermissionlessCreator.sol';
|
||||
|
||||
contract FreeCreditsProvider {
|
||||
PermissionlessCreator permissionlessCreator;
|
||||
|
||||
constructor(address permissionlessCreator_) {
|
||||
permissionlessCreator = PermissionlessCreator(permissionlessCreator_);
|
||||
}
|
||||
|
||||
function getFreeCredit(address user, uint256 amount) external {
|
||||
return permissionlessCreator.increaseCredits(user, amount);
|
||||
}
|
||||
|
||||
function burnCredits(uint256 amount) external {
|
||||
return permissionlessCreator.decreaseCredits(msg.sender, amount);
|
||||
}
|
||||
}
|
||||
@@ -34,12 +34,15 @@ contract ModuleRegistry is IModuleRegistry {
|
||||
uint256 timestamp
|
||||
);
|
||||
|
||||
event ModuleMetadataRefreshed(address indexed moduleAddress, string metadata, uint256 timestamp);
|
||||
|
||||
error NotLensModule();
|
||||
error ModuleDoesNotSupportType(uint256 moduleType);
|
||||
error ModuleNotRegistered();
|
||||
|
||||
mapping(address moduleAddress => uint256 moduleTypesBitmap) internal registeredModules;
|
||||
mapping(address moduleAddress => uint256 moduleTypesBitmap) internal _registeredModules;
|
||||
|
||||
mapping(address erc20CurrencyAddress => bool) internal registeredErc20Currencies;
|
||||
mapping(address erc20CurrencyAddress => bool) internal _registeredErc20Currencies;
|
||||
|
||||
// Modules
|
||||
|
||||
@@ -55,7 +58,7 @@ contract ModuleRegistry is IModuleRegistry {
|
||||
'Module Type out of bounds'
|
||||
);
|
||||
|
||||
bool isAlreadyRegisteredAsThatType = registeredModules[moduleAddress] & (1 << moduleType) != 0;
|
||||
bool isAlreadyRegisteredAsThatType = _registeredModules[moduleAddress] & (1 << moduleType) != 0;
|
||||
if (isAlreadyRegisteredAsThatType) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -67,7 +70,7 @@ contract ModuleRegistry is IModuleRegistry {
|
||||
|
||||
string memory metadata = ILensModule(moduleAddress).getModuleMetadataURI();
|
||||
emit ModuleRegistered(moduleAddress, moduleType, metadata, block.timestamp);
|
||||
registeredModules[moduleAddress] |= (1 << moduleType);
|
||||
_registeredModules[moduleAddress] |= (1 << moduleType);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -90,16 +93,16 @@ contract ModuleRegistry is IModuleRegistry {
|
||||
}
|
||||
|
||||
function getModuleTypes(address moduleAddress) public view returns (uint256) {
|
||||
return registeredModules[moduleAddress];
|
||||
return _registeredModules[moduleAddress];
|
||||
}
|
||||
|
||||
function isModuleRegistered(address moduleAddress) external view returns (bool) {
|
||||
return registeredModules[moduleAddress] != 0;
|
||||
return _registeredModules[moduleAddress] != 0;
|
||||
}
|
||||
|
||||
function isModuleRegisteredAs(address moduleAddress, uint256 moduleType) public view returns (bool) {
|
||||
require(moduleType <= type(uint8).max);
|
||||
return registeredModules[moduleAddress] & (1 << moduleType) != 0;
|
||||
return _registeredModules[moduleAddress] & (1 << moduleType) != 0;
|
||||
}
|
||||
|
||||
// Currencies
|
||||
@@ -110,7 +113,7 @@ contract ModuleRegistry is IModuleRegistry {
|
||||
}
|
||||
|
||||
function registerErc20Currency(address currencyAddress) public returns (bool registrationWasPerformed) {
|
||||
bool isAlreadyRegistered = registeredErc20Currencies[currencyAddress];
|
||||
bool isAlreadyRegistered = _registeredErc20Currencies[currencyAddress];
|
||||
if (isAlreadyRegistered) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -119,12 +122,19 @@ contract ModuleRegistry is IModuleRegistry {
|
||||
string memory symbol = IERC20Metadata(currencyAddress).symbol();
|
||||
|
||||
emit erc20CurrencyRegistered(currencyAddress, name, symbol, decimals, block.timestamp);
|
||||
registeredErc20Currencies[currencyAddress] = true;
|
||||
_registeredErc20Currencies[currencyAddress] = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function isErc20CurrencyRegistered(address currencyAddress) external view returns (bool) {
|
||||
return registeredErc20Currencies[currencyAddress];
|
||||
return _registeredErc20Currencies[currencyAddress];
|
||||
}
|
||||
|
||||
function emitModuleMetadataRefresh(address moduleAddress) external {
|
||||
if (_registeredModules[moduleAddress] == 0) {
|
||||
revert ModuleNotRegistered();
|
||||
}
|
||||
emit ModuleMetadataRefreshed(moduleAddress, ILensModule(moduleAddress).getModuleMetadataURI(), block.timestamp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,8 +11,10 @@ contract NFTMinter is ProfileTokenURI, ERC721 {
|
||||
constructor() ERC721('Test Protocol', 'TEST') {}
|
||||
|
||||
function mintMany(uint256 tokenIdFrom, uint256 tokenIdTo) external {
|
||||
for (uint256 i = tokenIdFrom; i < tokenIdTo; i++) {
|
||||
_mint(msg.sender, i);
|
||||
for (uint256 tokenId = tokenIdFrom; tokenId <= tokenIdTo; tokenId++) {
|
||||
if (!_exists(tokenId)) {
|
||||
_mint(msg.sender, tokenId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,18 +77,18 @@ contract DeployTestProfiles is Script, ForkManagement {
|
||||
}
|
||||
|
||||
function interact() internal {
|
||||
nftMinter = NFTMinter(0x9358Fe2E2Ec00bd24eeee491DFd3d57333A88FBB);
|
||||
vm.startBroadcast(_deployer.ownerPk);
|
||||
nftMinter.mintMany(100, 101);
|
||||
nftMinter.mintMany(200, 201);
|
||||
nftMinter.mintMany(300, 301);
|
||||
nftMinter.mintMany(400, 401);
|
||||
nftMinter.mintMany(500, 501);
|
||||
nftMinter.mintMany(600, 601);
|
||||
nftMinter.mintMany(700, 701);
|
||||
nftMinter.mintMany(800, 801);
|
||||
nftMinter.mintMany(900, 901);
|
||||
nftMinter.mintMany(1001, 1010);
|
||||
nftMinter.mintMany(1, 100);
|
||||
nftMinter.mintMany(101, 200);
|
||||
nftMinter.mintMany(201, 300);
|
||||
nftMinter.mintMany(301, 400);
|
||||
nftMinter.mintMany(401, 500);
|
||||
nftMinter.mintMany(501, 600);
|
||||
nftMinter.mintMany(601, 700);
|
||||
nftMinter.mintMany(701, 800);
|
||||
nftMinter.mintMany(801, 900);
|
||||
nftMinter.mintMany(901, 1000);
|
||||
nftMinter.mintMany(1001, 1100);
|
||||
|
||||
// nftMinter.mintMany(1, 100);
|
||||
// nftMinter.mintMany(101, 200);
|
||||
@@ -117,7 +119,7 @@ contract DeployTestProfiles is Script, ForkManagement {
|
||||
checkNetworkParams();
|
||||
loadBaseAddresses();
|
||||
loadPrivateKeys();
|
||||
// deploy();
|
||||
deploy();
|
||||
interact();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,6 +94,20 @@ contract ProfileSVGGen is Test {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
for (uint8 c = 0; c <= uint8(type(Skin.SkinColors).max) + 1; c++) {
|
||||
uint256 seed = setVariant(uint8(Face.FaceVariants.BABY), Helpers.ComponentBytes.FACE) +
|
||||
setColor(c, Helpers.ComponentBytes.SKIN);
|
||||
string memory result = profileNFT.tryWithSeed(seed, c == uint8(Skin.SkinColors.GOLD));
|
||||
vm.writeFile(string.concat(dir, 'faces/face_baby_', vm.toString(c), '.svg'), result);
|
||||
}
|
||||
|
||||
for (uint8 c = 0; c <= uint8(type(Skin.SkinColors).max) + 1; c++) {
|
||||
uint256 seed = setVariant(uint8(Face.FaceVariants.VAMP), Helpers.ComponentBytes.FACE) +
|
||||
setColor(c, Helpers.ComponentBytes.SKIN);
|
||||
string memory result = profileNFT.tryWithSeed(seed, c == uint8(Skin.SkinColors.GOLD));
|
||||
vm.writeFile(string.concat(dir, 'faces/face_vamp_', vm.toString(c), '.svg'), result);
|
||||
}
|
||||
}
|
||||
|
||||
function testHandsAndBody() public {
|
||||
@@ -182,13 +196,13 @@ contract ProfileSVGGen is Test {
|
||||
}
|
||||
}
|
||||
// Icecream
|
||||
for (uint8 c = 0; c <= 4; c++) {
|
||||
for (uint8 c = 0; c <= 7; c++) {
|
||||
uint256 seed = setVariant(69, Helpers.ComponentBytes.HEADWEAR) +
|
||||
setColor(c, Helpers.ComponentBytes.HEADWEAR);
|
||||
string memory result = profileNFT.tryWithSeed(seed, false);
|
||||
vm.writeFile(string.concat(dir, 'headwear/headwear_v69', '_c', vm.toString(c), '.svg'), result);
|
||||
}
|
||||
for (uint8 c = 0; c <= 4; c++) {
|
||||
for (uint8 c = 0; c <= 7; c++) {
|
||||
uint256 seed = setVariant(69, Helpers.ComponentBytes.HEADWEAR) +
|
||||
setColor(c, Helpers.ComponentBytes.HEADWEAR);
|
||||
string memory result = profileNFT.tryWithSeed(seed, true);
|
||||
|
||||
101
test/misc/FreeCreditsProviderTest.t.sol
Normal file
101
test/misc/FreeCreditsProviderTest.t.sol
Normal file
@@ -0,0 +1,101 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.13;
|
||||
|
||||
import 'test/base/BaseTest.t.sol';
|
||||
import {PermissionlessCreator} from 'contracts/misc/PermissionlessCreator.sol';
|
||||
import {FreeCreditsProvider} from 'contracts/misc/FreeCreditsProvider.sol';
|
||||
import {Types} from 'contracts/libraries/constants/Types.sol';
|
||||
|
||||
contract FreeCreditsProviderTest is BaseTest {
|
||||
error OnlyOwner();
|
||||
|
||||
using stdJson for string;
|
||||
|
||||
PermissionlessCreator permissionlessCreator;
|
||||
address permissionlessCreatorOwner = makeAddr('PERMISSIONLESS_CREATOR_OWNER');
|
||||
|
||||
FreeCreditsProvider freeCreditsProvider;
|
||||
|
||||
function setUp() public virtual override {
|
||||
super.setUp();
|
||||
|
||||
if (fork) {
|
||||
if (keyExists(json, string(abi.encodePacked('.', forkEnv, '.PermissionlessCreator')))) {
|
||||
permissionlessCreator = PermissionlessCreator(
|
||||
json.readAddress(string(abi.encodePacked('.', forkEnv, '.PermissionlessCreator')))
|
||||
);
|
||||
permissionlessCreatorOwner = permissionlessCreator.OWNER();
|
||||
} else {
|
||||
console.log('PermissionlessCreator key does not exist');
|
||||
if (forkVersion == 1) {
|
||||
console.log('No PermissionlessCreator address found - deploying new one');
|
||||
permissionlessCreator = new PermissionlessCreator(
|
||||
permissionlessCreatorOwner,
|
||||
address(hub),
|
||||
address(lensHandles),
|
||||
address(tokenHandleRegistry)
|
||||
);
|
||||
} else {
|
||||
console.log('No PermissionlessCreator address found in addressBook, which is required for V2');
|
||||
revert('No PermissionlessCreator address found in addressBook, which is required for V2');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
permissionlessCreator = new PermissionlessCreator(
|
||||
permissionlessCreatorOwner,
|
||||
address(hub),
|
||||
address(lensHandles),
|
||||
address(tokenHandleRegistry)
|
||||
);
|
||||
vm.startPrank(permissionlessCreatorOwner);
|
||||
permissionlessCreator.setHandleCreationPrice(5 ether);
|
||||
permissionlessCreator.setProfileCreationPrice(5 ether);
|
||||
permissionlessCreator.setHandleLengthMin(5);
|
||||
vm.stopPrank();
|
||||
}
|
||||
|
||||
vm.prank(governance);
|
||||
hub.whitelistProfileCreator(address(permissionlessCreator), true);
|
||||
|
||||
freeCreditsProvider = new FreeCreditsProvider(address(permissionlessCreator));
|
||||
|
||||
vm.prank(permissionlessCreatorOwner);
|
||||
permissionlessCreator.addCreditProvider(address(freeCreditsProvider));
|
||||
}
|
||||
|
||||
// Scenarios
|
||||
function testIncreaseCredit(address profileCreator, address txSender) public {
|
||||
vm.assume(profileCreator != address(0));
|
||||
vm.assume(profileCreator != address(permissionlessCreator));
|
||||
vm.assume(profileCreator != address(freeCreditsProvider));
|
||||
vm.assume(txSender != address(0));
|
||||
vm.assume(txSender != address(permissionlessCreator));
|
||||
vm.assume(txSender != address(freeCreditsProvider));
|
||||
|
||||
uint256 creditsBefore = permissionlessCreator.getCreditBalance(profileCreator);
|
||||
|
||||
vm.prank(txSender);
|
||||
freeCreditsProvider.getFreeCredit(profileCreator, 123);
|
||||
|
||||
uint256 creditsAfter = permissionlessCreator.getCreditBalance(profileCreator);
|
||||
|
||||
assertEq(creditsBefore + 123, creditsAfter);
|
||||
}
|
||||
|
||||
function testDecreaseCredit(address profileCreator) public {
|
||||
vm.assume(profileCreator != address(0));
|
||||
vm.assume(profileCreator != address(permissionlessCreator));
|
||||
vm.assume(profileCreator != address(freeCreditsProvider));
|
||||
|
||||
freeCreditsProvider.getFreeCredit(profileCreator, 123456);
|
||||
|
||||
uint256 creditsBefore = permissionlessCreator.getCreditBalance(profileCreator);
|
||||
|
||||
vm.prank(profileCreator);
|
||||
freeCreditsProvider.burnCredits(123);
|
||||
|
||||
uint256 creditsAfter = permissionlessCreator.getCreditBalance(profileCreator);
|
||||
|
||||
assertEq(creditsBefore - 123, creditsAfter);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user