Giter Club home page Giter Club logo

fortune_cookie's Introduction

fortune_cookie

file serving project

For this project, we will be creating a Fortune Cookie application! A fortune will appear once a user clicks the fortune cookie.

To start, you will need to create an index.html file that contains the fortune cookie image.

We will also need to link up our app.js, stylesheet.css, bootstrap and jquery files.

We will then create a data.json file and create an object that contains one "fortune cookie" array. Each index in this array will contain a fortune object. Provide at least 5 fortunes.

The next step is to create a "get" request in our app.js. Upon clicking the fortune cookie image, the "get" request to the data.json file will fire off.

With the data received from that get request, we can perform a randomization function to grab a random fortune from the returned object. We will then append that fortune to the DOM.

HARD MODE: Add jQuery animation to the fortunes

PRO MODE: Instead of creating a complete fortune message, create multiple arrays in the data.json object that contains compenents that will create a fortune when combined. Then you will perform multiple "get" requests to grab the data from each object, and append them together to create a new fortune. ex:

{ "firsts" : [ {"first": "You"}, {"first": "Your friends"}, {"first": "Your family"} ], "seconds" : [ {"second": "should not"}, {"second": "will"} ], "thirds" : [ {"third": "drive home"}, {"third": "eat chinese"}, {"third": "laugh"}, ] }

fortune_cookie's People

Contributors

cmmisura14 avatar

Watchers

 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.