letras siguiendo el cursor

 <style type='text/css'>

#outerCircleText {

font-style: italic;

font-weight: bold;

font-family: 'comic sans ms', verdana, arial;

color: #C5B358;

position: absolute;top: 0;left: 0;z-index: 3000;cursor: default;}

#outerCircleText div {position: relative;}

#outerCircleText div div {position: absolute;top: 0;left: 0;text-align: center;}

</style>


<script type='text/javascript'>

//<![CDATA[

;(function(){

// Your message here (QUOTED STRING)

var msg = "- MENSAGE";

/* THE REST OF THE EDITABLE VALUES BELOW ARE ALL UNQUOTED NUMBERS */

// Set font's style size for calculating dimensions

// Set to number of desired pixels font size (decimal and negative numbers not allowed)

var size =20;

// Set both to 1 for plain circle, set one of them to 2 for oval

// Other numbers & decimals can have interesting effects, keep these low (0 to 3)

var circleY = 0.75; var circleX = 2;

// The larger this divisor, the smaller the spaces between letters

// (decimals allowed, not negative numbers)

var letter_spacing = 5;

// The larger this multiplier, the bigger the circle/oval

// (decimals allowed, not negative numbers, some rounding is applied)

var diameter = 10;

// Rotation speed, set it negative if you want it to spin clockwise (decimals allowed)

var rotation = 0.4;

// This is not the rotation speed, its the reaction speed, keep low!

// Set this to 1 or a decimal less than one (decimals allowed, not negative numbers)

var speed = 0.3;

////////////////////// Stop Editing //////////////////////

if (!window.addEventListener && !window.attachEvent || !document.createElement) return;

msg = msg.split('');

var n = msg.length - 1, a = Math.round(size * diameter * 0.208333), currStep = 20,

ymouse = a * circleY + 20, xmouse = a * circleX + 20, y = [], x = [], Y = [], X = [],

o = document.createElement('div'), oi = document.createElement('div'),

b = document.compatMode && document.compatMode != "BackCompat"? document.documentElement

:

document.body,

mouse = function(e){

e = e || window.event;

ymouse = !isNaN(e.pageY)? e.pageY : e.clientY; // y-position

xmouse = !isNaN(e.pageX)? e.pageX : e.clientX; // x-position

},

makecircle = function(){ // rotation/positioning

if(init.nopy){

o.style.top = (b || document.body).scrollTop + 'px';

o.style.left = (b || document.body).scrollLeft + 'px';

};

currStep -= rotation;

for (var d, i = n; i > -1; --i){ // makes the circle

d = document.getElementById('iemsg' + i).style;

d.top = Math.round(y[i] + a * Math.sin((currStep + i) / letter_spacing) * circleY - 15) +

'px';

d.left = Math.round(x[i] + a * Math.cos((currStep + i) / letter_spacing) * circleX) + 'px';

};

},

drag = function(){ // makes the resistance

y[0] = Y[0] += (ymouse - Y[0]) * speed;

x[0] = X[0] += (xmouse - 20 - X[0]) * speed;

for (var i = n; i > 0; --i){

y[i] = Y[i] += (y[i-1] - Y[i]) * speed;

x[i] = X[i] += (x[i-1] - X[i]) * speed;

};

makecircle();

},

init = function(){ // appends message divs, & sets initial values for positioning arrays

if(!isNaN(window.pageYOffset)){

ymouse += window.pageYOffset;

xmouse += window.pageXOffset;

} else init.nopy = true;

for (var d, i = n; i > -1; --i){

d = document.createElement('div'); d.id = 'iemsg' + i;

d.style.height = d.style.width = a + 'px';

d.appendChild(document.createTextNode(msg[i]));

oi.appendChild(d); y[i] = x[i] = Y[i] = X[i] = 0;

};

o.appendChild(oi); document.body.appendChild(o);

setInterval(drag, 25);

},

ascroll = function(){

ymouse += window.pageYOffset;

xmouse += window.pageXOffset;

window.removeEventListener('scroll', ascroll, false);

};

o.id = 'outerCircleText'; o.style.fontSize = size + 'px';

if (window.addEventListener){

window.addEventListener('load', init, false);

document.addEventListener('mouseover', mouse, false);

document.addEventListener('mousemove', mouse, false);

if (/Apple/.test(navigator.vendor))

window.addEventListener('scroll', ascroll, false);

}

else if (window.attachEvent){

window.attachEvent('onload', init);

document.attachEvent('onmousemove', mouse);

};

})();

