Back to Projects
Project Case Study

Maharani Food Plaza

A freelance restaurant website with GSAP scroll animations, interactive menu, and EmailJS-powered reservation form.

Timeline

2026

Role

Lead Developer

Maharani Food Plaza
HTMLCSSJSGSAP

# 🍦 Maharani Ice Cream Parlour & Food Plaza

HTML5 JavaScript CSS-38B2AC?style=for-the-badge&logo=tailwind-css&logoColor=white" alt="TailwindCSS" class="inline-block mr-1 my-1" /> Zero Build License

Table of Contents


1. Project Overview

What is this project?

🍦 Maharani Ice Cream Parlour & Food Plaza

What real problem does it solve and who is it built for? It is built for local restaurants and cafés who need an instant, app-like mobile presence without the overhead of native app development, complex backend servers, or third-party delivery commission fees. It bridges the gap between physical dining and digital ordering by utilizing WhatsApp as the communication bridge.

Value proposition: A zero-build, mobile-first ordering engine turning casual browsers into paying customers via a seamless WhatsApp checkout.


2. Live Demo & Visuals

🔗 Live Demo Link Placeholder

<!-- Visuals:

  • Hero Section & Menu View
  • Category Scroll Navigation
  • Cart Checkout Drawer
  • Dark Theme & Light Theme -->

3. Tech Stack & Choices

TechnologyVersionWhy Chosen
Core
HTML5NativeProvides the semantic structure; chosen over frameworks (like React) for a zero-build, lightning-fast initial load.
Vanilla JavaScript (ES6)NativeHandles state, DOM manipulation, and logic dynamically without the overhead of heavy JavaScript bundles.
State Management
Local VariablesNativeLightweight JS objects (const cart = {}) manage state efficiently in memory without the need for external tools like Redux.
Styling
Tailwind CSSLatest (CDN)Enables rapid, utility-first styling directly in HTML without needing a build step or bundler.
Vanilla CSS3NativeUsed via style.css for custom micro-animations, glassmorphism UI overlays, and native scrollbar hiding.
Phosphor IconsLatest (Unpkg)Lightweight, scalable SVGs that visually enhance the menu UI consistently.
Google Fonts (Outfit)Web APIProvides a modern, premium, and highly legible typography setup that matches the brand identity.
Storage & APIs
localStorageNativePersists the user's Dark/Light mode preference across browser sessions reliably.
WhatsApp APIWeb LinkPowers a serverless, immediate checkout system (wa.me) bypassing the need for complex payment gateways.
Dev Tools
Zero-Build ArchitectureN/AExcluded bundlers like Webpack/Vite to keep the deployment process incredibly simple (can be hosted statically anywhere).


4. Core Features

  • ⭐ Mobile-First App-Like Experience
- What it does: Mimics a native iOS/Android application perfectly within the browser. - User Experience: Provides smooth drawer modals (cartPill & checkoutModal), sticky bottom sheets, and responsive card layouts heavily optimized for 360px-430px screens.
  • ⭐ Zero-Build Dynamic Rendering
- What it does: Renders the entire menu layout, categories, and dynamic buttons directly from a static JSON-like array (menuData). - User Experience: Ensures lightning speed load times and instant UI generation without any page reloads.
  • ⭐ Real-Time Fuzzy Search & Highlighting
- What it does: Filters through the menuData array dynamically based on user input, matching category items on the fly. - User Experience: Users see immediate search results, and their exact matched text is visually highlighted dynamically.
  • Intelligent Scroll-Spy Navigation
- What it does: Listens to the window scroll event (handleScrollSpy()) and calculates the viewport overlap with respective menu categories. - User Experience: The top navigation pill automatically updates and highlights exactly where the user is currently reading on the menu.
  • Serverless WhatsApp Checkout Flow
- What it does: Translates the cart state object into a neatly formatted WhatsApp text body string. - User Experience: Users click checkout, fill in mandatory details (like Name & Notes), and securely transfer their comprehensive order to the restaurant with one tap.
  • Persisted Dark & Light Mode
- What it does: Validates user system preference or manual toggle state, storing it within localStorage. - User Experience: Users can tap the theme icon to toggle between clean Light mode and sleek Dark mode with smooth transitions, remembered globally on reload.

5. Project Structure

shop/
├── assets/           # Stores static assets like logos and brand imagery (e.g., logo2.png, logof.png)
├── index.html        # Main entry point; contains semantic layout, drawer templates, and CDN imports
├── style.css         # Custom CSS logic for granular details (animations, patterns, glassmorphism overrides)
└── app.js            # The primary brain tracking state, data source array, DOM rendering, and event handlers
  • app.js is the core file, executing the heavy lifting for DOM and state management where usually a component framework would step in.

6. State Management & Data Flow

How is state managed in this project? State is managed internally using native JavaScript global variables within app.js, completely sidestepping complex external tools.

  • cart (Object): The global cart dictionary and primary store. Keys are item ids, values are quantity integers.
  • activeCategory (String): Tracks the current focused category for the scroll-spy logic.
  • menuData (Array of objects): Serves as the single source of truth database holding core item and price configurations.
