GithubHelp home page GithubHelp logo

js-fortuneteller-vsb's Introduction

Create a Fortune Teller

Intro

You've grown tired of waiting until the next time you get a fortune cookie to find what your future holds and have decided to take things into your own hands. Using your knowledge of CSS, HTML, and JavaScript you'll create your very own personal fortune teller, so you can get your fortune fix whenever you need.

Task

You've been provided with an image that you can use for your fortune teller, but feel free to replace this with whatever image you trust to see into the future. Your goal is to recreate the example shown below. Each time the image is clicked on, the fortune displayed should change randomly.

Not sure where to begin?

Here are some general steps to get you started...

  1. Write your HTML file, you'll need to include the image and some kind of text element.
  2. Give your page some very basic styling, you can always come back to this, at this point we just want readability.
  3. Write some JavaScript in your script.js file. Your code should detect when you click on the image and change the text displayed. You may want to think about...
  • What type of variable should each fortune be? How will you keep all of these fortunes grouped together and easily accessible?
  • How do you generate a random number that will be within valid index bounds?
  • How do you get elements from your HTML into your JavaScript?
  • And so much more!

Extensions

Finished up early and want to keep going?

  1. Style your page nicely so other people will trust your website for fortunes too.
  2. Have two fortune tellers for your user to choose from, have each one give a different type of fortune. For example, one could be very philosophical while the other told you things like "Don't forget to tie your shoes today!"
  3. Give your fortune teller a yellow border when your mouse is over it so it looks like it's glowing with magical powers.

js-fortuneteller-vsb's People

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.