dojo.require ('dojo.NodeList-fx') ; //dojo.require("dojox.gfx3d"); var textos = new Array ('En Lefre ¡Estamos de estreno!', 'Lembra... ¿Que tes na caldereta?', 'Vindeiro martes 10 con Rubén Coca', '20:30 h. no pub Borsalino en Ferrol.') ; // var textos = new Array ('xxxxxx xxxxxxx xxxxxxx xxxxxxxx xxxxxx x') ; var $0 = new Object ; $0.clonar = function (obx) { function f() {} ; f.prototype = obx ; return new f() ; } ; $0.anim_lefre = (function() { var inst ; var lenzo, vista, matriz, matriz_orix, camara, cilindro, matriz_aux ; // var ang ; var duracion = 2000 ; //1500 ; var volta = 0 ; var voltas = 20 ; var freq = 100 ; var fonte ; var ancora_txt ; var txt, txt_pos ; var cont ; var lenzo_anim ; var letras_aire = new Object() ; if (dojo.isIE) var correccion = 0.1 ; else var correccion = 0 ; var letra = (function() { var saltos = 10 ; function mover() { if (cont >= this.ini + saltos) { delete letras_aire ['l'+this.ind] ; this.capa.parentNode.removeChild (this.capa) ; ancora_txt.lastChild.childNodes [this.ind - 1].style.visibility = 'visible' ; } else { this.v [0] += this.a [0] ; this.v [1] += this.a [1] ; this.v [2] += this.a [2] ; this.pos [0] += this.v [0] ; this.pos [1] += this.v [1] ; this.pos [2] += this.v [2] ; var dim = 60 * (1 + this.pos [2] / 300) ; this.capa.style.fontSize = dim ; this.capa.style.left = (this.pos [0] - dojo.style (this.capa, 'width') / 2) + 'px' ; this.capa.style.bottom = (this.pos [1] - dojo.style (this.capa, 'height') / 2) + 'px' ; } } function constr (capa, pos, v, ind) { this.ini = cont ; this.ind = ind ; this.mover = mover ; this.capa = capa ; this.pos = pos ; this.v = v ; this.a = new Array() ; this.a[0] = 2 * (420 + this.ind * 10 - this.pos [0] - this.v [0] * saltos) / Math.pow (saltos, 2) ; this.a[1] = 2 * (50 - this.pos [1] - this.v [1] * saltos) / Math.pow (saltos, 2) ; this.a[2] = 2 * (-150 - this.pos [2] - this.v [2] * saltos) / Math.pow (saltos, 2) ; } return constr ; })() ; var _pub = { anim_met: function (e) { // e [0] = Math.PI / 2 + 0.1 ; // e [1] = 1 ; this.anim_obx.duration = e [2] ; cilindro.setTransform ([matriz_orix,matriz.rotateX (e [1] * Math.sin (e [0])),matriz.rotateY (e [1] * Math.cos (e [0]))]) ; var z = (165 * Math.sin (e [1])) * Math.sin (e [0]); var x = 175 + 165 * Math.sin (e [1]) * Math.cos (e [0]) ; var y = 75 + 185 * Math.cos (Math.sqrt (Math.pow (e [1], 2) + Math.pow (0.4, 2) + 2 * e[1] * 0.4 * Math.cos (Math.PI / 2 - e[0]))) ; cilindro.invalidate() ;//vista.applyCameraTransform (camara); vista.render(); if (z < -80) fonte.style.zIndex = -1 ; else fonte.style.zIndex = 1 ; var dim = 60 * (1 + z / 300) ; fonte.style.fontSize = dim ; fonte.style.left = (x - dojo.style (fonte, 'width') / 2) + 'px' ; fonte.style.bottom = (y - dojo.style (fonte, 'height') / 2) + 'px' ; // console.log (cont) ; if (true || ! (cont % 2)) { if (fonte.innerHTML.length) { var vx = e [1] * -Math.sin (e [0]) * 150 ; var vy = e [1] * -Math.cos (e [0]) * Math.sin (e [1]) * 150 ; var vz = e [1] * Math.cos (e [0]) * Math.cos (e [1]) * 150 ; var capa = document.createElement ('div') ; /*if (dojo.isIE) */capa.className = 'letra' ; // else capa.class = 'letra' ; lenzo_anim.appendChild (capa) ; capa.innerHTML = fonte.innerHTML ; fonte.innerHTML = '' ; letras_aire ['l'+txt_pos] = new letra (capa, [x,y,z], [vx, vy, vz], txt_pos) ; } if (txt.length/* && cont < 12*/) { do { var aux = txt.shift() ; txt_pos ++ ; } while (aux == ' ') ; if (aux != ' ') fonte.innerHTML = aux ; // } } // this.anim_obx.stop() ; for (var i in letras_aire) { letras_aire [i].mover() ; } }, anim_fin: function() { volta ++ ; if (volta >= voltas) { // console.log ('x') ; this.anim_obx.stop() ; } // console.log ('xxxxxx') ; }, getValue: function (paso) { cont ++ ; var aux = /*1 -*/ ((volta+paso)/voltas) ; var aux2 = /*1 -*/ Math.pow (1 - aux, 5) ; //http://origin91.110mb.com/Mecanica_y_Animacion1.htm resultado = new Array(correccion + paso * (2 * Math.PI - 2 * correccion), 1 * aux2, freq + (duracion-freq) * aux2) ; if (paso == 1) { volta ++ ; if (volta >= voltas) { //volta-- ;//parche this.anim_obx.repeat=0 ; this.anim_obx.stop() ; if (this.anim_obx._active) { } else { if (textos.length) { volta = 0 ; if (! inst.anim_obx._active) inst.anim_obx.play() ; } else { this.sair() ; } } } } //0.6 -> 0 // return resultado ; }, anim_ini: function() { // console.log ('ini') ; if (! volta) { cont = -1 ; var div = document.createElement ('div') ; ancora_txt.appendChild (div) ; txt = textos.shift().split ('') ; txt_pos = 0 ; for (var i=0 ; i' ; for(i=1;i<=7;i++) //minutero txt += '
' ; for(i=1;i<=7;i++) //segundero txt += '
' ; for(i=1;i<=12;i++) //digitos txt += '
'+i+'
' ; //font-size:7px ;background-image:url(\'/fondo_dix_reloxio.png\') ; txt += '' ; document.getElementById ('reloxio').innerHTML = txt ; // mueve_capa( exterior, 100, 200); } function avanza_reloj() { ahora = new Date() ahora.hrs = ahora.getHours() ahora.min = ahora.getMinutes() ahora.sec = ahora.getSeconds() ahora.hrs = ( ahora.hrs >= 12 ) ? ahora.hrs - 12 : ahora.hrs ahora.hrs = Math.floor( ( ahora.hrs * 5 ) + ( ahora.min/12 ) ) for(n=0;n