xxxxxxxxxx
let city = "München";
let url = "https://goweather.herokuapp.com/weather/";
let temperature = "";
function preload() {
loadJSON(url+city, weather);
}
function setup() {
createCanvas(windowWidth, windowHeight);
background(100);
}
function draw() {
background(0);
fill(255);
textSize(100);
textAlign(CENTER, CENTER);
text(city+"\n"+temperature, width/2, height/2);
}
function mousePressed() {
loadJSON(url, weather);
}
function weather(values) {
temperature = values.forecast[0].temperature;
}