-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
23 lines (21 loc) · 846 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/**
Challenge:
- Make the styling more exciting once an activity idea comes
back from the Bored API
- Resources: DOM element "classList" property, uigradients.com,
Google Fonts, color.adobe.com
- Some ideas:
- Change the title from "BoredBot" to something more exciting!
- Change the background to something less drab.
- Bonus: Animate something on the screen to move around and add more
excitement to the page
*/
document.getElementById("get-activity").addEventListener("click", function() {
fetch("https://apis.scrimba.com/bored/api/activity")
.then(response => response.json())
.then(data => {
document.getElementById("activity").textContent = data.activity
document.getElementById("title").textContent = "🦾 HappyBot🦿"
document.body.classList.add("fun")
})
})