Page 1 of 1

Wiki fading out

Posted: Sat Apr 02, 2011 6:27 am
by Hannahmaus
When I view the wiki, it gradually fades away. This is due to a bit of javascript which I've attached for posterity. Now April 1st has gone, can it be removed?

Code: Select all

<script>
	function fade() {
		var c = readCookie('thw_fade41');
		if(c == null){
			c = 1;
		}
		if (c > .005 ){
			for (i = c; i >= 0; i -= .005) {
				setTimeout("setOpacity(" + i + ")", (c-i) * 150000);
			}
	  }
	}
	
	function setOpacity(level) {
	  document.body.style.opacity = level;
	  document.body.style.MozOpacity = level;
	  document.body.style.KhtmlOpacity = level;
	  document.body.style.filter = "alpha(opacity=" + (level * 100) + ");";
	  createCookie('thw_fade41',level,1.5);
	}
	
	function createCookie(name,value,hours) {
		if (hours) {
			var date = new Date();
			date.setTime(date.getTime()+(hours*60*60*1000));
			var expires = "; expires="+date.toGMTString();
		}
		else var expires = "";
		document.cookie = name+"="+value+expires+"; path=/";
	}

	function readCookie(name) {
		var nameEQ = name + "=";
		var ca = document.cookie.split(';');
		for(var i=0;i < ca.length;i++) {
			var c = ca[i];
			while (c.charAt(0)==' ') c = c.substring(1,c.length);
			if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
		}
		return null;
	}

	function eraseCookie(name) {
		createCookie(name,"",-1);
	}
	fade();

Re: Wiki fading out

Posted: Sat Apr 02, 2011 7:42 am
by zillow
...Twilight Heroes and the wiki are not run by the same person so they have nothing to do with each other. You could delete this thread and move it to the wiki for better results

Re: Wiki fading out

Posted: Mon Apr 04, 2011 1:49 am
by Cristiona
It's been fixed.