CBV01 commited on
Commit
0bfcc32
·
1 Parent(s): 061901d

style(campaigns): set 2 grid cards per row and localize color to angled top beam

Browse files
Files changed (1) hide show
  1. frontend/src/app/campaigns/page.tsx +38 -27
frontend/src/app/campaigns/page.tsx CHANGED
@@ -507,11 +507,11 @@ export default function CampaignsPage() {
507
  switch (status) {
508
  case 'completed':
509
  return {
510
- topBorder: 'border-t-2 border-t-teal-500/80',
511
- cardBg: 'bg-[#0e1514] bg-gradient-to-b from-teal-500/[0.06] via-[#0e1514] to-[#0e1514]',
512
- iconBg: 'bg-teal-500/15 text-teal-400',
513
- dotColor: 'bg-teal-400',
514
- accentText: 'text-teal-400',
515
  ringColor: '#2dd4bf',
516
  statusText: 'COMPLETED',
517
  actionBtn: 'bg-white/[0.04] text-neutral-300 hover:bg-white/[0.08] border border-white/[0.08]'
@@ -520,22 +520,22 @@ export default function CampaignsPage() {
520
  case 'active':
521
  case 'running':
522
  return {
523
- topBorder: 'border-t-2 border-t-emerald-500/80',
524
- cardBg: 'bg-[#0d1412] bg-gradient-to-b from-emerald-500/[0.06] via-[#0d1412] to-[#0d1412]',
525
- iconBg: 'bg-emerald-500/15 text-emerald-400',
526
- dotColor: 'bg-emerald-400',
527
- accentText: 'text-emerald-400',
528
  ringColor: '#34d399',
529
  statusText: 'ACTIVE',
530
  actionBtn: 'bg-white/[0.04] text-neutral-300 hover:bg-white/[0.08] border border-white/[0.08]'
531
  };
532
  case 'paused':
533
  return {
534
- topBorder: 'border-t-2 border-t-amber-500/80',
535
- cardBg: 'bg-[#15120d] bg-gradient-to-b from-amber-500/[0.06] via-[#15120d] to-[#15120d]',
536
- iconBg: 'bg-amber-500/15 text-amber-400',
537
- dotColor: 'bg-amber-400',
538
- accentText: 'text-amber-400',
539
  ringColor: '#fbbf24',
540
  statusText: 'PAUSED',
541
  actionBtn: 'bg-[#12281d] text-[#34d399] hover:bg-[#183526] border border-emerald-500/30'
@@ -543,20 +543,20 @@ export default function CampaignsPage() {
543
  case 'failed':
544
  case 'error':
545
  return {
546
- topBorder: 'border-t-2 border-t-rose-500/80',
547
- cardBg: 'bg-[#150d0f] bg-gradient-to-b from-rose-500/[0.06] via-[#150d0f] to-[#150d0f]',
548
- iconBg: 'bg-rose-500/15 text-rose-400',
549
- dotColor: 'bg-rose-400',
550
- accentText: 'text-rose-400',
551
  ringColor: '#fb7185',
552
  statusText: 'FAILED',
553
  actionBtn: 'bg-rose-950/70 text-rose-400 hover:bg-rose-900/70 border border-rose-500/30'
554
  };
555
  default:
556
  return {
557
- topBorder: 'border-t-2 border-t-white/[0.12]',
558
- cardBg: 'bg-[#111317]',
559
- iconBg: 'bg-white/[0.06] text-neutral-400',
560
  dotColor: 'bg-neutral-400',
561
  accentText: 'text-neutral-400',
562
  ringColor: '#64748b',
@@ -705,8 +705,8 @@ export default function CampaignsPage() {
705
  </button>
706
  </div>
707
  ) : viewMode === 'grid' ? (
708
- /* Natural Modern Grid Cards Inspired by User Reference */
709
- <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5">
710
  {filteredCampaigns.map((camp) => {
711
  const progressPct = Math.min(100, Math.round(((camp.sent_count || 0) / Math.max(1, camp.total_targets || 1)) * 100));
712
  let failedCount = 0;
@@ -747,8 +747,14 @@ export default function CampaignsPage() {
747
  return (
748
  <div
749
  key={camp.id}
750
- className={`relative rounded-2xl ${cardStyle.cardBg} ${cardStyle.topBorder} p-6 transition-all duration-300 hover:translate-y-[-2px] flex flex-col justify-between group/card shadow-sm`}
 
751
  >
 
 
 
 
 
752
  <div>
753
  {/* Header: Icon, Title, Status & Action Button */}
754
  <div className="flex items-start justify-between gap-3 mb-2.5">
@@ -953,8 +959,13 @@ export default function CampaignsPage() {
953
  return (
954
  <div
955
  key={camp.id}
956
- className={`relative rounded-2xl ${cardStyle.cardBg} ${cardStyle.topBorder} p-4 transition-all flex flex-col md:flex-row md:items-center justify-between gap-4 group/card`}
 
957
  >
 
 
 
 
958
  <div className="flex items-center gap-3.5 min-w-0">
959
  <div className={`w-11 h-11 rounded-2xl flex items-center justify-center shrink-0 ${cardStyle.iconBg}`}>
960
  <Zap size={20} className="fill-current" />
 
507
  switch (status) {
508
  case 'completed':
509
  return {
510
+ topBeamColor: 'from-transparent via-teal-400 to-transparent',
511
+ radialGlow: 'radial-gradient(circle at 45% -20%, rgba(45, 212, 191, 0.12) 0%, rgba(45, 212, 191, 0.02) 40%, transparent 70%)',
512
+ iconBg: 'bg-[#102422] text-[#2dd4bf]',
513
+ dotColor: 'bg-[#2dd4bf]',
514
+ accentText: 'text-[#2dd4bf]',
515
  ringColor: '#2dd4bf',
516
  statusText: 'COMPLETED',
517
  actionBtn: 'bg-white/[0.04] text-neutral-300 hover:bg-white/[0.08] border border-white/[0.08]'
 
520
  case 'active':
521
  case 'running':
522
  return {
523
+ topBeamColor: 'from-transparent via-emerald-400 to-transparent',
524
+ radialGlow: 'radial-gradient(circle at 45% -20%, rgba(52, 211, 153, 0.12) 0%, rgba(52, 211, 153, 0.02) 40%, transparent 70%)',
525
+ iconBg: 'bg-[#13271d] text-[#34d399]',
526
+ dotColor: 'bg-[#34d399]',
527
+ accentText: 'text-[#34d399]',
528
  ringColor: '#34d399',
529
  statusText: 'ACTIVE',
530
  actionBtn: 'bg-white/[0.04] text-neutral-300 hover:bg-white/[0.08] border border-white/[0.08]'
531
  };
532
  case 'paused':
533
  return {
534
+ topBeamColor: 'from-transparent via-amber-400 to-transparent',
535
+ radialGlow: 'radial-gradient(circle at 50% -20%, rgba(251, 191, 36, 0.12) 0%, rgba(251, 191, 36, 0.02) 40%, transparent 70%)',
536
+ iconBg: 'bg-[#272012] text-[#fbbf24]',
537
+ dotColor: 'bg-[#fbbf24]',
538
+ accentText: 'text-[#fbbf24]',
539
  ringColor: '#fbbf24',
540
  statusText: 'PAUSED',
541
  actionBtn: 'bg-[#12281d] text-[#34d399] hover:bg-[#183526] border border-emerald-500/30'
 
543
  case 'failed':
544
  case 'error':
545
  return {
546
+ topBeamColor: 'from-transparent via-rose-400 to-transparent',
547
+ radialGlow: 'radial-gradient(circle at 45% -20%, rgba(244, 63, 94, 0.12) 0%, rgba(244, 63, 94, 0.02) 40%, transparent 70%)',
548
+ iconBg: 'bg-[#271216] text-[#fb7185]',
549
+ dotColor: 'bg-[#fb7185]',
550
+ accentText: 'text-[#fb7185]',
551
  ringColor: '#fb7185',
552
  statusText: 'FAILED',
553
  actionBtn: 'bg-rose-950/70 text-rose-400 hover:bg-rose-900/70 border border-rose-500/30'
554
  };
555
  default:
556
  return {
557
+ topBeamColor: 'from-transparent via-white/20 to-transparent',
558
+ radialGlow: 'none',
559
+ iconBg: 'bg-[#1a1e24] text-neutral-400',
560
  dotColor: 'bg-neutral-400',
561
  accentText: 'text-neutral-400',
562
  ringColor: '#64748b',
 
705
  </button>
706
  </div>
707
  ) : viewMode === 'grid' ? (
708
+ /* Natural Modern Grid Cards - Two Per Line (Matching Screenshot) */
709
+ <div className="grid grid-cols-1 lg:grid-cols-2 gap-5">
710
  {filteredCampaigns.map((camp) => {
711
  const progressPct = Math.min(100, Math.round(((camp.sent_count || 0) / Math.max(1, camp.total_targets || 1)) * 100));
712
  let failedCount = 0;
 
747
  return (
748
  <div
749
  key={camp.id}
750
+ className="relative rounded-2xl bg-[#111513] border border-white/[0.05] p-6 transition-all duration-300 hover:translate-y-[-2px] flex flex-col justify-between group/card shadow-sm overflow-hidden"
751
+ style={{ backgroundImage: cardStyle.radialGlow !== 'none' ? cardStyle.radialGlow : undefined }}
752
  >
753
+ {/* Angled Glowing Top Beam */}
754
+ <div
755
+ className={`absolute -top-px left-[15%] right-[15%] h-[2px] bg-gradient-to-r ${cardStyle.topBeamColor} pointer-events-none`}
756
+ />
757
+
758
  <div>
759
  {/* Header: Icon, Title, Status & Action Button */}
760
  <div className="flex items-start justify-between gap-3 mb-2.5">
 
959
  return (
960
  <div
961
  key={camp.id}
962
+ className="relative rounded-2xl bg-[#111513] border border-white/[0.05] p-4 transition-all flex flex-col md:flex-row md:items-center justify-between gap-4 group/card overflow-hidden"
963
+ style={{ backgroundImage: cardStyle.radialGlow !== 'none' ? cardStyle.radialGlow : undefined }}
964
  >
965
+ {/* Angled Glowing Top Beam */}
966
+ <div
967
+ className={`absolute -top-px left-[20%] right-[20%] h-[2px] bg-gradient-to-r ${cardStyle.topBeamColor} pointer-events-none`}
968
+ />
969
  <div className="flex items-center gap-3.5 min-w-0">
970
  <div className={`w-11 h-11 rounded-2xl flex items-center justify-center shrink-0 ${cardStyle.iconBg}`}>
971
  <Zap size={20} className="fill-current" />