Giter Club home page Giter Club logo

nursery-menu's Introduction

Nursery menu

My son's nursery has a 4-weekly rotating menu, and I always forget where it is up to. So: a web app! This is build using sveltekit, with a supabase database and prisma ORM, and is deployed to https://nursery-menu.vercel.app/.

Development

A few notes on things I found worked well / hadn't done before:

Horizontal scrolling grid

This was a fun one. I wanted the first column (meal names and times) fixed, and the remainder (day and menu items) I wanted to scroll horizontally so that you could see 1 day at a time clearly on mobile. I set up a svelte REPL, 'css carousel' while building this out, based largely on Well-controlled scrolling with CSS Scroll Snap from web.dev.

Showing the current week

One of the problems I wanted to solve was remembering which of the 4 weeks the nursery is on. So, I created a function getCurrentWeekNumber which calculates current week based on how many days have passed since a source of truth (in this case, that 2023-09-22 was week 1), and storing the current week in a derived store currentWeekNumber. The load function in top level +page.server.ts+ then uses this load the current week using sveltekit's redirect helper.

Supabase x Prisma

Supabase have a page called supabase works with prisma and it really does work very easily. Setup was easy, apart from a well-discussed type error from the browser on deploymnet, which I resolved using this fix suggested in the comments. Note I only set up read from supabase and all data entry was via prisma studio, for my own ease.

Transitions

I set up transitions for the nav dropdown using svelte/transition, and for the menu icon using CSS transitions. Initially I tried using svelte transitions for both but this resulted in jerky behaviour, I think because of how svelte processes two simultaneous transitions.

Favicon

The favicon is a cheeseburger from flaticons, free to use with attribution.

nursery-menu's People

Contributors

ccozens avatar

Watchers

 avatar

nursery-menu's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.