thirdTimertimer-actions.ts6 matches
18* a success notification, and the current timestamp
19*/
20export function startWork(currentState: TimerState): TimerActionResult {
21const now = Date.now();
2244* or unchanged state if not currently working
45*/
46export function takeBreak(currentState: TimerState): TimerActionResult {
47if (!currentState.workStartTime) {
48return { newState: currentState };
81* and notification about remaining break time
82*/
83export function resumeWork(currentState: TimerState): TimerActionResult {
84if (!currentState.breakStartTime) {
85return { newState: currentState, currentTime: Date.now() };
128* or unchanged state if not currently working
129*/
130export function handleInterruption(
131currentState: TimerState,
132): TimerActionResult {
163* @returns A TimerActionResult with break mode activated and all saved break time consumed
164*/
165export function takeBigBreak(currentState: TimerState): TimerActionResult {
166const now = Date.now();
167const newState = { ...currentState };
195* @returns A TimerActionResult with the timer reset to idle state and all timing data cleared
196*/
197export function resetSession(currentState: TimerState): TimerActionResult {
198return {
199newState: {
thirdTimerTimerContainer.tsx1 match
26}
2728export const TimerContainer = React.memo(function TimerContainer({
29state,
30setState,
thirdTimerutils.ts2 matches
1export function formatTime(seconds: number): string {
2const hours = Math.floor(seconds / 3600);
3const minutes = Math.floor((seconds % 3600) / 60);
12}
1314export function formatMinutes(minutes: number): string {
15if (minutes < 1) return `${Math.round(minutes * 60)}s`;
16if (minutes < 60) return `${Math.round(minutes)}m`;
thirdTimerStatsGrid.tsx1 match
12}
1314export function StatsGrid({ stats, columns = 3 }: StatsGridProps) {
15const colorClasses = {
16green: "text-green-500",
thirdTimerSessionStats.tsx1 match
10}
1112export function SessionStatsDisplay({
13stats,
14formatMinutes,
thirdTimerHelpText.tsx1 match
9);
1011export const HelpText = React.memo(function HelpText() {
12return (
13<Card>
thirdTimerFooter.tsx1 match
6export const SOURCE_URL = "https://val.town/x/nbbaier/thirdTimer";
78export const Footer = React.memo(function Footer() {
9return (
10<footer className="flex gap-2 items-center p-4 mx-auto my-0 max-w-5xl text-xs">
thirdTimerCard.tsx2 matches
5className?: string;
6}
7export function CardHeader({ children, className = "" }: CardProps) {
8return (
9<div className={`mb-3 text-lg font-semibold ${className}`}>
13}
1415export function Card({ children, className = "" }: CardProps) {
16return (
17<div
thirdTimerButton.tsx1 match
19}
2021export function Button({
22children,
23onClick,
19}
2021export const BreakFractionSettings = React.memo(function BreakFractionSettings({
22currentBreakFraction,
23onBreakFractionChange,