Tripura Documentation
A modern travel and tour booking website built with Next.js 16, React 19, and Tailwind CSS 4. Tripura showcases travel destinations, tour packages, and blog content with smooth scroll-triggered animations and a fully responsive design.
Tech Stack
@/* → src/*).| Package | Version | Purpose |
|---|---|---|
next | 16.1.6 | React framework with App Router |
react | 19.2.3 | UI library |
tailwindcss | 4.x | Utility-first CSS |
framer-motion | 12.35.0 | Animation library |
swiper | 11.2.10 | Carousel / slider |
nouislider | 15.8.1 | Price range slider |
@fortawesome/fontawesome-free | 7.2.0 | Icon library |
Getting Started
Prerequisites
- Node.js 18+ (LTS recommended)
- npm, yarn, or pnpm
Install & Run
# Clone the repository
git clone <repository-url>
cd tripura-nextjs
# Install dependencies
npm install
# Start development server (Turbopack)
npm run dev
# Build for production
npm run build
# Start production server
npm start
Open http://localhost:3000 in your browser.
Available Scripts
| Script | Command | Description |
|---|---|---|
dev | next dev | Start dev server with Turbopack |
build | next build | Production build (static prerender) |
start | next start | Serve production build |
lint | eslint | Run ESLint with Next.js rules |
Project Structure
tripura-nextjs/ ├── package.json ├── next.config.ts # Next.js configuration ├── tsconfig.json # TypeScript config (strict, @/* alias) ├── postcss.config.mjs # PostCSS → @tailwindcss/postcss ├── eslint.config.mjs # ESLint + Next.js core web vitals │ ├── src/ │ ├── app/ # App Router pages │ │ ├── layout.tsx # Root layout (fonts, vendor CSS, metadata) │ │ ├── globals.css # Tailwind import + custom utilities │ │ ├── page.tsx # Home page │ │ ├── about/ │ │ ├── contact/ │ │ ├── destinations/ │ │ ├── destinations-details/ │ │ ├── home-two/ │ │ ├── news/ │ │ ├── news-details/ │ │ ├── tour-details/ │ │ ├── tours/ │ │ └── tours-list/ │ │ │ ├── components/ # Reusable UI components │ │ ├── ClientLayout.tsx # Page wrapper (header, footer, hooks) │ │ ├── Header.tsx # Desktop navigation │ │ ├── MobileNav.tsx # Mobile drawer navigation │ │ ├── Footer.tsx # Site footer │ │ ├── FadeIn.tsx # Framer Motion scroll animation │ │ ├── Preloader.tsx # Loading spinner │ │ ├── BackToTop.tsx # Scroll-to-top button │ │ ├── SearchPopup.tsx # Search modal │ │ └── PageBanner.tsx # Page header with breadcrumb │ │ │ └── hooks/ # Custom React hooks │ ├── useAnimations.ts # Counter & progress bar animations │ ├── useSwiperInit.ts # Swiper carousel initializer │ └── useUIPlugins.ts # Sticky header, accordion, popups, slider │ └── public/ └── assets/ ├── css/ # Template CSS │ ├── tripura.css │ └── tripura-responsive.css ├── images/ # Static images └── vendors/ # Third-party CSS (FontAwesome, Swiper, etc.)
Configuration
TypeScript — tsconfig.json
Strict mode is enabled. The @/* path alias maps to ./src/* for clean imports.
{
"compilerOptions": {
"target": "ES2017",
"strict": true,
"jsx": "react-jsx",
"moduleResolution": "bundler",
"paths": { "@/*": ["./src/*"] }
}
}
PostCSS — postcss.config.mjs
Uses @tailwindcss/postcss as the only plugin — Tailwind CSS v4 style.
const config = {
plugins: {
"@tailwindcss/postcss": {},
},
};
export default config;
ESLint — eslint.config.mjs
Next.js core web vitals and TypeScript rules. Ignores build output directories
(.next, out, build).
Styling
CSS Architecture
Styling is organized in three layers:
| Layer | File(s) | Description |
|---|---|---|
| Tailwind | globals.css |
Tailwind CSS v4 import, custom container, utility classes |
| Template | tripura.css, tripura-responsive.css |
Template-specific styles, component classes, responsive overrides |
| Vendor | public/assets/vendors/ |
Third-party CSS (FontAwesome, Swiper, noUiSlider, Jarallax, etc.) |
Global CSS Utilities
/* globals.css */
@import "tailwindcss";
@layer base {
.container {
margin-inline: auto;
padding-inline: 15px;
}
}
@utility list-unstyled {
list-style: none;
padding-left: 0;
margin-bottom: 0;
}
@utility clearfix {
&::after {
content: "";
display: table;
clear: both;
}
}
Tailwind Breakpoints
Default Tailwind CSS v4 breakpoints are used throughout the project:
| Prefix | Min-width | Usage |
|---|---|---|
sm | 640px | Small devices |
md | 768px | Tablets |
lg | 1024px | Laptops |
xl | 1280px | Desktops |
2xl | 1536px | Large screens |
Pages & Routes
All pages live under src/app/ using the Next.js App Router convention.
Each page wraps its content in <ClientLayout> for the shared header,
footer, and client-side functionality. All 11 routes are statically prerendered at build time.
| Route | File | Description |
|---|---|---|
/ | src/app/page.tsx | Home — hero carousel with star rating, tour search form |
/home-two | src/app/home-two/page.tsx | Alternate home with background slideshow, 6 tour cards |
/about | src/app/about/page.tsx | About the company |
/destinations | src/app/destinations/page.tsx | Destinations in masonry grid layout |
/destinations-details | src/app/destinations-details/page.tsx | Individual destination with gallery |
/tours | src/app/tours/page.tsx | Featured tour packages — grid view |
/tours-list | src/app/tours-list/page.tsx | Tour packages — list view with sidebar filters |
/tour-details | src/app/tour-details/page.tsx | Tour detail with image slider, accordion, booking |
/news | src/app/news/page.tsx | Blog / travel stories listing |
/news-details | src/app/news-details/page.tsx | Individual article with two-column layout |
/contact | src/app/contact/page.tsx | Contact form with details |
Home Page — /
Main landing page featuring a Swiper hero carousel (3 slides) with 4.6-star
rating display and call-to-action buttons. Below the slider is a tour search form
with destination and date filters, animated into view with the FadeIn component.
- Swiper config: fade effect, 5s autoplay, pagination bullets
- Star rating SVG icons with numeric display
- Search redesign section with dropdown selectors
Home Two — /home-two
Alternate landing with a Vegas background slideshow (rotating background images)
and a tour search CTA. Displays 6 tour cards with pricing, duration, and feature lists.
Each card uses staggered FadeIn animations.
About — /about
Company information page with a hero banner, breadcrumb navigation, and content sections. Uses the standard page header pattern with background image.
Destinations — /destinations, /destinations-details
Destinations displays locations in a masonry grid layout with varied card sizes. Destination Details shows an individual location with an image gallery, description, and two-column layout (8/12 content + 4/12 sidebar).
Tours — /tours, /tours-list, /tour-details
Tours shows packages in a responsive grid (3 cols on xl, 2 on md). Tours List offers a list view with a sidebar containing a price range slider (noUiSlider). Tour Details has an image slider (Swiper with fade + pagination), FAQ accordion, and booking form.
News — /news, /news-details
News lists 6 articles with staggered fade-in animations. Topics include travel stories and destination guides. News Details shows a full article in a two-column layout.
Contact — /contact
Contact page with a form (left column) and contact details. Uses responsive flex grid layout.
Components
ClientLayout
src/components/ClientLayout.tsx
"use client"
Purpose
Top-level wrapper for all pages. Renders the full page shell (preloader, header, footer, mobile nav, search popup, back-to-top) and initializes all client-side hooks.
Props
| Prop | Type | Description |
|---|---|---|
children | ReactNode | Page content rendered between header and footer |
Hooks Initialized
useAnimations()— counter & progress bar animationsuseSwiperInit()— auto-initialize Swiper carouselsuseUIPlugins()— sticky header, accordion, popups, slider
Render Tree
<Preloader />
<div.announcement-bar>
<div.page-wrapper>
<Header />
{children}
<Footer />
</div>
<MobileNav />
<SearchPopup />
<BackToTop />
Header
src/components/Header.tsx
"use client"
Purpose
Desktop navigation bar with logo, dropdown menus, and route-aware active states.
Props
| Prop | Type | Description |
|---|---|---|
onMobileNavToggle | () => void | Callback to open mobile navigation drawer |
Navigation Items
Defined as a navItems array with the following structure:
| Menu | Children |
|---|---|
| Home | Home One (/), Home Two (/home-two) |
| Destinations | Destinations (/destinations), Destination Details (/destinations-details) |
| Tours | Tours (/tours), Tours List (/tours-list), Tour Details (/tour-details) |
| Pages | About (/about) |
| News | News (/news), News Details (/news-details) |
| Contact | (direct link to /contact) |
Active State Logic
Uses usePathname() from next/navigation to determine the current route.
The isItemActive() function checks if the pathname matches any child href.
Active parent <li> elements receive the current CSS class;
matching child <li> elements receive the active class.
MobileNav
src/components/MobileNav.tsx
"use client"
Purpose
Off-canvas mobile navigation drawer with accordion-style collapsible submenus.
Props
| Prop | Type | Description |
|---|---|---|
isOpen | boolean | Controls drawer visibility |
onClose | () => void | Callback to close the drawer |
Features
- Overlay backdrop with click-to-close
- Submenu toggle via
openMenusSet state - Same
navItemsand active state logic as Header - Expanded class (
.expanded) controls slide-in animation
Footer
src/components/Footer.tsx
Purpose
Site footer with branding, navigation links, social media, and CTA buttons.
Sections
- Left: Logo + three link columns (Pages, Socials, Contact)
- Right: Tagline "Travel smarter, greener, richer" + Contact Us & Subscribe buttons
- Bottom: Brand text "Travel ♦ Tripura"
FadeIn
src/components/FadeIn.tsx
"use client"
Purpose
Generic scroll-triggered animation wrapper using Framer Motion. Elements fade and slide into view when they enter the viewport.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | Content to animate |
className | string | — | CSS classes |
style | CSSProperties | — | Inline styles |
id | string | — | DOM id |
direction | "up" | "down" | "left" | "right" | "up" | Slide direction |
delay | number | 0 | Delay in seconds |
duration | number | 0.6 | Duration in seconds |
as | "div" | "section" | "li" | "span" | "div" | HTML element to render |
Direction Offsets
| Direction | Initial X | Initial Y |
|---|---|---|
up | 0 | 40px |
down | 0 | -40px |
left | -60px | 0 |
right | 60px | 0 |
Usage
<FadeIn direction="up" delay={0.2}>
<div className="tour-card">...</div>
</FadeIn>
<FadeIn as="li" direction="left" duration={0.8}>
<span>Animated list item</span>
</FadeIn>
Preloader
src/components/Preloader.tsx
"use client"
Purpose
Full-screen loading spinner shown on initial page load. Displays the Tripura star logo with a rotating ring.
Behavior
- Visible for 500ms, then adds
.preloader--hiddento fade out - At 1100ms, sets
display: noneto remove from flow - Cleans up timers on unmount
BackToTop
src/components/BackToTop.tsx
"use client"
Purpose
Floating button in the bottom-right corner. Appears after scrolling 300px and smoothly scrolls to the top on click.
SearchPopup
src/components/SearchPopup.tsx
"use client"
Purpose
Global search modal overlay with a text input and submit button. Toggled by the .active class. Includes overlay backdrop dismiss and body scroll locking.
PageBanner
src/components/PageBanner.tsx
Purpose
Reusable page header banner with a background image, title, and breadcrumb navigation.
Props
| Prop | Type | Description |
|---|---|---|
title | string | Page heading text |
breadcrumbs | { label: string; href?: string }[] | Breadcrumb items (href makes it a link) |
Usage
<PageBanner
title="About Us"
breadcrumbs={[
{ label: "Home", href: "/" },
{ label: "Pages" },
{ label: "About" },
]}
/>
Hooks
useAnimations
src/hooks/useAnimations.ts
Purpose
Handles scroll-triggered counter animations and progress bar fills using IntersectionObserver.
Features
| Target | Selector | Data Attribute | Animation |
|---|---|---|---|
| Odometer counters | .odometer |
data-odometer-final or data-count |
Animates from 0 to target over 2s with cubic ease-out |
| Progress bars | .count-bar |
data-percent |
Fills width over 1.5s with ease-out |
Both use a 30% visibility threshold and trigger only once per element.
useSwiperInit
src/hooks/useSwiperInit.ts
Purpose
Finds all elements with .thm-swiper__slider[data-swiper-options],
parses the JSON options from the data attribute, and creates Swiper instances.
Modules Loaded
- Navigation — prev/next arrows
- Pagination — dot indicators
- Autoplay — auto-rotation
- EffectFade — crossfade transitions
Usage in HTML
<div
class="thm-swiper__slider swiper-container"
data-swiper-options='{
"slidesPerView": 1,
"effect": "fade",
"autoplay": { "delay": 5000 },
"pagination": { "el": ".swiper-pagination", "clickable": true }
}'
>
<div class="swiper-wrapper">
<div class="swiper-slide">...</div>
</div>
</div>
useUIPlugins
src/hooks/useUIPlugins.ts
Purpose
Replaces multiple jQuery plugins with vanilla JavaScript equivalents. Initializes on mount and cleans up all event listeners on unmount.
Plugin Replacements
| Feature | Selector | Behavior |
|---|---|---|
| Sticky Header | .stricked-menu |
Clones nav into sticky element; adds .stricky-fixed on scroll > 130px |
| Accordion | .accrodion-grp |
Single-open accordion — clicking a title toggles .active |
| Video Popup | .video-popup |
Full-screen modal with iframe embed; auto-detects YouTube URLs |
| Image Popup | .img-popup |
Lightbox overlay for image links |
| Background Slideshow | .banner-bg-slide |
Rotates background images via JSON data-options |
| Price Range Slider | #range-slider-price |
noUiSlider with range 0–6000 and live min/max display |
Vendor CSS
External vendor stylesheets are loaded in the root layout via <link> tags.
These files live in public/assets/vendors/.
| Library | Path | Purpose |
|---|---|---|
| Font Awesome 7 | fontawesome/css/all.min.css | Icons (solid, regular, brands) |
| Jarallax | jarallax/jarallax.css | Parallax background styles |
| noUiSlider | nouislider/nouislider.min.css | Range slider styles |
| noUiSlider Pips | nouislider/nouislider.pips.css | Slider tick marks |
| Swiper | swiper/swiper.min.css | Carousel base styles |
| Tripura Icons | tripura-icons/style.css | Custom icon font |
| Reey Font | reey-font/stylesheet.css | Decorative display font |
Deployment
All pages are statically prerendered at build time. The output can be deployed to any static hosting platform or Node.js server.
Build Output
npm run build
✓ Compiled successfully
✓ Generating static pages (14/14)
Routes:
○ /
○ /_not-found
○ /about
○ /contact
○ /destinations
○ /destinations-details
○ /home-two
○ /news
○ /news-details
○ /tour-details
○ /tours
○ /tours-list
Vercel (Recommended)
Deploy directly from your Git repository to Vercel. No additional configuration is required — Vercel auto-detects Next.js projects.
Self-Hosted
# Build and start
npm run build
npm start
# Or export as static HTML (add output: 'export' to next.config.ts)
npm run build
# Serve the 'out' directory with any static server
Tripura - Travel & Tour Next.js Template • Built with Next.js, React, and Tailwind CSS