From 06fe4783f276178d141abe52dab5292c9dfcc6aa Mon Sep 17 00:00:00 2001 From: Kurdistan Tech Ministry Date: Sat, 1 Nov 2025 08:44:56 +0300 Subject: [PATCH] feat: Add Kurdistan sun animation for swap processing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added animated Kurdistan-themed loading indicator that displays during swap transactions: - KurdistanSun component with 21 rays (Kurdistan flag symbolism) - White center sun with glow effects - Rotating colored halos: green (outer), red (middle), yellow (inner) - Full-screen overlay with backdrop blur during processing - Fixed timing: dialog closes before animation shows 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/components/KurdistanSun.tsx | 188 ++++++++++++++++++++++++++++++++ src/components/TokenSwap.tsx | 15 ++- 2 files changed, 202 insertions(+), 1 deletion(-) create mode 100644 src/components/KurdistanSun.tsx diff --git a/src/components/KurdistanSun.tsx b/src/components/KurdistanSun.tsx new file mode 100644 index 00000000..4fca9e38 --- /dev/null +++ b/src/components/KurdistanSun.tsx @@ -0,0 +1,188 @@ +import React from 'react'; + +interface KurdistanSunProps { + size?: number; + className?: string; +} + +export const KurdistanSun: React.FC = ({ size = 200, className = '' }) => { + return ( +
+ {/* Rotating colored halos */} +
+ {/* Green halo (outermost) */} +
+ {/* Red halo (middle) */} +
+ {/* Yellow halo (inner) */} +
+
+ + {/* Kurdistan Sun with 21 rays */} + + {/* Sun rays (21 rays for Kurdistan flag) */} + + {Array.from({ length: 21 }).map((_, i) => { + const angle = (i * 360) / 21; + return ( + + ); + })} + + + {/* Central white circle */} + + + {/* Inner glow */} + + + + + + + + + + + +
+ ); +}; diff --git a/src/components/TokenSwap.tsx b/src/components/TokenSwap.tsx index 48bbc74b..8cf3df31 100644 --- a/src/components/TokenSwap.tsx +++ b/src/components/TokenSwap.tsx @@ -10,6 +10,7 @@ import { usePolkadot } from '@/contexts/PolkadotContext'; import { useWallet } from '@/contexts/WalletContext'; import { ASSET_IDS, formatBalance, parseAmount } from '@/lib/wallet'; import { useToast } from '@/hooks/use-toast'; +import { KurdistanSun } from './KurdistanSun'; const TokenSwap = () => { const { api, isApiReady, selectedAccount } = usePolkadot(); @@ -330,6 +331,7 @@ const TokenSwap = () => { } setIsSwapping(true); + setShowConfirm(false); // Close dialog before transaction starts try { const amountIn = parseAmount(fromAmount, 12); const minAmountOut = parseAmount( @@ -447,7 +449,6 @@ const TokenSwap = () => { description: `Swapped ${fromAmount} ${fromToken} for ~${toAmount} ${toToken}`, }); - setShowConfirm(false); setFromAmount(''); // Refresh balances without page reload @@ -513,6 +514,18 @@ const TokenSwap = () => { return (
+ {/* Kurdistan Sun Animation Overlay during swap (only after confirm dialog is closed) */} + {isSwapping && !showConfirm && ( +
+
+ +

+ Processing your swap... +

+
+
+ )} +