Spaces:
Running
Running
File size: 12,386 Bytes
1643700 c58f73d 1643700 c58f73d 1643700 c58f73d 1643700 c58f73d 1643700 c58f73d 1643700 c58f73d 1643700 c58f73d 1643700 c58f73d 1643700 c58f73d 1643700 c58f73d 1643700 c58f73d 1643700 c58f73d 1643700 c58f73d 1643700 c58f73d 1643700 c58f73d 1643700 c58f73d 1643700 c58f73d 1643700 c58f73d 1643700 c58f73d 1643700 c58f73d 1643700 c58f73d 1643700 c58f73d 1643700 c58f73d 1643700 c58f73d 1643700 c58f73d 1643700 c58f73d 1643700 c58f73d 1643700 c58f73d 1643700 c58f73d 1643700 c58f73d 1643700 c58f73d 1643700 c58f73d 1643700 c58f73d 1643700 c58f73d 1643700 c58f73d 1643700 c58f73d 1643700 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FindYourself DAO - Functional Dashboard</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script src="https://cdn.ethers.io/lib/ethers-5.2.umd.min.js"></script>
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<style>
:root {
--primary-color: #6E56CF;
--secondary-color: #A78BFA;
--background-dark: #0A0A0F;
--panel-dark: #121218;
--text-light: #E1E3E8;
--accent-color: #00F5D4;
}
body {
background-color: var(--background-dark);
color: var(--text-light);
font-family: 'Inter', sans-serif;
}
</style>
</head>
<body class="bg-[var(--background-dark)]">
<div id="app" class="container mx-auto px-4 py-8">
<!-- Wallet Connection Component -->
<div class="mb-8 flex justify-between items-center">
<h1 class="text-3xl font-bold text-[var(--primary-color)]">FindYourself DAO</h1>
<div class="flex items-center space-x-4">
<div v-if="!walletConnected"
@click="connectWallet"
class="bg-[var(--primary-color)] text-white px-4 py-2 rounded-full cursor-pointer hover:bg-[var(--secondary-color)] transition">
Connect Wallet
</div>
<div v-else class="flex items-center space-x-2">
<span class="text-green-400">✓ Connected</span>
<span class="bg-[var(--panel-dark)] px-3 py-1 rounded-full">
{{ shortenAddress(walletAddress) }}
</span>
<button
@click="disconnectWallet"
class="bg-red-600 text-white px-3 py-1 rounded-full text-sm">
Disconnect
</button>
</div>
</div>
</div>
<!-- User Dashboard -->
<div v-if="walletConnected" class="grid grid-cols-3 gap-6">
<!-- Wallet Balance -->
<div class="bg-[var(--panel-dark)] p-6 rounded-2xl">
<h3 class="text-xl font-bold mb-4 text-[var(--accent-color)]">Wallet Balance</h3>
<div class="space-y-3">
<div class="flex justify-between">
<span>USDT Balance</span>
<span class="font-bold">{{ usdtBalance }} USDT</span>
</div>
<div class="flex justify-between">
<span>DAO Token Balance</span>
<span class="font-bold">{{ daoTokenBalance }} DAO</span>
</div>
<div class="flex justify-between">
<span>Total Value</span>
<span class="font-bold text-green-400">${{ totalWalletValue.toFixed(2) }}</span>
</div>
</div>
</div>
<!-- Staking Module -->
<div class="bg-[var(--panel-dark)] p-6 rounded-2xl">
<h3 class="text-xl font-bold mb-4 text-[var(--accent-color)]">Staking Dashboard</h3>
<div class="space-y-4">
<div>
<label class="block mb-2">Stake Amount</label>
<input
type="number"
v-model="stakeAmount"
class="w-full bg-[var(--background-dark)] p-2 rounded-lg"
placeholder="Enter USDT amount"
>
</div>
<div>
<label class="block mb-2">Staking Period</label>
<select
v-model="stakingPeriod"
class="w-full bg-[var(--background-dark)] p-2 rounded-lg"
>
<option value="3">3 Months (0.5% daily)</option>
<option value="6">6 Months (0.6% daily)</option>
<option value="12">12 Months (0.7% daily)</option>
</select>
</div>
<button
@click="executeStake"
:disabled="!canStake"
class="w-full bg-[var(--primary-color)] text-white p-2 rounded-lg disabled:opacity-50"
>
Stake Tokens
</button>
<div v-if="stakeError" class="text-red-400 text-sm">
{{ stakeError }}
</div>
</div>
</div>
<!-- Reward Simulator -->
<div class="bg-[var(--panel-dark)] p-6 rounded-2xl">
<h3 class="text-xl font-bold mb-4 text-[var(--accent-color)]">Reward Simulator</h3>
<div class="space-y-3">
<div class="flex justify-between">
<span>Estimated Daily Reward</span>
<span class="font-bold">{{ dailyReward.toFixed(2) }} USDT</span>
</div>
<div class="flex justify-between">
<span>Monthly Reward</span>
<span class="font-bold">{{ monthlyReward.toFixed(2) }} USDT</span>
</div>
<div class="flex justify-between">
<span>Total Period Reward</span>
<span class="font-bold text-green-400">{{ totalPeriodReward.toFixed(2) }} USDT</span>
</div>
<div class="mt-4 bg-[var(--background-dark)] p-3 rounded-lg">
<div class="text-sm mb-2">Reward Breakdown</div>
<div class="grid grid-cols-2 gap-2">
<div>
<span class="text-xs">To Wallet</span>
<div class="bg-gray-700 rounded-full h-2 overflow-hidden">
<div class="h-full bg-[var(--primary-color)] w-[40%]"></div>
</div>
</div>
<div>
<span class="text-xs">Restaked</span>
<div class="bg-gray-700 rounded-full h-2 overflow-hidden">
<div class="h-full bg-[var(--accent-color)] w-[60%]"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Network Statistics -->
<div class="mt-8 grid grid-cols-4 gap-6">
<div v-for="stat in networkStats" :key="stat.label"
class="bg-[var(--panel-dark)] p-4 rounded-2xl">
<div class="text-sm text-gray-400">{{ stat.label }}</div>
<div class="text-2xl font-bold text-[var(--accent-color)]">
{{ stat.value }}
</div>
<div :class="[
'text-sm',
stat.change > 0 ? 'text-green-400' : 'text-red-400'
]">
{{ stat.change > 0 ? '+' : '' }}{{ stat.change }}%
</div>
</div>
</div>
</div>
<script>
const { createApp, ref, computed } = Vue;
createApp({
setup() {
// Wallet Connection State
const walletConnected = ref(false);
const walletAddress = ref('');
// Wallet Balances
const usdtBalance = ref(1250.45);
const daoTokenBalance = ref(500.75);
const totalWalletValue = computed(() =>
usdtBalance.value + (daoTokenBalance.value * 2.5)
);
// Staking Variables
const stakeAmount = ref(0);
const stakingPeriod = ref(3);
const stakeError = ref('');
// Reward Calculation
const dailyReward = computed(() => {
const baseRate = stakingPeriod.value === 3 ? 0.005 :
stakingPeriod.value === 6 ? 0.006 : 0.007;
return stakeAmount.value * baseRate;
});
const monthlyReward = computed(() =>
dailyReward.value * 30
);
const totalPeriodReward = computed(() =>
dailyReward.value * (stakingPeriod.value * 30)
);
// Validation
const canStake = computed(() =>
stakeAmount.value > 0 &&
stakeAmount.value <= usdtBalance.value
);
// Network Statistics
const networkStats = ref([
{
label: 'Total Value Locked',
value: '$1.2M',
change: 12.4
},
{
label: 'Daily Volume',
value: '$345K',
change: 8.7
},
{
label: 'Active Stakers',
value: '4,567',
change: 15.2
},
{
label: 'Current APY',
value: '12.4%',
change: 2.1
}
]);
// Wallet Connection Methods
const connectWallet = async () => {
try {
// Simulated wallet connection
walletConnected.value = true;
walletAddress.value = '0x1234...5678';
} catch (error) {
console.error('Wallet connection failed', error);
}
};
const disconnectWallet = () => {
walletConnected.value = false;
walletAddress.value = '';
};
// Stake Execution
const executeStake = () => {
if (!canStake.value) {
stakeError.value = 'Insufficient balance or invalid stake amount';
return;
}
// Simulated staking logic
usdtBalance.value -= stakeAmount.value;
stakeError.value = '';
alert(`Successfully staked ${stakeAmount.value} USDT for ${stakingPeriod.value} months`);
};
// Utility Methods
const shortenAddress = (address) =>
`${address.substring(0, 6)}...${address.substring(address.length - 4)}`;
return {
// State
walletConnected,
walletAddress,
usdtBalance,
daoTokenBalance,
totalWalletValue,
// Staking
stakeAmount,
stakingPeriod,
stakeError,
dailyReward,
monthlyReward,
totalPeriodReward,
canStake,
// Network
networkStats,
// Methods
connectWallet,
disconnectWallet,
executeStake,
shortenAddress
};
}
}).mount('#app');
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=kuganryde/projecttest" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html> |