Skip to main content

Overview

The @hyperscape/website package is the official marketing website for Hyperscape, featuring a modern landing page with 3D effects, responsive design, and the $GOLD token page. Tech Stack:
  • Next.js 15: React framework with static export
  • React 19: UI framework
  • Three.js: 3D rendering and effects
  • React Three Fiber: Declarative Three.js
  • Tailwind CSS 4: Utility-first styling
  • Framer Motion: Animations
  • GSAP: Advanced animations
  • Lenis: Smooth scrolling

Package Structure


Development

Commands

Port Allocation

The website runs on port 3334 to avoid conflicts with the game client (3333) and other services.

Configuration

Next.js Config

Location: packages/website/next.config.ts
TypeScript build errors are ignored because React Three Fiber types conflict with Next.js’s jsx: preserve mode. The code works at runtime.

Environment Variables

Location: packages/website/.env.example
Copy .env.example to .env.local and fill in values.

Pages

Landing Page (/)

Components:
  • Header - Navigation with logo and links
  • Hero - Main hero section with logo, tagline, and CTA
  • Features - Feature cards with icons
  • CTA - Call-to-action banner
  • Footer - Links and social media
  • Background - Gradient background with image overlay
Features:
  • Responsive layout (mobile, tablet, desktop)
  • Staggered animations with Framer Motion
  • Smooth scrolling with Lenis
  • Dark fantasy theme with gold accents

$GOLD Token Page (/gold)

Components:
  • GoldToken - Complete token page with scroll design
  • Two-column hero - Token image and description
  • Token details - Contract address with copy-to-clipboard
  • Features - Token utility and benefits
  • How it works - Token mechanics
  • CTA - Call-to-action with banner
Token Information:
  • 1 $GOLD = 1 gold in-game
  • Be the richest player at launch
  • Exclusive items for top holders

Styling

Theme Configuration

Location: packages/website/src/app/globals.css Custom CSS variables for consistent theming:

Utility Classes

Responsive Container Padding


Components

Background

Location: packages/website/src/components/Background.tsx Reusable background with gradient overlay:
Features:
  • Fixed positioning (stays in place during scroll)
  • Horizontal gradient with dark center, gold-tinted edges
  • Customizable background image
  • Adjustable opacity

Hero

Location: packages/website/src/components/Hero/Hero.tsx Landing page hero section: Features:
  • Responsive layout (stacks on mobile)
  • Logo with glow effect
  • Tagline with gradient text
  • CTA button with hover effects
  • Staggered animations (logo → tagline → button)

Features

Location: packages/website/src/components/Features/Features.tsx Feature cards section: Features:
  • Grid layout (1 column mobile, 2 columns desktop)
  • Icon + title + description
  • Hover effects
  • Responsive sizing

CTA

Location: packages/website/src/components/CTA/CTA.tsx Call-to-action section: Features:
  • Banner background image
  • Gradient overlay
  • Centered text and button
  • Responsive padding

GoldToken

Location: packages/website/src/components/GoldToken/GoldToken.tsx Complete $GOLD token page: Sections:
  • Two-column hero (token image + description)
  • Token details with contract address
  • Features grid
  • How it works
  • CTA section
Features:
  • Scroll-style design
  • Copy-to-clipboard for contract address
  • Responsive layout
  • Gold theme throughout

Fonts

Font Configuration

Location: packages/website/src/lib/fonts.ts
Usage:
  • Cinzel: Display font for headings
  • Rubik: Body font for content

SEO & Metadata

Root Layout Metadata

Location: packages/website/src/app/layout.tsx

Page-Specific Metadata


Deployment

Static Export

The website builds to a static site for deployment:
Build Output:
  • HTML files for each page
  • Optimized CSS and JavaScript
  • Static assets (images, fonts)
  • No server-side rendering required

Deployment Targets

Compatible with:
  • Vercel (recommended)
  • Netlify
  • Cloudflare Pages
  • GitHub Pages
  • Any static hosting

Dependencies

Core Dependencies

Dev Dependencies


Performance Optimizations

Image Optimization

Images are unoptimized for static export:
For production, consider:
  • Pre-optimizing images with Sharp
  • Using WebP format
  • Responsive image sizes

GPU Detection

Location: Uses detect-gpu package

Reduced Motion

Respects user preferences:

Accessibility

Features

  • Semantic HTML structure
  • ARIA labels on interactive elements
  • Keyboard navigation support
  • Focus visible states
  • Reduced motion support
  • High contrast text (WCAG AA compliant)

Color Contrast

All text meets WCAG AA standards:
  • Primary text: #f5f0e8 on #0a0a0c (17.8:1)
  • Secondary text: #c4b896 on #0a0a0c (10.2:1)
  • Muted text: #7d7460 on #0a0a0c (4.8:1)

Customization

Adding a New Page

  1. Create page file in src/app/:
  1. Add link to Header component

Customizing Theme

Edit CSS variables in src/app/globals.css:

Assets

Images

Location: packages/website/public/images/

Fonts

Location: packages/website/public/fonts/
  • rubik.woff2 - Body font (self-hosted for performance)

Build Output

Static Export

Output Structure:

Bundle Size

Optimized for performance:
  • Tailwind CSS purged (only used classes)
  • Three.js tree-shaken
  • Code splitting by route
  • Static generation (no runtime overhead)

Integration with Monorepo

Workspace Configuration

The website package is included in the monorepo but independent - it doesn’t depend on other Hyperscape packages.

Turbo Configuration


Troubleshooting

TypeScript Errors

Issue: R3F types conflict with Next.js Solution: Build errors are ignored in config. If you need strict type checking:

Image Optimization

Issue: Images not optimized in static export Solution: Pre-optimize images before adding:

Font Loading

Issue: FOUT (Flash of Unstyled Text) Solution: Fonts use display: swap for better UX. Consider preloading:

Package Overview

All packages in the monorepo

Development Setup

Local development workflow

Deployment

Production deployment guide