Project: Launch Board
No new theory: this project uses everything from the first three parts. Tables, the selectors of part 3, and a script that reads data, decides, filters, sorts and switches classes. You build your own page from an empty folder: a launch board for the station's rocket pads.
This project is separate from the station site. When you're not sure how to do a step, open the lesson it comes from again.
Your files
The folder starts empty. Make three files with New file: index.html, style.css and script.js.
What you will see
The launch crew watches this board all day. Make it clear, and make it keep itself up to date. A launch can be Scheduled (planned), Scrubbed (called off for today) or Launched.
The steps
Build it in this order:
- The frame. An English page that can show any letter, called Launch Board on its tab and in its only biggest heading.
- The table. A table with the id
launches, with a caption of your choice. Its header row, in athead, has Rocket, Pad, Time and Status. Each one is a header that says it's the label of its column. - The launches. The table's body has at least five launches, with at least one of each status:
Scheduled,ScrubbedandLaunched. You write a time like09:15. Every cell of a launch has the class of its column:rocket,pad,timeandstatus. - Lines and stripes. In
style.css, the table is as wide as its column. It has single lines between its cells, and zebra stripes in its body. - The mouse. A row lights up when the mouse is over it, unlike any other row.
- Statuses. Every status cell is bold, and no other cell is. A scrubbed launch's row has a line through it.
- Easy to read. Everything is easy to read, and nothing comes out sideways on a phone.
- Status classes. The head loads
script.js, which waits for the page. It gives every row the class of its status, in small letters:scheduled,scrubbedorlaunched. - The summary. A paragraph with the id
summarycounts the launches by status:3 scheduled, 1 scrubbed, 1 launched. - The next launch. A paragraph with the id
next-launchnames the earliest scheduled launch:Next launch: Falcon at 09:15. When there is none, it saysNo launch scheduled. - A toggle. A button with the id
hide-scrubbedsays Hide scrubbed, and isn't pressed for a screen reader. A click hides the scrubbed launches, with the classhide-scrubbedon the table. Then the button says Show scrubbed and is pressed. A second click brings them back.
Both paragraphs follow the table: change a launch in the HTML, and they change too.
Run the tests when you like. They tell you which steps are still missing.