File size: 774 Bytes
c4e3b10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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

import React, { useContext } from 'react';
import { ThemeContext } from '../App';

interface LoaderProps {
  loading: boolean;
}

const Loader: React.FC<LoaderProps> = ({ loading }) => {
  const { theme } = useContext(ThemeContext);

  return (
    <div
      className={`fixed top-0 left-0 w-full h-full flex justify-center items-center z-[9999] transition-opacity duration-1000 ease-in-out ${
        loading ? 'opacity-100' : 'opacity-0 pointer-events-none'
      } ${theme === 'dark' ? 'bg-[#0a0a0a]' : 'bg-[#f8f9fa]'}`}
    >
      <div
        className={`text-3xl animate-pulse ${
          theme === 'dark' ? 'text-[#00ffff]' : 'text-[#0066cc]'
        }`}
      >
        Initializing Mathematical Cosmos...
      </div>
    </div>
  );
};

export default Loader;