修改文案页面布局

This commit is contained in:
yuyongdong 2024-06-25 13:45:57 +08:00
parent 4e630357e0
commit da0b9a8c15
29 changed files with 835 additions and 616 deletions

View File

@ -1,7 +1,9 @@
VITE_BASE_API='https://oauth-svr.cebggame.com/mint'
VITE_GPAL_API='http://192.168.100.83:4000/sns'
# VITE_GPAL_ROUTER='https://vlpwkzon-testflight.counterfire.games'
VITE_GPAL_ROUTER='https://mint.kingsome.cn/'
VITE_TOKENID_ID='0x34a1'
VITE_ERC_ADDRESS='0xFd42bfb03212dA7e1A4608a44d7658641D99CF34'
VITE_CFNFT_ADDRESS='0xaa34B79A0Ab433eaC900fB3CB9f191F5Cd27501D'
VITE_CLAIM_ADDRESS='0xf45702180314187a3549FEDac3B78349b47ca6A0'
VITE_CLAIMWL_ADDRESS='0x31f29c9a3d0c1c13c825475aebf0d964b5b47c45'
VITE_CLAIMWL_ADDRESS='0x20204A3df0c3191Ee93f4DB328Ca92aEe148Ce24'

View File

@ -1,5 +1,6 @@
VITE_BASE_API='https://oauth-svr.cebggame.com/mint'
VUE_APP_GPAL_API='http://192.168.100.83:4000/sns'
VITE_GPAL_ROUTER='http://localhost:5173'
VITE_TOKENID_ID='0x34a1'
VITE_ERC_ADDRESS='0xFd42bfb03212dA7e1A4608a44d7658641D99CF34'
VITE_CFNFT_ADDRESS='0xaa34B79A0Ab433eaC900fB3CB9f191F5Cd27501D'

8
.env.text Normal file
View File

@ -0,0 +1,8 @@
VITE_BASE_API='https://oauth-svr.cebggame.com/mint'
VITE_GPAL_API='http://192.168.100.83:4000/sns'
VITE_GPAL_ROUTER='http://localhost:5173'
VITE_TOKENID_ID='0x34a1'
VITE_ERC_ADDRESS='0xFd42bfb03212dA7e1A4608a44d7658641D99CF34'
VITE_CFNFT_ADDRESS='0xaa34B79A0Ab433eaC900fB3CB9f191F5Cd27501D'
VITE_CLAIM_ADDRESS='0xf45702180314187a3549FEDac3B78349b47ca6A0'
VITE_CLAIMWL_ADDRESS='0x20204A3df0c3191Ee93f4DB328Ca92aEe148Ce24'

View File

