Giter Club home page Giter Club logo

restaurant's Introduction

Restaurant Project

screenshot

Welcome to the Restaurant Project! This is a multipage website for an imaginary pizzeria named "Pizzeria," built entirely using JavaScript.

The primary objective of this project was to craft a restaurant webpage that features switchable tabs. To achieve this, JavaScript was exclusively employed to generate elements and seamlessly incorporate them into the Document Object Model (DOM). Moreover, a significant emphasis was placed on minimizing the usage of global code by adopting the use of modules. Webpack has been used to budle the modules.

Project Reflections

  • During the course of this project, I gained valuable insights in the following areas:

    • Utilizing Webpack by thoroughly studying its documentation, grasping concepts like module import/export, and effectively managing assets.
    • Proficiently installing packages using npm and adeptly scripting functionalities.
    • Mastering the art of dynamically rendering website content using JavaScript.
  • Presented below is a code snippet that I take pride in:

        const margherita = new Pizza(
            'Margherita',
            'Pomodoro - Mozzarella - Basilico Fresco - Olio EVO',
            '6,50'
        );
        menuContainer.appendChild(margherita.createCard())

    Where createCard() is a method in the class Pizza:

        class Pizza {
        constructor(name, ingredients, price){
            this.name = name;
            this.ingredients = ingredients;
            this.price = price
        }
    
        createCard() {
            const card = document.createElement('div')
            card.classList = 'card'
    
            const firstLine = document.createElement('div')
            firstLine.classList = 'first-line'
    
            const nameTag = document.createElement('h3')
            nameTag.textContent = this.name
            nameTag.classList = 'pizza-name'
            
            const priceTag = document.createElement('p')
            priceTag.textContent = this.price
            priceTag.classList = 'price-tag'
    
            firstLine.appendChild(nameTag)
            firstLine.appendChild(priceTag)
    
            const ingredientsTag = document.createElement('p')
            ingredientsTag.textContent = this.ingredients
            ingredientsTag.classList = 'ingredients-tag'
    
            card.appendChild(firstLine)
            card.appendChild(ingredientsTag)
            
            return card
        }
    }

    Although I could have written an additional method to prevent code repetition within the createCard method, I acknowledge that just a few weeks ago, I would have been far from arriving at this solution.

Future Upgrades

  • Responsive design
  • Footer

restaurant's People

Contributors

sofiabaezzato avatar

Watchers

 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.