CBDGold commited on
Commit
d134afc
·
verified ·
1 Parent(s): c673fc8

import React, { useState } from 'react';

Browse files

import { Wallet, Coins, Gift, Lock, Star, ShoppingCart, Users, TrendingUp, Award, Zap, Crown, Shield, Leaf, Flame, Dice1 } from 'lucide-react';

const HempTokenCBDPlatform = () => {
const [walletConnected, setWalletConnected] = useState(false);
const [algorandAddress, setAlgorandAddress] = useState('');
const [hempTokenBalance, setHempTokenBalance] = useState(0);
const [weedTokenBalance, setWeedTokenBalance] = useState(0);
const [algoBalance, setAlgoBalance] = useState(0);
const [usdcBalance, setUsdcBalance] = useState(0);
const [stakedTokens, setStakedTokens] = useState(500000);
const [activeTab, setActiveTab] = useState('dashboard');
const [stakingAmount, setStakingAmount] = useState('');
const [isSpinning, setIsSpinning] = useState(false);
const [spinResult, setSpinResult] = useState(null);

// Algorand ASA Information
const HEMP_ASA_ID = 2675148574;
const WEED_ASA_ID = 2676316280;
const VAULT_ADDRESS = '420vault.algo';

// Mock Algorand wallet connection
const connectAlgoWallet = async () => {
try {
const mockAddress = 'HEMP7X4A3QZXKJYB2NWVF8H5M9GTCR6PLQS1EUDKA8YW3V2TZRI4BJLM6A';
setAlgorandAddress(mockAddress);
setWalletConnected(true);
setHempTokenBalance(12500000);
setWeedTokenBalance(2500);
setAlgoBalance(150);
setUsdcBalance(1250);
} catch (error) {
console.error('Wallet connection failed:', error);
}
};

const disconnectWallet = () => {
setWalletConnected(false);
setAlgorandAddress('');
setHempTokenBalance(0);
setWeedTokenBalance(0);
};

// Calculate staking tier based on staked amount
const calculateStakingTier = (stakedAmount) => {
if (stakedAmount >= 1000000) return { name: 'Gold', discount: 50, apy: 10, shipping: 'Priority', color: 'from-yellow-400 to-yellow-600' };
if (stakedAmount >= 500000) return { name: 'Silver', discount: 30, apy: 5, shipping: 'Faster', color: 'from-gray-300 to-gray-500' };
if (stakedAmount >= 100000) return { name: 'Bronze', discount: 20, apy: 3, shipping: 'Faster', color: 'from-orange-400 to-orange-600' };
return { name: 'None', discount: 0, apy: 0, shipping: 'Standard', color: 'from-gray-600 to-gray-700' };
};

const currentStakingTier = calculateStakingTier(stakedTokens);

// CBD Gold 510 ceramic vapes
const cbdVapes = [
{
id: 1,
name: 'Northern Lights CBD',
strain: 'Northern Lights',
type: 'Indica-dominant',
flavor: 'Sweet Pine & Earth',
effects: 'Deeply Relaxing',
priceAlgo: 15,
priceUsdc: 45.99,
hempEarned: 90000,
potency: '66.6% CBD',
terpenes: ['Myrcene', 'Pinene', 'Caryophyllene'],
color: 'from-purple-500 to-indigo-600',
emoji: '🌌'
},
{
id: 2,
name: 'Sour Diesel CBD',
strain: 'Sour Diesel',
type: 'Sativa-dominant',
flavor: 'Citrus Fuel & Herbs',
effects: 'Energizing Focus',
priceAlgo: 16,
priceUsdc: 47.99,
hempEarned: 95000,
potency: '66.6% CBD',
terpenes: ['Limonene', 'Caryophyllene', 'Myrcene'],
color: 'from-yellow-500 to-orange-600',
emoji: '⚡'
},
{
id: 3,
name: 'OG Kush CBD',
strain: 'OG Kush',
type: 'Hybrid',
flavor: 'Earthy Lemon Pine',
effects: 'Balanced Euphoria',
priceAlgo: 17,
priceUsdc: 49.99,
hempEarned: 100000,
potency: '66.6% CBD',
terpenes: ['Myrcene', 'Limonene', 'Caryophyllene'],
color: 'from-green-500 to-emerald-600',
emoji: '👑'
}
];

// Staking pools
const stakingPools = [
{
id: 1,
name: 'Bronze Tier',
minStake: 100000,
discount: 20,
apy: 3,
shipping: 'Faster',
benefits: ['20% off CBD Gold Vapes', 'Faster shipping', 'Community access'],
color: 'from-orange-400 to-orange-600'
},
{
id: 2,
name: 'Silver Tier',
minStake: 500000,
discount: 30,
apy: 5,
shipping: 'Faster',
benefits: ['30% off CBD Gold Vapes', 'Faster shipping', 'Exclusive strains', 'New releases'],
color: 'from-gray-300 to-gray-500'
},
{
id: 3,
name: 'Gold Tier',
minStake: 1000000,
discount: 50,
apy: 10,
shipping: 'Priority',
benefits: ['50% off CBD Gold Vapes', 'Priority shipping', 'VIP event tickets', 'All exclusive access'],
color: 'from-yellow-400 to-yellow-600'
}
];

// Governance proposals
const governanceProposals = [
{
id: 1,
title: 'New Strain: Zkittlez CBD',
description: 'Vote to add Zkittlez-inspired terpene profile with 66.6% CBD potency',
votingPower: Math.floor(weedTokenBalance / 0.001),
status: 'Active',
timeLeft: '5 days',
weedRequired: 1
},
{
id: 2,
title: 'Limited Edition: 24K Gold Hardware',
description: 'Propose gold-plated ceramic tips for premium tier members',
votingPower: Math.floor(weedTokenBalance / 0.001),
status: 'Active',
timeLeft: '12 days',
weedRequired: 2.5
}
];

// Slot machine game
const spinForGold = async (vape) => {
if (isSpinning) return;

setIsSpinning(true);
setSpinResult(null);

setTimeout(() => {
const outcomes = [
{ type: 'hemp', amount: 50000, probability: 0.4 },
{ type: 'hemp', amount: 100000, probability: 0.25 },
{ type: 'hemp', amount: 200000, probability: 0.15 },
{ type: 'discount', amount: 10, probability: 0.1 },
{ type: 'discount', amount: 25, probability: 0.05 },
{ type: 'jackpot', amount: 1000000, probability: 0.05 }
];

const random = Math.random();
let cumulative = 0;

for (let outcome of outcomes) {
cumulative += outcome.probability;
if (random <= cumulative) {
if (outcome.type === 'hemp' || outcome.type === 'jackpot') {
setHempTokenBalance(prev => prev + outcome.amount);
}
setSpinResult(outcome);
break;
}
}

setIsSpinning(false);
}, 3000);
};

const purchaseWithAlgo = (vape) => {
const discountedPrice = vape.priceAlgo * (1 - currentStakingTier.discount / 100);

if (algoBalance >= discountedPrice) {
setAlgoBalance(prev => prev - discountedPrice);
setHempTokenBalance(prev => prev + vape.hempEarned);

alert(`Purchased ${vape.name} with ALGO!\n\nCost: ${discountedPrice.toFixed(2)} ALGO (${currentStakingTier.discount}% ${currentStakingTier.name} discount)\nEarned: ${vape.hempEarned.toLocaleString()} HEMP\nLP Contribution: ALGO/HEMP pool\nShipping: ${currentStakingTier.shipping}`);
} else {
alert(`Insufficient ALGO! Need ${discountedPrice.toFixed(2)} ALGO`);
}
};

const purchaseWithUsdc = (vape) => {
const discountedPrice = vape.priceUsdc * (1 - currentStakingTier.discount / 100);

if (usdcBalance >= discountedPrice) {
setUsdcBalance(prev => prev - discountedPrice);
setHempTokenBalance(prev => prev + vape.hempEarned);

alert(`Purchased ${vape.name} with USDC!\n\nCost: $${discountedPrice.toFixed(2)} USDC (${currentStakingTier.discount}% ${currentStakingTier.name} discount)\nEarned: ${vape.hempEarned.toLocaleString()} HEMP\nLP Contribution: USDC/HEMP pool\nWEED tokens purchased for ${VAULT_ADDRESS}\nShipping: ${currentStakingTier.shipping}`);
} else {
alert(`Insufficient USDC! Need $${discountedPrice.toFixed(2)} USDC`);
}
};

const stakeTokens = async (pool) => {
const amount = parseInt(stakingAmount);

if (amount && amount <= hempTokenBalance && amount >= pool.minStake) {
setHempTokenBalance(prev => prev - amount);
setStakedTokens(prev => prev + amount);
setStakingAmount('');

alert(`Successfully staked ${amount.toLocaleString()} HEMP tokens!\n\nTier: ${pool.name}\nDiscount: ${pool.discount}% off CBD Gold Vapes\nAPY: ${pool.apy}% HEMP\nShipping: ${pool.shipping}\nBenefits unlocked: ${pool.benefits.join(', ')}`);
} else {
alert('Invalid staking amount or insufficient balance!');
}
};

const TabButton = ({ id, label, icon: Icon, active, onClick }) => (
<button
onClick={onClick}
className={`flex items-center space-x-2 px-6 py-3 rounded-lg font-semibold transition-all duration-300 ${
active
? 'bg-gradient-to-r from-green-400 to-green-600 text-black shadow-lg transform scale-105'
: 'bg-gray-800 text-gray-300 hover:bg-gray-700 hover:text-white'
}`}
>
<Icon size={20} />
<span>{label}</span>
</button>
);

const GlassCard = ({ children, className = '' }) => (
<div className={`bg-white/10 backdrop-blur-md rounded-2xl border border-white/20 shadow-2xl ${className}`}>
{children}
</div>
);

const renderDashboard = () => (
<div className="space-y-8">
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
<GlassCard className="p-6">
<div className="flex items-center justify-between mb-4">
<h3 className="text-xl font-bold text-white flex items-center">
<Leaf className="mr-2 text-green-400" />
Multi-Token Wallet
</h3>
<button onClick={disconnectWallet} className="text-sm text-red-400 hover:text-red-300">
Disconnect
</button>
</div>
<div className="bg-black/30 rounded-lg p-4 space-y-3">
<div>
<p className="text-sm text-gray-300">Algorand Address:</p>
<p className="font-mono text-xs text-green-400 break-all">{algorandAddress}</p>
</div>
<div className="grid grid-cols-2 gap-4 text-sm">
<div>
<p className="text-gray-300">HEMP:</p>
<p className="text-green-400 font-bold">{hempTokenBalance.toLocaleString()}</p>
<p className="text-xs text-gray-500">ASA: {HEMP_ASA_ID}</p>
</div>
<div>
<p className="text-gray-300">WEED:</p>
<p className="text-purple-400 font-bold">{weedTokenBalance.toL

Files changed (3) hide show
  1. README.md +7 -5
  2. index.html +982 -18
  3. prompts.txt +581 -0
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Cbdgold
3
- emoji: 🐨
4
- colorFrom: pink
5
- colorTo: indigo
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: cbdgold
3
+ emoji: 🐳
4
+ colorFrom: purple
5
+ colorTo: gray
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,983 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  </html>
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>HEMP Token Platform</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet">
9
+ <script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script>
10
+ <script src="https://unpkg.com/feather-icons"></script>
11
+ <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
12
+ <style>
13
+ body {
14
+ background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
15
+ color: white;
16
+ min-height: 100vh;
17
+ }
18
+ .glass-card {
19
+ background: rgba(255, 255, 255, 0.1);
20
+ backdrop-filter: blur(10px);
21
+ border: 1px solid rgba(255, 255, 255, 0.2);
22
+ box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
23
+ }
24
+ .gradient-text {
25
+ background-clip: text;
26
+ -webkit-background-clip: text;
27
+ color: transparent;
28
+ }
29
+ @keyframes spin {
30
+ 0% { transform: rotate(0deg); }
31
+ 100% { transform: rotate(360deg); }
32
+ }
33
+ .spinning {
34
+ animation: spin 1s linear infinite;
35
+ }
36
+ </style>
37
+ </head>
38
+ <body class="font-sans">
39
+ <div class="container mx-auto px-4 py-8">
40
+ <!-- Header -->
41
+ <header class="flex justify-between items-center mb-8">
42
+ <div class="flex items-center">
43
+ <div class="w-10 h-10 bg-gradient-to-r from-green-400 to-green-600 rounded-full flex items-center justify-center mr-3">
44
+ <i data-feather="leaf" class="text-white"></i>
45
+ </div>
46
+ <h1 class="text-2xl font-bold">CBD Gold Ecosystem</h1>
47
+ </div>
48
+ <button id="connectWalletBtn" class="bg-gradient-to-r from-green-400 to-green-600 px-6 py-2 rounded-full font-semibold hover:from-green-500 hover:to-green-700 transition-all">
49
+ Connect Wallet
50
+ </button>
51
+ </header>
52
+
53
+ <!-- Wallet Modal -->
54
+ <div id="walletModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
55
+ <div class="glass-card rounded-2xl p-6 max-w-md w-full" data-aos="zoom-in">
56
+ <div class="flex justify-between items-center mb-4">
57
+ <h3 class="text-xl font-bold">Wallet Connected</h3>
58
+ <button id="closeModalBtn" class="text-gray-400 hover:text-white">
59
+ <i data-feather="x"></i>
60
+ </button>
61
+ </div>
62
+ <div class="bg-black bg-opacity-30 rounded-lg p-4 mb-4">
63
+ <p class="text-sm text-gray-300 mb-1">Algorand Address:</p>
64
+ <p id="walletAddress" class="font-mono text-xs text-green-400 break-all">HEMP7X4A3QZXKJYB2NWVF8H5M9GTCR6PLQS1EUDKA8YW3V2TZRI4BJLM6A</p>
65
+ </div>
66
+ <div class="grid grid-cols-2 gap-4 text-sm mb-4">
67
+ <div>
68
+ <p class="text-gray-300">HEMP:</p>
69
+ <p class="text-green-400 font-bold">12,500,000</p>
70
+ <p class="text-xs text-gray-500">ASA: 2675148574</p>
71
+ </div>
72
+ <div>
73
+ <p class="text-gray-300">WEED:</p>
74
+ <p class="text-purple-400 font-bold">2,500</p>
75
+ <p class="text-xs text-gray-500">ASA: 2676316280</p>
76
+ </div>
77
+ <div>
78
+ <p class="text-gray-300">ALGO:</p>
79
+ <p class="text-blue-400 font-bold">150.00</p>
80
+ </div>
81
+ <div>
82
+ <p class="text-gray-300">USDC:</p>
83
+ <p class="text-yellow-400 font-bold">$1,250.00</p>
84
+ </div>
85
+ </div>
86
+ <button id="disconnectWalletBtn" class="w-full bg-gradient-to-r from-red-500 to-red-600 py-2 rounded-lg font-semibold hover:from-red-600 hover:to-red-700 transition-all">
87
+ Disconnect Wallet
88
+ </button>
89
+ </div>
90
+ </div>
91
+
92
+ <!-- Navigation Tabs -->
93
+ <div class="flex flex-wrap gap-2 mb-8">
94
+ <button data-tab="dashboard" class="tab-btn active flex items-center space-x-2 px-6 py-3 rounded-lg font-semibold bg-gradient-to-r from-green-400 to-green-600 text-black shadow-lg transform scale-105">
95
+ <i data-feather="home"></i>
96
+ <span>Dashboard</span>
97
+ </button>
98
+ <button data-tab="vapes" class="tab-btn flex items-center space-x-2 px-6 py-3 rounded-lg font-semibold bg-gray-800 text-gray-300 hover:bg-gray-700 hover:text-white">
99
+ <i data-feather="shopping-bag"></i>
100
+ <span>CBD Vapes</span>
101
+ </button>
102
+ <button data-tab="staking" class="tab-btn flex items-center space-x-2 px-6 py-3 rounded-lg font-semibold bg-gray-800 text-gray-300 hover:bg-gray-700 hover:text-white">
103
+ <i data-feather="lock"></i>
104
+ <span>Staking</span>
105
+ </button>
106
+ <button data-tab="governance" class="tab-btn flex items-center space-x-2 px-6 py-3 rounded-lg font-semibold bg-gray-800 text-gray-300 hover:bg-gray-700 hover:text-white">
107
+ <i data-feather="users"></i>
108
+ <span>Governance</span>
109
+ </button>
110
+ </div>
111
+
112
+ <!-- Content Sections -->
113
+ <div id="contentSections">
114
+ <!-- Dashboard Section -->
115
+ <div id="dashboardSection" class="space-y-8">
116
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
117
+ <div class="glass-card rounded-2xl p-6">
118
+ <div class="flex items-center justify-between mb-4">
119
+ <h3 class="text-xl font-bold text-white flex items-center">
120
+ <i data-feather="leaf" class="mr-2 text-green-400"></i>
121
+ Multi-Token Wallet
122
+ </h3>
123
+ <button id="disconnectBtn" class="text-sm text-red-400 hover:text-red-300 hidden">
124
+ Disconnect
125
+ </button>
126
+ </div>
127
+ <div class="bg-black bg-opacity-30 rounded-lg p-4 space-y-3">
128
+ <div>
129
+ <p class="text-sm text-gray-300">Algorand Address:</p>
130
+ <p id="addressDisplay" class="font-mono text-xs text-green-400 break-all"></p>
131
+ </div>
132
+ <div class="grid grid-cols-2 gap-4 text-sm">
133
+ <div>
134
+ <p class="text-gray-300">HEMP:</p>
135
+ <p id="hempBalance" class="text-green-400 font-bold">0</p>
136
+ <p class="text-xs text-gray-500">ASA: 2675148574</p>
137
+ </div>
138
+ <div>
139
+ <p class="text-gray-300">WEED:</p>
140
+ <p id="weedBalance" class="text-purple-400 font-bold">0</p>
141
+ <p class="text-xs text-gray-500">ASA: 2676316280</p>
142
+ </div>
143
+ <div>
144
+ <p class="text-gray-300">ALGO:</p>
145
+ <p id="algoBalance" class="text-blue-400 font-bold">0.00</p>
146
+ </div>
147
+ <div>
148
+ <p class="text-gray-300">USDC:</p>
149
+ <p id="usdcBalance" class="text-yellow-400 font-bold">$0.00</p>
150
+ </div>
151
+ </div>
152
+ </div>
153
+ </div>
154
+
155
+ <div class="glass-card rounded-2xl p-6">
156
+ <div class="flex items-center justify-between mb-4">
157
+ <h3 class="text-xl font-bold text-white flex items-center">
158
+ <i data-feather="award" class="mr-2 text-orange-400"></i>
159
+ Staking Tier Status
160
+ </h3>
161
+ </div>
162
+ <div id="tierDisplay" class="bg-gradient-to-r from-gray-600 to-gray-700 rounded-lg p-4 mb-3">
163
+ <div class="flex items-center justify-between">
164
+ <div>
165
+ <p class="text-black font-bold text-lg">None Tier</p>
166
+ <p class="text-black/80 text-sm">0% Off • 0% APY</p>
167
+ </div>
168
+ <i data-feather="award" class="text-black"></i>
169
+ </div>
170
+ </div>
171
+ <div class="text-sm space-y-1">
172
+ <div class="flex justify-between">
173
+ <span class="text-gray-300">Staked HEMP:</span>
174
+ <span id="stakedBalance" class="text-green-400">0</span>
175
+ </div>
176
+ <div class="flex justify-between">
177
+ <span class="text-gray-300">Shipping:</span>
178
+ <span id="shippingStatus" class="text-blue-400">Standard</span>
179
+ </div>
180
+ <div class="flex justify-between">
181
+ <span class="text-gray-300">Voting Power:</span>
182
+ <span id="votingPower" class="text-purple-400">0</span>
183
+ </div>
184
+ </div>
185
+ </div>
186
+ </div>
187
+
188
+ <div class="grid grid-cols-1 md:grid-cols-4 gap-6">
189
+ <div class="glass-card rounded-2xl p-6">
190
+ <div class="flex items-center justify-between">
191
+ <div>
192
+ <p class="text-gray-300 text-sm">Available HEMP</p>
193
+ <p id="availableHemp" class="text-3xl font-bold text-green-400">0</p>
194
+ <p class="text-xs text-gray-400">Ready to spend</p>
195
+ </div>
196
+ <i data-feather="leaf" class="text-green-400"></i>
197
+ </div>
198
+ </div>
199
+
200
+ <div class="glass-card rounded-2xl p-6">
201
+ <div class="flex items-center justify-between">
202
+ <div>
203
+ <p class="text-gray-300 text-sm">Staked HEMP</p>
204
+ <p id="stakedHemp" class="text-3xl font-bold text-blue-400">0</p>
205
+ <p id="apyDisplay" class="text-xs text-gray-400">Earning 0% APY</p>
206
+ </div>
207
+ <i data-feather="lock" class="text-blue-400"></i>
208
+ </div>
209
+ </div>
210
+
211
+ <div class="glass-card rounded-2xl p-6">
212
+ <div class="flex items-center justify-between">
213
+ <div>
214
+ <p class="text-gray-300 text-sm">WEED Governance</p>
215
+ <p id="weedGov" class="text-3xl font-bold text-purple-400">0</p>
216
+ <p id="votesDisplay" class="text-xs text-gray-400">0 votes</p>
217
+ </div>
218
+ <i data-feather="users" class="text-purple-400"></i>
219
+ </div>
220
+ </div>
221
+
222
+ <div class="glass-card rounded-2xl p-6">
223
+ <div class="flex items-center justify-between">
224
+ <div>
225
+ <p class="text-gray-300 text-sm">LP Contributions</p>
226
+ <p class="text-3xl font-bold text-yellow-400">0</p>
227
+ <p class="text-xs text-gray-400">ALGO & USDC pools</p>
228
+ </div>
229
+ <i data-feather="trending-up" class="text-yellow-400"></i>
230
+ </div>
231
+ </div>
232
+ </div>
233
+ </div>
234
+
235
+ <!-- Vapes Section (hidden by default) -->
236
+ <div id="vapesSection" class="space-y-8 hidden">
237
+ <div class="text-center">
238
+ <h2 class="text-3xl font-bold text-white mb-2">CBD Gold 510 Ceramic Vapes</h2>
239
+ <p class="text-gray-300">Premium CBD 510 ceramic vapes with 66.6% CBD potency</p>
240
+ <div class="flex justify-center items-center space-x-4 mt-4">
241
+ <div id="currentTierBadge" class="px-4 py-2 rounded-lg bg-gradient-to-r from-gray-600 to-gray-700">
242
+ <span class="text-white font-semibold">None Tier - 0% Off All Vapes</span>
243
+ </div>
244
+ </div>
245
+ </div>
246
+
247
+ <div id="spinResult" class="glass-card rounded-2xl p-6 text-center hidden">
248
+ <h3 class="text-xl font-bold text-white mb-4">🎰 Spin Result - Verified on Algorand!</h3>
249
+ <div class="bg-black bg-opacity-30 rounded-lg p-4">
250
+ <p id="spinResultText" class="font-bold"></p>
251
+ </div>
252
+ </div>
253
+
254
+ <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
255
+ <!-- Vape cards will be inserted here by JavaScript -->
256
+ </div>
257
+ </div>
258
+
259
+ <!-- Staking Section (hidden by default) -->
260
+ <div id="stakingSection" class="space-y-8 hidden">
261
+ <div class="text-center">
262
+ <h2 class="text-3xl font-bold text-white mb-2">HEMP Token Staking Tiers</h2>
263
+ <p class="text-gray-300">Stake HEMP tokens to unlock tiered discounts and exclusive benefits</p>
264
+ </div>
265
+
266
+ <div class="grid grid-cols-1 md:grid-cols-3 gap-6">
267
+ <!-- Staking pools will be inserted here by JavaScript -->
268
+ </div>
269
+ </div>
270
+
271
+ <!-- Governance Section (hidden by default) -->
272
+ <div id="governanceSection" class="space-y-8 hidden">
273
+ <div class="text-center">
274
+ <h2 class="text-3xl font-bold text-white mb-2">WEED Governance</h2>
275
+ <p class="text-gray-300">Participate in platform governance with your WEED tokens</p>
276
+ </div>
277
+
278
+ <div class="glass-card rounded-2xl p-6">
279
+ <div class="flex items-center justify-between mb-4">
280
+ <h3 class="text-xl font-bold text-white flex items-center">
281
+ <i data-feather="users" class="mr-2 text-purple-400"></i>
282
+ Active Proposals
283
+ </h3>
284
+ <span id="votingPowerDisplay" class="text-sm text-purple-400">Voting Power: 0</span>
285
+ </div>
286
+
287
+ <div class="space-y-4">
288
+ <!-- Proposals will be inserted here by JavaScript -->
289
+ </div>
290
+ </div>
291
+ </div>
292
+ </div>
293
+ </div>
294
+
295
+ <script>
296
+ // Initialize AOS animations
297
+ AOS.init({
298
+ duration: 800,
299
+ easing: 'ease-in-out',
300
+ once: true
301
+ });
302
+
303
+ // Initialize Feather Icons
304
+ feather.replace();
305
+
306
+ // App State
307
+ const state = {
308
+ walletConnected: false,
309
+ algorandAddress: '',
310
+ hempTokenBalance: 0,
311
+ weedTokenBalance: 0,
312
+ algoBalance: 0,
313
+ usdcBalance: 0,
314
+ stakedTokens: 0,
315
+ activeTab: 'dashboard',
316
+ stakingAmount: '',
317
+ isSpinning: false,
318
+ spinResult: null,
319
+ HEMP_ASA_ID: 2675148574,
320
+ WEED_ASA_ID: 2676316280,
321
+ VAULT_ADDRESS: '420vault.algo'
322
+ };
323
+
324
+ // CBD Vapes Data
325
+ const cbdVapes = [
326
+ {
327
+ id: 1,
328
+ name: 'Northern Lights CBD',
329
+ strain: 'Northern Lights',
330
+ type: 'Indica-dominant',
331
+ flavor: 'Sweet Pine & Earth',
332
+ effects: 'Deeply Relaxing',
333
+ priceAlgo: 15,
334
+ priceUsdc: 45.99,
335
+ hempEarned: 90000,
336
+ potency: '66.6% CBD',
337
+ terpenes: ['Myrcene', 'Pinene', 'Caryophyllene'],
338
+ color: 'from-purple-500 to-indigo-600',
339
+ emoji: '🌌'
340
+ },
341
+ {
342
+ id: 2,
343
+ name: 'Sour Diesel CBD',
344
+ strain: 'Sour Diesel',
345
+ type: 'Sativa-dominant',
346
+ flavor: 'Citrus Fuel & Herbs',
347
+ effects: 'Energizing Focus',
348
+ priceAlgo: 16,
349
+ priceUsdc: 47.99,
350
+ hempEarned: 95000,
351
+ potency: '66.6% CBD',
352
+ terpenes: ['Limonene', 'Caryophyllene', 'Myrcene'],
353
+ color: 'from-yellow-500 to-orange-600',
354
+ emoji: '⚡'
355
+ },
356
+ {
357
+ id: 3,
358
+ name: 'OG Kush CBD',
359
+ strain: 'OG Kush',
360
+ type: 'Hybrid',
361
+ flavor: 'Earthy Lemon Pine',
362
+ effects: 'Balanced Euphoria',
363
+ priceAlgo: 17,
364
+ priceUsdc: 49.99,
365
+ hempEarned: 100000,
366
+ potency: '66.6% CBD',
367
+ terpenes: ['Myrcene', 'Limonene', 'Caryophyllene'],
368
+ color: 'from-green-500 to-emerald-600',
369
+ emoji: '👑'
370
+ }
371
+ ];
372
+
373
+ // Staking Pools Data
374
+ const stakingPools = [
375
+ {
376
+ id: 1,
377
+ name: 'Bronze Tier',
378
+ minStake: 100000,
379
+ discount: 20,
380
+ apy: 3,
381
+ shipping: 'Faster',
382
+ benefits: ['20% off CBD Gold Vapes', 'Faster shipping', 'Community access'],
383
+ color: 'from-orange-400 to-orange-600'
384
+ },
385
+ {
386
+ id: 2,
387
+ name: 'Silver Tier',
388
+ minStake: 500000,
389
+ discount: 30,
390
+ apy: 5,
391
+ shipping: 'Faster',
392
+ benefits: ['30% off CBD Gold Vapes', 'Faster shipping', 'Exclusive strains', 'New releases'],
393
+ color: 'from-gray-300 to-gray-500'
394
+ },
395
+ {
396
+ id: 3,
397
+ name: 'Gold Tier',
398
+ minStake: 1000000,
399
+ discount: 50,
400
+ apy: 10,
401
+ shipping: 'Priority',
402
+ benefits: ['50% off CBD Gold Vapes', 'Priority shipping', 'VIP event tickets', 'All exclusive access'],
403
+ color: 'from-yellow-400 to-yellow-600'
404
+ }
405
+ ];
406
+
407
+ // Governance Proposals Data
408
+ const governanceProposals = [
409
+ {
410
+ id: 1,
411
+ title: 'New Strain: Zkittlez CBD',
412
+ description: 'Vote to add Zkittlez-inspired terpene profile with 66.6% CBD potency',
413
+ status: 'Active',
414
+ timeLeft: '5 days',
415
+ weedRequired: 1
416
+ },
417
+ {
418
+ id: 2,
419
+ title: 'Limited Edition: 24K Gold Hardware',
420
+ description: 'Propose gold-plated ceramic tips for premium tier members',
421
+ status: 'Active',
422
+ timeLeft: '12 days',
423
+ weedRequired: 2.5
424
+ }
425
+ ];
426
+
427
+ // DOM Elements
428
+ const connectWalletBtn = document.getElementById('connectWalletBtn');
429
+ const disconnectWalletBtn = document.getElementById('disconnectWalletBtn');
430
+ const disconnectBtn = document.getElementById('disconnectBtn');
431
+ const walletModal = document.getElementById('walletModal');
432
+ const closeModalBtn = document.getElementById('closeModalBtn');
433
+ const addressDisplay = document.getElementById('addressDisplay');
434
+ const walletAddress = document.getElementById('walletAddress');
435
+ const hempBalance = document.getElementById('hempBalance');
436
+ const weedBalance = document.getElementById('weedBalance');
437
+ const algoBalance = document.getElementById('algoBalance');
438
+ const usdcBalance = document.getElementById('usdcBalance');
439
+ const tierDisplay = document.getElementById('tierDisplay');
440
+ const stakedBalance = document.getElementById('stakedBalance');
441
+ const shippingStatus = document.getElementById('shippingStatus');
442
+ const votingPower = document.getElementById('votingPower');
443
+ const availableHemp = document.getElementById('availableHemp');
444
+ const stakedHemp = document.getElementById('stakedHemp');
445
+ const apyDisplay = document.getElementById('apyDisplay');
446
+ const weedGov = document.getElementById('weedGov');
447
+ const votesDisplay = document.getElementById('votesDisplay');
448
+ const currentTierBadge = document.getElementById('currentTierBadge');
449
+ const spinResult = document.getElementById('spinResult');
450
+ const spinResultText = document.getElementById('spinResultText');
451
+ const votingPowerDisplay = document.getElementById('votingPowerDisplay');
452
+ const tabButtons = document.querySelectorAll('.tab-btn');
453
+ const contentSections = document.getElementById('contentSections');
454
+ const dashboardSection = document.getElementById('dashboardSection');
455
+ const vapesSection = document.getElementById('vapesSection');
456
+ const stakingSection = document.getElementById('stakingSection');
457
+ const governanceSection = document.getElementById('governanceSection');
458
+ const vapesContainer = document.querySelector('#vapesSection > div:last-child');
459
+ const stakingContainer = document.querySelector('#stakingSection > div:last-child');
460
+ const governanceContainer = document.querySelector('#governanceSection > div:last-child > div:last-child');
461
+
462
+ // Helper Functions
463
+ function formatNumber(num) {
464
+ return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
465
+ }
466
+
467
+ function calculateStakingTier(stakedAmount) {
468
+ if (stakedAmount >= 1000000) return {
469
+ name: 'Gold',
470
+ discount: 50,
471
+ apy: 10,
472
+ shipping: 'Priority',
473
+ color: 'from-yellow-400 to-yellow-600'
474
+ };
475
+ if (stakedAmount >= 500000) return {
476
+ name: 'Silver',
477
+ discount: 30,
478
+ apy: 5,
479
+ shipping: 'Faster',
480
+ color: 'from-gray-300 to-gray-500'
481
+ };
482
+ if (stakedAmount >= 100000) return {
483
+ name: 'Bronze',
484
+ discount: 20,
485
+ apy: 3,
486
+ shipping: 'Faster',
487
+ color: 'from-orange-400 to-orange-600'
488
+ };
489
+ return {
490
+ name: 'None',
491
+ discount: 0,
492
+ apy: 0,
493
+ shipping: 'Standard',
494
+ color: 'from-gray-600 to-gray-700'
495
+ };
496
+ }
497
+
498
+ function updateUI() {
499
+ const currentStakingTier = calculateStakingTier(state.stakedTokens);
500
+
501
+ // Update dashboard
502
+ addressDisplay.textContent = state.algorandAddress || 'Not connected';
503
+ walletAddress.textContent = state.algorandAddress || 'Not connected';
504
+ hempBalance.textContent = formatNumber(state.hempTokenBalance);
505
+ weedBalance.textContent = formatNumber(state.weedTokenBalance);
506
+ algoBalance.textContent = state.algoBalance.toFixed(2);
507
+ usdcBalance.textContent = `$${state.usdcBalance.toFixed(2)}`;
508
+
509
+ // Update tier display
510
+ tierDisplay.className = `bg-gradient-to-r ${currentStakingTier.color} rounded-lg p-4 mb-3`;
511
+ tierDisplay.innerHTML = `
512
+ <div class="flex items-center justify-between">
513
+ <div>
514
+ <p class="text-black font-bold text-lg">${currentStakingTier.name} Tier</p>
515
+ <p class="text-black/80 text-sm">${currentStakingTier.discount}% Off • ${currentStakingTier.apy}% APY</p>
516
+ </div>
517
+ <i data-feather="award" class="text-black"></i>
518
+ </div>
519
+ `;
520
+
521
+ stakedBalance.textContent = formatNumber(state.stakedTokens);
522
+ shippingStatus.textContent = currentStakingTier.shipping;
523
+ votingPower.textContent = formatNumber(Math.floor(state.weedTokenBalance / 0.001));
524
+ availableHemp.textContent = (state.hempTokenBalance / 1000000).toFixed(1) + 'M';
525
+ stakedHemp.textContent = (state.stakedTokens / 1000000).toFixed(1) + 'M';
526
+ apyDisplay.textContent = `Earning ${currentStakingTier.apy}% APY`;
527
+ weedGov.textContent = formatNumber(state.weedTokenBalance);
528
+ votesDisplay.textContent = `${formatNumber(Math.floor(state.weedTokenBalance / 0.001))} votes`;
529
+ currentTierBadge.className = `px-4 py-2 rounded-lg bg-gradient-to-r ${currentStakingTier.color}`;
530
+ currentTierBadge.innerHTML = `<span class="text-black font-semibold">${currentStakingTier.name} Tier - ${currentStakingTier.discount}% Off All Vapes</span>`;
531
+ votingPowerDisplay.textContent = `Voting Power: ${formatNumber(Math.floor(state.weedTokenBalance / 0.001))}`;
532
+
533
+ // Update vapes section
534
+ renderVapes();
535
+
536
+ // Update staking section
537
+ renderStakingPools();
538
+
539
+ // Update governance section
540
+ renderGovernanceProposals();
541
+
542
+ // Update tab states
543
+ updateTabStates();
544
+
545
+ // Update wallet connection state
546
+ updateWalletConnectionState();
547
+
548
+ // Refresh feather icons
549
+ feather.replace();
550
+ }
551
+
552
+ function updateTabStates() {
553
+ tabButtons.forEach(button => {
554
+ const tab = button.getAttribute('data-tab');
555
+ if (tab === state.activeTab) {
556
+ button.classList.remove('bg-gray-800', 'text-gray-300', 'hover:bg-gray-700', 'hover:text-white');
557
+ button.classList.add('bg-gradient-to-r', 'from-green-400', 'to-green-600', 'text-black', 'shadow-lg', 'transform', 'scale-105');
558
+ } else {
559
+ button.classList.remove('bg-gradient-to-r', 'from-green-400', 'to-green-600', 'text-black', 'shadow-lg', 'transform', 'scale-105');
560
+ button.classList.add('bg-gray-800', 'text-gray-300', 'hover:bg-gray-700', 'hover:text-white');
561
+ }
562
+ });
563
+ }
564
+
565
+ function updateWalletConnectionState() {
566
+ if (state.walletConnected) {
567
+ connectWalletBtn.textContent = 'Wallet Connected';
568
+ connectWalletBtn.classList.remove('from-green-400', 'to-green-600', 'hover:from-green-500', 'hover:to-green-700');
569
+ connectWalletBtn.classList.add('from-blue-400', 'to-blue-600', 'hover:from-blue-500', 'hover:to-blue-700');
570
+ disconnectBtn.classList.remove('hidden');
571
+ } else {
572
+ connectWalletBtn.textContent = 'Connect Wallet';
573
+ connectWalletBtn.classList.remove('from-blue-400', 'to-blue-600', 'hover:from-blue-500', 'hover:to-blue-700');
574
+ connectWalletBtn.classList.add('from-green-400', 'to-green-600', 'hover:from-green-500', 'hover:to-green-700');
575
+ disconnectBtn.classList.add('hidden');
576
+ }
577
+ }
578
+
579
+ function renderVapes() {
580
+ vapesContainer.innerHTML = '';
581
+
582
+ cbdVapes.forEach(vape => {
583
+ const currentStakingTier = calculateStakingTier(state.stakedTokens);
584
+ const discountedAlgoPrice = vape.priceAlgo * (1 - currentStakingTier.discount / 100);
585
+ const discountedUsdcPrice = vape.priceUsdc * (1 - currentStakingTier.discount / 100);
586
+
587
+ const vapeCard = document.createElement('div');
588
+ vapeCard.className = 'glass-card rounded-2xl p-6 overflow-hidden relative';
589
+ vapeCard.innerHTML = `
590
+ <div class="absolute top-0 right-0 w-20 h-20 bg-gradient-to-br ${vape.color} opacity-20 rounded-full -mr-10 -mt-10"></div>
591
+ <div class="relative">
592
+ <div class="flex items-center justify-between mb-4">
593
+ <div class="text-3xl">${vape.emoji}</div>
594
+ <div class="px-3 py-1 rounded-full text-xs font-semibold ${
595
+ vape.type.includes('Indica') ? 'bg-purple-600 text-white' :
596
+ vape.type.includes('Sativa') ? 'bg-yellow-600 text-black' :
597
+ 'bg-green-600 text-white'
598
+ }">
599
+ ${vape.type}
600
+ </div>
601
+ </div>
602
+
603
+ <h3 class="font-bold text-white text-lg mb-1">${vape.name}</h3>
604
+ <p class="text-sm text-gray-300 mb-2">Based on ${vape.strain}</p>
605
+
606
+ <div class="bg-black bg-opacity-30 rounded-lg p-3 mb-4 space-y-2">
607
+ <div class="flex justify-between text-sm">
608
+ <span class="text-gray-300">Flavor:</span>
609
+ <span class="text-yellow-400">${vape.flavor}</span>
610
+ </div>
611
+ <div class="flex justify-between text-sm">
612
+ <span class="text-gray-300">Effects:</span>
613
+ <span class="text-green-400">${vape.effects}</span>
614
+ </div>
615
+ <div class="flex justify-between text-sm">
616
+ <span class="text-gray-300">Potency:</span>
617
+ <span class="text-blue-400 font-bold">${vape.potency}</span>
618
+ </div>
619
+ </div>
620
+
621
+ <div class="mb-4">
622
+ <p class="text-xs text-gray-400 mb-1">Key Terpenes:</p>
623
+ <div class="flex flex-wrap gap-1">
624
+ ${vape.terpenes.map(terpene => `
625
+ <span class="px-2 py-1 bg-green-600/30 text-green-300 text-xs rounded-full">
626
+ ${terpene}
627
+ </span>
628
+ `).join('')}
629
+ </div>
630
+ </div>
631
+
632
+ <div class="bg-black bg-opacity-30 rounded-lg p-3 mb-4">
633
+ <div class="text-center mb-2">
634
+ <p class="text-lg font-bold text-blue-400">${discountedAlgoPrice.toFixed(2)} ALGO</p>
635
+ <p class="text-lg font-bold text-yellow-400">$${discountedUsdcPrice.toFixed(2)} USDC</p>
636
+ ${currentStakingTier.discount > 0 ? `
637
+ <p class="text-xs text-green-400">(${currentStakingTier.discount}% ${currentStakingTier.name} discount applied)</p>
638
+ ` : ''}
639
+ </div>
640
+ <div class="text-xs text-center">
641
+ <p class="text-green-300">Earn: ${formatNumber(vape.hempEarned)} HEMP</p>
642
+ </div>
643
+ </div>
644
+
645
+ <div class="space-y-2">
646
+ <button
647
+ onclick="purchaseWithAlgo(${vape.id})"
648
+ ${state.algoBalance >= discountedAlgoPrice ? '' : 'disabled'}
649
+ class="w-full py-2 px-4 rounded-lg font-semibold transition-all duration-300 ${
650
+ state.algoBalance >= discountedAlgoPrice
651
+ ? 'bg-gradient-to-r from-blue-500 to-blue-600 text-white hover:from-blue-600 hover:to-blue-700'
652
+ : 'bg-gray-600 text-gray-400 cursor-not-allowed'
653
+ }"
654
+ >
655
+ <i data-feather="dollar-sign" class="inline mr-2"></i>
656
+ Buy with ALGO
657
+ </button>
658
+
659
+ <button
660
+ onclick="purchaseWithUsdc(${vape.id})"
661
+ ${state.usdcBalance >= discountedUsdcPrice ? '' : 'disabled'}
662
+ class="w-full py-2 px-4 rounded-lg font-semibold transition-all duration-300 ${
663
+ state.usdcBalance >= discountedUsdcPrice
664
+ ? 'bg-gradient-to-r from-yellow-500 to-yellow-600 text-black hover:from-yellow-600 hover:to-yellow-700'
665
+ : 'bg-gray-600 text-gray-400 cursor-not-allowed'
666
+ }"
667
+ >
668
+ <i data-feather="shopping-cart" class="inline mr-2"></i>
669
+ Buy with USDC
670
+ </button>
671
+
672
+ <button
673
+ onclick="spinForGold(${vape.id})"
674
+ ${state.isSpinning ? 'disabled' : ''}
675
+ class="w-full py-2 px-4 rounded-lg font-semibold transition-all duration-300 ${
676
+ state.isSpinning
677
+ ? 'bg-gray-600 text-gray-400 cursor-not-allowed'
678
+ : 'bg-gradient-to-r from-purple-500 to-pink-600 text-white hover:from-purple-600 hover:to-pink-700'
679
+ }"
680
+ >
681
+ <i data-feather="refresh-cw" class="inline mr-2 ${state.isSpinning ? 'spinning' : ''}"></i>
682
+ ${state.isSpinning ? 'SPINNING...' : 'SPIN FOR GOLD'}
683
+ </button>
684
+ </div>
685
+ </div>
686
+ `;
687
+
688
+ vapesContainer.appendChild(vapeCard);
689
+ });
690
+
691
+ feather.replace();
692
+ }
693
+
694
+ function renderStakingPools() {
695
+ stakingContainer.innerHTML = '';
696
+
697
+ stakingPools.forEach(pool => {
698
+ const poolCard = document.createElement('div');
699
+ poolCard.className = 'glass-card rounded-2xl p-6';
700
+ poolCard.innerHTML = `
701
+ <div class="text-center">
702
+ <div class="w-16 h-16 bg-gradient-to-br ${pool.color} rounded-full mx-auto mb-4 flex items-center justify-center">
703
+ <i data-feather="lock" class="text-white"></i>
704
+ </div>
705
+
706
+ <h3 class="font-bold text-white text-xl mb-2">${pool.name}</h3>
707
+
708
+ <div class="inline-block px-4 py-2 rounded-full mb-4 bg-gradient-to-r ${pool.color}">
709
+ <span class="text-black font-bold">${pool.discount}% OFF</span>
710
+ </div>
711
+
712
+ <div class="bg-black bg-opacity-30 rounded-lg p-3 mb-4">
713
+ <div class="text-sm space-y-2">
714
+ <div class="flex justify-between">
715
+ <span class="text-gray-300">Min Stake:</span>
716
+ <span class="text-green-400">${(pool.minStake / 1000000).toFixed(1)}M HEMP</span>
717
+ </div>
718
+ <div class="flex justify-between">
719
+ <span class="text-gray-300">APY:</span>
720
+ <span class="text-blue-400">${pool.apy}%</span>
721
+ </div>
722
+ <div class="flex justify-between">
723
+ <span class="text-gray-300">Shipping:</span>
724
+ <span class="text-purple-400">${pool.shipping}</span>
725
+ </div>
726
+ </div>
727
+ </div>
728
+
729
+ <div class="bg-black bg-opacity-30 rounded-lg p-3 mb-4">
730
+ <p class="text-xs text-gray-300 font-semibold mb-2">Benefits:</p>
731
+ <div class="space-y-1">
732
+ ${pool.benefits.map(benefit => `
733
+ <p class="text-xs text-yellow-400">• ${benefit}</p>
734
+ `).join('')}
735
+ </div>
736
+ </div>
737
+
738
+ <div class="space-y-3">
739
+ <input
740
+ type="number"
741
+ placeholder="Min ${(pool.minStake / 1000000).toFixed(1)}M HEMP"
742
+ id="stakingAmount${pool.id}"
743
+ class="w-full bg-black bg-opacity-30 border border-white/20 rounded-lg px-3 py-2 text-white placeholder-gray-400 text-sm"
744
+ />
745
+
746
+ <button
747
+ onclick="stakeTokens(${pool.id})"
748
+ class="w-full py-3 px-4 rounded-lg font-semibold transition-all duration-300 bg-gradient-to-r ${pool.color} text-black hover:opacity-90"
749
+ >
750
+ Stake HEMP Tokens
751
+ </button>
752
+ </div>
753
+ </div>
754
+ `;
755
+
756
+ stakingContainer.appendChild(poolCard);
757
+ });
758
+
759
+ feather.replace();
760
+ }
761
+
762
+ function renderGovernanceProposals() {
763
+ governanceContainer.innerHTML = '';
764
+
765
+ governanceProposals.forEach(proposal => {
766
+ const proposalCard = document.createElement('div');
767
+ proposalCard.className = 'glass-card rounded-lg p-4 mb-4';
768
+ proposalCard.innerHTML = `
769
+ <div class="flex justify-between items-start mb-2">
770
+ <h4 class="font-bold text-white">${proposal.title}</h4>
771
+ <span class="text-xs px-2 py-1 rounded-full ${
772
+ proposal.status === 'Active' ? 'bg-green-600 text-white' : 'bg-gray-600 text-gray-300'
773
+ }">
774
+ ${proposal.status}
775
+ </span>
776
+ </div>
777
+ <p class="text-sm text-gray-300 mb-3">${proposal.description}</p>
778
+ <div class="flex justify-between items-center text-xs">
779
+ <span class="text-gray-400">${proposal.timeLeft} left</span>
780
+ <div>
781
+ <span class="text-purple-400 mr-2">${proposal.weedRequired} WEED to vote</span>
782
+ <button
783
+ onclick="voteOnProposal(${proposal.id})"
784
+ ${state.weedTokenBalance >= proposal.weedRequired ? '' : 'disabled'}
785
+ class="px-3 py-1 rounded-full text-xs font-semibold ${
786
+ state.weedTokenBalance >= proposal.weedRequired
787
+ ? 'bg-purple-600 text-white hover:bg-purple-700'
788
+ : 'bg-gray-600 text-gray-400 cursor-not-allowed'
789
+ }"
790
+ >
791
+ Vote
792
+ </button>
793
+ </div>
794
+ </div>
795
+ `;
796
+
797
+ governanceContainer.appendChild(proposalCard);
798
+ });
799
+ }
800
+
801
+ // Event Handlers
802
+ function connectWallet() {
803
+ const mockAddress = 'HEMP7X4A3QZXKJYB2NWVF8H5M9GTCR6PLQS1EUDKA8YW3V2TZRI4BJLM6A';
804
+
805
+ state.walletConnected = true;
806
+ state.algorandAddress = mockAddress;
807
+ state.hempTokenBalance = 12500000;
808
+ state.weedTokenBalance = 2500;
809
+ state.algoBalance = 150;
810
+ state.usdcBalance = 1250;
811
+ state.stakedTokens = 500000;
812
+
813
+ walletModal.classList.remove('hidden');
814
+ updateUI();
815
+ }
816
+
817
+ function disconnectWallet() {
818
+ state.walletConnected = false;
819
+ state.algorandAddress = '';
820
+ state.hempTokenBalance = 0;
821
+ state.weedTokenBalance = 0;
822
+ state.algoBalance = 0;
823
+ state.usdcBalance = 0;
824
+ state.stakedTokens = 0;
825
+
826
+ walletModal.classList.add('hidden');
827
+ updateUI();
828
+ }
829
+
830
+ function switchTab(tab) {
831
+ state.activeTab = tab;
832
+
833
+ dashboardSection.classList.add('hidden');
834
+ vapesSection.classList.add('hidden');
835
+ stakingSection.classList.add('hidden');
836
+ governanceSection.classList.add('hidden');
837
+
838
+ if (tab === 'dashboard') dashboardSection.classList.remove('hidden');
839
+ if (tab === 'vapes') vapesSection.classList.remove('hidden');
840
+ if (tab === 'staking') stakingSection.classList.remove('hidden');
841
+ if (tab === 'governance') governanceSection.classList.remove('hidden');
842
+
843
+ updateTabStates();
844
+ }
845
+
846
+ function purchaseWithAlgo(vapeId) {
847
+ const vape = cbdVapes.find(v => v.id === vapeId);
848
+ const currentStakingTier = calculateStakingTier(state.stakedTokens);
849
+ const discountedPrice = vape.priceAlgo * (1 - currentStakingTier.discount / 100);
850
+
851
+ if (state.algoBalance >= discountedPrice) {
852
+ state.algoBalance -= discountedPrice;
853
+ state.hempTokenBalance += vape.hempEarned;
854
+
855
+ alert(`Purchased ${vape.name} with ALGO!\n\nCost: ${discountedPrice.toFixed(2)} ALGO (${currentStakingTier.discount}% ${currentStakingTier.name} discount)\nEarned: ${formatNumber(vape.hempEarned)} HEMP\nLP Contribution: ALGO/HEMP pool\nShipping: ${currentStakingTier.shipping}`);
856
+ updateUI();
857
+ } else {
858
+ alert(`Insufficient ALGO! Need ${discountedPrice.toFixed(2)} ALGO`);
859
+ }
860
+ }
861
+
862
+ function purchaseWithUsdc(vapeId) {
863
+ const vape = cbdVapes.find(v => v.id === vapeId);
864
+ const currentStakingTier = calculateStakingTier(state.stakedTokens);
865
+ const discountedPrice = vape.priceUsdc * (1 - currentStakingTier.discount / 100);
866
+
867
+ if (state.usdcBalance >= discountedPrice) {
868
+ state.usdcBalance -= discountedPrice;
869
+ state.hempTokenBalance += vape.hempEarned;
870
+
871
+ alert(`Purchased ${vape.name} with USDC!\n\nCost: $${discountedPrice.toFixed(2)} USDC (${currentStakingTier.discount}% ${currentStakingTier.name} discount)\nEarned: ${formatNumber(vape.hempEarned)} HEMP\nLP Contribution: USDC/HEMP pool\nWEED tokens purchased for ${state.VAULT_ADDRESS}\nShipping: ${currentStakingTier.shipping}`);
872
+ updateUI();
873
+ } else {
874
+ alert(`Insufficient USDC! Need $${discountedPrice.toFixed(2)} USDC`);
875
+ }
876
+ }
877
+
878
+ function spinForGold(vapeId) {
879
+ if (state.isSpinning) return;
880
+
881
+ state.isSpinning = true;
882
+ state.spinResult = null;
883
+ spinResult.classList.add('hidden');
884
+ updateUI();
885
+
886
+ setTimeout(() => {
887
+ const outcomes = [
888
+ { type: 'hemp', amount: 50000, probability: 0.4 },
889
+ { type: 'hemp', amount: 100000, probability: 0.25 },
890
+ { type: 'hemp', amount: 200000, probability: 0.15 },
891
+ { type: 'discount', amount: 10, probability: 0.1 },
892
+ { type: 'discount', amount: 25, probability: 0.05 },
893
+ { type: 'jackpot', amount: 1000000, probability: 0.05 }
894
+ ];
895
+
896
+ const random = Math.random();
897
+ let cumulative = 0;
898
+
899
+ for (let outcome of outcomes) {
900
+ cumulative += outcome.probability;
901
+ if (random <= cumulative) {
902
+ if (outcome.type === 'hemp' || outcome.type === 'jackpot') {
903
+ state.hempTokenBalance += outcome.amount;
904
+ }
905
+ state.spinResult = outcome;
906
+ break;
907
+ }
908
+ }
909
+
910
+ state.isSpinning = false;
911
+
912
+ // Show spin result
913
+ if (state.spinResult) {
914
+ if (state.spinResult.type === 'hemp') {
915
+ spinResultText.textContent = `Won ${formatNumber(state.spinResult.amount)} HEMP tokens!`;
916
+ spinResultText.className = 'font-bold text-green-400';
917
+ } else if (state.spinResult.type === 'discount') {
918
+ spinResultText.textContent = `Won ${state.spinResult.amount}% additional discount!`;
919
+ spinResultText.className = 'font-bold text-yellow-400';
920
+ } else if (state.spinResult.type === 'jackpot') {
921
+ spinResultText.textContent = `🎉 JACKPOT! Won ${formatNumber(state.spinResult.amount)} HEMP tokens!`;
922
+ spinResultText.className = 'font-bold text-purple-400';
923
+ }
924
+
925
+ spinResult.classList.remove('hidden');
926
+ }
927
+
928
+ updateUI();
929
+ }, 3000);
930
+ }
931
+
932
+ function stakeTokens(poolId) {
933
+ const pool = stakingPools.find(p => p.id === poolId);
934
+ const amount = parseInt(document.getElementById(`stakingAmount${poolId}`).value);
935
+
936
+ if (amount && amount <= state.hempTokenBalance && amount >= pool.minStake) {
937
+ state.hempTokenBalance -= amount;
938
+ state.stakedTokens += amount;
939
+
940
+ alert(`Successfully staked ${formatNumber(amount)} HEMP tokens!\n\nTier: ${pool.name}\nDiscount: ${pool.discount}% off CBD Gold Vapes\nAPY: ${pool.apy}% HEMP\nShipping: ${pool.shipping}\nBenefits unlocked: ${pool.benefits.join(', ')}`);
941
+ updateUI();
942
+ } else {
943
+ alert('Invalid staking amount or insufficient balance!');
944
+ }
945
+ }
946
+
947
+ function voteOnProposal(proposalId) {
948
+ const proposal = governanceProposals.find(p => p.id === proposalId);
949
+
950
+ if (state.weedTokenBalance >= proposal.weedRequired) {
951
+ state.weedTokenBalance -= proposal.weedRequired;
952
+ alert(`Voted on proposal: ${proposal.title}\n\n${proposal.weedRequired} WEED tokens used for voting`);
953
+ updateUI();
954
+ } else {
955
+ alert(`You need at least ${proposal.weedRequired} WEED tokens to vote on this proposal`);
956
+ }
957
+ }
958
+
959
+ // Global functions for button clicks
960
+ window.purchaseWithAlgo = purchaseWithAlgo;
961
+ window.purchaseWithUsdc = purchaseWithUsdc;
962
+ window.spinForGold = spinForGold;
963
+ window.stakeTokens = stakeTokens;
964
+ window.voteOnProposal = voteOnProposal;
965
+
966
+ // Event Listeners
967
+ connectWalletBtn.addEventListener('click', connectWallet);
968
+ disconnectWalletBtn.addEventListener('click', disconnectWallet);
969
+ disconnectBtn.addEventListener('click', disconnectWallet);
970
+ closeModalBtn.addEventListener('click', () => walletModal.classList.add('hidden'));
971
+
972
+ tabButtons.forEach(button => {
973
+ button.addEventListener('click', () => {
974
+ const tab = button.getAttribute('data-tab');
975
+ switchTab(tab);
976
+ });
977
+ });
978
+
979
+ // Initialize UI
980
+ updateUI();
981
+ </script>
982
+ </body>
983
  </html>
prompts.txt ADDED
@@ -0,0 +1,581 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React, { useState } from 'react';
2
+ import { Wallet, Coins, Gift, Lock, Star, ShoppingCart, Users, TrendingUp, Award, Zap, Crown, Shield, Leaf, Flame, Dice1 } from 'lucide-react';
3
+
4
+ const HempTokenCBDPlatform = () => {
5
+ const [walletConnected, setWalletConnected] = useState(false);
6
+ const [algorandAddress, setAlgorandAddress] = useState('');
7
+ const [hempTokenBalance, setHempTokenBalance] = useState(0);
8
+ const [weedTokenBalance, setWeedTokenBalance] = useState(0);
9
+ const [algoBalance, setAlgoBalance] = useState(0);
10
+ const [usdcBalance, setUsdcBalance] = useState(0);
11
+ const [stakedTokens, setStakedTokens] = useState(500000);
12
+ const [activeTab, setActiveTab] = useState('dashboard');
13
+ const [stakingAmount, setStakingAmount] = useState('');
14
+ const [isSpinning, setIsSpinning] = useState(false);
15
+ const [spinResult, setSpinResult] = useState(null);
16
+
17
+ // Algorand ASA Information
18
+ const HEMP_ASA_ID = 2675148574;
19
+ const WEED_ASA_ID = 2676316280;
20
+ const VAULT_ADDRESS = '420vault.algo';
21
+
22
+ // Mock Algorand wallet connection
23
+ const connectAlgoWallet = async () => {
24
+ try {
25
+ const mockAddress = 'HEMP7X4A3QZXKJYB2NWVF8H5M9GTCR6PLQS1EUDKA8YW3V2TZRI4BJLM6A';
26
+ setAlgorandAddress(mockAddress);
27
+ setWalletConnected(true);
28
+ setHempTokenBalance(12500000);
29
+ setWeedTokenBalance(2500);
30
+ setAlgoBalance(150);
31
+ setUsdcBalance(1250);
32
+ } catch (error) {
33
+ console.error('Wallet connection failed:', error);
34
+ }
35
+ };
36
+
37
+ const disconnectWallet = () => {
38
+ setWalletConnected(false);
39
+ setAlgorandAddress('');
40
+ setHempTokenBalance(0);
41
+ setWeedTokenBalance(0);
42
+ };
43
+
44
+ // Calculate staking tier based on staked amount
45
+ const calculateStakingTier = (stakedAmount) => {
46
+ if (stakedAmount >= 1000000) return { name: 'Gold', discount: 50, apy: 10, shipping: 'Priority', color: 'from-yellow-400 to-yellow-600' };
47
+ if (stakedAmount >= 500000) return { name: 'Silver', discount: 30, apy: 5, shipping: 'Faster', color: 'from-gray-300 to-gray-500' };
48
+ if (stakedAmount >= 100000) return { name: 'Bronze', discount: 20, apy: 3, shipping: 'Faster', color: 'from-orange-400 to-orange-600' };
49
+ return { name: 'None', discount: 0, apy: 0, shipping: 'Standard', color: 'from-gray-600 to-gray-700' };
50
+ };
51
+
52
+ const currentStakingTier = calculateStakingTier(stakedTokens);
53
+
54
+ // CBD Gold 510 ceramic vapes
55
+ const cbdVapes = [
56
+ {
57
+ id: 1,
58
+ name: 'Northern Lights CBD',
59
+ strain: 'Northern Lights',
60
+ type: 'Indica-dominant',
61
+ flavor: 'Sweet Pine & Earth',
62
+ effects: 'Deeply Relaxing',
63
+ priceAlgo: 15,
64
+ priceUsdc: 45.99,
65
+ hempEarned: 90000,
66
+ potency: '66.6% CBD',
67
+ terpenes: ['Myrcene', 'Pinene', 'Caryophyllene'],
68
+ color: 'from-purple-500 to-indigo-600',
69
+ emoji: '🌌'
70
+ },
71
+ {
72
+ id: 2,
73
+ name: 'Sour Diesel CBD',
74
+ strain: 'Sour Diesel',
75
+ type: 'Sativa-dominant',
76
+ flavor: 'Citrus Fuel & Herbs',
77
+ effects: 'Energizing Focus',
78
+ priceAlgo: 16,
79
+ priceUsdc: 47.99,
80
+ hempEarned: 95000,
81
+ potency: '66.6% CBD',
82
+ terpenes: ['Limonene', 'Caryophyllene', 'Myrcene'],
83
+ color: 'from-yellow-500 to-orange-600',
84
+ emoji: '⚡'
85
+ },
86
+ {
87
+ id: 3,
88
+ name: 'OG Kush CBD',
89
+ strain: 'OG Kush',
90
+ type: 'Hybrid',
91
+ flavor: 'Earthy Lemon Pine',
92
+ effects: 'Balanced Euphoria',
93
+ priceAlgo: 17,
94
+ priceUsdc: 49.99,
95
+ hempEarned: 100000,
96
+ potency: '66.6% CBD',
97
+ terpenes: ['Myrcene', 'Limonene', 'Caryophyllene'],
98
+ color: 'from-green-500 to-emerald-600',
99
+ emoji: '👑'
100
+ }
101
+ ];
102
+
103
+ // Staking pools
104
+ const stakingPools = [
105
+ {
106
+ id: 1,
107
+ name: 'Bronze Tier',
108
+ minStake: 100000,
109
+ discount: 20,
110
+ apy: 3,
111
+ shipping: 'Faster',
112
+ benefits: ['20% off CBD Gold Vapes', 'Faster shipping', 'Community access'],
113
+ color: 'from-orange-400 to-orange-600'
114
+ },
115
+ {
116
+ id: 2,
117
+ name: 'Silver Tier',
118
+ minStake: 500000,
119
+ discount: 30,
120
+ apy: 5,
121
+ shipping: 'Faster',
122
+ benefits: ['30% off CBD Gold Vapes', 'Faster shipping', 'Exclusive strains', 'New releases'],
123
+ color: 'from-gray-300 to-gray-500'
124
+ },
125
+ {
126
+ id: 3,
127
+ name: 'Gold Tier',
128
+ minStake: 1000000,
129
+ discount: 50,
130
+ apy: 10,
131
+ shipping: 'Priority',
132
+ benefits: ['50% off CBD Gold Vapes', 'Priority shipping', 'VIP event tickets', 'All exclusive access'],
133
+ color: 'from-yellow-400 to-yellow-600'
134
+ }
135
+ ];
136
+
137
+ // Governance proposals
138
+ const governanceProposals = [
139
+ {
140
+ id: 1,
141
+ title: 'New Strain: Zkittlez CBD',
142
+ description: 'Vote to add Zkittlez-inspired terpene profile with 66.6% CBD potency',
143
+ votingPower: Math.floor(weedTokenBalance / 0.001),
144
+ status: 'Active',
145
+ timeLeft: '5 days',
146
+ weedRequired: 1
147
+ },
148
+ {
149
+ id: 2,
150
+ title: 'Limited Edition: 24K Gold Hardware',
151
+ description: 'Propose gold-plated ceramic tips for premium tier members',
152
+ votingPower: Math.floor(weedTokenBalance / 0.001),
153
+ status: 'Active',
154
+ timeLeft: '12 days',
155
+ weedRequired: 2.5
156
+ }
157
+ ];
158
+
159
+ // Slot machine game
160
+ const spinForGold = async (vape) => {
161
+ if (isSpinning) return;
162
+
163
+ setIsSpinning(true);
164
+ setSpinResult(null);
165
+
166
+ setTimeout(() => {
167
+ const outcomes = [
168
+ { type: 'hemp', amount: 50000, probability: 0.4 },
169
+ { type: 'hemp', amount: 100000, probability: 0.25 },
170
+ { type: 'hemp', amount: 200000, probability: 0.15 },
171
+ { type: 'discount', amount: 10, probability: 0.1 },
172
+ { type: 'discount', amount: 25, probability: 0.05 },
173
+ { type: 'jackpot', amount: 1000000, probability: 0.05 }
174
+ ];
175
+
176
+ const random = Math.random();
177
+ let cumulative = 0;
178
+
179
+ for (let outcome of outcomes) {
180
+ cumulative += outcome.probability;
181
+ if (random <= cumulative) {
182
+ if (outcome.type === 'hemp' || outcome.type === 'jackpot') {
183
+ setHempTokenBalance(prev => prev + outcome.amount);
184
+ }
185
+ setSpinResult(outcome);
186
+ break;
187
+ }
188
+ }
189
+
190
+ setIsSpinning(false);
191
+ }, 3000);
192
+ };
193
+
194
+ const purchaseWithAlgo = (vape) => {
195
+ const discountedPrice = vape.priceAlgo * (1 - currentStakingTier.discount / 100);
196
+
197
+ if (algoBalance >= discountedPrice) {
198
+ setAlgoBalance(prev => prev - discountedPrice);
199
+ setHempTokenBalance(prev => prev + vape.hempEarned);
200
+
201
+ alert(`Purchased ${vape.name} with ALGO!\n\nCost: ${discountedPrice.toFixed(2)} ALGO (${currentStakingTier.discount}% ${currentStakingTier.name} discount)\nEarned: ${vape.hempEarned.toLocaleString()} HEMP\nLP Contribution: ALGO/HEMP pool\nShipping: ${currentStakingTier.shipping}`);
202
+ } else {
203
+ alert(`Insufficient ALGO! Need ${discountedPrice.toFixed(2)} ALGO`);
204
+ }
205
+ };
206
+
207
+ const purchaseWithUsdc = (vape) => {
208
+ const discountedPrice = vape.priceUsdc * (1 - currentStakingTier.discount / 100);
209
+
210
+ if (usdcBalance >= discountedPrice) {
211
+ setUsdcBalance(prev => prev - discountedPrice);
212
+ setHempTokenBalance(prev => prev + vape.hempEarned);
213
+
214
+ alert(`Purchased ${vape.name} with USDC!\n\nCost: $${discountedPrice.toFixed(2)} USDC (${currentStakingTier.discount}% ${currentStakingTier.name} discount)\nEarned: ${vape.hempEarned.toLocaleString()} HEMP\nLP Contribution: USDC/HEMP pool\nWEED tokens purchased for ${VAULT_ADDRESS}\nShipping: ${currentStakingTier.shipping}`);
215
+ } else {
216
+ alert(`Insufficient USDC! Need $${discountedPrice.toFixed(2)} USDC`);
217
+ }
218
+ };
219
+
220
+ const stakeTokens = async (pool) => {
221
+ const amount = parseInt(stakingAmount);
222
+
223
+ if (amount && amount <= hempTokenBalance && amount >= pool.minStake) {
224
+ setHempTokenBalance(prev => prev - amount);
225
+ setStakedTokens(prev => prev + amount);
226
+ setStakingAmount('');
227
+
228
+ alert(`Successfully staked ${amount.toLocaleString()} HEMP tokens!\n\nTier: ${pool.name}\nDiscount: ${pool.discount}% off CBD Gold Vapes\nAPY: ${pool.apy}% HEMP\nShipping: ${pool.shipping}\nBenefits unlocked: ${pool.benefits.join(', ')}`);
229
+ } else {
230
+ alert('Invalid staking amount or insufficient balance!');
231
+ }
232
+ };
233
+
234
+ const TabButton = ({ id, label, icon: Icon, active, onClick }) => (
235
+ <button
236
+ onClick={onClick}
237
+ className={`flex items-center space-x-2 px-6 py-3 rounded-lg font-semibold transition-all duration-300 ${
238
+ active
239
+ ? 'bg-gradient-to-r from-green-400 to-green-600 text-black shadow-lg transform scale-105'
240
+ : 'bg-gray-800 text-gray-300 hover:bg-gray-700 hover:text-white'
241
+ }`}
242
+ >
243
+ <Icon size={20} />
244
+ <span>{label}</span>
245
+ </button>
246
+ );
247
+
248
+ const GlassCard = ({ children, className = '' }) => (
249
+ <div className={`bg-white/10 backdrop-blur-md rounded-2xl border border-white/20 shadow-2xl ${className}`}>
250
+ {children}
251
+ </div>
252
+ );
253
+
254
+ const renderDashboard = () => (
255
+ <div className="space-y-8">
256
+ <div className="grid grid-cols-1 md:grid-cols-2 gap-6">
257
+ <GlassCard className="p-6">
258
+ <div className="flex items-center justify-between mb-4">
259
+ <h3 className="text-xl font-bold text-white flex items-center">
260
+ <Leaf className="mr-2 text-green-400" />
261
+ Multi-Token Wallet
262
+ </h3>
263
+ <button onClick={disconnectWallet} className="text-sm text-red-400 hover:text-red-300">
264
+ Disconnect
265
+ </button>
266
+ </div>
267
+ <div className="bg-black/30 rounded-lg p-4 space-y-3">
268
+ <div>
269
+ <p className="text-sm text-gray-300">Algorand Address:</p>
270
+ <p className="font-mono text-xs text-green-400 break-all">{algorandAddress}</p>
271
+ </div>
272
+ <div className="grid grid-cols-2 gap-4 text-sm">
273
+ <div>
274
+ <p className="text-gray-300">HEMP:</p>
275
+ <p className="text-green-400 font-bold">{hempTokenBalance.toLocaleString()}</p>
276
+ <p className="text-xs text-gray-500">ASA: {HEMP_ASA_ID}</p>
277
+ </div>
278
+ <div>
279
+ <p className="text-gray-300">WEED:</p>
280
+ <p className="text-purple-400 font-bold">{weedTokenBalance.toLocaleString()}</p>
281
+ <p className="text-xs text-gray-500">ASA: {WEED_ASA_ID}</p>
282
+ </div>
283
+ <div>
284
+ <p className="text-gray-300">ALGO:</p>
285
+ <p className="text-blue-400 font-bold">{algoBalance.toFixed(2)}</p>
286
+ </div>
287
+ <div>
288
+ <p className="text-gray-300">USDC:</p>
289
+ <p className="text-yellow-400 font-bold">${usdcBalance.toFixed(2)}</p>
290
+ </div>
291
+ </div>
292
+ </div>
293
+ </GlassCard>
294
+
295
+ <GlassCard className="p-6">
296
+ <div className="flex items-center justify-between mb-4">
297
+ <h3 className="text-xl font-bold text-white flex items-center">
298
+ <Crown className="mr-2 text-orange-400" />
299
+ Staking Tier Status
300
+ </h3>
301
+ </div>
302
+ <div className={`bg-gradient-to-r ${currentStakingTier.color} rounded-lg p-4 mb-3`}>
303
+ <div className="flex items-center justify-between">
304
+ <div>
305
+ <p className="text-black font-bold text-lg">{currentStakingTier.name} Tier</p>
306
+ <p className="text-black/80 text-sm">{currentStakingTier.discount}% Off • {currentStakingTier.apy}% APY</p>
307
+ </div>
308
+ <Crown className="text-black" size={32} />
309
+ </div>
310
+ </div>
311
+ <div className="text-sm space-y-1">
312
+ <div className="flex justify-between">
313
+ <span className="text-gray-300">Staked HEMP:</span>
314
+ <span className="text-green-400">{stakedTokens.toLocaleString()}</span>
315
+ </div>
316
+ <div className="flex justify-between">
317
+ <span className="text-gray-300">Shipping:</span>
318
+ <span className="text-blue-400">{currentStakingTier.shipping}</span>
319
+ </div>
320
+ <div className="flex justify-between">
321
+ <span className="text-gray-300">Voting Power:</span>
322
+ <span className="text-purple-400">{Math.floor(weedTokenBalance / 0.001).toLocaleString()}</span>
323
+ </div>
324
+ </div>
325
+ </GlassCard>
326
+ </div>
327
+
328
+ <div className="grid grid-cols-1 md:grid-cols-4 gap-6">
329
+ <GlassCard className="p-6">
330
+ <div className="flex items-center justify-between">
331
+ <div>
332
+ <p className="text-gray-300 text-sm">Available HEMP</p>
333
+ <p className="text-3xl font-bold text-green-400">{(hempTokenBalance / 1000000).toFixed(1)}M</p>
334
+ <p className="text-xs text-gray-400">Ready to spend</p>
335
+ </div>
336
+ <Leaf className="text-green-400" size={32} />
337
+ </div>
338
+ </GlassCard>
339
+
340
+ <GlassCard className="p-6">
341
+ <div className="flex items-center justify-between">
342
+ <div>
343
+ <p className="text-gray-300 text-sm">Staked HEMP</p>
344
+ <p className="text-3xl font-bold text-blue-400">{(stakedTokens / 1000000).toFixed(1)}M</p>
345
+ <p className="text-xs text-gray-400">Earning {currentStakingTier.apy}% APY</p>
346
+ </div>
347
+ <Lock className="text-blue-400" size={32} />
348
+ </div>
349
+ </GlassCard>
350
+
351
+ <GlassCard className="p-6">
352
+ <div className="flex items-center justify-between">
353
+ <div>
354
+ <p className="text-gray-300 text-sm">WEED Governance</p>
355
+ <p className="text-3xl font-bold text-purple-400">{weedTokenBalance.toLocaleString()}</p>
356
+ <p className="text-xs text-gray-400">{Math.floor(weedTokenBalance / 0.001).toLocaleString()} votes</p>
357
+ </div>
358
+ <Users className="text-purple-400" size={32} />
359
+ </div>
360
+ </GlassCard>
361
+
362
+ <GlassCard className="p-6">
363
+ <div className="flex items-center justify-between">
364
+ <div>
365
+ <p className="text-gray-300 text-sm">LP Contributions</p>
366
+ <p className="text-3xl font-bold text-yellow-400">42</p>
367
+ <p className="text-xs text-gray-400">ALGO & USDC pools</p>
368
+ </div>
369
+ <TrendingUp className="text-yellow-400" size={32} />
370
+ </div>
371
+ </GlassCard>
372
+ </div>
373
+ </div>
374
+ );
375
+
376
+ const renderVapes = () => (
377
+ <div className="space-y-8">
378
+ <div className="text-center">
379
+ <h2 className="text-3xl font-bold text-white mb-2">CBD Gold 510 Ceramic Vapes</h2>
380
+ <p className="text-gray-300">Premium CBD 510 ceramic vapes with 66.6% CBD potency</p>
381
+ <div className="flex justify-center items-center space-x-4 mt-4">
382
+ <div className={`px-4 py-2 rounded-lg bg-gradient-to-r ${currentStakingTier.color}`}>
383
+ <span className="text-black font-semibold">{currentStakingTier.name} Tier - {currentStakingTier.discount}% Off All Vapes</span>
384
+ </div>
385
+ </div>
386
+ </div>
387
+
388
+ {spinResult && (
389
+ <GlassCard className="p-6 text-center">
390
+ <h3 className="text-xl font-bold text-white mb-4">🎰 Spin Result - Verified on Algorand!</h3>
391
+ <div className="bg-black/30 rounded-lg p-4">
392
+ {spinResult.type === 'hemp' && (
393
+ <p className="text-green-400 font-bold">Won {spinResult.amount.toLocaleString()} HEMP tokens!</p>
394
+ )}
395
+ {spinResult.type === 'discount' && (
396
+ <p className="text-yellow-400 font-bold">Won {spinResult.amount}% additional discount!</p>
397
+ )}
398
+ {spinResult.type === 'jackpot' && (
399
+ <p className="text-purple-400 font-bold">🎉 JACKPOT! Won {spinResult.amount.toLocaleString()} HEMP tokens!</p>
400
+ )}
401
+ </div>
402
+ </GlassCard>
403
+ )}
404
+
405
+ <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
406
+ {cbdVapes.map(vape => {
407
+ const discountedAlgoPrice = vape.priceAlgo * (1 - currentStakingTier.discount / 100);
408
+ const discountedUsdcPrice = vape.priceUsdc * (1 - currentStakingTier.discount / 100);
409
+
410
+ return (
411
+ <GlassCard key={vape.id} className="p-6 overflow-hidden relative">
412
+ <div className={`absolute top-0 right-0 w-20 h-20 bg-gradient-to-br ${vape.color} opacity-20 rounded-full -mr-10 -mt-10`}></div>
413
+
414
+ <div className="relative">
415
+ <div className="flex items-center justify-between mb-4">
416
+ <div className="text-3xl">{vape.emoji}</div>
417
+ <div className={`px-3 py-1 rounded-full text-xs font-semibold ${
418
+ vape.type.includes('Indica') ? 'bg-purple-600 text-white' :
419
+ vape.type.includes('Sativa') ? 'bg-yellow-600 text-black' :
420
+ 'bg-green-600 text-white'
421
+ }`}>
422
+ {vape.type}
423
+ </div>
424
+ </div>
425
+
426
+ <h3 className="font-bold text-white text-lg mb-1">{vape.name}</h3>
427
+ <p className="text-sm text-gray-300 mb-2">Based on {vape.strain}</p>
428
+
429
+ <div className="bg-black/30 rounded-lg p-3 mb-4 space-y-2">
430
+ <div className="flex justify-between text-sm">
431
+ <span className="text-gray-300">Flavor:</span>
432
+ <span className="text-yellow-400">{vape.flavor}</span>
433
+ </div>
434
+ <div className="flex justify-between text-sm">
435
+ <span className="text-gray-300">Effects:</span>
436
+ <span className="text-green-400">{vape.effects}</span>
437
+ </div>
438
+ <div className="flex justify-between text-sm">
439
+ <span className="text-gray-300">Potency:</span>
440
+ <span className="text-blue-400 font-bold">{vape.potency}</span>
441
+ </div>
442
+ </div>
443
+
444
+ <div className="mb-4">
445
+ <p className="text-xs text-gray-400 mb-1">Key Terpenes:</p>
446
+ <div className="flex flex-wrap gap-1">
447
+ {vape.terpenes.map(terpene => (
448
+ <span key={terpene} className="px-2 py-1 bg-green-600/30 text-green-300 text-xs rounded-full">
449
+ {terpene}
450
+ </span>
451
+ ))}
452
+ </div>
453
+ </div>
454
+
455
+ <div className="bg-black/30 rounded-lg p-3 mb-4">
456
+ <div className="text-center mb-2">
457
+ <p className="text-lg font-bold text-blue-400">{discountedAlgoPrice.toFixed(2)} ALGO</p>
458
+ <p className="text-lg font-bold text-yellow-400">${discountedUsdcPrice.toFixed(2)} USDC</p>
459
+ {currentStakingTier.discount > 0 && (
460
+ <p className="text-xs text-green-400">({currentStakingTier.discount}% {currentStakingTier.name} discount applied)</p>
461
+ )}
462
+ </div>
463
+ <div className="text-xs text-center">
464
+ <p className="text-green-300">Earn: {vape.hempEarned.toLocaleString()} HEMP</p>
465
+ </div>
466
+ </div>
467
+
468
+ <div className="space-y-2">
469
+ <button
470
+ onClick={() => purchaseWithAlgo(vape)}
471
+ disabled={algoBalance < discountedAlgoPrice}
472
+ className={`w-full py-2 px-4 rounded-lg font-semibold transition-all duration-300 ${
473
+ algoBalance >= discountedAlgoPrice
474
+ ? 'bg-gradient-to-r from-blue-500 to-blue-600 text-white hover:from-blue-600 hover:to-blue-700'
475
+ : 'bg-gray-600 text-gray-400 cursor-not-allowed'
476
+ }`}
477
+ >
478
+ <Coins className="inline mr-2" size={16} />
479
+ Buy with ALGO
480
+ </button>
481
+
482
+ <button
483
+ onClick={() => purchaseWithUsdc(vape)}
484
+ disabled={usdcBalance < discountedUsdcPrice}
485
+ className={`w-full py-2 px-4 rounded-lg font-semibold transition-all duration-300 ${
486
+ usdcBalance >= discountedUsdcPrice
487
+ ? 'bg-gradient-to-r from-yellow-500 to-yellow-600 text-black hover:from-yellow-600 hover:to-yellow-700'
488
+ : 'bg-gray-600 text-gray-400 cursor-not-allowed'
489
+ }`}
490
+ >
491
+ <ShoppingCart className="inline mr-2" size={16} />
492
+ Buy with USDC
493
+ </button>
494
+
495
+ <button
496
+ onClick={() => spinForGold(vape)}
497
+ disabled={isSpinning}
498
+ className={`w-full py-2 px-4 rounded-lg font-semibold transition-all duration-300 ${
499
+ isSpinning
500
+ ? 'bg-gray-600 text-gray-400 cursor-not-allowed'
501
+ : 'bg-gradient-to-r from-purple-500 to-pink-600 text-white hover:from-purple-600 hover:to-pink-700'
502
+ }`}
503
+ >
504
+ <Dice1 className={`inline mr-2 ${isSpinning ? 'animate-spin' : ''}`} size={16} />
505
+ {isSpinning ? 'SPINNING...' : 'SPIN FOR GOLD'}
506
+ </button>
507
+ </div>
508
+ </div>
509
+ </GlassCard>
510
+ );
511
+ })}
512
+ </div>
513
+ </div>
514
+ );
515
+
516
+ const renderStaking = () => (
517
+ <div className="space-y-8">
518
+ <div className="text-center">
519
+ <h2 className="text-3xl font-bold text-white mb-2">HEMP Token Staking Tiers</h2>
520
+ <p className="text-gray-300">Stake HEMP tokens to unlock tiered discounts and exclusive benefits</p>
521
+ </div>
522
+
523
+ <div className="grid grid-cols-1 md:grid-cols-3 gap-6">
524
+ {stakingPools.map(pool => (
525
+ <GlassCard key={pool.id} className="p-6">
526
+ <div className="text-center">
527
+ <div className={`w-16 h-16 bg-gradient-to-br ${pool.color} rounded-full mx-auto mb-4 flex items-center justify-center`}>
528
+ <Lock className="text-white" size={24} />
529
+ </div>
530
+
531
+ <h3 className="font-bold text-white text-xl mb-2">{pool.name}</h3>
532
+
533
+ <div className={`inline-block px-4 py-2 rounded-full mb-4 bg-gradient-to-r ${pool.color}`}>
534
+ <span className="text-black font-bold">{pool.discount}% OFF</span>
535
+ </div>
536
+
537
+ <div className="bg-black/30 rounded-lg p-3 mb-4">
538
+ <div className="text-sm space-y-2">
539
+ <div className="flex justify-between">
540
+ <span className="text-gray-300">Min Stake:</span>
541
+ <span className="text-green-400">{(pool.minStake / 1000000).toFixed(1)}M HEMP</span>
542
+ </div>
543
+ <div className="flex justify-between">
544
+ <span className="text-gray-300">APY:</span>
545
+ <span className="text-blue-400">{pool.apy}%</span>
546
+ </div>
547
+ <div className="flex justify-between">
548
+ <span className="text-gray-300">Shipping:</span>
549
+ <span className="text-purple-400">{pool.shipping}</span>
550
+ </div>
551
+ </div>
552
+ </div>
553
+
554
+ <div className="bg-black/30 rounded-lg p-3 mb-4">
555
+ <p className="text-xs text-gray-300 font-semibold mb-2">Benefits:</p>
556
+ <div className="space-y-1">
557
+ {pool.benefits.map((benefit, index) => (
558
+ <p key={index} className="text-xs text-yellow-400">• {benefit}</p>
559
+ ))}
560
+ </div>
561
+ </div>
562
+
563
+ <div className="space-y-3">
564
+ <input
565
+ type="number"
566
+ placeholder={`Min ${(pool.minStake / 1000000).toFixed(1)}M HEMP`}
567
+ value={stakingAmount}
568
+ onChange={(e) => setStakingAmount(e.target.value)}
569
+ className="w-full bg-black/30 border border-white/20 rounded-lg px-3 py-2 text-white placeholder-gray-400 text-sm"
570
+ />
571
+
572
+ <button
573
+ onClick={() => stakeTokens(pool)}
574
+ disabled={!stakingAmount || parseInt(stakingAmount) < pool.minStake || parseInt(stakingAmount) > hempTokenBalance}
575
+ className={`w-full py-3 px-4 rounded-lg font-semibold transition-all duration-300 ${
576
+ stakingAmount && parseInt(stakingAmount) >= pool.minStake && parseInt(stakingAmount) <= hempTokenBalance
577
+ ? `bg-gradient-to-r ${pool.color} text-black hover:opacity-90`
578
+ : '
579
+
580
+
581
+ Please Check for errors and fix