diff --git a/dist.rar b/dist.rar index 25f10f5..a16de30 100644 Binary files a/dist.rar and b/dist.rar differ diff --git a/src/assets/img/home/Web_gameOffical_mainTitle_slices.zip b/src/assets/img/home/Web_gameOffical_mainTitle_slices.zip deleted file mode 100644 index 3e96fe1..0000000 Binary files a/src/assets/img/home/Web_gameOffical_mainTitle_slices.zip and /dev/null differ diff --git a/src/assets/img/home/login_icon_Meta.png b/src/assets/img/home/login_icon_Meta.png new file mode 100644 index 0000000..c576206 Binary files /dev/null and b/src/assets/img/home/login_icon_Meta.png differ diff --git a/src/assets/img/home/login_icon_OKX.png b/src/assets/img/home/login_icon_OKX.png new file mode 100644 index 0000000..82e87ff Binary files /dev/null and b/src/assets/img/home/login_icon_OKX.png differ diff --git a/src/assets/img/home/name切图.rar b/src/assets/img/home/name切图.rar deleted file mode 100644 index 9d13f08..0000000 Binary files a/src/assets/img/home/name切图.rar and /dev/null differ diff --git a/src/chain/ChainManager.ts b/src/chain/ChainManager.ts index cf66f9e..389ea98 100644 --- a/src/chain/ChainManager.ts +++ b/src/chain/ChainManager.ts @@ -64,13 +64,14 @@ export default class ChainManager { return this.bc.currentChain; } - public async login() { + public async login(type:any) { if (!AppModule.step) { try { - await this.bc.connect(true); + await this.bc.connect(true,type); await this.checkNance(); } catch (err) { message.error(err.message, 5); + this.bc.walletType = 0 await this.bc.disconnect(); await Promise.reject(err); } @@ -93,6 +94,7 @@ export default class ChainManager { }); AppModule.updateStep(1); } catch (err) { + this.bc.walletType = 0 console.log(err); await Promise.reject(err); } diff --git a/src/chain/blockchain.ts b/src/chain/blockchain.ts index eb4232e..9fe51a1 100644 --- a/src/chain/blockchain.ts +++ b/src/chain/blockchain.ts @@ -90,7 +90,7 @@ export class Blockchain { if (this.walletType === 1) { this.provider = await this.connectMetaMask(); } else if (this.walletType === 2) { - this.provider = await this.connectWalletConnect(); + this.provider = await this.connectokxwallet(); } if (!this.provider) { return; @@ -150,28 +150,58 @@ export class Blockchain { } } - public async connect(isManual = false) { - // if (isMobile()) { - // if (hasMetamask()) { - // this.walletType = 1; - // } else { - // this.walletType = 2; - // } - // } else { - // if (hasMetamask()) { - // if (isManual && !this.walletType) { - // this.walletType = await this.selectWallet(); - // } - // } else { - // this.walletType = 2; - // } - // } - this.walletType = 1; - if (isManual || this.isWalletConnect) { + public async connect(isManual = false, type) { + if (isMobile()) { + if (type == 1) { + if (!hasMetamask()) { + var next = window.location.href; + var url = `https://metamask.app.link/dapp/${next}`; + location.href = url; + } else { + this.walletType = 1; + } + } else if (type == 2) { + const ua = navigator.userAgent; + const isIOS = /iphone|ipad|ipod|ios/i.test(ua); + const isAndroid = /android|XiaoMi|MiuiBrowser/i.test(ua); + const isMobile = isIOS || isAndroid; + const isOKApp = /OKApp/i.test(ua); + + if (isMobile && isOKApp) { + this.walletType = 2; + } else { + var next = window.location.href; + window.open(`okx://wallet/dapp/details?dappUrl=${next}`); + } + } + } else { + // debugger + if (type == 1) { + if (hasMetamask()) { + if (isManual && !this.walletType) { + this.walletType = 1; + } + } else { + this.walletType = 1; + } + } else if (type == 2) { + if (typeof window.okxwallet !== "undefined") { + if (isManual && !this.walletType) { + this.walletType = 2; + } + } else { + this.walletType = 2; + } + } + } + + // this.walletType = 1; + if (isManual) { await this.connectWallet(isManual); } } + /** * show wallet picker * @return {Promise} @@ -209,8 +239,10 @@ export class Blockchain { }); } + public async connectMetaMask() { let provider = null; + /// debugger if (typeof window.ethereum !== "undefined") { provider = window.ethereum; try { @@ -232,7 +264,45 @@ export class Blockchain { } else if (window.celo) { provider = window.celo; } else { - throw new Error("Cannot find Metamask"); + this.walletType = 0; + + setTimeout(function () { + window.open("https://metamask.io/download/", "_blank"); + }, 2200); + throw new Error("No Web3 Provider found"); + } + return provider; + } + + public async connectokxwallet() { + let provider = null; + if (typeof window.okxwallet !== "undefined") { + provider = window.okxwallet; + try { + await provider.request({ method: "eth_requestAccounts" }); + } catch (error: any) { + if (error.code === -32002) { + // const hexChainId = toHexChainId(this.currentChain) + // await provider.request({ + // method: 'wallet_switchEthereumChain', + // params: [{ chainId: hexChainId }] + // }) + throw new Error( + "OKX Wallet not login, Open OKX Wallet and login first" + ); + } else { + this.walletType = 0; + throw new Error("User Rejected"); + } + } + } else { + this.walletType = 0; + + setTimeout(function () { + window.open("https://www.okx.com/download", "_blank"); + }, 2200); + + throw new Error("No Web3 Provider found"); } return provider; } diff --git a/src/components/about/TeamMember.vue b/src/components/about/TeamMember.vue index 80115ec..9bfcecb 100644 --- a/src/components/about/TeamMember.vue +++ b/src/components/about/TeamMember.vue @@ -39,15 +39,15 @@ const teamMembers = [ "Founder of Bubble Candy Studio to build Counter Fire", ], }, - { - name: "Yoda", - title: "Gaming Economist", - description: [ - "Gaming data expert in Giant Interactive", - "Core data officer of Foxconn Group(TPE:2354)", - " Gaming Economist in Bubble Candy Studio", - ], - }, + // { + // name: "Yoda", + // title: "Gaming Economist", + // description: [ + // "Gaming data expert in Giant Interactive", + // "Core data officer of Foxconn Group(TPE:2354)", + // " Gaming Economist in Bubble Candy Studio", + // ], + // }, { name: "SUPER G", title: "Producer", diff --git a/src/components/about/TeamVision.vue b/src/components/about/TeamVision.vue index b6713ee..602f11c 100644 --- a/src/components/about/TeamVision.vue +++ b/src/components/about/TeamVision.vue @@ -72,7 +72,7 @@ line-height: 36px; .team-members { display: flex; - justify-content: space-between; + justify-content: center; } .background-image { position: absolute; diff --git a/src/components/home/GameVideo.vue b/src/components/home/GameVideo.vue index a74a444..77255f4 100644 --- a/src/components/home/GameVideo.vue +++ b/src/components/home/GameVideo.vue @@ -41,9 +41,7 @@
@@ -95,10 +93,8 @@ const imageList = ref([ ]); const thumbsSwiper = ref(null); - const updateThumbnailsOpacity = (swiper) => { activeIndex.value = swiper.realIndex; - }; const setThumbsSwiper = (swiper) => { thumbsSwiper.value = swiper; @@ -126,10 +122,9 @@ onMounted(() => {}); position: absolute; left: 165px; top: 94px; - img{ - width: 312px; + img { + width: 312px; } - } .background-img { position: absolute; @@ -143,15 +138,13 @@ onMounted(() => {}); } .active-thumbnail { - - img{ + img { opacity: 1; } - } .inactive-thumbnail { - img{ + img { opacity: 0.5; } } @@ -295,9 +288,17 @@ onMounted(() => {}); // } :deep(.swiper-button-prev::after) { - content: url("../../assets/img/home/gameWeb_p3_arrow1.png"); + content: ""; + background: url("../../assets/img/home/gameWeb_p3_arrow1.png") no-repeat; + background-size: 100% 100%; + width: 39px; + height: 38px; } :deep(.swiper-button-next::after) { - content: url("../../assets/img/home/gameWeb_p3_arrow12.png"); + content: ""; + background: url("../../assets/img/home/gameWeb_p3_arrow12.png") no-repeat; + background-size: 100% 100%; + width: 39px; + height: 38px; } diff --git a/src/components/home/HeroCard.vue b/src/components/home/HeroCard.vue index 8bd9748..887cb59 100644 --- a/src/components/home/HeroCard.vue +++ b/src/components/home/HeroCard.vue @@ -51,7 +51,7 @@
Character Image @@ -149,9 +149,9 @@ const onSlideChange = (swiper) => { // console.log("Slide changed to index:", swiper.realIndex);headeyop selectHeroIdenx.value = swiper.realIndex; }; -const selectChange=(index)=>{ -selectHeroIdenx.value = index -} +const selectChange = (index) => { + selectHeroIdenx.value = index; +};