• Develop a memory card game using HTML5, CSS3 and JavaScript

    Published on April 10, 2012

    The goal of this project is to develop a memory-match card game based on the next requirements:

    • cards used are pairs got from a shuffled deck
    • give the possibility to replay the game
    • register the clicks made and the number of the matched pairs

    Some CSS3 properties will be used to add some animation to the HTML elements and jQuery framework for the game engine.
    This is how the result of the project looks:

    Content of the index.html file

    This is how the index.html file will look:

    In head meta tag contains the links for the style.css file, for the Sevillana font and for the JavaScript file necessary to add HTML5 specifications (to some extent) for older than ninth version of Internet Explorer

    The container with the ID stats will hold the clicks (made) and the pairs (found) values, that will be updated based on user’s actions.

    The container with the ID cards contains a child, container with the class “card”, which contains two divs, with classes face front and face back, containers that will be manipulated during the game flow to achieve the desired result.

    The container with the ID go-2-nxt.lvl will carry the necessary text which will give the user the option to restart the game (shuffle cards, reset clicks (made) and pairs (found) values).

    At the end, before the ending body tag, the necessary JavaScript files are loaded.
    Having this we can now style the HTML elements.

    19 comments to "Develop a memory card game using HTML5, CSS3 and JavaScript"

    Share your thoughts on this article.

    Your email address will not be published. Required fields are marked *

    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">