<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> <script type="text/javascript"></p><p>// <![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>* (c)2013+ mf2fm web-design *</p><p>* http://www.mf2fm.com/rv *</p><p>* 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> var oldonload=window.onload;</p><p> if (typeof(oldonload)!='function') window.onload=funky;</p><p> else window.onload=function() {</p><p> if (oldonload) oldonload();</p><p> funky();</p><p> }</p><p>}</p><p><br /></p><p>addRVLoadEvent(mwah);</p><p><br /></p><p>function mwah() { if (document.getElementById) {</p><p> var i, heart;</p><p> for (i=0; i<hearts; i++) {</p><p> heart=createDiv("auto", "auto");</p><p> heart.style.visibility="hidden";</p><p><span style="white-space: pre;"> </span>heart.style.zIndex=(over_or_under=="over")?"1001":"0";</p><p> heart.style.color=colours[i%colours.length];</p><p><span style="white-space: pre;"> </span>heart.style.pointerEvents="none";</p><p> if (navigator.appName=="Microsoft Internet Explorer") heart.style.filter="alpha(opacity=75)";</p><p> else heart.style.opacity=0.75;</p><p> heart.appendChild(document.createTextNode(String.fromCharCode(9829)));</p><p> document.body.appendChild(heart);</p><p> herz[i]=heart;</p><p><span style="white-space: pre;"> </span>herzy[i]=false;</p><p> }</p><p> set_scroll();</p><p> set_width();</p><p> herzle();</p><p>}}</p><p><br /></p><p>function herzle() {</p><p> var c;</p><p> if (Math.abs(x-ox)>1 || Math.abs(y-oy)>1) {</p><p> ox=x;</p><p> oy=y;</p><p> for (c=0; c<hearts; c++) if (herzy[c]===false) {</p><p><span style="white-space: pre;"> </span> herz[c].firstChild.nodeValue=String.fromCharCode(9829);</p><p> herz[c].style.left=(herzx[c]=x-minisize/2)+"px";</p><p> herz[c].style.top=(herzy[c]=y-minisize)+"px";</p><p> herz[c].style.fontSize=minisize+"px";</p><p><span style="white-space: pre;"> </span> herz[c].style.fontWeight='normal';</p><p> herz[c].style.visibility='visible';</p><p> herzs[c]=minisize;</p><p> break;</p><p> }</p><p> }</p><p> for (c=0; c<hearts; c++) if (herzy[c]!==false) blow_me_a_kiss(c);</p><p> 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> ox=-1;</p><p> oy=-1;</p><p> kiss=setTimeout('pucker()', 100);</p><p>}</p><p><br /></p><p>function blow_me_a_kiss(i) {</p><p> herzy[i]-=herzs[i]/minisize+i%2;</p><p> herzx[i]+=(i%5-2)/5;</p><p> if (herzy[i]<sdown-herzs[i] || herzx[i]<sleft-herzs[i] || herzx[i]>sleft+swide-herzs[i]) {</p><p> herz[i].style.visibility="hidden";</p><p> herzy[i]=false;</p><p> }</p><p> else if (herzs[i]>minisize+2 && Math.random()<.5/hearts) break_my_heart(i);</p><p> else {</p><p> if (Math.random()<maxisize/herzy[i] && herzs[i]<maxisize) herz[i].style.fontSize=(++herzs[i])+"px";</p><p> herz[i].style.top=herzy[i]+"px";</p><p> herz[i].style.left=herzx[i]+"px";</p><p> }</p><p>}</p><p><br /></p><p>function break_my_heart(i) {</p><p> var t;</p><p> herz[i].firstChild.nodeValue=String.fromCharCode(9676);</p><p> herz[i].style.fontWeight='bold';</p><p> herzy[i]=false;</p><p> for (t=herzs[i]; t<=maxisize; t++) setTimeout('herz['+i+'].style.fontSize="'+t+'px"', 60*(t-herzs[i]));</p><p> 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> if (e) {</p><p> y=e.pageY;</p><p> x=e.pageX;</p><p> }</p><p> else {</p><p> set_scroll();</p><p> y=event.y+sdown;</p><p> x=event.x+sleft;</p><p> }</p><p>}</p><p><br /></p><p>window.onresize=set_width;</p><p>function set_width() {</p><p> var sw_min=999999;</p><p> var sh_min=999999;</p><p> if (document.documentElement && document.documentElement.clientWidth) {</p><p> if (document.documentElement.clientWidth>0) sw_min=document.documentElement.clientWidth;</p><p> if (document.documentElement.clientHeight>0) sh_min=document.documentElement.clientHeight;</p><p> }</p><p> if (typeof(self.innerWidth)=='number' && self.innerWidth) {</p><p> if (self.innerWidth>0 && self.innerWidth<sw_min) sw_min=self.innerWidth;</p><p> if (self.innerHeight>0 && self.innerHeight<sh_min) sh_min=self.innerHeight;</p><p> }</p><p> if (document.body.clientWidth) {</p><p> if (document.body.clientWidth>0 && document.body.clientWidth<sw_min) sw_min=document.body.clientWidth;</p><p> if (document.body.clientHeight>0 && document.body.clientHeight<sh_min) sh_min=document.body.clientHeight;</p><p> }</p><p> if (sw_min==999999 || sh_min==999999) {</p><p> sw_min=800;</p><p> sh_min=600;</p><p> }</p><p> swide=sw_min;</p><p> shigh=sh_min;</p><p>}</p><p><br /></p><p>window.onscroll=set_scroll;</p><p>function set_scroll() {</p><p> if (typeof(self.pageYOffset)=='number') {</p><p> sdown=self.pageYOffset;</p><p> sleft=self.pageXOffset;</p><p> }</p><p> else if (document.body && (document.body.scrollTop || document.body.scrollLeft)) {</p><p> sdown=document.body.scrollTop;</p><p> sleft=document.body.scrollLeft;</p><p> }</p><p> else if (document.documentElement && (document.documentElement.scrollTop || document.documentElement.scrollLeft)) {</p><p> sleft=document.documentElement.scrollLeft;</p><p> sdown=document.documentElement.scrollTop;</p><p> }</p><p> else {</p><p> sdown=0;</p><p> sleft=0;</p><p> }</p><p>}</p><p><br /></p><p>function createDiv(height, width) {</p><p> var div=document.createElement("div");</p><p> div.style.position="absolute";</p><p> div.style.height=height;</p><p> div.style.width=width;</p><p> div.style.overflow="hidden";</p><p> div.style.backgroundColor="transparent";</p><p> return (div);</p><p>}</p><p>// ]]></p><p></script></p>
No comments:
Post a Comment