"use client"; import useSWR from "swr"; import Image from "next/image"; import Link from "next/link"; import BottomFooter from "@components/BottomFooter"; import { createPoster } from "@utils/axiosHelpers"; import getMagnitudeColor from "@utils/getMagnitudeColour"; import { TbHexagon } from "react-icons/tb"; // formats the date function getRelativeDate(dateString: string): string { const date = new Date(dateString); const now = new Date(); const diffMs = now.getTime() - date.getTime(); const diffDays = Math.floor(diffMs / (1000 * 60 * 60 * 24)); if (diffDays === 0) return "today"; if (diffDays === 1) return "yesterday"; return date.toLocaleDateString(); } // copied from sidebar function MagnitudeNumber({ magnitude }: { magnitude: number }) { const magnitudeStr = magnitude.toFixed(1); const [whole, decimal] = magnitudeStr.split("."); return (
{whole} . {decimal}
); } export default function Home() { const { data, error, isLoading } = useSWR("/api/earthquakes", createPoster({ rangeDaysPrev: 6 })); // Take 5 most recent const recents = (data?.earthquakes ?? []) .sort((a, b) => new Date(b.date).getTime() - new Date(a.date).getTime()) .slice(0, 5); return (
Background Image
Title Image

Education Icon

Earthquakes

Log new earthquakes with their required details or search past seismic events

Research Icon

Observatories

Find recently active observatories, and newly opened/closed sites

Technology Icon

Artefacts

View or purchase recently discovered artefacts from seismic events

Background Image

Welcome to Tremor Tracker

TremorTracker is a non-profit website and research company, that aims to provide true, reliable data. Our mission is seismic education and preparation for all

What is an earthquake?

Earthquakes are a shaking of the earth's surface caused by a sudden release of energy underground. They can range in size, from tiny trembles to large quakes, which can cause destruction and even tsunamis. Hundreds of earthquakes happen every day—but most are too small to feel.

How do we log earthquakes?

What information are we interested in?

info

What are observatories?

What is their role?

info

Recent Earthquake Events

Learn about the most recent earthquake events from around the world:

{error && (

Failed to load earthquakes.

)} {isLoading && (

Loading...

)} {!isLoading && recents.length === 0 && (

No earthquakes found.

)}
{recents.map((eq) => (
Earthquake in {eq.location || (eq.code && eq.code.split("-")[2])}
{getRelativeDate(eq.date)}
))}

Contact Information

Learn about Tremor Tracker's mission, our team or contact us directly:

Education Icon

Contact us directly

Visit our socials or leave us a message via phone or email.

Research Icon

Our Mission

Find out more about our purpose and the features we offer.

Technology Icon

Meet the Team

Learn about our team leads and their responsibilities.

Background Image
); // return ( //
//
// Next.js logo //
    //
  1. // Get started by editing{" "} // // src/app/page.tsx // // . //
  2. //
  3. Save and see your changes instantly.
  4. //
//
// // Vercel logomark // Deploy now // // // Read our docs // //
//
// //
// ); }