function makeView(tps,out,twds,wds,curc,cit) { var list = tps.list, cts=tps.categories; if(cit==-1) { for(var i=0; i< Back"); var tpl = list[cit]; makeItem(tps,cit,cts,out, true); } } function toID(str) { return str.toLowerCase().replace(/\s+/g, "-")+".html"; } function makeItem(tps, ind,cts,lst, big) { var tpl = tps.list[ind]; var rst = window.innerWidth-(245+30); //console.log(iw); var num = 1; while(rst/num>300) num++; var cc = Math.floor(rst/num); //console.log(cc); var isz = cc-26; //console.log(isz); var tit = tpl[7]; var lim = ~~(isz/9); //console.log(tpl); lst.push("
"); var iurl = tpl[3]//(Math.random()<0.5?"wide.png":"tall.png"); //* if(big) isz=rst/2; var wi = (isz+"px"); var hi = ((isz*0.67)+"px"); lst.push("
"); // ict */ //var wi = big?"50%":(isz+"px"); //lst.push("
"); // ict var aurl = "https://www.Photopea.com#t"+tpl[2].split("").reverse().join(""); //lst.push(""); lst.push("
"); // ict lst.push("
"); // cmt lst.push("" + escapeHtml((tit.length"); lst.push(""+"By "+tps.authors[tpl[0]] + " in " + cts["c"+tpl[4]]+""); if(big) { lst.push("

"+escapeHtml(tpl[8])+"

"); lst.push("

"); lst.push("Open"); lst.push("  Open Separately"); lst.push("

"); lst.push(""+"👁 "+tpl[5]+"×  ⭳ "+tpl[6]+"×"+""); } else { //var p = makeNode("span"); p.textContent = tpl[5]+"/"+tpl[6]; //ict.appendChild(p); //p.setAttribute("style","display:inline-block; right:4px; bottom:8px; padding:0px 4px; position:absolute; background:white;"); } lst.push("
"); // cmt lst.push("
"); } function escapeHtml(unsafe) { return unsafe .replace(/&/g, "&") .replace(//g, ">") .replace(/"/g, """) .replace(/'/g, "'"); } function getCatCounts(tps) { var list = tps.list, cts=tps.categories; var ccnt = JSON.parse(JSON.stringify(cts)); for(var cat in ccnt) ccnt[cat]=0; for(var i=0; iCATEGORIES"); for(var cat in cts) { if(ccnt[cat]==0) continue; var cw = parseInt(cat.slice(1)), isTop = (cw%10)==0; //console.log(cw); out.push("
"); out.push(cts[cat]); out.push(""+ccnt[cat]+""); out.push("
"); } } function cost(v) { var age = (Date.now()*0.001 - v[1]) / (60*60*24); var cst = v[6] / age; var ext = 20*Math.pow(2,-age*0.5); //console.log(age,cst,ext) return cst+ext; /* var ts = Math.max(0, v[1]-1134028003); var x = v[6]; var y = 1; var z = Math.max(1,Math.abs(x)); return getBaseLog(10, z) + (y*ts/45000); // 45000 */ } function getBaseLog(x, y) { return Math.log(y) / Math.log(x); }