technical-test-nextjs-tailwind Tailwind Templates

Technical Test Nextjs Tailwind

CloverMint Nonprofit Website

A modern, responsive website built with Next.js 14 and TailwindCSS for the CloverMint Nonprofit organization.

๐Ÿš€ Tech Stack

  • Framework: Next.js 14
  • Styling: TailwindCSS
  • Language: TypeScript
  • Icons: Lucide React
  • Development Tools:
    • PostCSS
    • Autoprefixer

๐Ÿ“ Project Structure

clovermint-nonprofit/
โ”œโ”€โ”€ app/                    # Next.js 14 app directory
โ”‚   โ”œโ”€โ”€ blog/               # Blog section
โ”‚   โ”œโ”€โ”€ contact/            # Contact page
โ”‚   โ”œโ”€โ”€ partner/            # Partners section
โ”‚   โ”œโ”€โ”€ team/               # Team section
โ”‚   โ”œโ”€โ”€ globals.css         # Global styles
โ”‚   โ”œโ”€โ”€ layout.tsx          # Root layout
โ”‚   โ””โ”€โ”€ page.tsx            # Home page
โ”œโ”€โ”€ components/             # Reusable components
โ”‚   โ”œโ”€โ”€ Logo.client.tsx     # Logo component
โ”‚   โ”œโ”€โ”€ Nav.client.tsx      # Navigation component
โ”‚   โ””โ”€โ”€ card.tsx            # Card component
โ”œโ”€โ”€ public/                 # Static assets
โ””โ”€โ”€ [Configuration files]   # Various config files

๐ŸŽฏ Features

  • Modern Stack: Built with Next.js 14 and TypeScript for robust type safety.
  • Responsive Design: Fully responsive layout using TailwindCSS.
  • Component Structure:
    • Custom Navigation Component
    • Logo Component
    • Reusable Card Component
  • Multiple Sections:
    • Blog Section
    • Contact Page
    • Partner Section
    • Team Section

๐Ÿ› ๏ธ Installation

  1. Clone the repository:
    git clone https://github.com/CASANOVA660/technical-test-nextjs-tailwind.git
    
  2. Install dependencies:
    npm install
    
  3. Run the development server:
    npm run dev
    
  4. Open http://localhost:3000 in your browser.

๐Ÿ“œ Available Scripts

  • npm run dev - Run development server
  • npm run build - Build production version
  • npm start - Start production server
  • npm run lint - Run linting

๐Ÿ”ง Configuration Files

  • next.config.js - Next.js configuration
  • tailwind.config.js - TailwindCSS configuration
  • postcss.config.js - PostCSS configuration
  • tsconfig.json - TypeScript configuration

๐ŸŒŸ Dependencies

Main Dependencies

  • next: ^14.0.4
  • react: ^18.2.0
  • react-dom: ^18.2.0
  • lucide-react: ^0.473.0

Development Dependencies

  • typescript: ^5.3.3
  • tailwindcss: ^3.4.0
  • postcss: ^8.4.32
  • autoprefixer: ^10.4.16
  • Various TypeScript types packages

๐ŸŽจ Technical Highlights

Dynamic Navigation with IntersectionObserver

The website features a sophisticated navigation system that dynamically adapts to the page content:

Color Adaptation System

  • Automatic Color Switching: The navigation logo automatically changes color based on the background section currently in view.
  • Scroll-Based Updates: Uses the IntersectionObserver API for efficient scroll detection.
  • Performance Optimized: More efficient than traditional scroll event listeners.

Implementation Details

const observerOptions = {
  threshold: [0, 0.05],
  rootMargin: '-1px 0px 0px 0px'
};

const observerCallback: IntersectionObserverCallback = (entries) => {
  entries.forEach(entry => {
    if (entry.isIntersecting) {
      const color = entry.target.getAttribute('data-logo-color');
      if (color) {
        setLogoColor(color); // Example state setter for logo color
      }
    }
  });
};

const observer = new IntersectionObserver(observerCallback, observerOptions);
document.querySelectorAll('.section').forEach(section => observer.observe(section));

Color Mapping

The navigation adapts to different sections with specific color combinations:

  • Light Cream Background (#EDEEC9) โ†’ Logo: #98C9A3
  • Green Background (#98C8A3) โ†’ Logo: #EDEEC9
  • Light Green Background (#DDE7C7) โ†’ Logo: #EDEEC9
  • Dark Background (#333333) โ†’ Logo: #EDEEC9

Route-Specific Styling

Special color handling for specific routes:

  • Blog Page (/blog) โ†’ Green Logo: #77BFA3
  • Partner Page (/partner) โ†’ Cream Logo: #EDEEC9

Technical Benefits

  • ๐Ÿš€ Optimized Performance
  • ๐Ÿ“ฑ Responsive Design
  • ๐ŸŽฏ Precise Intersection Detection
  • ๐Ÿงน Automatic Cleanup
  • โ™ป๏ธ Memory Efficient

๐Ÿ”„ Version

Current Version: 0.1.0

Top categories

Loading Svelte Themes