Step-by-step Walkthrough: Adding an Item to the Cart
  1. User taps the ADD button, firing the inline click event updateCart(${id}, 1).
  2. updateCart() fires. If the item's id does not exist in the global cart object, it initializes the key gracefully.
  3. The cart updates and dynamically detects device hardware to trigger navigator.vibrate(50) for instant haptic feedback.
  4. The button mapped explicitly to that ID's container dynamically re-renders to an increment/decrement stepper UI via getButtonHTML(itemId, cart[itemId]).
  5. updateCartSummary() is natively invoked, recalculating totals via a lightweight loop.
  6. The cartPill dynamically removes its hidden and translate-y-28 classes, gracefully sweeping into the user's view from the bottom, carrying the updated totals.

7. Browser APIs & Technical Highlights

Browser APIs Used

API NameFile/LocationHow it worksWhy it was chosen
localStorageapp.js (initTheme)Reads to check for an existing "theme"; writes to capture the user's manual preference.To persist user toggle states securely so they effortlessly survive page resets.
window.matchMediaapp.js (initTheme)Intercepts (prefers-color-scheme: dark) media query constraints actively.Allows the interface to immediately adopt the viewer's OS-level theme autonomously.
navigator.vibrateapp.js (updateCart)Commands a short 50ms burst to the mobile vibration motor.Yields a high-end, premium tactile bump upon tapping matching native UI feel.
encodeURIComponentapp.js (sendToWhatsApp)Escapes dangerous characters, line breaks, and emojis internally.Formats the final WhatsApp checkout URL correctly mitigating broken redirect links.
getBoundingClientRectapp.js (scrollToCategory)Evaluates specific element pixel coordinates relative to the viewport dynamically.Informs logic to offset the scroll mathematically accounting for fixed navigation bars.

Technical Integrations & Libraries

  • Tailwind CSS (cdn.tailwindcss.com): Integrated directly into index.html. It supplies ultra-fast utility styling. The configuration object tailwind.config = { ... } is injected cleverly through app.js, dodging the requirement for an extensive node build environment.
  • Phosphor Icons: Interfaced cleanly through standard <script> tags mapping Unpkg CDNs, making it effortlessly reusable through pure CSS class parsing (e.g. <i class="ph ph-moon"></i>).

Performance Optimizations

  • Memory Efficiency Policy: The cart store actively monitors key usage. If an item quantity drops to 0, it completely unmounts the allocation block using delete cart[itemId], preventing dead states from hanging around.
  • GPU Accelerated Motion: Transitions deliberately use Tailwind transform, translate, and scale CSS classes to bypass heavy CPU repaints entirely, ensuring strict mobile hardware 60FPS parity.
  • Initial Skeleton Rendering: Handled an aggressive raw CSS skeleton block (#skeleton) hardcoded into index.html prior to JavaScript execution. This yields an immediate psychological paint layer before actual list construction begins.
  • Event Delegation Avoidance: Hardcoded onclick attributes were utilized directly into the component payloads, stripping out the heavy lifting of multi-layered event listeners traversing the widespread DOM tree.

8. Local Setup & Installation

Because this project utilizes a Zero-Build Architecture, running it locally is incredibly simple.

  1. Clone the repository:
   git clone https://github.com/itsrajaniket/freelance-restaurant-app.git
   
  1. Open the project:
There is no npm install or build step required. Simply open index.html directly in your browser. - Tip: For the best development experience, use the Live Server extension in VS Code to see real-time updates as you edit the HTML or CSS.

9. How to Customize the Menu

The entire menu is dynamically generated from the menuData array located in app.js.

To add, edit, or remove an item:

  1. Open app.js.
  2. Locate the const menuData array.
  3. Modify the JSON object. Example:

   {
     category: "Desserts",
     icon: "ph-cake",
     items: [
       { id: 2001, name: "Chocolate Brownie", price: 120, type: "veg", bestseller: true }
     ]
   }
   
  1. Save the file. The UI, dynamic routing, highlight chips, and search engine will instantly adapt to the new data without any HTML changes.

10. Future Roadmap

  • [ ] Payment Gateway Integration: Replace the WhatsApp cart redirection with a Razorpay or Stripe API for direct, secure online checkouts.
  • [ ] QR Code Table Ordering: Add URL parameter validation (e.g., ?table=4) so restaurants can place physical QR codes on tables to automatically attach the table number to the cart order.
  • [ ] Backend Database (Supabase/Firebase): Migrate the hardcoded menuData to a real-time cloud database, allowing store owners to toggle "Out of Stock" items without redeploying code.

11. Author & License

Developed by @itsrajaniket This project is open-source and available under the MIT License. Feel free to fork it, modify it, and use it for your own restaurants or freelance clients!

Interested in this project?

I'm always open to discussing technical implementations or potential collaborations.