Code Monkey home page Code Monkey logo

phase-1-calexico's Introduction

Calexico

Finished Product

You've worked up quite the hunger after a long day of coding. Fortunately, your favorite tex-mex restuarant is open for delivery! Unfortunately, some jerk deleted all the javascript from their site!

ONLY YOU can fix Calexico's website and earn yourself some delicious fare.


Setup

Run json-server from this directory.

json-server --watch db.json

Test your server by visiting this route in the browser:

http://localhost:3000/menu

Then, open the index.html file on your browser to run the application.

Write your code in the index.js file.

Challenge #1

Fetch all the menu items from http://localhost:3000/menu. For each menu item create a span element that contains the name of the menu item, and add it to the #menu-items div.

Challenge #2

When the page loads, display the first menu item. You should set the image, name, description, and price. All the correct elements to set are located in the #dish section element.

Challenge #3

When the user clicks on the menu items on the left, they should see all the details for that specific menu item.

Challenge #4

The user should be able to add the menu items to their cart. When the user presses the 'Add to Cart' button, that number should be added to however many are currently in the cart.

For example, if there are currently 2 burritos in the cart, and the user adds 2 more, the total should be 4.

It is okay if the value resets in-between clicking on the menu items! It does not need to save state!


Bonus Challenges!

Bonus Challenge #1

The value of the cart for each item should persist when clicking through the various menu items.

Bonus Challenge #2

Calculate the total cost of what is currently in the cart and display it somewhere on the page.

Bonus Challenge #3

Use PATCH requests to maintain the value of the cart in-between refreshes.

phase-1-calexico's People

Contributors

bdenney avatar shokuninja avatar

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.