svelte_time_calculator Svelte Themes

Svelte_time_calculator

Perform time-based arithmetic using natural expressions

⏱️ time calculator

This is a Svelte 5 + SvelteKit time calculator application with TypeScript and Tailwind CSS v4.

πŸš€ Live Demo

πŸ‘‰ View the app on GitHub Pages (TODO)

✨ Features

  • Timestamp & Readable Date Conversion (TODO) Convert between UNIX timestamps and human-readable dates.

  • Timezone Selection (TODO) Choose your desired timezone for both input and output conversions.

  • Flexible Date Calculations Perform time-based arithmetic using natural expressions like:

    • now + 3 days
    • yesterday
    • now - 15 days 6 hr Both the input and result are displayed in timestamp and readable date formats.

🧰 Tech Stack

Svelte – Lightweight, fast, and reactive front-end framework. sv. GitHub Pages – Continuous deployment from main branch for seamless updates.

πŸ’‘ Why Svelte?

While experienced with React, this project was an opportunity to explore Svelte’s simpler and more expressive approach to building user interfaces.

file structure

  src/
  β”œβ”€β”€ components/
  β”‚   β”œβ”€β”€ ui/                          # Pure UI components
  β”‚   β”‚   β”œβ”€β”€ Button.svelte
  β”‚   β”‚   β”œβ”€β”€ Input.svelte
  β”‚   β”‚   └── Label.svelte
  β”‚   β”œβ”€β”€ forms/                       # Form components (controlled)
  β”‚   β”‚   β”œβ”€β”€ TimestampInput.svelte
  β”‚   β”‚   β”œβ”€β”€ DateInput.svelte
  β”‚   β”‚   └── DurationInput.svelte
  β”‚   └── containers/                  # Container components
  β”‚       β”œβ”€β”€ TimestampCard.svelte
  β”‚       └── ActionButtonGroup.svelte
  β”œβ”€β”€ lib/
  β”‚   β”œβ”€β”€ stores/                      # State management
  β”‚   β”‚   └── timestamp.svelte.ts
  β”‚   └── types/                       # Type definitions
  β”‚       └── timestamp.ts
  β”œβ”€β”€routes/
  β”‚   └── +page.svelte                 # Page component (state owner)
  └── utils/
      └── converters.ts                # Utils
      └── formators.ts

  • Development server
pnpm run dev
# or with browser opening
pnpm run dev -- --open
  • Build and deployment
pnpm run build
pnpm run preview  # Preview production build

Top categories

Loading Svelte Themes