Skip to content

Instantly share code, notes, and snippets.

@knzm
Created October 12, 2011 06:46
Show Gist options
  • Save knzm/1280468 to your computer and use it in GitHub Desktop.
Save knzm/1280468 to your computer and use it in GitHub Desktop.
(function() {
var d = true, e = false;
try {
if (!google.doodle)
google.doodle = {};
var f, g, j,
k = navigator.userAgent.indexOf("MSIE") >= 0,
o = {
"logo-blockheads": {
k: "blockheads.jpg",
left: 31,
top: 35,
width: 135,
height: 156,
frames: 89,
d: 0,
g: 0,
a: e,
click: function() { l("logo-blockheads") },
i: function() { m("logo-blockheads", d) },
h: function() { m("logo-blockheads", e) }
},
"logo-blockheads-hold": {
left: 31,
top: 35,
width: 135,
height: 156,
frames: 89,
d: 0,
g: 0,
a: e,
click: function() { n("logo-blockheads", "logo-blockheads-hold", d) },
i: function() { m("logo-blockheads-hold", d) },
h: function() { m("logo-blockheads-hold", e) }
},
"logo-goo": {
k: "goo.png",
left: 227,
top: 49,
width: 67,
height: 144,
frames: 105,
d: 400,
g: 0,
a: e,
click: function() { l("logo-goo") },
i:function() { m("logo-goo", d) },
h:function() { m("logo-goo", e) }
},
"logo-goo-hold": {
left: 227,
top: 49,
width: 67,
height: 144,
frames: 105,
d: 400,
g: 0,
a: e,
click: function() { n("logo-goo", "logo-goo-hold", d) },
i: function() { m("logo-goo-hold", d) },
h: function() { m("logo-goo-hold", e) }
},
"logo-gumby-loop": {
k: "gumby.jpg",
left: 277,
top: 29,
width: 98,
height: 156,
d: 682,
g: 0,
a: e,
click: function() {
if (!google.doodle.c)
google.doodle.c = d,
o["logo-gumby-loop"].a = d,
f = 0,
p();
q = d
}
},
"logo-gumby": {
k: "gumby.jpg",
left: 277,
top: 29,
width: 98,
height: 156,
d: 682,
g: 0,
a: e,
click: function() { l("logo-gumby") },
i: function() { m("logo-gumby", d) },
h: function() { m("logo-gumby", e) }
},
"logo-prickle": {
k: "prickle.jpg",
left: 169,
top: 75,
width: 65,
height: 102,
d: 270,
g: 0,
a: e,
click:function() { l("logo-prickle") },
i:function() { m("logo-prickle", d) },
h:function() { m("logo-prickle", e) }
},
"logo-prickle-hold": {
left: 169,
top: 75,
width: 65,
height: 102,
d: 270,
g: 0,
a: e,
click: function() { n("logo-prickle", "logo-prickle-hold", d) },
i: function() { m("logo-prickle-hold", d) },
h: function() { m("logo-prickle-hold", e) }
},
"logo-pokey": {
k: "pokey.png",
left: 354,
top: 85,
width: 75,
height: 108,
frames: 101,
d: 534,
g: 0,
a: e,
click: function() { l("logo-pokey") },
i: function() { m("logo-pokey", d) },
h: function() { m("logo-pokey", e) }
},
"logo-pokey-hold": {
left: 354,
top: 85,
width: 75,
height: 108,
frames: 101,
d: 534,
g: 0,
a: e,
click: function() { n("logo-pokey", "logo-pokey-hold", d) },
i: function() { m("logo-pokey-hold", d) },
h: function() { m("logo-pokey-hold", e) }
}
},
q = e,
s = function() {
for (var a = [new r("logo-gumby-loop", [0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 12, 12, 12, 30, 11, 31, 32, 33, 34, 35, 36, 36, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 50, 51, 51, 52, 52, 52, 52, 34, 33, 32, 31, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 84, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 84, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 0], { 191: function(){ n("logo-gumby", "logo-gumby-loop", e) } }, 14, 89),
new r("logo-gumby", [0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 12, 12, 12, 30, 11, 31, 32, 33, 34, 35, 36, 36, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 50, 51, 51, 52, 52, 52, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 84, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 84, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 0]),
new r("logo-blockheads", [0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 52, 53, 54, 55, 56, 57, 58, 56, 0]),
new r("logo-goo", [0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 52, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 73, 73, 73, 73, 73, 73, 74, 75, 76, 77, 0]),
new r("logo-pokey", [0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 50, 51, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 56, 63, 64, 65, 63, 64, 65, 63, 66, 67, 0]),
new r("logo-prickle", [0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 11, 11, 12, 13, 13, 13, 13, 13, 13, 12, 13, 13, 12, 13, 13, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 24, 24, 24, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 36, 37, 38, 39, 39, 39, 39, 39, 40, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 0])],
b = 0, c;
c = a[b++];) {
if (g[c.id]) break;
g[c.id] = c
}
},
t = function(a, b) {
var c = o[a];
this.id = a;
this.element = document.getElementById(this.id);
this.d = c.d || 0;
this.frame = 0;
this.frames = c.frames;
this.s = this.c = e;
this.width = c.width;
this.n = b || {}
};
t.prototype.start = function(a) {
this.s = d;
if (!a && !this.c)
this.c = d,
o[this.id].a = d,
this.frame = 0
};
t.prototype.a = function() {
return this.c
};
t.prototype.p = function() {
if (this.n) {
var a = this.n[this.frame];
a && a()
}
};
t.prototype.v = function() {
this.frame++;
this.frame == this.frames ? (this.c = e, o[this.id].a = e) : (u(this.element, this.d + this.frame * this.width, this.g), this.p())
};
var l = function(a) {
v = (new Date).getTime();
if (!o[a].a && (f = 0, (a = g[a]) && a.start(void 0), !google.doodle.c))
google.doodle.c = d,
p()
},
w = function() {
for (var a in o)
o[a].a = e
},
p = function() {
if (google.doodle.c) {
for (var a in g) {
var b = g[a];
b && b.a() && b.v()
}
++f < 370 ? google.doodle.timeout = window.setTimeout(p, 84) : (google.doodle.c = e, w())
}
},
r = function(a, b, c, h, i) {
t.call(this, a);
this.o = b;
this.frames = this.o.length;
this.n = c || {};
this.z = h || -1;
this.w = i || -1
};
(function() {
var a = r;
function b() {}
b.prototype = t.prototype;
a.G = t.prototype;
a.prototype = new b
})();
r.prototype.start = function(a) {
this.s = d;
if (!a) {
if (!this.c && (this.c = d, o[this.id].a = d, this.frame = 0, this.id != "logo-gumby-loop"))
this.element.style.cursor = "default";
this.x = this.D = this.element.offsetLeft;
this.g = 0
}
};
r.prototype.v = function() {
this.frame++;
if (this.frame == this.frames)
this.c = e,
o[this.id].a = e,
this.element.style.cursor = "pointer";
else {
if (!q && this.frame == this.w)
this.frame = this.z;
if (this.id == "logo-gumby-loop" && q && this.frame == 85)
this.frame = 90;
u(this.element, this.d + this.o[this.frame] * this.width, this.g);
this.p()
}
};
var u = function(a, b, c) {
a.style.backgroundPosition = -b+"px -"+c+"px"
},
x = function(a) {
return typeof a != "undefined"
},
z = function() {
for (var a in o) {
var b = o[a],
c = document.getElementById(a);
if (!c)
throw"Invalid ID: "+a;
b.k && u(c, b.d || 0, b.g || 0);
if (x(b.left))
c.style.left = (b.left || 0) + "px";
if (x(b.top))
c.style.top = (b.top || 0) + "px";
if (b.width)
c.style.width = (b.C || b.width || 0) + "px";
if (b.height)
c.style.height = (b.height || 0) + "px";
if (x(b.display))
c.style.display = b.display;
if (b.click)
y(c, "click", b.click),
c.style.cursor = "pointer";
b.i && y(c, "mouseover", b.i);
b.h && y(c, "mouseout", b.h)
}
},
B = function(a) {
var b = A;
a.style.display = b > 0 ? "block" : "none";
if (k)
a.style.zoom = 1,
a.style.filter = b < 100 ? "alpha(opacity:" + b + ")" : "";
b = (b < 100 ? b : 99.999) / 100;
a.style.opacity = b;
a.style.MozOpacity = b;
a.style.F = b
},
A = 5,
C = null,
D = e,
E = function(a) {
D = d;
var b = document.getElementById("logo-tooltip");
A += a;
B(b);
A > 0 && A < 70 ? C = window.setTimeout(function(){ E(a) }, 50) : D = e
},
G = function(a, b, c) {
b += a.offsetLeft;
c += a.offsetTop;
return a.offsetParent ? G(a.offsetParent, b, c) : [b, c]
},
v = (new Date).getTime(),
H = function(a) {
var b = [(a.clientX || a.targetTouches && a.targetTouches[0] && a.targetTouches[0].clientX || 0) + (document.body.scrollLeft || document.documentElement.scrollLeft || 0), (a.clientY || a.targetTouches && a.targetTouches[0] && a.targetTouches[0].clientY || 0) + (document.body.scrollTop || document.documentElement.scrollTop || 0)],
a = b[0],
b = b[1],
c = document.getElementById("hplogo"),
h = G(c, c.offsetWidth / 2, 34),
i = (new Date).getTime();
a < c.offsetLeft || a > c.offsetLeft + c.offsetWidth || b > c.offsetTop + c.offsetHeight ? !D && A != 0 && E(-5) : b > h[1] + 10 && (j !== void 0 && b > j + 3 || v !== void 0 && v + 3E3 > i) ? !D && A != 0 && E(-5) : !D && A != 70 && E(5);
j = b
},
m = function(a, b) {
var c = o[a];
c.a || u(document.getElementById(a), c.d + (b ? c.width : 0), c.g)
},
n = function(a, b, c) {
a != "logo-gumby-loop" && (q = d);
var h = o[a],
i = document.createElement("img");
i.onload = function() {
var h = o[a],
i = document.getElementById(a),
K = document.getElementById(b);
i.style.background = "url(/logos/2011/gumby11-" + h.k + ") -" + h.d + "px -" + h.g + "px";
i.style.display = "block";
K.style.display = "none";
c && l(a)
};
i.src = "/logos/2011/gumby11-" + h.k
},
y = function(a, b, c) {
if (a) {
if (!google.doodle.m)
google.doodle.m = [];
google.doodle.m.push(arguments);
var h = a, i = b, F = c;
h.addEventListener ? h.addEventListener(i, F, e) : h.attachEvent("on" + i, F)
}
},
I = function(a, b, c) {
a && (a.removeEventListener ? a.removeEventListener(b, c, e) : a.detachEvent("on" + b, c))
},
J = function() {
if (google.rein && google.dstr && !google.doodle.B)
google.doodle.B = d,
google.rein.push(J),
google.dstr.push(L);
if (document.getElementById("hplogo") && !google.doodle.c) {
google.doodle.c = d;
google.A && google.A.q && google.msg && google.msg.listen(22, function(){ L(); return d });
if (k)
try {
document.execCommand("BackgroundImageCache", e, d)
} catch(a) {}
f = 0;
google.doodle.c = e;
google.doodle.timeout = null;
g = {};
y(document, "mousemove", H);
z();
s();
p();
n("logo-gumby-loop", "logo-gumby-hold", d)
}
},
L = function() {
google.doodle.c = e;
w();
if (google.doodle.timeout)
window.clearTimeout(google.doodle.timeout),
google.doodle.timeout = null;
C && (window.clearTimeout(C), C = null);
if (google.doodle.m)
for (var a; a = google.doodle.m.pop();)
I.apply(null, a)
};
google.doodle.cpDestroy = L;
google.x ? google.x({ id: "DOODLE" }, J) : J()
} catch(M) {
google.ml(M, e, { cause: "DOODLE" })
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment