// JSONP call to Flickr to get images of some tag
const tag = "lamborghini";
const skycolor = 'white' ; // sky color
const skycolorObject = new THREE.Color ( skycolor.toLowerCase() );
AB.drawRunControls = false;
threeworld.drawCameraControls = false;
function World()
{
this.newRun = function()
{
threeworld.init3d ( 0, 10, skycolorObject );
// runheaderbox expand to whole page
document.getElementById("runheaderbox").style.maxWidth = "100vw";
document.getElementById("runheaderbox").style.width = "100vw";
var script = document.createElement("script");
script.src = "https://api.flickr.com/services/feeds/photos_public.gne?tags=" + tag + "&format=json&jsoncallback=myfn";
document.head.appendChild(script);
};
}
function myfn(data)
{
$("#user_span1").html( "<center> <h1> Demo of World building a web page. </h1> </center> <h1> Latest photos tagged with: " + tag + "</h1>");
// console.log ( data );
console.log ( data.items[0] );
var s = "";
for ( var i = 0; i < 10; i++ )
{
// console.log ( data[i] );
// var url = data.items[i].media.m;
// s = s + "<img border=1 src=" + url + "> ";
var descr = data.items[i].description;
s = s + "<hr> <h1> image " + i + "</h1>" + descr ;
}
$("#user_span2").html( s );
}