Giter Site home page Giter Site logo

giphy-games's Introduction

Application

Hint

Click the gifs to make them move.

Main Purpose


The main purpose of this assignment was to utilize api's to pull gifs from giphy. This project shows understanding on basic uses of api's.

The user clicks on a button, which sends them gifs according to how the button is labeled. The user has an option to add another button for a topic of their choosing. I went with the topic of video games for most of the buttons, but if the user does not want to use video games as a topic they can input any other topic of their choosing.

Some of the Functions


newTopic

The newTopic function is what allows the user to add a new button with a new topic. It has an if statement that prevents a new button from being added if it is already an available topic. The weakness this function has is that it doesn't prevent a topic being put in if it is spelled incorrectly or differently. New topic calls toLower which puts the entire topics array into the topicsChecker array, which then checks it against usInCheck.

newTopic is called in the $(document).ready function.

gifyGo

gifyGo is responsible for playing and pausing gifs by checking and changing the play-status in the html, and updates the src appropriately to play the gif or pause it.

clicketyClack

This function is responsible for laying down the related gifs for the chosen topic on the button click it's associated with. The button click will reassign the value of topReq, which is used in the url, so that the ajax can make the appropriate request.

after the gifs are requested, the promise uses a for loop to display the ten gifs using a for loop, in the for loop the gifs are put in elements with the appropriate classes for sizing and placements.

Since ajax is ran asynchonously, gifyGo is called in the promise portion to ensure that after each new set of gifs are loaded, they are still able to be played and paused at the user's discretion.

btnLayout

btnLayout lays out all of the buttons with the corresponding topics, the initial topics and the newly added topics given by the user. clicketyClack is called here to keep the function on call when a new topic is added, and when btnLayout is called in the $(document).ready portion.

giphy-games's People

Contributors

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