var Glitter = { path: "/static/img/glitter/", delay: 50, count: 0, radius: $(window).height() / 3, direction: false, centerX: $(window).width() * 2 / 7, centerY: $(window).height() / 3, loopTimer: false, loopers: [], rotate: function (id, angle, radius, direction, opacity) { if (direction) angle += 2 else angle -= 2 radians = angle * Math.PI / 180 newX = Math.sin(radians) * radius + Glitter.centerX newY = Math.cos(radians) * radius + Glitter.centerY $(id).css({ "left": newX, "top": newY, "opacity": opacity/100 }) opacity -= 1 if (opacity === 0) { $(id).remove() return false } return [id, angle, radius, direction, opacity] }, loop: function () { var newLoopers = [] for (i in Glitter.loopers) { var l = Glitter.loopers[i] var r = Glitter.rotate(l[0], l[1], l[2], l[3], l[4]) if (r) newLoopers.push(r) } Glitter.loopers = newLoopers Glitter.loopTimer = setTimeout(Glitter.loop, Glitter.delay) }, go: function () { Glitter.count += 1 // if (Glitter.count % 20 === 0) // Glitter.direction = ! Glitter.direction var index = Math.floor( Math.random() * GLITTER_DATA.length ) var radius = Glitter.radius + Math.floor( Math.random() * 100 ) var angle = Math.floor( Math.random() * 360 ) var opacity = 100 var newsrc = GLITTER_DATA[index] var newid = "glitter_" + Glitter.count var newdiv = "
"
setTimeout('$("#heading").html("'+newtitle+'")', 6000)
$("#topic").css({position:"fixed", top: 40, left: 750})
Room.loadCallback = function ()
{
setTimeout(Viewport.fullscreenOn, 500)
setTimeout('$("#logobg").css({width: "100%"})', 1000)
Keyboard.textareaMap = Glitter.textareaMap
Keyboard.standardMap = Glitter.standardMap
Keyboard.fullscreenMap = Glitter.fullscreenMap
Keyboard.focusTextarea()
}
},
}
Glitter.init()