The button that does nothing
You tap Pay. Nothing happens. You tap again. Still nothing. Did it work? Did it take your money twice?
You delete the app.
A good interface always answers the user. Today you learn the tools for this: pictures, movement, sound, touch and charts.
Key words
| Word | What it means | Example |
|---|---|---|
| User interface | Everything a person sees and uses to work with a program. | screens, buttons, sounds |
| Input | What the user gives to the program. | a tap, a typed word, a voice command |
| Feedback | The answer the program gives back to the user. | a message, a sound, a buzz |
| Animation | Movement on the screen over time. | |
| Effect | A visual change that adds style. | |
| Haptic | Feedback you feel. | |
| Data visualisation | Showing numbers as a picture. | |
| Dashboard | One screen that shows the most important figures together. | |
| Graph | A chart that draws numbers as bars, lines or points. | |
| Pixel | One tiny dot on a screen. |
The cells students fill in are left blank in this preview.
The tools of an interface
| Feature | What it does | Use it for | Take care |
|---|---|---|---|
| Images | Show a picture | Products, icons, maps | Big files load slowly. Add a text description for blind users |
| Animation | Moves things | Showing something is loading or changed | Too much is tiring. Let users turn it off |
| Audio | Plays sound | Alerts, music, spoken help | Never play loud sound without being asked |
| Effects | Fade, shadow, colour change | Showing a button is active | Keep them simple and quick |
| Haptic | Buzz or vibration | Confirming a tap on a phone | Not every device can do it |
The cells students fill in are left blank in this preview.
Animation makes a button grow
<button class="pulse">Press me</button>
Make a free account to save your work and track your progress.
Check: interface tools
Have a go
Check: interface tools
3 questionsCheck: effects and care
Have a go
Check: effects and care
3 questionsInput and feedback
An interaction has two halves. The user gives input. The program gives feedback.
Input can be a tap, a click, typing or a voice command. Feedback can be textual (a message), graphical (a colour change), audio (a sound) or haptic (a buzz).
Every input needs a clear answer, and it needs it fast.
A click gets three kinds of answer
<button id="pay">Pay £5</button>
<p id="message"></p>
Make a free account to save your work and track your progress.
A short sound confirms a press
<button id="beep">Play a sound</button>
<p>A browser plays sound only after the user presses something.</p>
Make a free account to save your work and track your progress.
Flashing is not only a style
Warning
Many people think a flashing effect is only a matter of style. It can harm people with some health conditions. So never flash more than three times in one second. Give users a way to turn off sound and movement.
Showing data as a picture
Numbers in a long table are hard to read. A picture shows the story at once.
This is data visualisation. A dashboard puts the most important figures and charts on one screen. The choice of chart matters.
Which chart for which question?
| Question | Chart | Example |
|---|---|---|
| Which is biggest? | Bar chart | Goals scored by each player |
| How does it change over time? | Line graph | Your phone battery during a day |
| How are parts of a whole shared? | Pie chart | How you spend your phone time: games, music and chat |
| What is the exact number? | Table or big figure | Today's sales on a dashboard |
The cells students fill in are left blank in this preview.
Code draws a bar chart
<div id="chart"></div>
Make a free account to save your work and track your progress.
Worked example: bar heights
| Value | Step 1: multiply by 100 | Step 2: divide by the biggest value (10) | Height |
|---|---|---|---|
| 3 | 3 times 100 = 300 | 300 divided by 10 = 30 | 30 pixels |
| 7 | 7 times 100 = 700 | 700 divided by 10 = 70 | 70 pixels |
| 10 | 10 times 100 = 1000 | 1000 divided by 10 = 100 | 100 pixels (the biggest bar) |
The cells students fill in are left blank in this preview.
Charts and feedback: find the match
Have a go
Loading…
Your answers are marked here and are not kept. A college account keeps every student’s marks.
Scale each bar to the biggest value
Write two JavaScript functions. barHeights gives the height in pixels of each bar in a chart. The biggest value gets the full height. Every other bar gets a smaller height in the same way. Round to a whole number. labelFor makes the text for a label. Press Run Tests.
function barHeights(values, maxPixels) {
// values is a list of whole numbers, such as [10, 25, 50].
// The biggest value gets a bar of maxPixels. The other bars get a smaller height in the same way.
// Round each height to a whole number. Give back the list of heights.
return [];
}
function labelFor(name, value) {
// Give back text like: Goals: 12
return "";
}
Make a free account to save your work, or press Start lab to work through the whole lesson.
Build a small football dashboard
Build a small football club dashboard. Show three big figures: wins, draws and losses. Draw a bar for each one, with a height that matches the number. Add a button "Add a win". When it is pressed, the win figure and the bar both change. Add a text message as feedback. Your teacher marks this task. Check that a new user can see what the page shows within five seconds.
<h1>Football club dashboard</h1>
<!-- 1. Show the three numbers as big figures with labels: wins, draws, losses. -->
<!-- 2. Add a bar for each number. The bar heights come from the numbers. -->
<!-- 3. Add a button that says "Add a win" and updates the figures and the bars. -->
<div id="figures"></div>
<div id="bars"></div>
<button id="add">Add a win</button>
Make a free account to save your work, or press Start lab to work through the whole lesson.
Exit quiz
Have a go