Coder Social home page Coder Social logo

edissondiaz / exercise-random-card Goto Github PK

View Code? Open in Web Editor NEW

This project forked from breatheco-de/exercise-random-card

0.0 0.0 0.0 179 KB

💻📹Video Tutorial: Ideal project tutorial for Javascript newbies, build a random card dealer with little JS, HTML and CSS.

Home Page: https://projects.breatheco.de/interactive-coding-tutorial/beginner/random-card

License: Other

JavaScript 18.29% HTML 16.60% CSS 65.10%

exercise-random-card's Introduction

alt text Random Card Dealer in Javascript, HTML and CSS

In this project you will learn how to change your website styles during the runtime using VanillaJS (plain normal js).

📝 Instructions

Create an algorithm that randomly builds a card on every refresh:

  1. Every time the website refreshes a new random card needs to show.
  2. The card must have one of the possible suits: Hearts, Spades, Clubs and Diamonds.
  3. The card value must be one of the following: 1 to 10, King, Queen, Jack or Ace, (no joker).

In the end, the project needs to look similar to this demo.

🌱 How to start this project

Do not clone this repository.

The first step to start coding is cloning the vanilla.js boilerplate on your local computer or gitpod.

a) If using Gitpod (recommended) you can clone the boilerplate by clicking here.

b) If working locally type the following command from your command line:

$ git clone https://github.com/4GeeksAcademy/vanillajs-hello.git

💡 Important: Remember to create a new repository, update the remote (git remote set-url origin <your new url>), and upload the code to your new repository using add, commit and push.

💡Hints

  • Remember that the first event of a website lifecycle is onLoad (your code starts running there). You should generate a random number between 1 and 4 to pick a suit and another random number between 0 and 12 to pick a card number.
  • Create a general .card class that applies the general styles to each card, and one additional CSS class for each suit: .spade, .club, .heart & .diamond.
  • Apply the .card class to the entire div but only apply one of the suit classes at a time, depending on what suit you want to apply. For example, a 3 of Hearts will have this HTML declaration:
    <div class='card heart'></div>
  • You can grab the icons from here (copy and paste into your code): ♦ ♥ ♠ ♣

😎 Feeling Confident?

The following requirements are not needed to sucessfully finish this project, but you can try and challenge yourself!

+1 Add a button that generates a new card when clicked.
+1 Add a timer that generates a new card every 10 seconds.
+1 Allow the user to specify the card with and height using text inputs.

exercise-random-card's People

Contributors

alesanchezr avatar elviraqdp avatar jtoledo88 avatar edissondiaz avatar gemmamorales avatar gmihov001 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.