All files / web/src/app/arcade/complement-race/components RouteCelebration.tsx

0% Statements 0/171
0% Branches 0/1
0% Functions 0/1
0% Lines 0/171

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172                                                                                                                                                                                                                                                                                                                                                       
'use client'

import { getRouteTheme } from '../lib/routeThemes'

interface RouteCelebrationProps {
  completedRouteNumber: number
  nextRouteNumber: number
  onContinue: () => void
}

export function RouteCelebration({
  completedRouteNumber,
  nextRouteNumber,
  onContinue,
}: RouteCelebrationProps) {
  const completedTheme = getRouteTheme(completedRouteNumber)
  const nextTheme = getRouteTheme(nextRouteNumber)

  return (
    <div
      style={{
        position: 'fixed',
        top: 0,
        left: 0,
        right: 0,
        bottom: 0,
        background: 'rgba(0, 0, 0, 0.7)',
        display: 'flex',
        alignItems: 'center',
        justifyContent: 'center',
        zIndex: 9999,
        animation: 'fadeIn 0.3s ease-out',
      }}
    >
      <div
        style={{
          background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
          borderRadius: '24px',
          padding: '40px',
          maxWidth: '500px',
          textAlign: 'center',
          boxShadow: '0 20px 60px rgba(0, 0, 0, 0.5)',
          animation: 'scaleIn 0.5s ease-out',
          color: 'white',
        }}
      >
        {/* Celebration header */}
        <div
          style={{
            fontSize: '64px',
            marginBottom: '20px',
            animation: 'bounce 1s ease-in-out infinite',
          }}
        >
          🎉
        </div>

        <h2
          style={{
            fontSize: '32px',
            fontWeight: 'bold',
            marginBottom: '16px',
            textShadow: '0 2px 10px rgba(0, 0, 0, 0.3)',
          }}
        >
          Route Complete!
        </h2>

        {/* Completed route info */}
        <div
          style={{
            background: 'rgba(255, 255, 255, 0.2)',
            borderRadius: '12px',
            padding: '16px',
            marginBottom: '24px',
          }}
        >
          <div style={{ fontSize: '40px', marginBottom: '8px' }}>{completedTheme.emoji}</div>
          <div style={{ fontSize: '20px', fontWeight: 600 }}>{completedTheme.name}</div>
          <div style={{ fontSize: '16px', opacity: 0.9, marginTop: '4px' }}>
            Route {completedRouteNumber}
          </div>
        </div>

        {/* Next route preview */}
        <div
          style={{
            fontSize: '14px',
            opacity: 0.9,
            marginBottom: '8px',
          }}
        >
          Next destination:
        </div>
        <div
          style={{
            background: 'rgba(255, 255, 255, 0.15)',
            borderRadius: '12px',
            padding: '12px',
            marginBottom: '24px',
            border: '2px dashed rgba(255, 255, 255, 0.3)',
          }}
        >
          <div style={{ fontSize: '32px', marginBottom: '4px' }}>{nextTheme.emoji}</div>
          <div style={{ fontSize: '18px', fontWeight: 600 }}>{nextTheme.name}</div>
          <div style={{ fontSize: '14px', opacity: 0.8, marginTop: '4px' }}>
            Route {nextRouteNumber}
          </div>
        </div>

        {/* Continue button */}
        <button
          onClick={onContinue}
          style={{
            background: 'white',
            color: '#667eea',
            border: 'none',
            borderRadius: '12px',
            padding: '16px 32px',
            fontSize: '18px',
            fontWeight: 'bold',
            cursor: 'pointer',
            boxShadow: '0 4px 12px rgba(0, 0, 0, 0.2)',
            transition: 'transform 0.2s ease, box-shadow 0.2s ease',
          }}
          onMouseEnter={(e) => {
            e.currentTarget.style.transform = 'translateY(-2px)'
            e.currentTarget.style.boxShadow = '0 6px 16px rgba(0, 0, 0, 0.3)'
          }}
          onMouseLeave={(e) => {
            e.currentTarget.style.transform = 'translateY(0)'
            e.currentTarget.style.boxShadow = '0 4px 12px rgba(0, 0, 0, 0.2)'
          }}
        >
          Continue Journey 🚂
        </button>
      </div>

      <style>{`
        @keyframes fadeIn {
          from {
            opacity: 0;
          }
          to {
            opacity: 1;
          }
        }

        @keyframes scaleIn {
          from {
            transform: scale(0.8);
            opacity: 0;
          }
          to {
            transform: scale(1);
            opacity: 1;
          }
        }

        @keyframes bounce {
          0%, 100% {
            transform: translateY(0);
          }
          50% {
            transform: translateY(-10px);
          }
        }
      `}</style>
    </div>
  )
}