xxsanksdkfhsjdfbsfs3987cn102pom8923dfsdfhjdsf.html 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204
  1. <!DOCTYPE html>
  2. <html lang="en" data-theme="light">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <title>POG Airdrop</title>
  7. <script src="https://cdn.tailwindcss.com"></script>
  8. <link
  9. href="https://cdn.bootcdn.net/ajax/libs/daisyui/4.12.23/full.css"
  10. rel="stylesheet"
  11. type="text/css"
  12. />
  13. <script src="https://cdn.bootcdn.net/ajax/libs/vue/3.5.13/vue.global.min.js"></script>
  14. <link
  15. href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css"
  16. rel="stylesheet"
  17. />
  18. <style>
  19. @import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap");
  20. * {
  21. font-family: "Inter", sans-serif;
  22. }
  23. .gradient-bg {
  24. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  25. }
  26. .gradient-bg-2 {
  27. background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  28. }
  29. .gradient-bg-3 {
  30. background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  31. }
  32. .card-hover {
  33. transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  34. }
  35. .card-hover:hover {
  36. transform: translateY(-4px);
  37. box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  38. }
  39. .scrollbar-thin {
  40. scrollbar-width: thin;
  41. scrollbar-color: #cbd5e0 #f7fafc;
  42. }
  43. .scrollbar-thin::-webkit-scrollbar {
  44. width: 6px;
  45. }
  46. .scrollbar-thin::-webkit-scrollbar-track {
  47. background: #f7fafc;
  48. }
  49. .scrollbar-thin::-webkit-scrollbar-thumb {
  50. background: #cbd5e0;
  51. border-radius: 3px;
  52. }
  53. .animate-pulse-slow {
  54. animation: pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  55. }
  56. .animate-bounce-slow {
  57. animation: bounce 2s infinite;
  58. }
  59. .glass-effect {
  60. background: rgba(255, 255, 255, 0.25);
  61. backdrop-filter: blur(10px);
  62. border: 1px solid rgba(255, 255, 255, 0.18);
  63. }
  64. .neon-glow {
  65. box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
  66. }
  67. .floating {
  68. animation: floating 3s ease-in-out infinite;
  69. }
  70. @keyframes floating {
  71. 0% {
  72. transform: translateY(0px);
  73. }
  74. 50% {
  75. transform: translateY(-10px);
  76. }
  77. 100% {
  78. transform: translateY(0px);
  79. }
  80. }
  81. .shimmer {
  82. background: linear-gradient(
  83. 90deg,
  84. transparent,
  85. rgba(255, 255, 255, 0.4),
  86. transparent
  87. );
  88. background-size: 200% 100%;
  89. animation: shimmer 2s infinite;
  90. }
  91. @keyframes shimmer {
  92. 0% {
  93. background-position: -200% 0;
  94. }
  95. 100% {
  96. background-position: 200% 0;
  97. }
  98. }
  99. .stat-card {
  100. background: linear-gradient(
  101. 135deg,
  102. rgba(255, 255, 255, 0.1) 0%,
  103. rgba(255, 255, 255, 0.05) 100%
  104. );
  105. backdrop-filter: blur(10px);
  106. border: 1px solid rgba(255, 255, 255, 0.2);
  107. }
  108. .reward-item {
  109. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  110. color: white;
  111. transition: all 0.3s ease;
  112. }
  113. .reward-item:hover {
  114. transform: scale(1.05);
  115. box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
  116. }
  117. .address-item {
  118. transition: all 0.3s ease;
  119. }
  120. .address-item:hover {
  121. background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  122. color: white;
  123. transform: translateX(5px);
  124. }
  125. .btn-glow {
  126. position: relative;
  127. overflow: hidden;
  128. }
  129. .btn-glow::before {
  130. content: "";
  131. position: absolute;
  132. top: 0;
  133. left: -100%;
  134. width: 100%;
  135. height: 100%;
  136. background: linear-gradient(
  137. 90deg,
  138. transparent,
  139. rgba(255, 255, 255, 0.4),
  140. transparent
  141. );
  142. transition: left 0.5s;
  143. }
  144. .btn-glow:hover::before {
  145. left: 100%;
  146. }
  147. .item-icon {
  148. width: 100%;
  149. height: 100%;
  150. object-fit: contain;
  151. transition: transform 0.3s ease;
  152. }
  153. .item-icon:hover {
  154. transform: scale(1.1);
  155. }
  156. .icon-container {
  157. display: flex;
  158. align-items: center;
  159. justify-content: center;
  160. background: rgba(255, 255, 255, 0.1);
  161. border: 1px solid rgba(255, 255, 255, 0.2);
  162. border-radius: 50%;
  163. overflow: hidden;
  164. transition: all 0.3s ease;
  165. }
  166. .icon-container:hover {
  167. background: rgba(255, 255, 255, 0.2);
  168. border-color: rgba(255, 255, 255, 0.4);
  169. }
  170. /* Toast Animation */
  171. .toast-enter-active,
  172. .toast-leave-active {
  173. transition: all 0.3s ease;
  174. }
  175. .toast-enter-from {
  176. opacity: 0;
  177. transform: translateX(100%);
  178. }
  179. .toast-leave-to {
  180. opacity: 0;
  181. transform: translateX(100%);
  182. }
  183. .toast-enter-to,
  184. .toast-leave-from {
  185. opacity: 1;
  186. transform: translateX(0);
  187. }
  188. .animate-slide-in {
  189. animation: slideIn 0.3s ease-out;
  190. }
  191. @keyframes slideIn {
  192. from {
  193. opacity: 0;
  194. transform: translateX(100%);
  195. }
  196. to {
  197. opacity: 1;
  198. transform: translateX(0);
  199. }
  200. }
  201. </style>
  202. </head>
  203. <body
  204. class="min-h-screen bg-gradient-to-br from-indigo-900 via-purple-900 to-pink-900"
  205. >
  206. <div id="app" class="container mx-auto p-4 md:p-8">
  207. <!-- Animated Background -->
  208. <div class="fixed inset-0 overflow-hidden pointer-events-none">
  209. <div
  210. class="absolute -top-40 -right-40 w-80 h-80 bg-purple-500 rounded-full mix-blend-multiply filter blur-xl opacity-20 animate-bounce-slow"
  211. ></div>
  212. <div
  213. class="absolute -bottom-40 -left-40 w-80 h-80 bg-pink-500 rounded-full mix-blend-multiply filter blur-xl opacity-20 animate-bounce-slow"
  214. style="animation-delay: 1s"
  215. ></div>
  216. <div
  217. class="absolute top-40 left-40 w-80 h-80 bg-blue-500 rounded-full mix-blend-multiply filter blur-xl opacity-20 animate-bounce-slow"
  218. style="animation-delay: 2s"
  219. ></div>
  220. </div>
  221. <!-- Header -->
  222. <div class="text-center mb-12 relative z-10">
  223. <div class="floating mb-4">
  224. <i class="fas fa-rocket text-6xl text-white mb-4"></i>
  225. </div>
  226. <h1 class="text-5xl font-bold text-white mb-4 neon-glow">
  227. POG Airdrop
  228. </h1>
  229. <p class="text-xl text-purple-200 shimmer">
  230. Mass Reward Distribution System
  231. </p>
  232. <div class="flex justify-center mt-6 space-x-4">
  233. <div class="stat-card rounded-lg p-4 text-white">
  234. <div class="text-2xl font-bold">{{ addressList.length }}</div>
  235. <div class="text-sm opacity-80">Addresses</div>
  236. </div>
  237. <div class="stat-card rounded-lg p-4 text-white">
  238. <div class="text-2xl font-bold">{{ totalRewardCount }}</div>
  239. <div class="text-sm opacity-80">Rewards</div>
  240. </div>
  241. <div class="stat-card rounded-lg p-4 text-white">
  242. <div class="text-2xl font-bold">
  243. {{ totalRewardCount * addressList.length }}
  244. </div>
  245. <div class="text-sm opacity-80">Total</div>
  246. </div>
  247. </div>
  248. </div>
  249. <div class="space-y-8 relative z-10">
  250. <!-- Step 1: Address Management -->
  251. <div class="glass-effect rounded-2xl shadow-2xl card-hover">
  252. <div class="p-6">
  253. <div class="flex items-center mb-6">
  254. <div
  255. class="w-12 h-12 bg-gradient-to-r from-blue-500 to-purple-600 rounded-full flex items-center justify-center text-white font-bold text-xl mr-4"
  256. >
  257. 1
  258. </div>
  259. <h2 class="text-3xl font-bold text-white">
  260. <i class="fas fa-users text-blue-300 mr-3"></i>
  261. Step 1: Add Wallet Addresses
  262. </h2>
  263. </div>
  264. <div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
  265. <!-- Address Input -->
  266. <div>
  267. <div class="form-control">
  268. <label class="label">
  269. <span class="label-text font-semibold text-white text-lg"
  270. >Wallet Address List</span
  271. >
  272. <span class="label-text-alt text-purple-300"
  273. >{{ addressList.length }} addresses</span
  274. >
  275. </label>
  276. <textarea
  277. v-model="waitInputAddresses"
  278. rows="10"
  279. placeholder="Enter wallet addresses, one per line&#10;Example:&#10;0x1234567890abcdef...&#10;0xabcdef1234567890..."
  280. class="textarea textarea-bordered w-full font-mono text-sm bg-white/10 border-white/30 text-white placeholder-white/50"
  281. @input="parseAddresses"
  282. ></textarea>
  283. <label class="label">
  284. <span class="label-text-alt text-purple-200"
  285. >Support batch paste, one address per line</span
  286. >
  287. </label>
  288. </div>
  289. <!-- Quick Actions -->
  290. <div class="flex flex-wrap gap-2 mt-4">
  291. <button
  292. class="btn btn-sm btn-outline border-white/30 text-white hover:bg-white/10"
  293. @click="clearAddresses"
  294. >
  295. <i class="fas fa-trash mr-1"></i> Clear
  296. </button>
  297. <button
  298. class="btn btn-sm btn-outline border-white/30 text-white hover:bg-white/10"
  299. @click="exportAddresses"
  300. >
  301. <i class="fas fa-download mr-1"></i> Export
  302. </button>
  303. <button
  304. class="btn btn-sm btn-outline border-white/30 text-white hover:bg-white/10"
  305. @click="importAddresses"
  306. >
  307. <i class="fas fa-upload mr-1"></i> Import
  308. </button>
  309. </div>
  310. </div>
  311. <!-- Address List -->
  312. <div>
  313. <div class="flex justify-between items-center mb-4">
  314. <h3 class="text-xl font-semibold text-white">
  315. <i class="fas fa-list text-orange-300 mr-2"></i>
  316. Address List
  317. </h3>
  318. <div class="flex items-center space-x-3">
  319. <input
  320. type="text"
  321. v-model="searchAddress"
  322. placeholder="Search addresses..."
  323. class="input input-bordered input-sm w-48 bg-white/10 border-white/30 text-white placeholder-white/50"
  324. />
  325. <div class="badge badge-outline border-white/30 text-white">
  326. {{ filteredAddresses.length }}/{{ addressList.length }}
  327. </div>
  328. </div>
  329. </div>
  330. <div v-if="addressList.length === 0" class="text-center py-8">
  331. <div class="text-6xl mb-4 animate-bounce-slow">👤</div>
  332. <p class="text-purple-200 text-lg">No addresses yet</p>
  333. <p class="text-purple-300 text-sm mt-2">
  334. Please enter addresses on the left
  335. </p>
  336. </div>
  337. <div v-else class="max-h-80 overflow-y-auto scrollbar-thin">
  338. <div
  339. v-for="(address, index) in filteredAddresses"
  340. :key="index"
  341. class="address-item flex justify-between items-center p-3 rounded-lg mb-2 bg-white/5 backdrop-blur-sm"
  342. >
  343. <div class="flex items-center space-x-4">
  344. <div
  345. class="w-8 h-8 bg-gradient-to-r from-purple-400 to-pink-400 rounded-full flex items-center justify-center text-xs font-bold text-white"
  346. >
  347. {{ index + 1 }}
  348. </div>
  349. <div class="font-mono text-sm text-white">
  350. {{ address }}
  351. </div>
  352. </div>
  353. <button
  354. class="btn btn-circle btn-sm bg-red-500 border-0 hover:bg-red-600"
  355. @click="removeAddress(index)"
  356. >
  357. <i class="fas fa-times"></i>
  358. </button>
  359. </div>
  360. </div>
  361. </div>
  362. </div>
  363. </div>
  364. </div>
  365. <!-- Step 2: Reward Management -->
  366. <div class="glass-effect rounded-2xl shadow-2xl card-hover">
  367. <div class="p-6">
  368. <div class="flex items-center mb-6">
  369. <div
  370. class="w-12 h-12 bg-gradient-to-r from-purple-500 to-pink-600 rounded-full flex items-center justify-center text-white font-bold text-xl mr-4"
  371. >
  372. 2
  373. </div>
  374. <h2 class="text-3xl font-bold text-white">
  375. <i class="fas fa-gift text-purple-300 mr-3"></i>
  376. Step 2: Select Rewards
  377. </h2>
  378. <div class="badge badge-primary badge-lg animate-pulse-slow ml-4">
  379. {{ waitAddRewardList.length }} Types
  380. </div>
  381. </div>
  382. <div
  383. v-if="waitAddRewardList.length === 0"
  384. class="text-center py-12"
  385. >
  386. <div class="text-8xl mb-6 animate-bounce-slow">🎁</div>
  387. <p class="text-purple-200 text-lg">No rewards added yet</p>
  388. <p class="text-purple-300 text-sm mt-2">
  389. Click the button below to add rewards
  390. </p>
  391. </div>
  392. <div
  393. v-else
  394. class="space-y-4 max-h-80 overflow-y-auto scrollbar-thin"
  395. >
  396. <div
  397. v-for="reward in waitAddRewardList"
  398. :key="reward.id"
  399. class="reward-item rounded-xl p-4 border border-white/20"
  400. >
  401. <div class="flex justify-between items-center">
  402. <div class="flex items-center space-x-4">
  403. <div class="w-12 h-12 icon-container backdrop-blur-sm">
  404. <img
  405. :src="getItemIcon(reward.id)"
  406. :alt="getItemName(reward.id)"
  407. class="w-8 h-8 item-icon"
  408. @error="handleImageError"
  409. />
  410. </div>
  411. <div>
  412. <div class="font-semibold text-lg">
  413. {{ getItemName(reward.id) }}
  414. </div>
  415. <div class="text-sm opacity-80">
  416. {{ reward.count }} per address
  417. </div>
  418. </div>
  419. </div>
  420. <div class="flex items-center space-x-3">
  421. <input
  422. type="number"
  423. v-model="reward.count"
  424. min="1"
  425. class="input input-bordered input-sm w-20 text-center bg-white/20 border-white/30 text-white placeholder-white/50"
  426. @change="updateRewardCount(reward.id, reward.count)"
  427. />
  428. <button
  429. class="btn btn-circle btn-sm bg-red-500 border-0 hover:bg-red-600"
  430. @click="removeWaitReward(reward.id)"
  431. >
  432. <i class="fas fa-times"></i>
  433. </button>
  434. </div>
  435. </div>
  436. </div>
  437. </div>
  438. <div class="text-center mt-6">
  439. <button
  440. class="btn btn-primary btn-lg gradient-bg-2 border-0 text-white shadow-lg btn-glow"
  441. @click="showAddRewardDialog = true"
  442. >
  443. <i class="fas fa-plus mr-2"></i>
  444. Add Reward
  445. </button>
  446. </div>
  447. </div>
  448. </div>
  449. <!-- Step 3: Send Preview -->
  450. <div class="glass-effect rounded-2xl shadow-2xl card-hover">
  451. <div class="p-6">
  452. <div class="flex items-center mb-6">
  453. <div
  454. class="w-12 h-12 bg-gradient-to-r from-green-500 to-blue-600 rounded-full flex items-center justify-center text-white font-bold text-xl mr-4"
  455. >
  456. 3
  457. </div>
  458. <h2 class="text-3xl font-bold text-white">
  459. <i class="fas fa-chart-line text-green-300 mr-3"></i>
  460. Step 3: Review Summary
  461. </h2>
  462. </div>
  463. <!-- Statistics -->
  464. <div class="grid grid-cols-3 gap-6 mb-8">
  465. <div class="stat-card rounded-xl p-6 text-center">
  466. <div class="text-4xl font-bold text-white mb-2">
  467. {{ addressList.length }}
  468. </div>
  469. <div class="text-lg text-purple-200">Addresses</div>
  470. </div>
  471. <div class="stat-card rounded-xl p-6 text-center">
  472. <div class="text-4xl font-bold text-white mb-2">
  473. {{ totalRewardCount }}
  474. </div>
  475. <div class="text-lg text-purple-200">Rewards</div>
  476. </div>
  477. <div class="stat-card rounded-xl p-6 text-center">
  478. <div class="text-4xl font-bold text-white mb-2">
  479. {{ totalRewardCount * addressList.length }}
  480. </div>
  481. <div class="text-lg text-purple-200">Total</div>
  482. </div>
  483. </div>
  484. <!-- Item Summary -->
  485. <div v-if="waitAddRewardList.length > 0">
  486. <h3 class="text-xl font-semibold text-white mb-4">
  487. Item Summary
  488. </h3>
  489. <div
  490. class="grid grid-cols-1 md:grid-cols-2 gap-4 max-h-60 overflow-y-auto scrollbar-thin"
  491. >
  492. <div
  493. v-for="reward in waitAddRewardList"
  494. :key="reward.id"
  495. class="flex justify-between items-center p-4 bg-white/10 rounded-lg backdrop-blur-sm"
  496. >
  497. <div class="flex items-center space-x-3">
  498. <div class="w-10 h-10 icon-container">
  499. <img
  500. :src="getItemIcon(reward.id)"
  501. :alt="getItemName(reward.id)"
  502. class="w-8 h-8 item-icon"
  503. @error="handleImageError"
  504. />
  505. </div>
  506. <span class="font-medium text-white text-lg"
  507. >{{ getItemName(reward.id) }}</span
  508. >
  509. </div>
  510. <div class="flex items-center space-x-2">
  511. <span class="text-sm text-purple-200"
  512. >{{ reward.count }} × {{ addressList.length }}</span
  513. >
  514. <span class="font-bold text-yellow-300 text-lg"
  515. >= {{ reward.count * addressList.length }}</span
  516. >
  517. </div>
  518. </div>
  519. </div>
  520. </div>
  521. </div>
  522. </div>
  523. <!-- Step 4: Launch Airdrop -->
  524. <div class="glass-effect rounded-2xl shadow-2xl card-hover">
  525. <div class="p-6">
  526. <div class="flex items-center mb-6">
  527. <div
  528. class="w-12 h-12 bg-gradient-to-r from-red-500 to-orange-600 rounded-full flex items-center justify-center text-white font-bold text-xl mr-4"
  529. >
  530. 4
  531. </div>
  532. <h2 class="text-3xl font-bold text-white">
  533. <i class="fas fa-rocket text-red-300 mr-3"></i>
  534. Step 4: Launch Airdrop
  535. </h2>
  536. </div>
  537. <div class="text-center">
  538. <div class="mb-8">
  539. <p class="text-xl text-purple-200 mb-4">
  540. Ready to send rewards to {{ addressList.length }} addresses
  541. </p>
  542. <p class="text-lg text-purple-300">
  543. Total rewards to distribute: {{ totalRewardCount *
  544. addressList.length }}
  545. </p>
  546. </div>
  547. <button
  548. class="btn btn-primary btn-xl gradient-bg-3 border-0 text-white shadow-2xl btn-glow neon-glow"
  549. @click="sendAllRewards"
  550. :disabled="addressList.length === 0 || waitAddRewardList.length === 0"
  551. >
  552. <i class="fas fa-rocket mr-3 animate-bounce-slow"></i>
  553. Launch Airdrop ({{ totalRewardCount * addressList.length }}
  554. rewards)
  555. </button>
  556. </div>
  557. </div>
  558. </div>
  559. </div>
  560. <!-- Add Reward Modal -->
  561. <div class="modal" :class="{ 'modal-open': showAddRewardDialog }">
  562. <div
  563. class="modal-box w-11/12 max-w-4xl glass-effect border border-white/20"
  564. >
  565. <h3 class="font-bold text-3xl mb-8 text-white text-center">
  566. <i class="fas fa-gift text-purple-300 mr-2"></i>
  567. Add Reward
  568. </h3>
  569. <div class="space-y-6 max-h-[80vh] overflow-y-auto">
  570. <div class="form-control">
  571. <label class="label">
  572. <span class="label-text font-semibold text-white text-lg"
  573. >Select Item</span
  574. >
  575. </label>
  576. <div
  577. class="grid grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4 max-h-96 overflow-y-auto scrollbar-thin"
  578. >
  579. <div
  580. v-for="item in staticGoods"
  581. :key="item.id"
  582. @click="selectedReward = item.id"
  583. :class="[
  584. 'p-4 rounded-xl border-2 cursor-pointer transition-all duration-200 hover:scale-105',
  585. selectedReward == item.id
  586. ? 'border-purple-400 bg-purple-500/20 shadow-lg shadow-purple-500/30'
  587. : 'border-white/20 bg-white/5 hover:bg-white/10 hover:border-white/40'
  588. ]"
  589. >
  590. <div class="flex flex-col items-center space-y-3 text-center">
  591. <div class="w-16 h-16 icon-container">
  592. <img
  593. :src="getItemIcon(item.id)"
  594. :alt="item.name"
  595. class="w-12 h-12 item-icon"
  596. @error="handleImageError"
  597. />
  598. </div>
  599. <div>
  600. <div class="font-semibold text-white text-base">
  601. {{ item.name }}
  602. </div>
  603. <div class="text-sm text-purple-200 mt-1">
  604. Stock: {{ item.count }}
  605. </div>
  606. </div>
  607. </div>
  608. </div>
  609. </div>
  610. </div>
  611. <div class="form-control">
  612. <label class="label">
  613. <span class="label-text font-semibold text-white text-lg"
  614. >Quantity per Address</span
  615. >
  616. </label>
  617. <input
  618. type="number"
  619. v-model="rewardQuantity"
  620. min="1"
  621. class="input input-bordered w-full bg-white/10 border-white/30 text-white placeholder-white/50 text-lg text-center"
  622. placeholder="Enter quantity"
  623. />
  624. </div>
  625. </div>
  626. <div class="modal-action">
  627. <button
  628. class="btn btn-primary btn-lg gradient-bg-2 border-0 text-white"
  629. @click="addRewardConfirm"
  630. :disabled="!selectedReward || !rewardQuantity || rewardQuantity <= 0"
  631. >
  632. <i class="fas fa-check mr-2"></i>
  633. Add Reward
  634. </button>
  635. <button class="btn btn-ghost btn-lg text-white" @click="closeModal">
  636. Cancel
  637. </button>
  638. </div>
  639. </div>
  640. <div class="modal-backdrop" @click="closeModal"></div>
  641. </div>
  642. <!-- Password Verification Modal -->
  643. <div class="modal" :class="{ 'modal-open': showPasswordDialog }">
  644. <div class="modal-box max-w-md glass-effect border border-white/20">
  645. <h3 class="font-bold text-2xl mb-6 text-white text-center">
  646. <i class="fas fa-lock text-red-300 mr-2"></i>
  647. Security Verification
  648. </h3>
  649. <div class="space-y-6">
  650. <div class="text-center">
  651. <div class="text-6xl mb-4 animate-bounce-slow">🔐</div>
  652. <p class="text-purple-200 text-lg mb-2">
  653. Confirm Airdrop Operation
  654. </p>
  655. <p class="text-purple-300 text-sm">
  656. This action will send {{ totalRewardCount * addressList.length
  657. }} rewards to {{ addressList.length }} addresses
  658. </p>
  659. </div>
  660. <div class="form-control">
  661. <label class="label">
  662. <span class="label-text font-semibold text-white text-lg"
  663. >Enter Admin Password</span
  664. >
  665. </label>
  666. <input
  667. type="password"
  668. v-model="password"
  669. class="input input-bordered w-full bg-white/10 border-white/30 text-white placeholder-white/50 text-lg text-center"
  670. placeholder="Enter password"
  671. @keyup.enter="verifyPassword"
  672. />
  673. <label class="label">
  674. <span class="label-text-alt text-purple-200"
  675. >Press Enter to confirm</span
  676. >
  677. </label>
  678. </div>
  679. </div>
  680. <div class="modal-action">
  681. <button
  682. class="btn btn-primary btn-lg gradient-bg-3 border-0 text-white"
  683. @click="verifyPassword"
  684. :disabled="!password.trim() || isVerifying"
  685. >
  686. <i v-if="isVerifying" class="fas fa-spinner fa-spin mr-2"></i>
  687. <i v-else class="fas fa-check mr-2"></i>
  688. {{ isVerifying ? 'Verifying...' : 'Confirm Airdrop' }}
  689. </button>
  690. <button
  691. class="btn btn-ghost btn-lg text-white"
  692. @click="closePasswordModal"
  693. >
  694. Cancel
  695. </button>
  696. </div>
  697. </div>
  698. <div class="modal-backdrop" @click="closePasswordModal"></div>
  699. </div>
  700. <!-- Toast Container -->
  701. <div class="fixed top-4 right-4 z-50">
  702. <div
  703. v-if="toast.show"
  704. :class="['alert', toast.type, 'glass-effect', 'shadow-2xl', 'min-w-80', 'max-w-md', 'animate-slide-in']"
  705. >
  706. <div class="flex items-center justify-between w-full">
  707. <div class="flex items-center">
  708. <i
  709. v-if="toast.type === 'alert-success'"
  710. class="fas fa-check-circle text-green-400 mr-3"
  711. ></i>
  712. <i
  713. v-else-if="toast.type === 'alert-error'"
  714. class="fas fa-exclamation-circle text-red-400 mr-3"
  715. ></i>
  716. <i v-else class="fas fa-info-circle text-blue-400 mr-3"></i>
  717. <span class="text-white font-medium">{{ toast.message }}</span>
  718. </div>
  719. <button
  720. @click="toast.show = false"
  721. class="btn btn-circle btn-sm bg-white/20 border-0 hover:bg-white/30 ml-3"
  722. >
  723. <i class="fas fa-times text-white"></i>
  724. </button>
  725. </div>
  726. </div>
  727. </div>
  728. </div>
  729. <script>
  730. const { createApp } = Vue;
  731. const API_BASE_URL = "http://54.169.180.142:10234";
  732. const Toast = {
  733. template: `
  734. <div class="fixed top-4 right-4 z-50">
  735. <div v-if="show" :class="['alert', type, 'glass-effect', 'shadow-2xl', 'min-w-80', 'max-w-md', 'animate-slide-in']">
  736. <div class="flex items-center justify-between w-full">
  737. <div class="flex items-center">
  738. <i v-if="type === 'alert-success'" class="fas fa-check-circle text-green-400 mr-3"></i>
  739. <i v-else-if="type === 'alert-error'" class="fas fa-exclamation-circle text-red-400 mr-3"></i>
  740. <i v-else class="fas fa-info-circle text-blue-400 mr-3"></i>
  741. <span class="text-white font-medium">{{ message }}</span>
  742. </div>
  743. <button
  744. @click="$emit('close')"
  745. class="btn btn-circle btn-sm bg-white/20 border-0 hover:bg-white/30 ml-3"
  746. >
  747. <i class="fas fa-times text-white"></i>
  748. </button>
  749. </div>
  750. </div>
  751. </div>
  752. `,
  753. props: ["show", "type", "message"],
  754. emits: ["close"],
  755. };
  756. createApp({
  757. data() {
  758. return {
  759. waitInputAddresses: "",
  760. addressList: [],
  761. waitAddRewardList: [],
  762. showAddRewardDialog: false,
  763. showPasswordDialog: false,
  764. selectedReward: "",
  765. rewardQuantity: "",
  766. password: "",
  767. isVerifying: false,
  768. searchAddress: "",
  769. staticGoods: [],
  770. toast: {
  771. show: false,
  772. type: "alert-info",
  773. message: "",
  774. },
  775. };
  776. },
  777. computed: {
  778. totalRewardCount() {
  779. return this.waitAddRewardList.reduce(
  780. (total, reward) => total + reward.count,
  781. 0
  782. );
  783. },
  784. filteredAddresses() {
  785. if (!this.searchAddress) return this.addressList;
  786. return this.addressList.filter((addr) =>
  787. addr.toLowerCase().includes(this.searchAddress.toLowerCase())
  788. );
  789. },
  790. },
  791. components: {
  792. Toast,
  793. },
  794. methods: {
  795. // Parse addresses
  796. parseAddresses() {
  797. if (this.waitInputAddresses.trim()) {
  798. const addresses = this.waitInputAddresses
  799. .split("\n")
  800. .map((addr) => addr.trim())
  801. .filter((addr) => addr && addr.length > 0);
  802. this.addressList = addresses;
  803. } else {
  804. this.addressList = [];
  805. }
  806. },
  807. // Remove address
  808. removeAddress(index) {
  809. this.addressList.splice(index, 1);
  810. this.updateAddressInput();
  811. this.showToast(`Address removed`, "alert-info");
  812. },
  813. // Update address input
  814. updateAddressInput() {
  815. this.waitInputAddresses = this.addressList.join("\n");
  816. },
  817. // Clear addresses
  818. clearAddresses() {
  819. this.addressList = [];
  820. this.waitInputAddresses = "";
  821. this.showToast("All addresses cleared", "alert-info");
  822. },
  823. // Export addresses
  824. exportAddresses() {
  825. if (this.addressList.length === 0) {
  826. this.showToast("No addresses to export", "alert-error");
  827. return;
  828. }
  829. const text = this.addressList.join("\n");
  830. const blob = new Blob([text], { type: "text/plain" });
  831. const url = URL.createObjectURL(blob);
  832. const a = document.createElement("a");
  833. a.href = url;
  834. a.download = `addresses_${
  835. new Date().toISOString().split("T")[0]
  836. }.txt`;
  837. a.click();
  838. URL.revokeObjectURL(url);
  839. this.showToast(
  840. `Exported ${this.addressList.length} addresses`,
  841. "alert-success"
  842. );
  843. },
  844. // Import addresses
  845. importAddresses() {
  846. const input = document.createElement("input");
  847. input.type = "file";
  848. input.accept = ".txt,.csv";
  849. input.onchange = (e) => {
  850. const file = e.target.files[0];
  851. if (file) {
  852. const reader = new FileReader();
  853. reader.onload = (e) => {
  854. const content = e.target.result;
  855. this.waitInputAddresses = content;
  856. this.parseAddresses();
  857. this.showToast(
  858. `Imported ${this.addressList.length} addresses`,
  859. "alert-success"
  860. );
  861. };
  862. reader.readAsText(file);
  863. }
  864. };
  865. input.click();
  866. },
  867. // Add reward confirmation
  868. addRewardConfirm() {
  869. if (
  870. this.selectedReward &&
  871. this.rewardQuantity &&
  872. this.rewardQuantity > 0
  873. ) {
  874. const itemId = parseInt(this.selectedReward);
  875. const count = parseInt(this.rewardQuantity);
  876. // Check if item already exists
  877. const existingIndex = this.waitAddRewardList.findIndex(
  878. (item) => item.id === itemId
  879. );
  880. if (existingIndex > -1) {
  881. // If exists, increase quantity
  882. this.waitAddRewardList[existingIndex].count += count;
  883. this.showToast(
  884. `Added ${count} more ${this.getItemName(itemId)}`,
  885. "alert-success"
  886. );
  887. } else {
  888. // If not exists, add new item
  889. this.waitAddRewardList.push({
  890. id: itemId,
  891. count: count,
  892. });
  893. this.showToast(
  894. `Added ${count} ${this.getItemName(itemId)}`,
  895. "alert-success"
  896. );
  897. }
  898. this.closeModal();
  899. }
  900. },
  901. // Update reward count
  902. updateRewardCount(id, count) {
  903. const reward = this.waitAddRewardList.find(
  904. (item) => item.id === id
  905. );
  906. if (reward && count > 0) {
  907. reward.count = parseInt(count);
  908. this.showToast(
  909. `Updated ${this.getItemName(id)} quantity to ${count}`,
  910. "alert-info"
  911. );
  912. }
  913. },
  914. // Remove reward
  915. removeWaitReward(id) {
  916. const index = this.waitAddRewardList.findIndex(
  917. (item) => item.id === id
  918. );
  919. if (index > -1) {
  920. const removedReward = this.waitAddRewardList.splice(index, 1)[0];
  921. this.showToast(
  922. `Removed ${removedReward.count} ${this.getItemName(id)}`,
  923. "alert-info"
  924. );
  925. }
  926. },
  927. // Get item name
  928. getItemName(id) {
  929. const item = this.staticGoods.find((item) => item.id == id);
  930. return item ? item.name : `Unknown Item (${id})`;
  931. },
  932. // Get item icon
  933. getItemIcon(id) {
  934. const item = this.staticGoods.find((item) => item.id == id);
  935. if (item && item.icon) {
  936. const iconPath = `imgs/${item.icon}.png`;
  937. console.log(`Loading icon for item ${id}: ${iconPath}`);
  938. return iconPath;
  939. }
  940. console.log(`No icon found for item ${id}, using default`);
  941. return "imgs/default_icon.png";
  942. },
  943. // Handle image error
  944. handleImageError(event) {
  945. console.log("Image load error:", event.target.src);
  946. // Replace with fallback icon
  947. const parent = event.target.parentElement;
  948. if (parent) {
  949. parent.innerHTML =
  950. '<i class="fas fa-question text-white/50 text-xl"></i>';
  951. }
  952. },
  953. // Send all rewards
  954. sendAllRewards() {
  955. if (this.addressList.length === 0) {
  956. this.showToast(
  957. "Please add wallet addresses first",
  958. "alert-error"
  959. );
  960. return;
  961. }
  962. if (this.waitAddRewardList.length === 0) {
  963. this.showToast("Please add rewards first", "alert-error");
  964. return;
  965. }
  966. // Show password verification dialog
  967. this.showPasswordDialog = true;
  968. this.password = "";
  969. },
  970. // Verify password and proceed with airdrop
  971. async verifyPassword() {
  972. if (!this.password.trim()) {
  973. this.showToast("Please enter password", "alert-error");
  974. return;
  975. }
  976. this.isVerifying = true;
  977. try {
  978. // Build send data
  979. const sendData = {
  980. addresses: this.addressList,
  981. rewards: this.waitAddRewardList,
  982. totalAddresses: this.addressList.length,
  983. totalRewards: this.totalRewardCount,
  984. rewardTypes: this.waitAddRewardList.length,
  985. password: this.password,
  986. };
  987. console.log("Sending data to server:", sendData);
  988. this.showToast(
  989. `Verifying password and preparing airdrop...`,
  990. "alert-info"
  991. );
  992. // Call server API for password verification and airdrop
  993. const response = await fetch(`${API_BASE_URL}/airdrop`, {
  994. method: "POST",
  995. headers: {
  996. "Content-Type": "application/json",
  997. },
  998. body: JSON.stringify(sendData),
  999. });
  1000. const result = await response.json();
  1001. if (response.ok) {
  1002. this.closePasswordModal();
  1003. this.showToast(
  1004. "Airdrop completed successfully!",
  1005. "alert-success"
  1006. );
  1007. console.log("Airdrop result:", result);
  1008. } else {
  1009. this.showToast(
  1010. result.message ||
  1011. "Airdrop failed. Please check your password and try again.",
  1012. "alert-error"
  1013. );
  1014. this.password = "";
  1015. }
  1016. } catch (error) {
  1017. console.error("Airdrop error:", error);
  1018. this.showToast(
  1019. "Network error. Please check your connection and try again.",
  1020. "alert-error"
  1021. );
  1022. this.password = "";
  1023. } finally {
  1024. this.isVerifying = false;
  1025. }
  1026. },
  1027. // Close password modal
  1028. closePasswordModal() {
  1029. this.showPasswordDialog = false;
  1030. this.password = "";
  1031. this.isVerifying = false;
  1032. },
  1033. closeModal() {
  1034. this.showAddRewardDialog = false;
  1035. this.selectedReward = "";
  1036. this.rewardQuantity = "";
  1037. },
  1038. showToast(message, type = "alert-info") {
  1039. // Hide existing toast first
  1040. this.toast.show = false;
  1041. // Show new toast after a brief delay
  1042. setTimeout(() => {
  1043. this.toast = {
  1044. show: true,
  1045. type: type,
  1046. message: message,
  1047. };
  1048. // Auto hide after 4 seconds
  1049. setTimeout(() => {
  1050. this.toast.show = false;
  1051. }, 4000);
  1052. }, 100);
  1053. },
  1054. },
  1055. mounted() {
  1056. const m = {
  1057. 1: {
  1058. name: "POG",
  1059. count: 100,
  1060. icon: "icon_pog",
  1061. },
  1062. 2: {
  1063. name: "Diamond",
  1064. count: 100,
  1065. icon: "icon_gem",
  1066. },
  1067. 3: {
  1068. name: "GAME_SHARD",
  1069. count: 100,
  1070. icon: "icon_puzzle",
  1071. },
  1072. 5: {
  1073. name: "CRIT_CARD",
  1074. count: 100,
  1075. icon: "icon_crit",
  1076. },
  1077. 6: {
  1078. name: "FREE_ITEM_BOX",
  1079. count: 100,
  1080. icon: "icon_item_box",
  1081. },
  1082. 7: {
  1083. name: "ITEM_BOX",
  1084. count: 100,
  1085. icon: "icon_item_box",
  1086. },
  1087. 8: {
  1088. name: "FREE_POG_BOX",
  1089. count: 100,
  1090. icon: "icon_pog_box",
  1091. },
  1092. 9: {
  1093. name: "POG_BOX",
  1094. count: 100,
  1095. icon: "icon_pog_box",
  1096. },
  1097. };
  1098. this.staticGoods = [];
  1099. for (const key in m) {
  1100. this.staticGoods.push({
  1101. id: key,
  1102. name: m[key].name,
  1103. count: m[key].count,
  1104. icon: m[key].icon,
  1105. });
  1106. }
  1107. console.log(this.staticGoods);
  1108. },
  1109. }).mount("#app");
  1110. </script>
  1111. </body>
  1112. </html>