lfkeitel / hungry

A small webapp that chooses a place to eat

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hungry

A small web page to choose a place to eat.

Setup

Throw the html and js files on a web server and you're good to go.

Restaurants are stored in the .js file.

const defaultCity = "city"
const restaurants = {
  "city": [
    {
      name: "Mom and Pop Pizza",
      sch: "t,w,r,f,sa", // Schedule, see below
      weight: 2
    },
    "Taco Bell"
  ],

  "other city": [
    "Deli"
  ]
};

Shortcuts can be taken. If weight is omitted, it will default to 0. If sch is omitted, it will default to everyday. If sch and weight are both omitted, the array element can be a simple string of the name instead of an object.

[
  {
    name: "Mom and Pop Pizza"
  }
]
// or
[
  "Mom and Pop Pizza"
]

Schedule format:

Comma separated list of day abbreviations. Letter case doesn't matter. Abbreviations are:

  • Monday: m
  • Tuesday: t
  • Wednesday: w
  • Thursday: th,r
  • Friday: f
  • Saturday: sa
  • Sunday: s,su

About

A small webapp that chooses a place to eat

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:JavaScript 63.8%Language:CSS 24.4%Language:HTML 11.8%