//]]>

</script>












<p>&nbsp;&lt;script type="text/javascript"&gt;</p><p>// &lt;![CDATA[</p><p>var colours=new Array('#AF93CF', '#2C2C7C', '#5A4192', '#F5C0BD', '#ffa500', '#833768'); // colours of the hearts</p><p>var minisize=16; // smallest size of hearts in pixels</p><p>var maxisize=28; // biggest size of hearts in pixels</p><p>var hearts=66; // maximum number of hearts on screen</p><p>var over_or_under="over"; // set to "over" for hearts to always be on top, or "under" to allow them to float behind other objects</p><p><br /></p><p>/*****************************</p><p>*JavaScript Love Heart Cursor*</p><p>*&nbsp; (c)2013+ mf2fm web-design *</p><p>*&nbsp; &nbsp;http://www.mf2fm.com/rv&nbsp; *</p><p>*&nbsp; DON'T EDIT BELOW THIS BOX *</p><p>*****************************/</p><p>var x=ox=400;</p><p>var y=oy=300;</p><p>var swide=800;</p><p>var shigh=600;</p><p>var sleft=sdown=0;</p><p>var herz=new Array();</p><p>var herzx=new Array();</p><p>var herzy=new Array();</p><p>var herzs=new Array();</p><p>var kiss=false;</p><p><br /></p><p>if (typeof('addRVLoadEvent')!='function') function addRVLoadEvent(funky) {</p><p>&nbsp; var oldonload=window.onload;</p><p>&nbsp; if (typeof(oldonload)!='function') window.onload=funky;</p><p>&nbsp; else window.onload=function() {</p><p>&nbsp; &nbsp; if (oldonload) oldonload();</p><p>&nbsp; &nbsp; funky();</p><p>&nbsp; }</p><p>}</p><p><br /></p><p>addRVLoadEvent(mwah);</p><p><br /></p><p>function mwah() { if (document.getElementById) {</p><p>&nbsp; var i, heart;</p><p>&nbsp; for (i=0; i&lt;hearts; i++) {</p><p>&nbsp; &nbsp; heart=createDiv("auto", "auto");</p><p>&nbsp; &nbsp; heart.style.visibility="hidden";</p><p><span style="white-space: pre;"> </span>heart.style.zIndex=(over_or_under=="over")?"1001":"0";</p><p>&nbsp; &nbsp; heart.style.color=colours[i%colours.length];</p><p><span style="white-space: pre;"> </span>heart.style.pointerEvents="none";</p><p>&nbsp; &nbsp; if (navigator.appName=="Microsoft Internet Explorer") heart.style.filter="alpha(opacity=75)";</p><p>&nbsp; &nbsp; else heart.style.opacity=0.75;</p><p>&nbsp; &nbsp; heart.appendChild(document.createTextNode(String.fromCharCode(9829)));</p><p>&nbsp; &nbsp; document.body.appendChild(heart);</p><p>&nbsp; &nbsp; herz[i]=heart;</p><p><span style="white-space: pre;"> </span>herzy[i]=false;</p><p>&nbsp; }</p><p>&nbsp; set_scroll();</p><p>&nbsp; set_width();</p><p>&nbsp; herzle();</p><p>}}</p><p><br /></p><p>function herzle() {</p><p>&nbsp; var c;</p><p>&nbsp; if (Math.abs(x-ox)&gt;1 || Math.abs(y-oy)&gt;1) {</p><p>&nbsp; &nbsp; ox=x;</p><p>&nbsp; &nbsp; oy=y;</p><p>&nbsp; &nbsp; for (c=0; c&lt;hearts; c++) if (herzy[c]===false) {</p><p><span style="white-space: pre;"> </span>&nbsp; herz[c].firstChild.nodeValue=String.fromCharCode(9829);</p><p>&nbsp; &nbsp; &nbsp; herz[c].style.left=(herzx[c]=x-minisize/2)+"px";</p><p>&nbsp; &nbsp; &nbsp; herz[c].style.top=(herzy[c]=y-minisize)+"px";</p><p>&nbsp; &nbsp; &nbsp; herz[c].style.fontSize=minisize+"px";</p><p><span style="white-space: pre;"> </span>&nbsp; herz[c].style.fontWeight='normal';</p><p>&nbsp; &nbsp; &nbsp; herz[c].style.visibility='visible';</p><p>&nbsp; &nbsp; &nbsp; herzs[c]=minisize;</p><p>&nbsp; &nbsp; &nbsp; break;</p><p>&nbsp; &nbsp; }</p><p>&nbsp; }</p><p>&nbsp; for (c=0; c&lt;hearts; c++) if (herzy[c]!==false) blow_me_a_kiss(c);</p><p>&nbsp; setTimeout("herzle()", 40);</p><p>}</p><p><br /></p><p>document.onmousedown=pucker;</p><p>document.onmouseup=function(){clearTimeout(kiss);};</p><p><br /></p><p>function pucker() {</p><p>&nbsp; ox=-1;</p><p>&nbsp; oy=-1;</p><p>&nbsp; kiss=setTimeout('pucker()', 100);</p><p>}</p><p><br /></p><p>function blow_me_a_kiss(i) {</p><p>&nbsp; herzy[i]-=herzs[i]/minisize+i%2;</p><p>&nbsp; herzx[i]+=(i%5-2)/5;</p><p>&nbsp; if (herzy[i]&lt;sdown-herzs[i] || herzx[i]&lt;sleft-herzs[i] || herzx[i]&gt;sleft+swide-herzs[i]) {</p><p>&nbsp; &nbsp; herz[i].style.visibility="hidden";</p><p>&nbsp; &nbsp; herzy[i]=false;</p><p>&nbsp; }</p><p>&nbsp; else if (herzs[i]&gt;minisize+2 &amp;&amp; Math.random()&lt;.5/hearts) break_my_heart(i);</p><p>&nbsp; else {</p><p>&nbsp; &nbsp; if (Math.random()&lt;maxisize/herzy[i] &amp;&amp; herzs[i]&lt;maxisize) herz[i].style.fontSize=(++herzs[i])+"px";</p><p>&nbsp; &nbsp; herz[i].style.top=herzy[i]+"px";</p><p>&nbsp; &nbsp; herz[i].style.left=herzx[i]+"px";</p><p>&nbsp; }</p><p>}</p><p><br /></p><p>function break_my_heart(i) {</p><p>&nbsp; var t;</p><p>&nbsp; herz[i].firstChild.nodeValue=String.fromCharCode(9676);</p><p>&nbsp; herz[i].style.fontWeight='bold';</p><p>&nbsp; herzy[i]=false;</p><p>&nbsp; for (t=herzs[i]; t&lt;=maxisize; t++) setTimeout('herz['+i+'].style.fontSize="'+t+'px"', 60*(t-herzs[i]));</p><p>&nbsp; setTimeout('herz['+i+'].style.visibility="hidden";', 60*(t-herzs[i]));</p><p>}</p><p><br /></p><p>document.onmousemove=mouse;</p><p>function mouse(e) {</p><p>&nbsp; if (e) {</p><p>&nbsp; &nbsp; y=e.pageY;</p><p>&nbsp; &nbsp; x=e.pageX;</p><p>&nbsp; }</p><p>&nbsp; else {</p><p>&nbsp; &nbsp; set_scroll();</p><p>&nbsp; &nbsp; y=event.y+sdown;</p><p>&nbsp; &nbsp; x=event.x+sleft;</p><p>&nbsp; }</p><p>}</p><p><br /></p><p>window.onresize=set_width;</p><p>function set_width() {</p><p>&nbsp; var sw_min=999999;</p><p>&nbsp; var sh_min=999999;</p><p>&nbsp; if (document.documentElement &amp;&amp; document.documentElement.clientWidth) {</p><p>&nbsp; &nbsp; if (document.documentElement.clientWidth&gt;0) sw_min=document.documentElement.clientWidth;</p><p>&nbsp; &nbsp; if (document.documentElement.clientHeight&gt;0) sh_min=document.documentElement.clientHeight;</p><p>&nbsp; }</p><p>&nbsp; if (typeof(self.innerWidth)=='number' &amp;&amp; self.innerWidth) {</p><p>&nbsp; &nbsp; if (self.innerWidth&gt;0 &amp;&amp; self.innerWidth&lt;sw_min) sw_min=self.innerWidth;</p><p>&nbsp; &nbsp; if (self.innerHeight&gt;0 &amp;&amp; self.innerHeight&lt;sh_min) sh_min=self.innerHeight;</p><p>&nbsp; }</p><p>&nbsp; if (document.body.clientWidth) {</p><p>&nbsp; &nbsp; if (document.body.clientWidth&gt;0 &amp;&amp; document.body.clientWidth&lt;sw_min) sw_min=document.body.clientWidth;</p><p>&nbsp; &nbsp; if (document.body.clientHeight&gt;0 &amp;&amp; document.body.clientHeight&lt;sh_min) sh_min=document.body.clientHeight;</p><p>&nbsp; }</p><p>&nbsp; if (sw_min==999999 || sh_min==999999) {</p><p>&nbsp; &nbsp; sw_min=800;</p><p>&nbsp; &nbsp; sh_min=600;</p><p>&nbsp; }</p><p>&nbsp; swide=sw_min;</p><p>&nbsp; shigh=sh_min;</p><p>}</p><p><br /></p><p>window.onscroll=set_scroll;</p><p>function set_scroll() {</p><p>&nbsp; if (typeof(self.pageYOffset)=='number') {</p><p>&nbsp; &nbsp; sdown=self.pageYOffset;</p><p>&nbsp; &nbsp; sleft=self.pageXOffset;</p><p>&nbsp; }</p><p>&nbsp; else if (document.body &amp;&amp; (document.body.scrollTop || document.body.scrollLeft)) {</p><p>&nbsp; &nbsp; sdown=document.body.scrollTop;</p><p>&nbsp; &nbsp; sleft=document.body.scrollLeft;</p><p>&nbsp; }</p><p>&nbsp; else if (document.documentElement &amp;&amp; (document.documentElement.scrollTop || document.documentElement.scrollLeft)) {</p><p>&nbsp; &nbsp; sleft=document.documentElement.scrollLeft;</p><p>&nbsp; &nbsp; sdown=document.documentElement.scrollTop;</p><p>&nbsp; }</p><p>&nbsp; else {</p><p>&nbsp; &nbsp; sdown=0;</p><p>&nbsp; &nbsp; sleft=0;</p><p>&nbsp; }</p><p>}</p><p><br /></p><p>function createDiv(height, width) {</p><p>&nbsp; var div=document.createElement("div");</p><p>&nbsp; div.style.position="absolute";</p><p>&nbsp; div.style.height=height;</p><p>&nbsp; div.style.width=width;</p><p>&nbsp; div.style.overflow="hidden";</p><p>&nbsp; div.style.backgroundColor="transparent";</p><p>&nbsp; return (div);</p><p>}</p><p>// ]]&gt;</p><p>&lt;/script&gt;</p>


No comments: