GithubHelp home page GithubHelp logo

tommygaessler / wdi-resident-code-challenge Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 12 KB

WDI Resident Code Challenge

Home Page: http://tommygaessler.com/wdi-resident-code-challenge/

HTML 13.29% JavaScript 86.71%

wdi-resident-code-challenge's Introduction

WDI Resident Code Challenge

Completed Code Challenge

For the code challenge, you will be building a simple web page that will allow the user to load a .json file that follows a certain syntax but is arbitrarily nested. When that file is loaded, you will generate HTML based on the nested structure and display that HTML on the page.

For an example, visit the solution site.

To learn how to read a file locally, this article is a great start: HTML5rocks

Goals

  1. Get as far as you can with the tasks above
  2. Separate and clean your code so it's readable and presentable
  3. Make multiple, clear commits to demonstrate your knowledge of git
  4. Do not worry about designing the site in any particular format
  5. Deploy your static site and email me the URL

Note: You may use whatever resources you want to solve the problem besides your instructors! We want you to craft together a solution as best you can. ๐Ÿ˜€

Tips

  1. Remember Polya's Problem Solving Technique -- feel free to ask for clarification on edge cases and make sure to break apart the problem!
  2. The above article on reading files locally has some good examples to get started but you'll likely need to read through the full article to get to the right answer
  3. When parsing the JSON, notice that each object has the exact same structure which means you'll likely want to find a recursive solution and/or use a while loop

Sample JSON

The following files should all work with your website. Copy each code block into a separate file and then load it into the example website to see what might be rendered.

[
  {
    "tag": "section",
    "content": {
      "tag": "p",
      "content": "Hello world!"
    }
  }
]
[
  {
    "tag": "section",
    "content": {
      "tag": "h2",
      "content": "This file is a bit more complicated because:"
    }
  },
  {
    "tag": "section",
    "content": {
      "tag": "ol",
      "content": [
        {
          "tag": "li",
          "content": "There are multiple levels of nesting."
        },
        {
          "tag": "li",
          "content": "Some keys are at the same level."
        },
        {
          "tag": "li",
          "content": "The data types are mixed!"
        }
      ]
    }
  }
]
[
  {
    "tag": "section",
    "content": {
      "tag": "h2",
      "content": "Welcome to My Page!"
    }
  },
  {
    "tag": "section",
    "content": [
      {
        "tag": "h3",
        "content": "My Favorite Things"
      },
      {
        "tag": "ul",
        "content": [
          {
            "tag": "li",
            "content": "<img src='http://placekitten.com/g/200/200'/>"
          },
          {
            "tag": "li",
            "content": "<img src='http://placekitten.com/g/201/200'/>"
          },
          {
            "tag": "li",
            "content": "<img src='http://placekitten.com/g/200/201'/>"
          }
        ]
      },
      {
        "tag": "p",
        "content": [
          {
            "tag": "span",
            "content": "In short, I "
          },
          {
            "tag": "strong",
            "content": "just love"
          },
          {
            "tag": "span",
            "content": " kittens!"
          }
        ]
      }
    ]
  }
]

wdi-resident-code-challenge's People

Contributors

tommygaessler avatar

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.