misc: Profile SVG - Face and minor fixes

This commit is contained in:
vicnaum
2023-12-01 18:31:04 +01:00
parent 9deb89cae0
commit ee33642def
3 changed files with 12 additions and 10 deletions

View File

@@ -113,6 +113,8 @@ library Face {
_getLightColor(skinColor),
'} .skinColorDark{fill:',
_getDarkColor(skinColor),
'} .mouthOverlay{fill:',
faceColor == FaceColors.GOLD ? LensColors.darkGold : LensColors.black,
'}</style>'
);
}
@@ -195,7 +197,7 @@ library Face2 {
} 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 fill="#000" 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 fill="#000" 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>';
'<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.
}

View File

@@ -7,11 +7,11 @@ import {LensColors} from './LensColors.sol';
library Logo {
enum LogoVariants {
NONE,
HAPPY,
HEART,
LENS,
PEACE,
NONE
PEACE
}
enum LogoColors {

View File

@@ -69,9 +69,9 @@ library ProfileSVG {
return
string.concat(
traits,
_getTrait(chosenElements.logoVariant), // Clothing Logo
_getTrait(chosenElements.logoColor), // Clothing Logo Color
_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
);
@@ -226,7 +226,7 @@ library ProfileSVG {
} else {
revert();
}
return string.concat('{"trait_type":"Clothing Logo","value":"', stringLogoVariant, '"},');
return string.concat(',{"trait_type":"Clothing Logo","value":"', stringLogoVariant, '"}');
}
function _getTrait(Logo.LogoColors logoColor) internal pure returns (string memory) {
@@ -244,11 +244,11 @@ library ProfileSVG {
} else if (logoColor == Logo.LogoColors.GOLD) {
stringLogoColor = 'gold';
} else if (logoColor == Logo.LogoColors.NONE) {
stringLogoColor = 'none';
return '';
} else {
revert();
}
return string.concat('{"trait_type":"Clothing Logo Color","value":"', stringLogoColor, '"},');
return string.concat(',{"trait_type":"Clothing Logo Color","value":"', stringLogoColor, '"}');
}
function _getTrait(Face.FaceVariants faceVariant) internal pure returns (string memory) {
@@ -352,7 +352,7 @@ library ProfileSVG {
function _getTrait(Headwear.HeadwearColors headwearColor) internal pure returns (string memory) {
string memory stringHeadwearColor;
if (headwearColor == Headwear.HeadwearColors.NONE) {
stringHeadwearColor = 'none';
return '';
} else if (headwearColor == Headwear.HeadwearColors.GREEN) {
stringHeadwearColor = 'green';
} else if (headwearColor == Headwear.HeadwearColors.PURPLE) {
@@ -415,7 +415,7 @@ library ProfileSVG {
chosenElements.logoVariant = chosenElements.bodyVariant == Body.BodyVariants.SHIBUYA
? Logo.LogoVariants.NONE
: Logo.LogoVariants(
uint8(Helpers.getVariant(seed, Helpers.ComponentBytes.LOGO)) % (uint8(type(Logo.LogoVariants).max))
uint8(Helpers.getVariant(seed, Helpers.ComponentBytes.LOGO)) % (uint8(type(Logo.LogoVariants).max) + 1)
);
if (chosenElements.logoVariant == Logo.LogoVariants.NONE) {