Git Product home page Git Product logo

firstgiphyapi's Introduction

FirstGiphyAPI

Requirement

  • Use the GIPHY API to make a dynamic web page that populates with gifs of your choice. To finish this task, you must call the GIPHY API and use JavaScript and jQuery to change the HTML of your site.

Prerequisites

  • Download Chrome or Internet Explorer or Mozilla for your specific operating system.

Instructions

  • You can see the live Demo.
  • By clicking on each animal, 10 gifs are showing.
  • if user click on each picture, it starts animation and if it was already animated, then it just get freezed without animation.
  • Also, user can add favorite animal to the end of buttons and it will show the new animal at the end.
  • user can click on new added button and see the pictures. Also, can click on pictures to change the status from still to animation and vise versa.

Image of firstGiphy

Technologies Used

  • HTML
  • CSS
  • Javascript
  • jQuery
  • Giphy API
  • AJAX call

Code Explanation

Lesson Learned

  • What is AJAX call and how to use it to call on APIs.
  • How I can use different usefull APIs to get data and show it on my application.
  • How to use jQuery to show different images in the web page.

Code Highlights

var queryURL = "https://api.giphy.com/v1/gifs/search?q=" +
    animal + "&api_key=ONa0PbNywJdmdoQxrnKwLWuIYtkm38EH&limit=10";

    $.ajax({
        url: queryURL,
        method: "get"
    }).then(function(response){
        console.log(response);
        var result=response.data;
        var i=0;
        for(i=0;i<10;i++){
            
            var newDivImg = $("<div>");
            newDivImg.attr("class"," col-md-4  text-info ");
            var newPImg = $("<p>").text("Rating: "+result[i].rating);
            var newPTitle=$("<p>").text("Title: "+result[i].title);

Authors

  • Sara Alinazari

firstgiphyapi's People

Contributors

saraalinazari avatar

Watchers

James Cloos avatar  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.