Skip to content

crper/next-time-shift

Repository files navigation

Next Time Shift

Next Time Shift 是一个多时区时间转换工具,支持 Unix 时间戳输入、日期时间选择、跨时区对比展示,面向跨国协作、国际会议和时区排障场景。

功能特性

  • 🕒 时间戳与本地时间互转
  • 🌍 全球时区展示(含标准 UTC 时区组)
  • 📅 日期时间选择器与快捷时间点
  • 🔄 多时区并排对比
  • ⚡ 虚拟滚动优化大量时区卡片渲染
  • 🌓 深色 / 浅色 / 跟随系统主题
  • 📱 响应式布局(移动端与桌面端)

录屏演示

next-time-shift.mov

在线访问

技术栈

本地开发

前置条件

  • Node.js 20+
  • pnpm 10+

安装依赖

pnpm install

启动开发环境

pnpm dev

常用脚本

# 代码检查
pnpm lint

# 单元测试
pnpm test
pnpm test:watch

# 类型检查
pnpm type-check

# 生产构建
pnpm build
pnpm start

# 一键全量校验(lint + test + type-check + build)
pnpm check

项目结构

next-time-shift/
├── src/
│   ├── app/                         # Next.js App Router 页面
│   │   ├── about/
│   │   ├── layout.tsx
│   │   ├── page.tsx
│   │   ├── error.tsx
│   │   ├── loading.tsx
│   │   └── not-found.tsx
│   ├── components/
│   │   ├── TimestampConverter.tsx
│   │   ├── TimestampInput.tsx
│   │   ├── TimestampList.tsx
│   │   ├── TimezoneSelector.tsx
│   │   ├── TimezoneResults.tsx
│   │   ├── LoadingStates.tsx
│   │   ├── ThemeProvider.tsx
│   │   ├── ThemeSwitcher.tsx
│   │   ├── NavMenu.tsx
│   │   ├── timestamp-converter/
│   │   └── timezone-card/
│   ├── hooks/
│   │   ├── useErrorHandler.ts
│   │   ├── useResponsive.ts
│   │   ├── useStyles.ts
│   │   └── useSystemTheme.ts
│   ├── store/
│   │   ├── themeStore.ts
│   │   ├── timezoneStore.ts
│   │   └── index.ts
│   ├── utils/
│   │   ├── datetime/
│   │   │   ├── core.ts
│   │   │   ├── formatter.ts
│   │   │   ├── period.ts
│   │   │   ├── timezone.ts
│   │   │   ├── timezone-data.ts
│   │   │   └── __tests__/
│   │   ├── error-handler.ts
│   │   └── path-utils.ts
│   └── types/
├── public/
├── .github/workflows/
└── ...

部署

项目已配置 GitHub Pages 自动部署。

  • 推送 main 分支后由 GitHub Actions 自动构建并发布
  • 使用 Next.js 静态导出(output: 'export'
  • 默认部署路径为 /next-time-shift

许可证

MIT

About

现代化时间戳快速换算工具(不同时区一目了然),支持响应式(PC&Mobile), 夜间模式....

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors

Languages