イケニエスタイル


javascript:
(function({
  var d=document;
  var s=d.createElement("script");
  s.charset="UTF-8";
  s.src="http://w.ikenie.com/8985nize/jquery.js?"+(new Date()).getTime();
  d.body.appendChild(s);
  s=d.createElement("script");
  s.charset="UTF-8";
  s.src="http://w.ikenie.com/8985nize/8985.js?"+(new Date()).getTime();
  d.body.appendChild(s);
})();
http://ikenie.com/blog/archives/71

jquery.js と 8985.js を d.createElement("script");
で 8985.js は、っていうと、

(function() {

$("img").each(function(){
	i = 0;	
	offset = $(this).offset();
	var div = document.createElement("div");
	div.style.position = "absolute";
	div.style.zIndex = 9999;
	div.style.top = offset.top+'px';
	div.style.left = 0;
	div.style.width = '100%';
	div.style.height = this.height+'px';
	div.style.textAlign = "right";
	div.style.background = 'url(http://w.ikenie.com/crop/crop.php?f='+this.src+'&m=bg)';
	document.body.appendChild(div);
	
	var div2 = document.createElement("div");
	div2.style.background = 'url(http://w.ikenie.com/crop/crop.php?f='+this.src+'&m=left) no-repeat';
	div.appendChild(div2);
	
	var img = document.createElement("img");
	img.src = 'http://w.ikenie.com/crop/crop.php?f='+this.src+'&m=right';
	div2.appendChild(img);
	
	/*
	***flash version***
	var so = new SWFObject("http://w.ikenie.com/8985nize/8985.swf?" + new Date().getTime(), '8985nize'+i, '100%', this.style.height, "9", "#ffffff");
	//so.addParam("wmode", "transparent");
	so.addParam("allowScriptAccess", "always");
	so.addVariable("url","http://w.ikenie.com/8985nize/wrap.php?f="+this.src);
	so.addVariable("ofst", 5);
	so.write(div);
	*/
	
	this.style.visibility = 'hidden';
	
	i++;

});

})();
http://w.ikenie.com/8985nize/8985.js

技術的にはそんな難しい事はしてなくて、jQueryで画像位置のオフセットを取って来て(自力でやるのめんどかった)、8985でも使ってる自作のphpで画像処理してびにょーんってしてるだけ。終わり。

http://ikenie.com/blog/archives/71

最初はflashでやってみたんだけど重かったからやめた。

http://ikenie.com/blog/archives/71

flash版も埋め込み済みっすネ。


autopagerize効かせたいなー。tumblrのdsbdでやるとサイコーにおもしろい。greasemonkeyってjqueryとか呼び込めるとかって言ってたよなー。autopagerize化はos0xセンセーがおしえてくれたのでイケるんだろーし。オレでもやれるかなあー。