Giter Club home page Giter Club logo

movie-booking-js---dom-manipulation-settimeout-js-bom-history-dom-model-dom---93cf69ea16im's Introduction

First step in the website will be making a nav bar using flex. Inside the nav you will have a div with classname logo and a list for displaying the respective links as in the mock UI. Use flexbox in nav to display the logo and list of links on the opposite side of the screen and also use flexbox in the list inside the nav also, to evenly space the links.

Give nav a padding of 12px 16px. All the text on nav should have white for font color, so apply the property on nav itself.

You will be using the API functions in api.js file to fetch the relevant data. When page loads,make a request to get list of all movies using fetchMovieList function.

This will return array of objects each having name and thumbnail URL. While you are fetching this data, we cannot show user a black screen, so instead we will show a loader element with id="loader", it could contain text "Loading..." or an animation, its up to you, but should have the id="loader".

After the data is finished loading, i.e request has finsihed, remove the loader from screen(dont hide it, remove it). Inside the main component, add .movie-holder div inside it.

Inside that div we will be adding the individual movie components. Each individual movie component will be made up of an anchor tag on the outside with class .movie-link. Example of the basic strucutre is given below. Replace moviename by actual name of the rendered movie <a class="movie-link" href="/moviename"> <div class="movie" data-id="moviename"> <div class="movie-img-wrapper">
</div> <h4>$moviename</h4> </div> </a>
movie-img-wrapper will have css, background image property set to the imgUrl of the movie and background size as cover.

index.html has markup defined for #booker class, which will hold elements related to seat booking. Upon clicking the movie-link, the app loads data from the fetchMovieAvailability using moviename as parameter.

After data has been loaded h3 inside #booker should be visible by toggling the pre defined class v-none. Also two 4x3 grids should be displayed.Each box is numbered and equivalent of a seat.Seat will be numbered from 1-12 on left box and 13-24 on the right hand side box.

Each grid will have class "booking-grid", and each cell in it will have id "booking-grid-gridNumber", gridNumber being the values between 1 - 24.

The two "booking-grid" divs will be inside "booker-grid-holder" div. Since the API returns list of unavailable sets, when rendering the booking-grid, cells which are not available will have class "unavailable-seat" which willbe unclickable, rest all other seats will have "available-seat" class and can be selected.

Clicking on "available-seat" div adds a classname "selected-seat" which should have these css styles "border:4px outset rgb(0, 0, 0)". You can select multiple seats.

After selecting the first seat, the button with id="book-ticket-btn" which is already present in html markup, should toggle its v-none class,i.e remove it.

If the selected seats ever go bacck to zero,i.e user selects 2 seats and deselect them later, the button should again be set classname v-none to hide it.

So when user has selected more than one seats, upon clicking the "book-ticket-btn" the content inside #booker div is deleted and then replaced by a div with id="confirm-purchase". Inside that display a h3 with text "Confirm your booking for seat numbers:${seats.join(",")}", where seats are the selected seats. Also display a form with id="customer-detail-form" inside the confirm-purchase div. This form will use proper input types for taking email and phone number of the user(tel). All of them should be marked required. Then finally a button with type="submit".

Upon filling the relevant details and clicking the submit button, again the content inside #booker div is deleted and then replaced by a div with id="Success". Inside that it shows "Booking details", followed by the booking details, seat numbers, email and phone number.

movie-booking-js---dom-manipulation-settimeout-js-bom-history-dom-model-dom---93cf69ea16im's People

Contributors

rinky6767 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.