← back to Calc 67

app/page.tsx

119 lines

'use client'

import { useState } from 'react'
import ScientificCalculator from '@/components/ScientificCalculator'
import MortgageCalculator from '@/components/MortgageCalculator'
import BMICalculator from '@/components/BMICalculator'
import TipCalculator from '@/components/TipCalculator'

export default function Home() {
  const [activeCalc, setActiveCalc] = useState<'scientific' | 'mortgage' | 'bmi' | 'tip'>('scientific')
  const [showSecret, setShowSecret] = useState(false)

  return (
    <main className="min-h-screen bg-gradient-to-br from-blue-600 via-white to-red-600 p-2 sm:p-3 pt-safe pb-safe">
      <div className="max-w-4xl mx-auto pt-4">
        {/* Header */}
        <div className="text-center mb-3 sm:mb-4">
          <h1 className="text-3xl sm:text-4xl md:text-5xl font-bold text-blue-900 mb-2">
            🇺🇸 67 Calc
          </h1>
          <p className="text-base sm:text-lg md:text-xl text-blue-800 font-semibold">
            American Made Calculator
          </p>
        </div>

        {/* Calculator Tabs */}
        <div className="flex flex-wrap justify-center gap-2 sm:gap-3 mb-3 sm:mb-4">
          <button
            onClick={(e) => {
              e.preventDefault();
              setActiveCalc('scientific');
            }}
            onTouchEnd={(e) => {
              e.preventDefault();
              setActiveCalc('scientific');
            }}
            className={`px-4 sm:px-6 py-2 sm:py-3 rounded-lg font-bold select-none cursor-pointer text-base sm:text-lg md:text-xl shadow-lg ${
              activeCalc === 'scientific'
                ? 'bg-blue-800 text-white scale-105'
                : 'bg-white/80 text-blue-900'
            }`}
            style={{ WebkitTapHighlightColor: 'transparent' }}
          >
            🔬 Calculator
          </button>
          <button
            onClick={(e) => {
              e.preventDefault();
              setActiveCalc('mortgage');
            }}
            onTouchEnd={(e) => {
              e.preventDefault();
              setActiveCalc('mortgage');
            }}
            className={`px-4 sm:px-6 py-2 sm:py-3 rounded-lg font-bold select-none cursor-pointer text-base sm:text-lg md:text-xl shadow-lg ${
              activeCalc === 'mortgage'
                ? 'bg-blue-800 text-white scale-105'
                : 'bg-white/80 text-blue-900'
            }`}
            style={{ WebkitTapHighlightColor: 'transparent' }}
          >
            🏠 Mortgage
          </button>
          <button
            onClick={(e) => {
              e.preventDefault();
              setActiveCalc('bmi');
            }}
            onTouchEnd={(e) => {
              e.preventDefault();
              setActiveCalc('bmi');
            }}
            className={`px-4 sm:px-6 py-2 sm:py-3 rounded-lg font-bold select-none cursor-pointer text-base sm:text-lg md:text-xl shadow-lg ${
              activeCalc === 'bmi'
                ? 'bg-blue-800 text-white scale-105'
                : 'bg-white/80 text-blue-900'
            }`}
            style={{ WebkitTapHighlightColor: 'transparent' }}
          >
            💪 BMI
          </button>
          <button
            onClick={(e) => {
              e.preventDefault();
              setActiveCalc('tip');
            }}
            onTouchEnd={(e) => {
              e.preventDefault();
              setActiveCalc('tip');
            }}
            className={`px-4 sm:px-6 py-2 sm:py-3 rounded-lg font-bold select-none cursor-pointer text-base sm:text-lg md:text-xl shadow-lg ${
              activeCalc === 'tip'
                ? 'bg-blue-800 text-white scale-105'
                : 'bg-white/80 text-blue-900'
            }`}
            style={{ WebkitTapHighlightColor: 'transparent' }}
          >
            💵 Tip
          </button>
        </div>

        {/* Calculator Display */}
        <div className="mb-3 sm:mb-4">
          {activeCalc === 'scientific' && <ScientificCalculator />}
          {activeCalc === 'mortgage' && <MortgageCalculator />}
          {activeCalc === 'bmi' && <BMICalculator />}
          {activeCalc === 'tip' && <TipCalculator />}
        </div>

        {/* Footer */}
        <div className="text-center text-blue-900/70 text-sm sm:text-base">
          <p className="mb-1">🇺🇸 Proudly American</p>
          <p>Made with ❤️ in the USA</p>
        </div>
      </div>
    </main>
  )
}