@ -4,6 +4,7 @@
"version": "0.0.0",
"type": "module",
"scripts": {
"text": "vite --host --mode text",
"dev": "vite --host --mode development",
"build": "vite build --mode development",
"build:prod": "vite build --mode production",

View File

@ -1,5 +1,5 @@
<template>
<div>
<div id="app">
<HelloWorld />
<FooterView />
</div>
@ -11,7 +11,7 @@ import HelloWorld from "./view/mintIndex.vue";
import FooterView from "./components/footerView.vue";
</script>
<style scoped>
<style lang="scss" scoped>
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 MiB

After

Width:  |  Height:  |  Size: 6.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 MiB

BIN
src/assets/home/ICON01.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
src/assets/home/ICON02.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 MiB

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

BIN
src/assets/home/medium.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -11,6 +11,10 @@ const props = defineProps({
type: String,
required: true,
},
openNft: {
type: Number,
required: true,
}
});
let remainingTime = ref(0); // 24 = 86400
const day = ref(0);
@ -23,7 +27,7 @@ const starTimer = () => {
let nowTime = new Date().getTime();
// let str = localStorage.getItem(`openTime${props.getAddress}`)
// let strTime = (1718098200000 - nowTime) / 1000
let strTime = (1718098200000 - nowTime) / 1000
let strTime = (props.openNft - nowTime) / 1000
intervalId = setInterval(() => {
if (strTime >= 1) {
// remainingTime.value -= 1;

View File

@ -80,6 +80,21 @@ button:focus-visible {
body {
padding: 0 !important;
margin: 0 !important;
&::-webkit-scrollbar {
width: 0px;
}
&::-webkit-scrollbar-track {
background: #171220;
border-radius: 2px;
}
&::-webkit-scrollbar-corner {
display: block;
}
&::-webkit-scrollbar-thumb {
height: 15px;
background: #9950fd;
border-radius: 10px;
}
}
h1 {

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,5 @@
import Web3 from 'web3'
import { config, passport } from '@imtbl/sdk';
import { ethers, providers } from 'ethers';
import passportInit from './initPassport.js'
import ERC_abi from './../abi/ImmutableERC20MinterBurnerPermit.json'
import CFNFT_abi from './../abi/CFNFTGame.json'
import CLAIM_abi from './../abi/NFTClaimStage2.json'
@ -48,74 +46,15 @@ const queryMintData = async(user, data) => {
return requestChain(RPC, 'eth_call', params)
}
// const checkoutSDK = new checkout.Checkout()
// const type = checkout.WalletFilterTypes.ALL;
// window.addEventListener('load', function() {
// const passportInstance = new passport.Passport({
// baseConfig: {
// environment: config.Environment.SANDBOX, // or Environment.PRODUCTION
// publishableKey: 'wc:b348768c53d32b69062adcc7f67b263f771564c39edc06acc4cb3e9ee561d415@2?relay-protocol=irn&symKey=b8302aed25de3f9e3485eb8601d27c52779ab28cd8b1398312aa18be01cebbe8', // replace with your publishable API key from Hub
// // publishableKey: '', // replace with your publishable API key from Hub
// },
// clientId: 'eWbQF3aPY83RCNBMYGv2wUAbOJFKZo8l', // replace with your client ID from Hub
// redirectUri: 'http://localhost:5173/', // replace with one of your redirect URIs from Hub
// logoutRedirectUri: 'http://localhost:5173/', // replace with one of your logout URIs from Hub
// audience: '',
// scope: 'openid offline_access email transact',
// popupOverlayOptions: {
// disableGenericPopupOverlay: false, // Set to true to disable the generic pop-up overlay
// disableBlockedPopupOverlay: false, // Set to true to disable the blocked pop-up overlay
// }
// });
// passportInstance.loginCallback();
// });
const passportInstance = new passport.Passport({
baseConfig: {
environment: config.Environment.SANDBOX, // or Environment.PRODUCTION
publishableKey: 'pk_imapik-test-1E-detBXtG7U$5961WuL', // replace with your publishable API key from Hub
// publishableKey: '', // replace with your publishable API key from Hub
},
clientId: 'gYQrjtct7CN4UVwDG2sb8yACfYRo3xQJ', // replace with your client ID from Hub
redirectUri: 'http://localhost:5173/redirect', // replace with one of your redirect URIs from Hub
logoutRedirectUri: 'http://localhost:5173/logout', // replace with one of your logout URIs from Hub
audience: 'platform_api',
scope: 'openid offline_access email transact',
popupOverlayOptions: {
disableGenericPopupOverlay: true, // Set to true to disable the generic pop-up overlay
disableBlockedPopupOverlay: true, // Set to true to disable the blocked pop-up overlay
}
});
// 链接Wallet Connect钱包
export async function getConnect() {
const passportProvider = proxy.$passportInit;
const accounts = await passportProvider.request({ method: "eth_requestAccounts" })
console.log( accounts,'-----------------------------------------------------------------')
return
}
export async function getLogout() {
const profile = await passportInstance.logout();
return
}
export async function linkWallet(val) {
let res
if (val == 'ethereum') {
const web3js = window.ethereum
if (typeof web3js !== "undefined") {
// let res1 = await isSepoliNetwork(val)
// console.log(res1)
// return
res = await ethereum.request({ method: "eth_requestAccounts" })
}
} else if (val == 'okxwallet') {
// let res1 = await isSepoliNetwork(val)
// console.log(res1)
// return
res = await okxwallet.request({ method: "eth_requestAccounts" });
}
return res[0]
@ -124,45 +63,23 @@ let res
export async function disconnectLink(name) {
if (name == 'ethereum') {
await window.ethereum.request({
"method": "wallet_revokePermissions",
"params": [
method: "wallet_revokePermissions",
params: [
{
"eth_accounts": {}
eth_accounts: {}
}
]
});
} else if (name == 'okxwallet') {
await okxwallet.request({
"method": "wallet_disconnect",
method: "wallet_disconnect",
})
} else if(name == 'connect') {
await passportInstance.logout()
// } else if (name == 'connect') {
// await passportInit.logout()
// await passportInit.logoutSilentCallback(`${import.meta.env.VITE_GPAL_ROUTER}`)
}
}
// Wallet Connect初始化
// import { EthereumProvider } from '@walletconnect/ethereum-provider'
// const provider = await EthereumProvider.init({
// projectId: 'e7743d46923911fa8850619b7a7f6d9d', // required
// chains: ['1'], // required
// showQrModal: true, // requires @walletconnect/modal
// optionalChains: ['1'],
// // optionalMethods: ['eth_signTypedData', 'eth_signTypedData_v4'],
// metadata: {
// name: 'Counter Fire',
// description: 'Counter Fire',
// url: 'https://mint.counterfire.games/',
// icons: ['https://www.counterfire.games/favicon.ico'],
// },
// });
// 链接Wallet Connect钱包
// export async function getConnect() {
// await provider.connect()
// let result = await provider.request({ method: 'eth_requestAccounts' })
// return result
// }
// 获取钱包地址
export async function getWalletAddress() {
const web3js = window.ethereum
@ -206,7 +123,6 @@ export async function isSepoliNetwork(name) {
}
]
});
console.log(res,'-----')
return false
} else if (name == 'okxwallet') {
res =
@ -293,51 +209,28 @@ export async function addNetwork(name) {
}
const GAS_BOOST = 2
// claim NFT
export const claimStage2Nft = async(name, myAddress, params, web3) => {
let price = params*1e18
if(name == 'connect') {
let gasPrice = await web3.request({ method: 'eth_gasPrice' })
let web3Provider = new providers.Web3Provider(web3)
const signer = web3Provider.getSigner();
const [ userAddress ] = await web3.request({ method: "eth_requestAccounts"});
const contractFT = new ethers.Contract(ERCAddress, abis['ERC'].abi, signer);
let gasApprove = await contractFT.estimateGas.approve(claimWlAddress, BigInt(price))
// let gasApprove = await contractFT.estimateGas.approve(claimWlAddress, price)
gasApprove = (parseInt(gasApprove) * GAS_BOOST) | 0;
await contractFT.approve(claimWlAddress, BigInt(price))
// await contractFT.approve(claimWlAddress, price)
//------
const contract = new ethers.Contract(claimWlAddress, abis['CLAIMWL'].abi, signer);
let gas = await contract.estimateGas.claim(params)
// console.log(await contract.claim(params))
return await contract.claim(params)
} else {
// const account = await web3.eth.getAccounts()
// let res = await isSepoliNetwork(name)
// if(!res) {
// await addNetwork(name)
// }
export const claimStage2Nft = async (name, myAddress, params, mintPrice, web3) => {
const price = params * mintPrice * 1e18
console.log(BigInt(price))
const gasPrice = await web3.eth.getGasPrice()
const contractFT = new web3.eth.Contract(abis['ERC'].abi, ERCAddress, {
from: myAddress
});
const allowance = await contractFT.methods.allowance(myAddress, claimWlAddress).call()
console.log('allowance', allowance)
if(allowance < BigInt(price)) {
let gasApprove = await contractFT.methods.approve(claimWlAddress, price).estimateGas();
gasApprove = (parseInt(gasApprove) * GAS_BOOST) | 0;
await contractFT.methods.approve(claimWlAddress, price).send({ gas: gasApprove, gasPrice });
}
const contract = new web3.eth.Contract(abis['CLAIMWL'].abi, claimWlAddress, {
from: myAddress
});
let gas = await contract.methods.claim(params).estimateGas()
gas = (parseInt(gas) * GAS_BOOST) | 0;
// let abc = await contract.methods.claim(params).send({gas, gasPrice})
// console.log(abc)
return contract.methods.claim(params).send({ gas, gasPrice })
}
}
@ -351,7 +244,7 @@ export const balanceOfAmount = async(name, myAddress) => {
} else if (name == 'connect') {
web3 = new Web3(provider)
}
let contract = new web3.eth.Contract(abis['CLAIM'].abi, claimAddress, { from: myAddress})
let contract = new web3.eth.Contract(abis['CLAIMWL'].abi, claimWlAddress, { from: myAddress })
const tokenId = await contract.methods.totalCount(myAddress).call();
return parseInt(tokenId)
}
@ -367,7 +260,7 @@ export const mintConfig = async(name, myAddress) => {
} else if (name == 'connect') {
web3 = new Web3(provider)
}
let contract = new web3.eth.Contract(abis['CLAIM'].abi, claimAddress, { from: myAddress})
let contract = new web3.eth.Contract(abis['CLAIMWL'].abi, claimWlAddress, { from: myAddress })
const mintArr = await contract.methods.mintConfig(myAddress).call();
return mintArr
}
@ -385,9 +278,6 @@ export const fetchWLCount = async(name, myAddress) => {
let contract = new web3.eth.Contract(abis['CLAIMWL'].abi, claimWlAddress, { from: myAddress })
const tokenId = await contract.methods.whiteCount(myAddress).call();
return parseInt(tokenId)
const data = '0xe65ee803'
return queryMintData(user, data)
}
// 当前用户已获得的数量
@ -401,27 +291,7 @@ export const fetchMintedCount = async (name, myAddress) => {
web3 = new Web3(provider)
}
let contract = new web3.eth.Contract(abis['CLAIMWL'].abi, claimWlAddress, { from: myAddress })
const tokenId = await contract.methods.mintedNft(myAddress).call();
return tokenId
const data = '0xe65ee803'
return queryMintData(user, data)
const tokenArr = await contract.methods.mintedNft(myAddress).call();
return tokenArr
}
// passport send()
const returnSend = async (web3, ERCAddress, contractAddress, abi, data) => {
// let gasPrice = await web3.request({ method: 'eth_gasPrice' })
let web3Provider = new providers.Web3Provider(web3)
const signer = web3Provider.getSigner();
const contract = new ethers.Contract(ERCAddress, abi, signer);
let gasApprove = await contract.estimateGas.approve(contractAddress, data)
// let gasApprove = tx
gasApprove = (parseInt(gasApprove) * GAS_BOOST) | 0;
console.log(parseInt(gasApprove),'---')
return contract.approve(contractAddress, data)
}

View File

@ -1,18 +1,21 @@
import { Web3 } from "web3"
import { config, passport } from '@imtbl/sdk';
console.log(import.meta.env.VITE_GPAL_ROUTER,'import.meta.env.VITE_GPAL_ROUTER')
const passportInstance = new passport.Passport({
baseConfig: {
environment: config.Environment.SANDBOX, // or Environment.PRODUCTION
publishableKey: 'pk_imapik-test-1E-detBXtG7U$5961WuL', // replace with your publishable API key from Hub
publishableKey: 'pk_imapik-test-1E-detBXtG7U$5961WuL', // replace with your publishable API key from Hub pk_imapik-tU10buLqoyLZ0o54rcub pk_imapik-test-1E-detBXtG7U$5961WuL
// publishableKey: '', // replace with your publishable API key from Hub
},
clientId: 'gYQrjtct7CN4UVwDG2sb8yACfYRo3xQJ', // replace with your client ID from Hub
redirectUri: 'http://localhost:5173/redirect', // replace with one of your redirect URIs from Hub
logoutRedirectUri: 'http://localhost:5173/logout', // replace with one of your logout URIs from Hub
clientId: 'gYQrjtct7CN4UVwDG2sb8yACfYRo3xQJ', // replace with your client ID from Hub gYQrjtct7CN4UVwDG2sb8yACfYRo3xQJ tTB5eEedqDOHPHMI41sRDGmqAQwus9oE
redirectUri: `${import.meta.env.VITE_GPAL_ROUTER}/redirect`, // replace with one of your redirect URIs from Hub
logoutRedirectUri: `${import.meta.env.VITE_GPAL_ROUTER}`, // replace with one of your logout URIs from Hub
logoutMode: 'silent',
audience: 'platform_api',
scope: 'openid offline_access email transact',
popupOverlayOptions: {
disableGenericPopupOverlay: true, // Set to true to disable the generic pop-up overlay
disableBlockedPopupOverlay: true, // Set to true to disable the blocked pop-up overlay
disableGenericPopupOverlay: false, // Set to true to disable the generic pop-up overlay
disableBlockedPopupOverlay: false, // Set to true to disable the blocked pop-up overlay
}
});
const passportInit = app => {