From 73272ffbe304e51a5bfc07223347aa1c7f007c30 Mon Sep 17 00:00:00 2001 From: sbeltranc Date: Tue, 3 Feb 2026 23:21:32 -0500 Subject: [PATCH] add estimated time for an item --- frontend/src/routes/shop/+page.svelte | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/frontend/src/routes/shop/+page.svelte b/frontend/src/routes/shop/+page.svelte index c9057e0..a2def02 100644 --- a/frontend/src/routes/shop/+page.svelte +++ b/frontend/src/routes/shop/+page.svelte @@ -5,7 +5,7 @@ import AddressSelectModal from '$lib/components/AddressSelectModal.svelte' import { API_URL } from '$lib/config' import { getUser } from '$lib/auth-client' - import { X, Spool, PackageCheck } from '@lucide/svelte' + import { X, Spool, PackageCheck, Clock } from '@lucide/svelte' import { shopItemsStore, shopLoading, @@ -14,6 +14,13 @@ type ShopItem } from '$lib/stores' + const PHI = (1 + Math.sqrt(5)) / 2 + const MULTIPLIER = 10 + + function estimateHours(scraps: number): number { + return Math.round(scraps / (PHI * MULTIPLIER) * 10) / 10 + } + let selectedCategories = $state>(new Set()) let sortBy = $state<'default' | 'favorites' | 'probability'>('default') @@ -258,6 +265,7 @@

{item.description}

{item.price} + ~{estimateHours(item.price)}h
{#each item.category.split(',').map((c) => c.trim()).filter(Boolean) as cat} {cat}