Skip to content

ixd-system-design/json-planets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Planets

This demo is similar to Variety Shoe. It uses a JSON dataset of planets, along with a set of planet icons via Adobe.

Use this template

Sorting

A key feature in this demo is the sorting of data. In particular it's possible to sort an array of objects based on some common property that all those objects have. The array sort function is quite useful here. In this demo, you'll find two varations: sorting by temperature, and also sorting by distance from the sun.

Dynamic Colours

It's possible to use numeric values from a dataset as part of your content and markup, but it's also possible to use the same data to create CSS styling. For example, we can generate a background colour for each planet based on the given temperature using some math and the HSL colour model.

Dynamic Images

Given the name of a planet, (e.g. Saturn) we can dynamically generate a corresponding file path that points to an image. (e.g. assets/Saturn.svg). In this example, you'll find that we use this technique to add icons to each planet.

Learning Prompts

  • modify the template to show the composition of the atmosphere for each planet.
  • modify the JSON file to include the "dwarf planet" Pluto
  • Use Webfonts to support an outer space narrative.

About

Using JSON data to sort and display planets with images on a webpage.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors