Giter VIP home page Giter VIP logo

moviefight's Introduction

MovieFight

ALIU|Shpetim

This project consists of a JavaScript code that implements a movie comparison web application. The application fetches data from the OMDb API (Open Movie Database) using Axios library and displays it in a visually pleasing manner using Bulma CSS framework.

The main function is autoComplete which provides auto-complete functionality for the search bar using a debounce function to limit the number of API requests. The debounce function takes in two arguments, func which is the function to execute and delay which is the time in milliseconds to wait before executing the function.

The autoComplete function takes in an object that specifies the configuration for the auto-complete feature. The object contains three functions, renderMov, inputVal, and fetchData. The renderMov function returns the HTML markup for the movie result, inputVal function returns the title of the movie, and fetchData function retrieves data from the OMDb API.

The code then calls autoComplete function twice with different configurations and attaches them to separate HTML elements to create two separate search bars. Whenever a user selects a movie from the auto-complete results, the onMovie function is called with the selected movie's details as a parameter. This function retrieves the selected movie's details from the OMDb API and displays the movie's details on the webpage. It then updates the leftMovie or rightMovie variable depending on the side parameter passed in.

The runComp function compares the two movies' data and highlights the data with the higher value using CSS. Finally, the movieWidget function takes the OMDb API's data as a parameter and generates HTML code to display the selected movie's details.

moviefight's People

Contributors

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