visual changes + sacrifice error fix
This commit is contained in:
@@ -11,8 +11,6 @@
|
|||||||
border: 2px solid #000
|
border: 2px solid #000
|
||||||
&.bloodline-border--variant1
|
&.bloodline-border--variant1
|
||||||
border: 4px solid var(--midnight-black)
|
border: 4px solid var(--midnight-black)
|
||||||
@media (min-width: 992px)
|
|
||||||
border: 4px solid #000
|
|
||||||
@media (min-width: 992px)
|
@media (min-width: 992px)
|
||||||
padding: 24px 32px
|
padding: 24px 32px
|
||||||
border: 4px solid #000
|
border: 4px solid #000
|
||||||
|
|||||||
@@ -8,11 +8,8 @@
|
|||||||
padding: 16px 24px
|
padding: 16px 24px
|
||||||
gap: 8px
|
gap: 8px
|
||||||
border-radius: 14px
|
border-radius: 14px
|
||||||
@media (min-width: 992px)
|
|
||||||
background-color: $red
|
|
||||||
&:hover,&:focus,&:active
|
&:hover,&:focus,&:active
|
||||||
background-color: lighten($button-background-color, 10%),
|
background-color: darken($purple, 10%),
|
||||||
color: darken($button-color, 10%),
|
|
||||||
cursor: pointer
|
cursor: pointer
|
||||||
&.btn--disabled
|
&.btn--disabled
|
||||||
background-color: #151515
|
background-color: #151515
|
||||||
|
|||||||
@@ -92,7 +92,7 @@
|
|||||||
v-if="activeToken.allowance > 0 && activeToken.allowance >= tokenNumber"
|
v-if="activeToken.allowance > 0 && activeToken.allowance >= tokenNumber"
|
||||||
@click="approvalData = memeburnerStore.sacrificeMeme(tokenNumber)"
|
@click="approvalData = memeburnerStore.sacrificeMeme(tokenNumber)"
|
||||||
>
|
>
|
||||||
<font-awesome-icon v-if="loading" icon="spinner" spin />
|
<font-awesome-icon v-if="memeburnerStore.loading" icon="spinner" spin />
|
||||||
Sacrifce {{ activeToken.name }}
|
Sacrifce {{ activeToken.name }}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
@@ -162,18 +162,23 @@ async function getRewardsFor(e) {
|
|||||||
// const rewardsForResult = await tokenStore.getRewardsFor(10000);
|
// const rewardsForResult = await tokenStore.getRewardsFor(10000);
|
||||||
console.log("rewardsForResult", rewardsForResult);
|
console.log("rewardsForResult", rewardsForResult);
|
||||||
console.log("tokenStore.memeToken.decimals", tokenStore.memeToken.decimals);
|
console.log("tokenStore.memeToken.decimals", tokenStore.memeToken.decimals);
|
||||||
console.log("Math.pow(10, tokenStore.memeToken.decimals)", Math.pow(10, tokenStore.memeToken.decimals));
|
console.log(
|
||||||
output.value = rewardsForResult / Math.pow(10, tokenStore.memeToken.decimals);
|
"Math.pow(10, tokenStore.memeToken.decimals)",
|
||||||
|
Math.pow(10, tokenStore.memeToken.decimals)
|
||||||
|
);
|
||||||
|
output.value =
|
||||||
|
rewardsForResult / Math.pow(10, tokenStore.memeToken.decimals);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function addTokens(value) {
|
async function addTokens(value) {
|
||||||
tokenNumber.value = tokenNumber.value + value;
|
tokenNumber.value = tokenNumber.value + value;
|
||||||
output.value = await memeburnerStore.getRewardsFor(parseInt(tokenNumber.value));
|
output.value = await memeburnerStore.getRewardsFor(
|
||||||
|
parseInt(tokenNumber.value)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="sass">
|
<style lang="sass">
|
||||||
|
|
||||||
.sacrifice-wrapper
|
.sacrifice-wrapper
|
||||||
display: flex
|
display: flex
|
||||||
flex-direction: column
|
flex-direction: column
|
||||||
@@ -206,14 +211,15 @@ async function addTokens(value) {
|
|||||||
cursor: pointer
|
cursor: pointer
|
||||||
background-color: #0F0F0F
|
background-color: #0F0F0F
|
||||||
text-align: center
|
text-align: center
|
||||||
|
user-select: none
|
||||||
|
border: 4px solid transparent
|
||||||
|
.sacrifice-token-logo
|
||||||
|
pointer-events: none
|
||||||
// @media (min-width: 992px)
|
// @media (min-width: 992px)
|
||||||
// padding: 0
|
// padding: 0
|
||||||
// background-color: unset
|
// background-color: unset
|
||||||
&.sacrifice-token--active
|
&.sacrifice-token--active
|
||||||
padding: 10px
|
|
||||||
border-color: var(--purple)
|
border-color: var(--purple)
|
||||||
@media (min-width: 992px)
|
|
||||||
border-color: var(--blood-color)
|
|
||||||
|
|
||||||
.sacrifice-token-name
|
.sacrifice-token-name
|
||||||
padding: 5px 26px
|
padding: 5px 26px
|
||||||
@@ -272,6 +278,7 @@ async function addTokens(value) {
|
|||||||
width: 45px
|
width: 45px
|
||||||
height: 45px
|
height: 45px
|
||||||
border-radius: 50%
|
border-radius: 50%
|
||||||
|
pointer-events: none
|
||||||
@media (min-width: 992px)
|
@media (min-width: 992px)
|
||||||
height: 83px
|
height: 83px
|
||||||
width: auto
|
width: auto
|
||||||
|
|||||||
@@ -41,6 +41,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<div v-else class="btn btn-immortal btn--disabled">Nothing to claim</div>
|
<div v-else class="btn btn-immortal btn--disabled">Nothing to claim</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="stake-buttons">
|
||||||
|
<div class="btn btn-immortal">Stake</div>
|
||||||
|
<div class="btn btn-immortal">Unstake</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -58,7 +63,8 @@ const rewardLockerStore = useRewardLockerStore();
|
|||||||
const walletStore = useWalletStore();
|
const walletStore = useWalletStore();
|
||||||
const roundStore = useRoundsStore();
|
const roundStore = useRoundsStore();
|
||||||
const { address } = storeToRefs(walletStore);
|
const { address } = storeToRefs(walletStore);
|
||||||
const { activeRound, currentRound, getCurrentRoundData } = storeToRefs(roundStore);
|
const { activeRound, currentRound, getCurrentRoundData } =
|
||||||
|
storeToRefs(roundStore);
|
||||||
|
|
||||||
onMounted(async () => {});
|
onMounted(async () => {});
|
||||||
|
|
||||||
@@ -79,7 +85,13 @@ async function claimRewards() {
|
|||||||
padding: 32px 40px
|
padding: 32px 40px
|
||||||
.claim-button
|
.claim-button
|
||||||
text-align: center
|
text-align: center
|
||||||
margin-top: 32px
|
margin: 32px 0
|
||||||
|
.stake-buttons
|
||||||
|
display: flex
|
||||||
|
text-align: center
|
||||||
|
gap: 32px
|
||||||
|
div
|
||||||
|
flex: 1 1 50%
|
||||||
.rewards-wrapper
|
.rewards-wrapper
|
||||||
margin-bottom: 16px
|
margin-bottom: 16px
|
||||||
.rewards-divider
|
.rewards-divider
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ export const useMemeburnerStore = defineStore("memeburner", {
|
|||||||
state: () => ({
|
state: () => ({
|
||||||
config: MemeBurnerJson,
|
config: MemeBurnerJson,
|
||||||
contract: null,
|
contract: null,
|
||||||
|
loading: false,
|
||||||
|
|
||||||
}),
|
}),
|
||||||
getters: {},
|
getters: {},
|
||||||
@@ -90,7 +91,7 @@ export const useMemeburnerStore = defineStore("memeburner", {
|
|||||||
.sacrificeMeme(tokenStore.activeToken.contractAddress, amountDecimal)
|
.sacrificeMeme(tokenStore.activeToken.contractAddress, amountDecimal)
|
||||||
.send({ from: walletStore.address });
|
.send({ from: walletStore.address });
|
||||||
console.log("reward", reward);
|
console.log("reward", reward);
|
||||||
tokenStore.activeToken.allowance = await this.allowance();
|
tokenStore.activeToken.allowance = await tokenStore.allowance();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ export const useTokenStore = defineStore("token", {
|
|||||||
const memeBurnerStore = useMemeburnerStore();
|
const memeBurnerStore = useMemeburnerStore();
|
||||||
var approve = await this.contract.methods
|
var approve = await this.contract.methods
|
||||||
.approve(memeBurnerStore.config.contractAddress, amount)
|
.approve(memeBurnerStore.config.contractAddress, amount)
|
||||||
.send({ from: walletStore.address });
|
.send({ from: walletStore.address});
|
||||||
//todo parameter value übergeben in eth web3.utils.toHex(web3.utils.toWei(amount, 'ether'))
|
//todo parameter value übergeben in eth web3.utils.toHex(web3.utils.toWei(amount, 'ether'))
|
||||||
|
|
||||||
// .send({ from: walletStore.address, value: 0.5 });
|
// .send({ from: walletStore.address, value: 0.5 });
|
||||||
|
|||||||
@@ -77,6 +77,12 @@ export const useWalletStore = defineStore("wallet", {
|
|||||||
async isConnected() {
|
async isConnected() {
|
||||||
try {
|
try {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
if (!window.ethereum) {
|
||||||
|
console.warn("Metamask not installed"),
|
||||||
|
this.connected = false;
|
||||||
|
return;
|
||||||
|
|
||||||
|
}
|
||||||
const accounts = await window.ethereum.request({ method: "eth_accounts" });
|
const accounts = await window.ethereum.request({ method: "eth_accounts" });
|
||||||
if (accounts.length) {
|
if (accounts.length) {
|
||||||
this.connected = true;
|
this.connected = true;
|
||||||
|
|||||||
@@ -49,7 +49,9 @@ onBeforeUnmount(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function timeBetweenDates() {
|
function timeBetweenDates() {
|
||||||
const dateEntered = new Date(getCurrentRoundData.value?.expirationTimestamp * 1000);
|
const dateEntered = new Date(
|
||||||
|
getCurrentRoundData.value?.expirationTimestamp * 1000
|
||||||
|
);
|
||||||
|
|
||||||
if (dateEntered) {
|
if (dateEntered) {
|
||||||
var now = new Date();
|
var now = new Date();
|
||||||
@@ -206,7 +208,6 @@ function timeBetweenDates() {
|
|||||||
line-height: 80px
|
line-height: 80px
|
||||||
font-weight: 600
|
font-weight: 600
|
||||||
|
|
||||||
|
|
||||||
.chart-wrapper-coin
|
.chart-wrapper-coin
|
||||||
display: flex
|
display: flex
|
||||||
justify-content: space-evenly
|
justify-content: space-evenly
|
||||||
@@ -231,12 +232,15 @@ function timeBetweenDates() {
|
|||||||
padding-right: 16px
|
padding-right: 16px
|
||||||
#tokenomics
|
#tokenomics
|
||||||
background-color: var(--darkgrey)
|
background-color: var(--darkgrey)
|
||||||
|
padding-bottom: 32px
|
||||||
>div
|
>div
|
||||||
text-align: center
|
text-align: center
|
||||||
img
|
img
|
||||||
display: block
|
display: block
|
||||||
margin-left: auto
|
margin-left: auto
|
||||||
margin-right: auto
|
margin-right: auto
|
||||||
|
pointer-events: none
|
||||||
|
user-select: none
|
||||||
.chart-wrapper
|
.chart-wrapper
|
||||||
width: 600px
|
width: 600px
|
||||||
height: 600px
|
height: 600px
|
||||||
@@ -255,7 +259,6 @@ function timeBetweenDates() {
|
|||||||
text-align: center
|
text-align: center
|
||||||
padding-top: 10px
|
padding-top: 10px
|
||||||
|
|
||||||
|
|
||||||
.slider-wrapper
|
.slider-wrapper
|
||||||
display: flex
|
display: flex
|
||||||
justify-content: center
|
justify-content: center
|
||||||
@@ -266,9 +269,11 @@ function timeBetweenDates() {
|
|||||||
margin-top: auto
|
margin-top: auto
|
||||||
margin-bottom: auto
|
margin-bottom: auto
|
||||||
.slider-prev, .slider-next
|
.slider-prev, .slider-next
|
||||||
color: #3B0067
|
color: var(--purple)
|
||||||
font-size: 40px
|
font-size: 40px
|
||||||
cursor: pointer
|
cursor: pointer
|
||||||
|
&:hover,&:active, &:focus
|
||||||
|
filter: brightness(0.80)
|
||||||
&.disabled
|
&.disabled
|
||||||
opacity: .35
|
opacity: .35
|
||||||
pointer-events: none
|
pointer-events: none
|
||||||
|
|||||||
Reference in New Issue
Block a user