Git Product home page Git Product logo

restaurant-js-page's Introduction

TOP Restaurant Page

Using webpack to setup and manage workflow, dynamically build a restaurant website with Javascript. Split everything into modules imported and run through index.js, then bundled for production.

Full requirements from The Odin Project can be found here.

๐Ÿ‘‰ Live Demo ๐Ÿ‘ˆ

restaurant-js-page's People

Contributors

marlatte avatar

Watchers

 avatar

restaurant-js-page's Issues

5. Write 30k ft pseudo outline

Walking through logical flow from first task, write out the top-level functions necessary to get this done. Don't worry about details or specific properties/methods, just finish the prompt, "Okay, then I'll need a function to do ___" for every step. In the end, you'll have a skeleton to flesh out in the next steps.

Mobile footer too tall

Footer too tall on iPhone 11, covers down arrow on home tab and menu tab links.

Could be solved by splitting address and phone number left and right, instead of 2 lines, but I get the feeling that it won't fit horizontally.

A better solution might be to replace it with a "contact us" button that takes you to an "about us" tab (which will have to be added). Added bonus: embedding Gmaps would look good.

6. Fill out the skeleton

Problem-solving time!

Iterate over the pseudo outline, getting more specific with each pass.

If you don't know how to solve a specific challenge, mark it for the next pass or get to googling, but DO NOT skip things without making a note. That leaves unpleasant surprises for later.

This step should take a while, since it's actually several rolled into one. It ends when you run out of abstract ways to describe the steps and the pseudo is half JS anyway.

Lessons from past projects:

  • Event delegation can solve issues with dynamically created elements like buttons
  • Template literals are great for element.innerHTML; you don't have to create and append so many things.

Set up Webpack

  • npm install webpack webpack-cli --save-dev && touch webpack.config.js
  • Paste in config:
const path = require("path");

module.exports = {
	mode: "development",
	entry: "./src/index.js",
	output: {
		filename: "main.js",
		path: path.resolve(__dirname, "dist"),
	},
};
  • Add to scripts section of package.json:
"build": "webpack",
"watch": "webpack --watch"

3. Write simple HTML

No more than is necessary to capture main elements from the hand-drawn UI.
Do not get fancy yet!!!

Home tab logo height wrong

The logo, reservations link, and arrow aren't well positioned anymore. Probably because devtools mobile height and actual iPhone height are different. Will need to test on more devices/screens.

7. Translate pseudo to code

Arguably the easiest part. If you've iterated enough in the last step, this should be mostly changing syntax to turn pseudo into JS - putting brackets in the right spots, etc.

Pseudo modules:

  • index
  • home
  • sidebar
  • menu
  • events
  • sign-up form modal

1. User Story + logical flow

User story:
As a < type of user >, I want < some goal > so that < some reason >

Logical flow:
A few sentences on general functionality and the steps necessary to do all those things.

Run everything thru webpack

Go back thru Asset Management and Output Management guides on Webpack so that only the dynamically created index.html and main.js are the only things in dist/.

  • Create new branch
  • CSS loaded
  • Fonts loaded
  • HTML created
  • dist/ cleaned

4. VERY basic CSS

Black / white only, basically just do the borders and minimally acceptable spacing to make it look like the hand-drawn UI.

Don't get fancy, and DO NOT make any big design decisions yet!!

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.