Skip to content

Commit be128b3

Browse files
authored
Add customizable cooking timer with recipe JSON support (#184)
> Build cooking-timer.html - start with a copy of the existing timer that talks about chickpea stew, create a modified version that can support any recipe. When you first start it running it shows a starter field where it asks you to paste in either the URL to a recipe.json or the recipe JSON directly - it includes an example of the recipe format (make up a fun recipe for guacamole for the example) as JSON which you can copy and paste to somewhere else, plus a link that says "Create one with Claude" which links to the claude.ai page with a querystring parameter that pre-populates Claude and populates it with an example JSON document and a following prompt that says "output this format for the following recipe:" > > If you enter a URL the page redirects to ?url=THAT_URL - any time you load the page with that format it attempts to fetch() the JSON from that URL and use it > > If you paste in JSON instead then it stashes that in localStorage. It can actually stash multiple recipes in localStorage and shows a list on that initial homepage of stored recipes (with their names and creation dates - make sure the JSON format has a space for a name) for the user to select > > For any recipe you have loaded by URL that URL and the recipe name are also stored in localstorage so the "previous recipes" UI can link to those as well > > Once you have selected a recipe the tool works exactly the same way as the original. It uses localStorage to remember the time such that if you refresh the page it can jump right back to where you are > > Add a reset button with. a clear name that goes back to that initial state. Create cooking-timer.html that allows users to load recipes via: - URL parameter (?url=...) for recipe.json files - Pasting JSON directly into the interface - Selecting from previously saved recipes in localStorage Features: - Example guacamole recipe with copyable JSON format - Link to Claude for generating new recipe timers - Persistent timer state across page refreshes - Recipe history with delete functionality - "Choose Different Recipe" button to return to selection screen https://gistpreview.github.io/?33f973d84f202869a4567e6af097315e/index.html
1 parent 4d282b9 commit be128b3

File tree

1 file changed

+1138
-0
lines changed

1 file changed

+1138
-0
lines changed

0 commit comments

Comments
 (0)