From bdf398b10fe3f048bdf4561fefa1bda42789b0c6 Mon Sep 17 00:00:00 2001 From: imhson Date: Wed, 13 Mar 2024 16:02:38 +0700 Subject: [PATCH] update --- app/(private)/assets/gem-slot.svg | 357 +++++++++-------- app/(private)/assets/gem-slot_active.svg | 476 +++++++++++++++++++++++ app/(private)/assets/jackpot-active.svg | 372 +++++++++--------- app/(private)/jackpot/page.tsx | 6 +- app/(private)/page.tsx | 315 ++++++++------- components/button/filled.tsx | 28 +- public/config.example | 12 + 7 files changed, 1064 insertions(+), 502 deletions(-) create mode 100644 app/(private)/assets/gem-slot_active.svg diff --git a/app/(private)/assets/gem-slot.svg b/app/(private)/assets/gem-slot.svg index c4dacee..67518d0 100644 --- a/app/(private)/assets/gem-slot.svg +++ b/app/(private)/assets/gem-slot.svg @@ -1,96 +1,95 @@ - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -98,22 +97,22 @@ - + - + - + - + - + @@ -123,24 +122,24 @@ - + - + - + - + - + @@ -150,332 +149,328 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - + + diff --git a/app/(private)/assets/gem-slot_active.svg b/app/(private)/assets/gem-slot_active.svg new file mode 100644 index 0000000..189ea63 --- /dev/null +++ b/app/(private)/assets/gem-slot_active.svg @@ -0,0 +1,476 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/(private)/assets/jackpot-active.svg b/app/(private)/assets/jackpot-active.svg index be95489..1e7d834 100644 --- a/app/(private)/assets/jackpot-active.svg +++ b/app/(private)/assets/jackpot-active.svg @@ -1,208 +1,208 @@ - - - - - - - - - + + + + + + + + + - + - + - - + + - - - + + + - + - + - - - + + + - + - - - + + + - + - - - - + + + + - - + + - + - + - + - + - + - + - + - - - - + + + + - - + + - + - + - + - + - + - + - + - - - - - + + + + + - + - - - + + + - + - + - + - + - - - - - + + + + + - + - - - + + + - + - + - + - + - + - + - + - + - - - - + + + + - + - + - - + + - + - - + + - + - - - - + + + + - + - + - - + + - + - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - + @@ -213,22 +213,22 @@ - + - + - + - + - + @@ -240,19 +240,19 @@ - + - + - + - + @@ -260,7 +260,7 @@ - + @@ -268,15 +268,15 @@ - + - + - + @@ -284,15 +284,15 @@ - + - + - + @@ -300,7 +300,7 @@ - + @@ -308,43 +308,43 @@ - + - + - + - + - + - + - + - + - + - + @@ -352,15 +352,15 @@ - + - + - + @@ -368,11 +368,11 @@ - + - + @@ -380,31 +380,31 @@ - + - + - + - + - + - + - + @@ -416,19 +416,19 @@ - + - + - + - + @@ -436,75 +436,75 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -512,7 +512,7 @@ - + @@ -528,7 +528,7 @@ - + @@ -536,7 +536,7 @@ - + @@ -552,7 +552,7 @@ - + @@ -560,7 +560,7 @@ - + @@ -568,6 +568,6 @@ - + diff --git a/app/(private)/jackpot/page.tsx b/app/(private)/jackpot/page.tsx index b476aab..d7594ba 100644 --- a/app/(private)/jackpot/page.tsx +++ b/app/(private)/jackpot/page.tsx @@ -100,7 +100,9 @@ export default function Page() {
-
Jackpot will be revealed at 2 pm, 24th Mar 2024 (UTC +7)
+
+ The Dragon will appear and fulfill your wish at at 2 pm, 24th Mar 2024 (UTC +7) +
@@ -148,7 +150,7 @@ export default function Page() { )}
- Submit + Wish diff --git a/app/(private)/page.tsx b/app/(private)/page.tsx index e34a066..7df3889 100644 --- a/app/(private)/page.tsx +++ b/app/(private)/page.tsx @@ -12,6 +12,7 @@ import Image from 'next/image' import { useContext, useEffect, useMemo, useState } from 'react' import ForceBg from './assets/force-bg.svg' import GemSlot from './assets/gem-slot.svg' +import GemSlotActive from './assets/gem-slot_active.svg' import Shield from './assets/shield.svg' import TopBar2 from './assets/top-bar-2.svg' import TopBar from './assets/top-bar.svg' @@ -49,6 +50,7 @@ const initList = { export default function Home() { const { inventory } = useContext(Context) const [useShield, setUseShield] = useState(false) + const [activeSlot, setActiveSlot] = useState(0) const [selectedColorKey, setSelectedColorKey] = useState(new Set(['all_colors'])) const selectedColorValue = useMemo( () => Array.from(selectedColorKey).join(', ').replaceAll('_', ' '), @@ -90,6 +92,19 @@ export default function Home() { setGems(Map(gemList)) }, [inventory?.length]) + useEffect(() => { + if (!mainGem) { + setActiveSlot(0) + } else { + for (let i = 0; i < 5; i++) { + if (materialGems[i] == undefined) { + setActiveSlot(i + 1) + break + } + } + } + }, [mainGem, materialGems]) + const addGemHandler = (type: string) => { if (!mainGem) { setMainGem(type) @@ -116,7 +131,11 @@ export default function Home() {
- + {materialGems[0] && (
)}
+
- - {materialGems[1] && ( + + {materialGems[4] && (
- setMaterialGems([materialGems[0], undefined, materialGems[2], materialGems[3], materialGems[4]]) + setMaterialGems([materialGems[0], materialGems[1], materialGems[2], materialGems[3], undefined]) }>
- +
)}
+
- - {materialGems[2] && ( + + {materialGems[1] && (
- setMaterialGems([materialGems[0], materialGems[1], undefined, materialGems[3], materialGems[4]]) + setMaterialGems([materialGems[0], undefined, materialGems[2], materialGems[3], materialGems[4]]) }>
- +
)}
- + {mainGem && (
setMainGem(undefined)}>
-
+
- +
)}
- + {materialGems[3] && (
- - {materialGems[4] && ( + + {materialGems[2] && (
- setMaterialGems([materialGems[0], materialGems[1], materialGems[2], materialGems[3], undefined]) + setMaterialGems([materialGems[0], materialGems[1], undefined, materialGems[3], materialGems[4]]) }>
- +
)}
@@ -222,7 +263,7 @@ export default function Home() { className='mx-auto w-fit flex items-center mt-10 md:mt-20 gap-3 cursor-pointer' onClick={() => setUseShield(!useShield)}> -
Use Shield
+
Activate the Eternal Shield
@@ -234,122 +275,134 @@ export default function Home() {
-
Your Gems
-
Select gems here to forge
-
-
- - -
- {selectedColorValue} - - - -
-
- - All colors - White - Blue - Gold - Red - -
-
-
- - -
- {selectedRankValue} - - - -
-
- - All rank - 1-Star - 2-Star - 3-Star - 4-Star - 5-Star - 6-Star - 7-Star - -
-
-
-
- {['w', 'b', 'g', 'r'].map((color: string) => { - return ['1', '2', '3', '4', '5', '6', '7'].map((star: string) => { - if (gems.get(color + star) != 0) { - return ( -
addGemHandler(color + star)}> -
- + {inventory.length ? ( +
+
Your Gems
+
Select gems here to forge
+
+
+ + +
+ {selectedColorValue} + + +
-
{gems.get(color + star)}
-
- ) - } - }) - })} -
-
Your Shields
-
Shields are used to protect your base gem from downgrade
-
-
-
- + + + All colors + White + Blue + Gold + Red + + +
+
+ + +
+ {selectedRankValue} + + + +
+
+ + All rank + 1-Star + 2-Star + 3-Star + 4-Star + 5-Star + 6-Star + 7-Star + +
+
+
+
+ {['w', 'b', 'g', 'r'].map((color: string) => { + return ['1', '2', '3', '4', '5', '6', '7'].map((star: string) => { + if (gems.get(color + star) != 0 && !(activeSlot == 0 && star == '7')) { + return ( +
addGemHandler(color + star)}> +
+ +
+
{gems.get(color + star)}
+
+ ) + } + }) + })} +
+
Your Eternal Shields
+
+ Eternal Shields are used to Protect Dragon Gem from dropping levels if the forging fails +
+
+
+
+ +
+
15
+
-
15
-
+ ) : ( +
+
No Gems Found
+
Let's find some Gems on SeekHYPE marketplace!
+ Go to SeekHype +
+ )}
diff --git a/components/button/filled.tsx b/components/button/filled.tsx index 4e1a537..5b4ce80 100644 --- a/components/button/filled.tsx +++ b/components/button/filled.tsx @@ -1,8 +1,32 @@ import { MouseEventHandler, ReactNode } from 'react' -export default function FilledButton({ children, onClick, className }: { children: ReactNode, onClick?: MouseEventHandler, className?: string }) { +export default function FilledButton({ + children, + onClick, + className, + href, + target, +}: { + href?: string + target?: string + children: ReactNode + onClick?: MouseEventHandler + className?: string +}) { + if (href) { + return ( + + {children} + + ) + } return ( - ) diff --git a/public/config.example b/public/config.example index 18ac91a..61fcb9a 100644 --- a/public/config.example +++ b/public/config.example @@ -5,7 +5,19 @@ "TWITTER_POST_ID":"1740384898689667455", "AURASCAN_ENDPOINT":"https://explorer.dev.aura.network", "HOROSCOPE_ENDPOINT": "https://indexer-v2.dev.aurascan.io", + "HOROSCOPE_CHAINKEY":"auratestnet", "COSMOSKIT_CHAINKEY":"auradevnet", "DRAGON_GEM_COLLECTION_CONTRACT_ADDRESS":"aura189xmlzrj8ah96ww4700kp33va2uttzs7lgm0y8vx4hcw2clk4vsszgyu53" } +//eupho +{ + "REST_API_ENDPOINT": "https://campaign-api.euphoria.aura.network", + "HASURA_ENDPOINT": "https://campaign-hasura.euphoria.aura.network", + "TWITTER_POST_ID": "1740384898689667455", + "AURASCAN_ENDPOINT": "https://euphoria.aurascan.io", + "HOROSCOPE_ENDPOINT": "https://indexer-v2.staging.aurascan.io", + "HOROSCOPE_CHAINKEY":"euphoria", + "COSMOSKIT_CHAINKEY": "auratestnet", + "DRAGON_GEM_COLLECTION_CONTRACT_ADDRESS": "aura14rrxnmkpnvcmeknjzma0myeepdxaa86wh5837959ek37dmrl2lxqfg66z0" +}