Components
LoadingScreen
File:components/atoms/loading-screen.tsx
Full-screen splash gate that appears on first page load. It renders on top of everything (z-index: 60) using AnimatePresence from framer-motion and exits with a blur + scale + rotateY transition.
The screen presents two AudioChoiceButton controls — “Audio” and “Silent” — allowing the user to grant or deny audio consent before entering the site. This is required by browser autoplay policy.
Internally it uses:
useLoading()hook to read and clear the loading stateuseAudioContext()to callplay()andgrantConsent()if the user opts into audioShaderBackgroundas the visual backdrop
LoadingScreen reads loading state from LoadingProvider in contexts/. It is mounted in app/layout.tsx and should not be instantiated elsewhere.ThemeProvider
File:components/atoms/theme-provider.tsx
Thin wrapper around next-themes ThemeProvider. Passes all props through unchanged.
app/layout.tsx the theme is forced to light mode:
Do not remove
forcedTheme="light". The site’s colour palette and CSS variables are calibrated for light mode only.Typewriter
File:components/atoms/typewriter.tsx
Animates text character-by-character using useState + useEffect with a configurable per-character delay. Renders into an <h1> tag with a pulsing cursor (|).
ScrollToTop
File:components/atoms/scroll-to-top.tsx
A floating ArrowUp button that appears after the user scrolls more than 300 px. It adapts its icon colour automatically by sampling the computed backgroundColor of the element directly beneath the button position, converting the RGB value to a luminance score to choose between light and dark variants.
- Hidden until
window.scrollY > 300 - Uses
requestAnimationFramefor scroll event throttling - Calls
document.documentElement.scrollTo({ top: 0, behavior: 'smooth' }) - Fixed position:
bottom-6 right-6 z-40
app/layout.tsx globally alongside FloatingMenuButton and AudioPlayer.
RegularLogo
File:components/atoms/regular_logo.tsx
Displays the main Rajat Mahotsav logo from the Cloudflare CDN. The image source is CDN_ASSETS.mainLogo from lib/cdn-assets.ts.
max-w-[60vw] max-h-[45vh] and centred within its container.
Button
File:components/atoms/button.tsx
Extends the shadcn/ui Button with class-variance-authority (CVA). Supports an asChild prop via Radix Slot for composing with other elements.
- variant
- size
| Value | Description |
|---|---|
default | Primary filled button |
destructive | Red destructive action |
outline | Bordered with transparent background |
secondary | Muted secondary style |
ghost | No background, hover only |
link | Underline text style |
Other primitives
The following atoms wrap Radix UI or shadcn/ui primitives with project-specific styling. They are used internally by molecules and organisms.Input — components/atoms/input.tsx
Input — components/atoms/input.tsx
Standard text input. Styled for the registration theme with
reg-input CSS class support.Label — components/atoms/label.tsx
Label — components/atoms/label.tsx
Radix UI label wrapper. Used in all form molecules and organisms.
Checkbox — components/atoms/checkbox.tsx
Checkbox — components/atoms/checkbox.tsx
Radix UI checkbox. Used in
SevaSubmissionForm for seva type selection.Select — components/atoms/select.tsx
Select — components/atoms/select.tsx
Radix UI select (trigger + content + item). Used in forms for country and mandal dropdowns.
Popover — components/atoms/popover.tsx
Popover — components/atoms/popover.tsx
Radix UI popover. Used by
PhoneInput for the country selector dropdown.ScrollArea — components/atoms/scroll-area.tsx
ScrollArea — components/atoms/scroll-area.tsx
Radix UI scroll area. Used in phone input’s country list.
Textarea — components/atoms/textarea.tsx
Textarea — components/atoms/textarea.tsx
Styled textarea input for multi-line text fields.
Card — components/atoms/card.tsx
Card — components/atoms/card.tsx
shadcn/ui card with
CardHeader, CardContent, CardTitle, CardDescription sub-components. Used by SevaSubmissionForm.TagBadge — components/atoms/tag-badge.tsx
TagBadge — components/atoms/tag-badge.tsx
Small label badge for categorisation.
FloatingButton — components/atoms/floating-button.tsx
FloatingButton — components/atoms/floating-button.tsx
AudioChoiceButton — components/atoms/audio-choice-button.tsx
AudioChoiceButton — components/atoms/audio-choice-button.tsx
Toast — components/atoms/toast.tsx
Toast — components/atoms/toast.tsx
Toast notification primitive used via
useToast() hook.