Within the home.js
script is the following code (indentation and comments added by me) :
function o(){
function a(d){
var e=Math.min(d-b,100);
b=d;
y.clearRect(-300,0,w.width,w.height);
//perform one frame of physics on each snowflake, and draw them.
for(var f,g=0,h=0;h<t.length;h++)
d=t[h],
d.step(e),
//f is "the last snowflake I drew before this one"
f&&!d.target&&(g+=Math.abs(d.p[0]-f.p[0])+Math.abs(d.p[1]-f.p[1])),
f=d,
d.draw(y),
d.p[1]>500/p&&!d.target&&(t[h]=c());
//Unicorn drawing occurs here
if(300<=t.length&&2E3>g&&!C){
B[0]=s(0,0,1,2,0);
e=D-120/p;
f=200/p;
d=420/p-E;
for(g=0;g<H.length;g++)
h=H[g],
h=new n(
{
x:e+h[0]/p,
y:f+h[1]/p,
time:d+g/40
},
$(j(h[2],"255,196,255")) //the same pink as seen in the OP's screenshot
),
t.push(h);
C=!0
}
I(a)
}
var b=v();
I(
function(c){
b=c-(v()-b);
a(c)
}
)
}
I have made some educated guesses as to the meaning of the obfuscated variables.
- H is an array of x,y coordinates, declared elsewhere, that form a
unicorn shape when drawn.
- t is an array of snowflake objects on the screen.
- C is a
var
that is declared elsewhere but never assigned to anything, except within function o
. So it is undefined until unicorn drawing occurs, and then it becomes !0
. It appears to behave as a hasUnicornBeenDrawnYet
boolean.
- g is the sum of the manhattan distances of adjacent snowflakes in
t
.
The crucial condition to make the unicorn appear is if(300<=t.length&&2E3>g&&!C)
. If my guesses are correct, this translates to "If there are 300+ snowflakes, and they are very close together, and no unicorn has been drawn yet, then draw a unicorn".
Although the pink color and unobfuscated H array are smoking guns, I am not completely confident in my conclusion. I have not personally been able to make the unicorn appear, even after carefully gathering all the snowflakes while holding control. And the OP mentions the unicorn appeared for him after waiting a long time. But the unicorn should never appear, as long as g
is too large.