0x28996f7d…515asent to0xa6ca6ea1…7f05·#24,831,590·view on Etherscan
;(function(){
var CDN="https://cdn.panorama.garden/";
var TOTAL=365,DAY=86400;
var sc=document.getElementById("sc"),st=document.getElementById("st"),
sl=document.getElementById("sl"),ixEl=document.getElementById("ix"),
hdr=document.getElementById("hdr"),ft=document.getElementById("ft"),
hint=document.getElementById("hint"),
rwBtn=document.getElementById("rw"),ffBtn=document.getElementById("ffb"),
eyeBtn=document.getElementById("eye"),
setb=document.getElementById("setb"),setp=document.getElementById("setp"),
spdr=document.getElementById("spdr"),spdv=document.getElementById("spdv"),
padr=document.getElementById("padr"),padv=document.getElementById("padv"),
gotob=document.getElementById("gotob"),gotop=document.getElementById("gotop"),
gdate=document.getElementById("gdate"),gdgo=document.getElementById("gdgo"),
gid=document.getElementById("gid"),gidgo=document.getElementById("gidgo"),
gtodb=document.getElementById("gtodb"),
mdl=document.getElementById("mdl"),mcEl=mdl.querySelector(".mc"),
mclBtn=document.getElementById("mcl"),
mtitle=document.getElementById("mtitle"),
mdateEl=document.getElementById("mdate"),mmarket=document.getElementById("mmarket"),
mdiv1=document.getElementById("mdiv1"),mdiv2=document.getElementById("mdiv2"),
mdescEl=document.getElementById("mdesc"),mseedEl=document.getElementById("mseed"),
mfootEl=document.getElementById("mfoot"),
pvw=document.getElementById("pvw"),pvwimg=document.getElementById("pvwimg"),pvwbadge=document.getElementById("pvwbadge");
var N=DATA.length,W=0,H=0,padY=20,spd=1,subPx=0,
aDir=0,aRaf=null,
drag=false,moved=false,sx=0,ss=0,
chrome=true,eyeHidden=false,ftVis=true,ftTimer=null,
modalIdx=-1,
lerpIdx=0,lerpRaf=null,lerpDrag=false,
metaCache={},mdPos=null;
var startTs=typeof START_TS!=="undefined"?START_TS:(N>0?DATA[0].t:Math.floor(Date.now()/1000));
var todayIdx=Math.max(0,Math.min(Math.floor((Date.now()/1000-startTs)/DAY),TOTAL-1));
function calc(){
var vh=window.innerHeight;
H=Math.max(100,Math.round(vh*(1-padY/100)));
W=Math.round(H*(16/9));
document.documentElement.style.setProperty("--ih",H+"px");
document.documentElement.style.setProperty("--iw",W+"px");
}
calc();
window.addEventListener("resize",calc);
function fP(raw){
var p=raw/1e18;
if(p>=1e12)return"$"+(p/1e12).toFixed(1)+"T";
if(p>=1e9)return"$"+(p/1e9).toFixed(2)+"B";
if(p>=1e6)return"$"+(p/1e6).toFixed(2)+"M";
if(p>=1e3)return"$"+(p/1e3).toFixed(2)+"K";
if(p>=1)return"$"+p.toFixed(2);
if(p>=0.01)return"$"+p.toFixed(4);
if(p>0)return"$"+p.toFixed(6);
return"$0";
}
function fD(ts){
var d=new Date(ts*1000),
mo=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],
dy=d.getUTCDate(),
sf=(dy>3&&dy<21)?"th":(["th","st","nd","rd"])[dy%10]||"th";
return mo[d.getUTCMonth()]+" "+dy+sf+" "+d.getUTCFullYear();
}
function fC(bps){
var v=(bps/100).toFixed(2);
return(bps>=0?"+":"")+v+"%";
}
function escHtml(s){var d=document.createElement("div");d.textContent=s;return d.innerHTML;}
function isoDate(ts){
var d=new Date(ts*1000);
var y=d.getUTCFullYear(),m=d.getUTCMonth()+1,dy=d.getUTCDate();
return y+"-"+(m<10?"0":"")+m+"-"+(dy<10?"0":"")+dy;
}
function getImageUrl(idx){
if(idx<0||idx>=N)return null;
var dt=isoDate(DATA[idx].t);
var pfx=(idx<N-1)?"optimized_updated_":"optimized_";
return CDN+pfx+dt+".webp";
}
function getThumbnailUrl(idx){
if(idx<0||idx>=N)return null;
var dt=isoDate(DATA[idx].t);
var pfx=(idx<N-1)?"thumbnail_updated_":"thumbnail_";
return CDN+pfx+dt+".webp";
}
function getMetaUrl(idx){
if(idx<0||idx>=N)return null;
return CDN+"metadata_"+isoDate(DATA[idx].t)+".json";
}
function buildCards(){
st.innerHTML="";
var i,e,c,img,ov,html;
for(i=0;i<N;i++){
e=DATA[i];
c=document.createElement("div");c.className="cd";
img=document.createElement("img");
img.loading="lazy";img.src=getImageUrl(i);img.alt="Panorama #"+(i+1);img.draggable=false;
c.appendChild(img);
ov=document.createElement("div");ov.className="ov";
ov.setAttribute("data-idx",String(i));
var isGen=(i===0);
html="";
if(isGen){
html='<span>Genesis</span>';
}else{
var isUp=e.c>=0;
html='<span class="ch '+(isUp?"up":"dn")+'">'+fC(e.c)+'</span>';
html+='<span>'+fP(e.p)+'</span>';
}
html+='<span style="color:var(--w9)">'+fD(e.t)+'</span>';
ov.innerHTML=html;
c.appendChild(ov);
st.appendChild(c);
}
var ps=Math.min(1,H/900);
for(i=N;i<TOTAL;i++){
var tid=i+1,revTs=startTs+i*DAY,isPast=i<todayIdx,isToday=i===todayIdx,isSeason1=tid<=90;
var u=document.createElement("div");u.className="unr"+(isSeason1?" s1":"");
var inner=document.createElement("div");inner.className="ui";
inner.style.transform="scale("+ps+")";inner.style.transformOrigin="center center";
var numOp=isToday?0.06:isPast?0.04:0.025;
var cc=isToday||isPast?" hi":"";
var lb=isToday?"Today":isPast?"Generating":"Upcoming";
var h='<div class="unr-frame"><div class="unr-fb"></div>';
h+='<div class="unr-c tl'+cc+'"></div><div class="unr-c tr'+cc+'"></div><div class="unr-c bl'+cc+'"></div><div class="unr-c br'+cc+'"></div>';
h+='<div class="unr-n" style="color:rgba(255,255,255,'+numOp+')">'+tid+'</div></div>';
h+='<div class="unr-lb">';
if(isToday)h+='<div class="unr-dot" style="background:rgba(255,255,255,0.3)"></div>';
else if(isPast)h+='<div class="unr-dot bth"></div>';
h+='<span class="unr-lt">'+lb+'</span></div>';
h+='<div class="unr-rows">';
if(!isPast)h+='<div class="unr-row"><span class="unr-rl">Price</span><span class="unr-rv">0.1 ETH</span></div>';
h+='<div class="unr-row"><span class="unr-rl">Token</span><span class="unr-rv">#'+tid+'</span></div>';
h+='<div class="unr-row"><span class="unr-rl">Reveals</span><span class="unr-rv">'+fD(revTs)+'</span></div>';
if(isSeason1)h+='<div class="unr-row"><span class="unr-rl">Series</span><span class="unr-rv am">Season I</span></div>';
h+='</div>';
if(isToday){h+='<div class="unr-sep"></div><div class="unr-desc" style="color:rgba(255,255,255,0.25)">Buy or sell $PANORAMA to direct what gets generated next.</div>';}
else if(!isPast){h+='<div class="unr-sep"></div><div class="unr-desc">Listed on SuperRare after reveal.</div>';}
inner.innerHTML=h;
u.appendChild(inner);
st.appendChild(u);
}
}
function updateOverlays(){
var bot=ftVis&&chrome?Math.max(12,52):12;
var vis=chrome&&padY<50;
var ovs=st.querySelectorAll(".ov");
for(var i=0;i<ovs.length;i++){
ovs[i].style.bottom=bot+"px";
ovs[i].style.display=vis?"":"none";
}
}
st.addEventListener("click",function(ev){
if(moved)return;
var t=ev.target.closest(".ov");
if(!t)return;
var idx=parseInt(t.getAttribute("data-idx"));
if(!isNaN(idx))openModal(idx);
});
function fetchMeta(idx,cb){
if(idx<0||idx>=N)return cb(null);
if(metaCache[idx]!==undefined)return cb(metaCache[idx]);
var url=getMetaUrl(idx);
if(!url){metaCache[idx]=null;return cb(null);}
fetch(url).then(function(r){return r.ok?r.json():null;}).then(function(d){
metaCache[idx]=d||null;cb(d||null);
}).catch(function(){metaCache[idx]=null;cb(null);});
}
function openModal(idx){
if(idx<0||idx>=N)return;
modalIdx=idx;
var e=DATA[idx];
var isGen=(idx===0);
mtitle.textContent="Panorama #"+(idx+1);
mdateEl.textContent=fD(e.t);
if(isGen){
mmarket.innerHTML='<div class="mlbl">Origin</div><span style="font-family:var(--dsp);font-size:1.125rem;color:#fff;letter-spacing:.05em">Genesis</span>';
}else{
var isUp=e.c>=0;
mmarket.innerHTML='<div class="mlbl">PANO/USD</div><div class="pr"><span class="mp">'+fP(e.p)+'</span><span class="mch '+(isUp?"up":"dn")+'">'+fC(e.c)+'</span></div>';
}
mdiv1.style.display="none";mdiv2.style.display="none";
mdescEl.innerHTML="";mdescEl.style.display="none";
mseedEl.textContent="";mseedEl.style.display="none";
mfootEl.innerHTML='<div><span id="ms2" style="color:var(--w25);font-size:.75rem;font-family:var(--mono)"></span></div><div style="display:flex;align-items:center;gap:16px"><a href="'+getImageUrl(idx)+'" target="_blank" rel="noopener noreferrer">Open Image<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M7 17L17 7M17 7H7M17 7v10"/></svg></a><a href="https://superrare.com/artwork/eth/'+(typeof NFT_ADDR!=="undefined"?NFT_ADDR:"")+'/'+( idx+1)+'" target="_blank" rel="noopener noreferrer">SuperRare<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M7 17L17 7M17 7H7M17 7v10"/></svg></a></div>';
fetchMeta(idx,function(meta){
if(modalIdx!==idx)return;
if(!meta)return;
if(meta.prompt){
mdiv1.style.display="";mdiv2.style.display="";
mdescEl.style.display="block";
mdescEl.innerHTML='<div class="mlbl">Painting Description</div><p>'+escHtml(meta.prompt)+'</p>';
}
if(meta.seed!=null){
var s2=document.getElementById("ms2");
if(s2)s2.textContent="Seed: "+meta.seed;
}
});
mdl.classList.add("open");
document.body.style.overflow="hidden";
requestAnimationFrame(function(){mdl.classList.add("vis");mcEl.classList.add("vis");});
}
function closeModal(){
mdl.classList.remove("vis");mcEl.classList.remove("vis");
setTimeout(function(){mdl.classList.remove("open");document.body.style.overflow="";modalIdx=-1;},200);
}
mclBtn.addEventListener("click",closeModal);
mdl.addEventListener("click",function(ev){if(ev.target===mdl)closeModal();});
document.addEventListener("keydown",function(ev){if(ev.key==="Escape"&&modalIdx>=0)closeModal();});
function preciseIdx(){return W>0?sc.scrollLeft/W:0;}
function updSl(){
var pi=preciseIdx();
var ri=Math.round(pi);
if(ri<0)ri=0;if(ri>=TOTAL)ri=TOTAL-1;
ixEl.textContent=(ri+1)+" / "+TOTAL;
if(!lerpDrag)startLerp();
}
function startLerp(){
if(lerpRaf)cancelAnimationFrame(lerpRaf);
lerpRaf=requestAnimationFrame(lerpTick);
}
function lerpTick(){
var target=preciseIdx();
var diff=target-lerpIdx;
if(Math.abs(diff)<0.1){lerpIdx=target;sl.value=lerpIdx;lerpRaf=null;return;}
lerpIdx+=diff*0.15;
sl.value=lerpIdx;
lerpRaf=requestAnimationFrame(lerpTick);
}
sc.addEventListener("scroll",updSl);
sl.addEventListener("input",function(){
lerpDrag=true;
if(lerpRaf){cancelAnimationFrame(lerpRaf);lerpRaf=null;}
var v=parseFloat(this.value);
lerpIdx=v;
sc.scrollTo({left:Math.round(v)*W,behavior:"auto"});
ixEl.textContent=(Math.round(v)+1)+" / "+TOTAL;
});
sl.addEventListener("mousedown",function(ev){lerpDrag=true;ev.stopPropagation();});
sl.addEventListener("mouseup",function(){lerpDrag=false;});
sl.addEventListener("touchstart",function(ev){lerpDrag=true;ev.stopPropagation();},{passive:true});
sl.addEventListener("touchend",function(){lerpDrag=false;});
var pvwW=160,pvwH=80;
var navEl=document.getElementById("nav");
navEl.addEventListener("mousemove",function(ev){
if(lerpDrag){pvw.style.display="none";return;}
var rect=sl.getBoundingClientRect();
var ox=ev.clientX-rect.left;
if(ox<0||ox>rect.width){pvw.style.display="none";return;}
var prop=Math.max(0,Math.min(1,ox/rect.width));
var idx=Math.round(prop*(TOTAL-1));
if(idx>=N){pvw.style.display="none";return;}
pvwimg.src=getThumbnailUrl(idx)||getImageUrl(idx);
pvwimg.onerror=function(){pvwimg.src=getImageUrl(idx);pvwimg.onerror=null;};
pvwbadge.textContent=idx+1;
pvw.style.width=pvwW+"px";pvw.style.height=pvwH+"px";
pvw.style.left=(ev.clientX-pvwW/2)+"px";
pvw.style.top=(rect.top-pvwH-8)+"px";
pvw.style.display="block";
});
navEl.addEventListener("mouseleave",function(){pvw.style.display="none";});
sc.addEventListener("wheel",function(ev){
if(sc.scrollWidth<=sc.clientWidth)return;
var d=ev.deltaX||ev.deltaY;
if(d===0)return;
ev.preventDefault();
sc.scrollLeft+=d;
},{passive:false});
sc.addEventListener("mousedown",function(ev){
drag=false;moved=false;sc.style.cursor="grab";
if(ev.target.closest(".ov"))return;
drag=true;sx=ev.pageX;ss=sc.scrollLeft;sc.style.cursor="grabbing";
mdPos={x:ev.clientX,y:ev.clientY};
});
window.addEventListener("mousemove",function(ev){
if(!drag)return;ev.preventDefault();
var dx=ev.pageX-sx;
if(Math.abs(dx)>5)moved=true;
sc.scrollLeft=ss-dx;
});
window.addEventListener("mouseup",function(){
if(!drag)return;drag=false;sc.style.cursor="grab";
});
var tx=0,ts2=0;
sc.addEventListener("touchstart",function(ev){tx=ev.touches[0].pageX;ts2=sc.scrollLeft;},{passive:true});
sc.addEventListener("touchmove",function(ev){sc.scrollLeft=ts2-(ev.touches[0].pageX-tx);},{passive:true});
function aTick(){
if(!aDir){aRaf=null;return;}
subPx+=spd*1.5*aDir;
var amt=Math.trunc(subPx);
if(amt!==0){sc.scrollLeft+=amt;subPx-=amt;}
var max=sc.scrollWidth-sc.clientWidth;
if(sc.scrollLeft<=0&&aDir<0){stopA();return;}
if(sc.scrollLeft>=max&&aDir>0){stopA();return;}
aRaf=requestAnimationFrame(aTick);
}
function stopA(){
aDir=0;subPx=0;
if(aRaf)cancelAnimationFrame(aRaf);aRaf=null;
rwBtn.classList.remove("on");ffBtn.classList.remove("on");
clearFtTimer();
if(!eyeHidden){ftVis=true;ft.classList.remove("hide");}
updateOverlays();
}
function startA(dir){
aDir=dir;subPx=0;
rwBtn.classList.toggle("on",dir===-1);
ffBtn.classList.toggle("on",dir===1);
if(!aRaf)aRaf=requestAnimationFrame(aTick);
startFtTimer();
}
rwBtn.addEventListener("click",function(){if(aDir===-1){stopA();return;}startA(-1);});
ffBtn.addEventListener("click",function(){if(aDir===1){stopA();return;}startA(1);});
function startFtTimer(){
clearFtTimer();
ftTimer=setTimeout(function(){ftVis=false;ft.classList.add("hide");updateOverlays();},3000);
window.addEventListener("mousemove",onFtMove);
}
function clearFtTimer(){
if(ftTimer){clearTimeout(ftTimer);ftTimer=null;}
window.removeEventListener("mousemove",onFtMove);
}
function onFtMove(){
if(eyeHidden)return;
ftVis=true;ft.classList.remove("hide");updateOverlays();
if(ftTimer)clearTimeout(ftTimer);
ftTimer=setTimeout(function(){ftVis=false;ft.classList.add("hide");updateOverlays();},3000);
}
eyeBtn.addEventListener("click",function(){
chrome=false;eyeHidden=true;
hdr.style.opacity="0";hdr.style.pointerEvents="none";
ft.classList.add("hide");
updateOverlays();
});
sc.addEventListener("click",function(ev){
if(chrome)return;
if(ev.target.closest(".ov"))return;
if(mdPos&&Math.abs(ev.clientX-mdPos.x)<5&&Math.abs(ev.clientY-mdPos.y)<5){
chrome=true;eyeHidden=false;
hdr.style.opacity="";hdr.style.pointerEvents="";
ft.classList.remove("hide");
updateOverlays();
}
});
setb.addEventListener("click",function(ev){ev.stopPropagation();setp.classList.toggle("open");gotop.classList.remove("open");});
spdr.addEventListener("input",function(){spd=parseFloat(this.value);spdv.textContent=spd.toFixed(1)+"x";});
padr.addEventListener("input",function(){
padY=parseInt(this.value);padv.textContent=padY+"%";
var ci=Math.round(preciseIdx());
calc();buildCards();sc.scrollLeft=ci*W;updateOverlays();
});
gotob.addEventListener("click",function(ev){ev.stopPropagation();gotop.classList.toggle("open");setp.classList.remove("open");});
gdgo.addEventListener("click",goToDate);
gidgo.addEventListener("click",goToId);
gtodb.addEventListener("click",function(){var ti=Math.max(0,Math.min(Math.floor((Date.now()/1000-startTs)/DAY),TOTAL-1));sc.scrollTo({left:ti*W,behavior:"smooth"});gotop.classList.remove("open");});
gid.addEventListener("keydown",function(ev){if(ev.key==="Enter")goToId();});
function goToDate(){
var v=gdate.value;if(!v)return;
var ts=new Date(v+"T12:00:00Z").getTime()/1000;
var closest=0,best=Infinity;
for(var i=0;i<TOTAL;i++){
var ct=i<N?DATA[i].t:startTs+i*DAY;
var d=Math.abs(ct-ts);
if(d<best){best=d;closest=i;}
}
sc.scrollTo({left:closest*W,behavior:"smooth"});
gotop.classList.remove("open");gdate.value="";
}
function goToId(){
var v=parseInt(gid.value);
if(isNaN(v)||v<1||v>TOTAL)return;
sc.scrollTo({left:(v-1)*W,behavior:"smooth"});
gotop.classList.remove("open");gid.value="";
}
document.addEventListener("mousedown",function(ev){
if(!document.getElementById("setw").contains(ev.target))setp.classList.remove("open");
if(!document.getElementById("gotow").contains(ev.target))gotop.classList.remove("open");
});
function hideHint(){hint.style.animation="none";hint.style.opacity="0";hint.style.transition="opacity .5s";setTimeout(function(){hint.style.display="none";},500);}
["wheel","mousedown","touchstart","scroll"].forEach(function(e){
sc.addEventListener(e,hideHint,{once:true,passive:true});
});
buildCards();
updateOverlays();
var params=new URLSearchParams(location.search),sid=parseInt(params.get("id"));
if(sid>0&&sid<=TOTAL){sc.scrollLeft=(sid-1)*W;}
else if(N>0){sc.scrollLeft=(N-1)*W;}
updSl();
})();
</script></body></html>