From 38d97e5a1cd2311fad305d9e5f92505674e0f037 Mon Sep 17 00:00:00 2001 From: Polaris Date: Wed, 24 Jul 2024 15:18:05 -0400 Subject: [PATCH] static avatar resources --- app/(authenticated)/chunithm/page.tsx | 11 +- app/globals.css | 19 +- components/avatarcustomization/page.tsx | 736 +++++++++++++----------- 3 files changed, 406 insertions(+), 360 deletions(-) diff --git a/app/(authenticated)/chunithm/page.tsx b/app/(authenticated)/chunithm/page.tsx index c06b564..ac52baf 100644 --- a/app/(authenticated)/chunithm/page.tsx +++ b/app/(authenticated)/chunithm/page.tsx @@ -10,25 +10,25 @@ import { getAllAvatarParts } from "@/components/avatarcustomization/actions"; // the number is the category id for the specific part const getAvatarHeadAccessories = async () => { - const avatarParts = await getAllAvatarParts(2); + const avatarParts = await getAllAvatarParts(2); // head return { avatarParts }; }; const getAvatarFaceAccessories = async () => { - const avatarParts = await getAllAvatarParts(3); + const avatarParts = await getAllAvatarParts(3); // face return { avatarParts }; }; const getAvatarItemAccessories = async () => { - const avatarParts = await getAllAvatarParts(5); + const avatarParts = await getAllAvatarParts(5); // item_l item_r return { avatarParts }; }; const getAvatarBackAccessories = async () => { - const avatarParts = await getAllAvatarParts(7); + const avatarParts = await getAllAvatarParts(7); // back return { avatarParts }; }; const getAvatarWearAccessories = async () => { - const avatarParts = await getAllAvatarParts(1); + const avatarParts = await getAllAvatarParts(1); // wear return { avatarParts }; }; @@ -59,6 +59,7 @@ const Page = async () => { avatarWearSelectionData={AvatarWearAccessories} /> +
diff --git a/app/globals.css b/app/globals.css index fe889b7..38652fe 100644 --- a/app/globals.css +++ b/app/globals.css @@ -76,29 +76,12 @@ } - g, +img, video { max-width: revert; height: revert; } -.rainbow-text { - background: linear-gradient( - to left, - violet, - indigo, - blue, - green, - yellow, - orange, - red - ); - -webkit-background-clip: text; - color: transparent; - background-clip: text; - color: transparent; -} - /* * CHUSAN AVATAR */ diff --git a/components/avatarcustomization/page.tsx b/components/avatarcustomization/page.tsx index 01bae59..4fbfdfb 100644 --- a/components/avatarcustomization/page.tsx +++ b/components/avatarcustomization/page.tsx @@ -93,349 +93,411 @@ export const AvatarCustomization: FC = ({ }); } + const AvatarTextures: Record = { + AvatarFaceStatic: { + src: "avatarStatic/CHU_UI_Avatar_Tex_Face.png", + className: "avatar_face_static", + }, + AvatarSkin: { + src: `avatarAccessory/CHU_UI_Avatar_Tex_0${1400001}.png`, + className: "avatar_skin", + }, + AvatarRightHand: { + src: "avatarStatic/CHU_UI_Avatar_Tex_RightHand.png", + className: "avatar_hand_r", + }, + AvatarLeftHand: { + src: "avatarStatic/CHU_UI_Avatar_Tex_LeftHand.png", + className: "avatar_hand_l", + }, + AvatarSkinFootL: { + src: "avatarAccessory/CHU_UI_Avatar_Tex_01400001.png", + className: "avatar_skinfoot_l", + }, + AvatarSkinFootR: { + src: "avatarAccessory/CHU_UI_Avatar_Tex_01400001.png", + className: "avatar_skinfoot_r", + }, + + AvatarHeadAccessory: { + src: "avatarAccessory/CHU_UI_Avatar_Tex_06202301.png", + className: "avatar_head", + }, + + AvatarItemAccessoryR: { + src: "avatarAccessory/CHU_UI_Avatar_Tex_06502401.png", + className: "avatar_item_r", + }, + AvatarItemAccessoryL: { + src: "avatarAccessory/CHU_UI_Avatar_Tex_06502401.png", + className: "avatar_item_l", + }, + AvatarBackAccessory: { + src: "avatarAccessory/CHU_UI_Avatar_Tex_06703301.png", + className: "avatar_back", + }, + AvatarWearAccessory: { + src: "avatarAccessory/CHU_UI_Avatar_Tex_04103101.png", + className: "avatar_wear", + }, + + AvatarFace: { + src: "avatarAccessory/CHU_UI_Avatar_Tex_02300003.png", + className: "avatar_face", + }, + // not in use + AvatarFront: { + src: "avatarAccessory/CHU_UI_Avatar_Tex_01600001.png", + className: "avatar_front", + }, + }; + return ( -
-
- - ( - - Avatar Head Item - - - - - - - - - {/* bugged */} - {/* */} - - No avatar part found. - - {avatarHeadSelectionData.avatarParts.map((part) => ( - { - form.setValue( - "AvatarHeadAccessory", - part.avatarAccessoryId! - ); - }} - > - - {part.name} - - ))} - - - - - +
+ {" "} +
+ + + ( + + Avatar Head Item + + + + + + + + + {/* bugged */} + {/* */} + + No avatar part found. + + {avatarHeadSelectionData.avatarParts.map((part) => ( + { + form.setValue( + "AvatarHeadAccessory", + part.avatarAccessoryId! + ); + console.log(part.avatarAccessoryId); + }} + > + + {part.name} + + ))} + + + + + - - - )} - /> - ( - - Avatar Face Item - - - - - - - - - {/* bugged */} - {/* */} - - No language found. - - {avatarFaceSelectionData.avatarParts.map((part) => ( - { - form.setValue( - "AvatarFaceAccessory", - part.avatarAccessoryId! - ); - }} - > - - {part.name} - - ))} - - - - - + + + )} + /> + ( + + Avatar Face Item + + + + + + + + + {/* bugged */} + {/* */} + + No language found. + + {avatarFaceSelectionData.avatarParts.map((part) => ( + { + form.setValue( + "AvatarFaceAccessory", + part.avatarAccessoryId! + ); + }} + > + + {part.name} + + ))} + + + + + - - - )} - /> - ( - - Avatar Hand Item - - - - - - - - - {/* bugged */} - {/* */} - - No avatar part found. - - {avatarItemSelectionData.avatarParts.map((part) => ( - { - form.setValue( - "AvatarItemAccessory", - part.avatarAccessoryId! - ); - }} - > - - {part.name} - - ))} - - - - - + + + )} + /> + ( + + Avatar Hand Item + + + + + + + + + {/* bugged */} + {/* */} + + No avatar part found. + + {avatarItemSelectionData.avatarParts.map((part) => ( + { + form.setValue( + "AvatarItemAccessory", + part.avatarAccessoryId! + ); + }} + > + + {part.name} + + ))} + + + + + - - - )} - /> - ( - - Avatar Back Item - - - - - - - - - {/* bugged */} - {/* */} - - No avatar part found. - - {avatarBackSelectionData.avatarParts.map((part) => ( - { - form.setValue( - "AvatarBackAccessory", - part.avatarAccessoryId! - ); - }} - > - - {part.name} - - ))} - - - - - + + + )} + /> + ( + + Avatar Back Item + + + + + + + + + {/* bugged */} + {/* */} + + No avatar part found. + + {avatarBackSelectionData.avatarParts.map((part) => ( + { + form.setValue( + "AvatarBackAccessory", + part.avatarAccessoryId! + ); + }} + > + + {part.name} + + ))} + + + + + - - - )} - /> - ( - - Avatar Body Item - - - - - - - - - {/* bugged */} - {/* */} - - No avatar part found. - - {avatarWearSelectionData.avatarParts.map((part) => ( - { - form.setValue( - "AvatarWearAccessory", - part.avatarAccessoryId! - ); - }} - > - - {part.name} - - ))} - - - - - + + + )} + /> + ( + + Avatar Body Item + + + + + + + + + {/* bugged */} + {/* */} + + No avatar part found. + + {avatarWearSelectionData.avatarParts.map((part) => ( + { + form.setValue( + "AvatarWearAccessory", + part.avatarAccessoryId! + ); + }} + > + + {part.name} + + ))} + + + + + - - - )} - /> - - - + + + )} + /> + + + +
+ {/* Avatar Customization Section */} +
+
+ {Object.entries(AvatarTextures).map(([key, { className, src }]) => ( +
+ {key} +
+ ))} +
+
); }; - -{ - /*
State is: {state}
-
Server data:
-
-
    - {avatarSelectionData.avatarParts.map((part) => ( -
  • {part.name}
  • - ))} -
*/ -}