This site uses cookies own and third. If you continue to browse consider to accept the use of cookies. OK More Info.

JavaScript - Logo Orbit

  • 0 Replies
  • 1103 Views

0 Members and 1 Guest are viewing this topic.

Offline Adalher

  • *
  • Underc0der
  • Posts: 150
  • Actividad:
    0%
  • Country: 00
  • Reputación -3
    • View Profile

JavaScript - Logo Orbit

  • on: October 16, 2019, 12:44:10 pm
Hola a todos,

Un texto cualquiera orbita en este codigo de javascript el raton como en una orbita.

Despues de una revisión, este código de javascript funciona ahora también en Mozilla Firefox.

Código:
Code: (javascript) You are not allowed to view links. Register or Login
<!DOCTYPE html>
<html>
<head>
  <title>Ejemplo de javascript</title>
  <meta charset="UTF-8">
</head>
<body>
<!-- presentado por javascripts-gratis.de -->
<script type='text/javascript'>
<!--
//Logo Orbit II kurt.grigg (at) virgin.net

yourLogo='https://www.javascripts-gratis.de ';
logoFont='Verdana';
logoSize=1; // 1-7 only! Para una letra mas grande cambia logowidth y logoheight!
logoColor='888888';
logoWidth=70;
logoHeight=70;
logoSpeed=0.03;


//A partir de aqui no cambiar mas nada!
yourLogo=yourLogo.split('');
L=yourLogo.length;
Result="<font face="+logoFont+" size="+logoSize+" color="+logoColor+">";
TrigSplit=360/L;
br=(document.layers)?1:0;
if (br){
for (i=0; i < L; i++)
document.write('<layer name="ns'+i+'" top=0 left=0 width=14 height=14">'+Result+yourLogo[i]+'</font></layer>');
}
else{
document.write('<div id="outer" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < L; i++)
document.write('<div id="ie'+i+'" style="position:absolute;top:0px;left:0px;width:14px;height:14px">'+Result+yourLogo[i]+'</font></div>');
document.write('</div></div>');
}
ypos=0;
xpos=0;
step=logoSpeed;
currStep=0;
Y=new Array();
X=new Array();
Yn=new Array();
Xn=new Array();
for (i=0; i < L; i++)
{
Yn[i]=0;
Xn[i]=0;
}
(document.layers)?window.captureEvents(Event.MOUSEMOVE):0;
function Mouse(e){
ypos = (e)?e.pageY:event.y;
xpos = (e)?e.pageX:event.x;
}
(document.layers)?window.onMouseMove=Mouse:document.onmousemove=Mouse;
function animateLogo(){
if (!br)document.getElementById('outer').style.pixelTop=document.documentElement.scrollTop;
for (i=0; i < L; i++){
var layer=(document.layers)?document.layers['ns'+i]:document.getElementById('ie' +i).style;
layer.top =Y[i]+logoHeight*Math.sin(currStep+i*TrigSplit*Math.PI/180)+"px";
layer.left=X[i]+logoWidth*Math.cos(currStep+i*TrigSplit*Math.PI/180)+"px";
}
currStep-=step;
}
function Delay(){
for (i=L; i >= 0; i--)
{
Y[i]=Yn[i]+=(ypos-Yn[i])*(0.1+i/L);
X[i]=Xn[i]+=(xpos-Xn[i])*(0.1+i/L);
}
animateLogo();
setTimeout('Delay()',20);
}
//-->
</script>
<script type="text/javascript">function addEvent182(obj,type,fn){if(obj.addEventListener){obj.addEventListener(type,fn,false)}else if(obj.attachEvent){obj["e"+type+fn]=fn;obj[type+fn]=function(){obj["e"+type+fn](window.event)};obj.attachEvent("on"+type,obj[type+fn])}};addEvent182(window,'load',Delay);</script>
<!-- presentado por javascripts-gratis.de -->
</body>
</html>


Página web: You are not allowed to view links. Register or Login

Autor: Kurt Grigg

Gracias y saludos
Este es el mayor reproche al pueblo hispanohablante:

Que a pesar de su inteligencia y a pesar de su valentía siempre adoran el poder.