Jump to content

FE4 THREAD


Fia
 Share

Recommended Posts

  • Replies 674.9k
  • Created
  • Last Reply

Top Posters In This Topic

  • TheEnd

    72124

  • Rei Rei

    41380

  • Ϲharlie

    31020

  • Icon of Sin

    29767

Top Posters In This Topic

HwWyEZu.png

Explains, everything.

Also, I apparently found the source code for the thing...

I know it's not a big achievement but...

$(function(){
	$('#yourName, #bdMonth, #bdDay').change(function(){
		nameVal = $('#yourName').val();
		bdmVal = $('#bdMonth').val();
		bddVal = $('#bdDay').val();
		if(nameVal != '' && nameVal.length <= 30 && bdmVal != '' && bddVal != ''){
			SoulColor(nameVal, bdmVal, bddVal);
			$('#btn_make').removeAttr('disabled');
		}else{
			$('#btn_make').attr('disabled','disabled');
		}
	});
});
function SoulColor(yourName, bdM, bdD){
	//数字化システム配列
	//半角英数字
	var modern = { A:'1',B:'2',C:'3',D:'4',E:'5',F:'6',G:'7',H:'8',I:'9',J:'1',K:'2',L:'3',M:'4',N:'5',O:'6',P:'7',Q:'8',R:'9',S:'1',T:'2',U:'3',V:'4',W:'5',X:'6',Y:'7',Z:'8',_:'9' };
	//ひらがな
	var hira = {
		'぀':'1','ぁ':'2','あ':'3','ぃ':'4','い':'5',
		'ぅ':'6','う':'7','ぇ':'8','え':'9','ぉ':'0',
		'\u304A':'1','\u304B':'9','\u304C':'3','\u304D':'4','\u304E':'5',
		'\u304F':'6','ぐ':'7','け':'8','げ':'2','こ':'0',
		'ご':'1','さ':'2','ざ':'3','し':'4','じ':'5',
		'す':'6','\u305A':'7','\u305B':'8','\u305C':'9','\u305D':'0',
		'\u305E':'1','\u305F':'2','だ':'3','ち':'4','ぢ':'5',
		'っ':'6','つ':'7','づ':'8','て':'2','で':'0',
		'と':'1','ど':'9','\u306A':'9','\u306B':'4','\u306C':'5',
		'\u306D':'6','\u306E':'7','\u306F':'8','ば':'3','ぱ':'0',
		'ひ':'1','び':'2','ぴ':'3','ふ':'4','ぶ':'5',
		'ぷ':'6','へ':'7','べ':'8','\u307A':'9','\u307B':'0',
		'\u307C':'1','\u307D':'2','\u307E':'9','\u307F':'4','む':'5',
		'め':'9','も':'7','ゃ':'8','や':'6','ゅ':'0',
		'ゆ':'1','ょ':'2','よ':'3','ら':'4','\u308A':'5',
		'\u308B':'6','\u308C':'7','\u308D':'8','\u308E':'3','\u308F':'0',
		'ゐ':'1','ゑ':'2','を':'3','ん':'4','ゔ':'5',
		'ゕ':'6','ゖ':'7','゗':'8','゘':'9','゙':'0',
		'\u309A':'1','\u309B':'2','\u309C':'3','\u309D':'4','\u309E':'5',
		'\u309F':'6'};
	//カタカナ
	var kata = {
		'\u30A0':'1','\u30A1':'2','\u30A2':'3','\u30A3':'4','\u30A4':'5',
		'\u30A5':'6','\u30A6':'7','\u30A7':'8','\u30A8':'9','\u30A9':'0',
		'\u30AA':'1','\u30AB':'9','\u30AC':'3','\u30AD':'4','\u30AE':'5',
		'\u30AF':'6','\u30B0':'7','\u30B1':'8','\u30B2':'2','\u30B3':'0',
		'\u30B4':'1','\u30B5':'2','\u30B6':'3','\u30B7':'4','\u30B8':'5',
		'\u30B9':'6','\u30BA':'7','\u30BB':'8','\u30BC':'9','\u30BD':'0',
		'\u30BE':'1','\u30BF':'2','\u30C0':'3','\u30C1':'4','\u30C2':'5',
		'\u30C3':'6','\u30C4':'7','\u30C5':'8','\u30C6':'2','\u30C7':'0',
		'\u30C8':'1','\u30C9':'9','\u30CA':'9','\u30CB':'4','\u30CC':'5',
		'\u30CD':'6','\u30CE':'7','\u30CF':'8','\u30D0':'3','\u30D1':'0',
		'\u30D2':'1','\u30D3':'2','\u30D4':'3','\u30D5':'4','\u30D6':'5',
		'\u30D7':'6','\u30D8':'7','\u30D9':'8','\u30DA':'9','\u30DB':'0',
		'\u30DC':'1','\u30DD':'2','\u30DE':'9','\u30DF':'4','\u30E0':'5',
		'\u30E1':'9','\u30E2':'7','\u30E3':'8','\u30E4':'6','\u30E5':'0',
		'\u30E6':'1','\u30E7':'2','\u30E8':'3','\u30E9':'4','\u30EA':'5',
		'\u30EB':'6','\u30EC':'7','\u30ED':'8','\u30EE':'3','\u30EF':'0',
		'\u30F0':'1','\u30F1':'2','\u30F2':'3','\u30F3':'4','\u30F4':'5',
		'\u30F5':'6','\u30F6':'7','\u30F7':'8','\u30F8':'9','\u30F9':'0',
		'\u30FA':'1','\u30FB':'2','\u30FC':'3','\u30FD':'4','\u30FE':'5',
		'\u30FF':'6'};

	//名前を配列に
	yourName = yourName.split('');
	var nameNum = 0;
	
	for(var i = 0; i < yourName.length; i ++){
		if(yourName[i].match(/[0-9]/)){
			nameNum +=  Number(yourName[i]);
		}else if(yourName[i].match(/[A-Za-z_]/)){
			key = yourName[i].toUpperCase();
			nameNum += Number(modern[key]);
		}else if(yourName[i].match(/[぀-\u309F]/)){
			Key = yourName[i];
			nameNum += Number(hira[Key]);
		}else if(yourName[i].match(/[\u30A0-\u30FF]/)){
			Key = yourName[i];
			nameNum += Number(kata[Key]);
		}else{
			nameNum += 1;
		}
	}
	
	// hueを決定
	var hueNum = Math.abs(360 - Math.round((nameNum / Number(bdM)) * Number(bdD)));
	while(hueNum >= 361){
		hueNum = Math.abs(360 - hueNum);
	}
	
	// saturationを決定
	var satNum = Math.abs(nameNum - 100);
	while(satNum >= 101){
		satNum = Math.abs(100 - satNum);
	}

	// brightnessを決定
	var brtNum = Math.abs((Number(bdM) + Number(bdD)) - 100);
	while(brtNum >= 101){
		brtNum = Math.abs(100 - brtNum);
	}

	soulHex = hsbToHex(hueNum , satNum , brtNum);
	$('#ynNum').val(nameNum);
	$('#soulColorCode').val(soulHex);
}

// hsbをhex変換する
var hsbToHex = function(hue, saturation, brightness){
	var rgb = {};
	var h = Math.round(hue);
	var s = Math.round(saturation*255/100);
	var v = Math.round(brightness*255/100);
	if(s == 0) {
		rgb.r = rgb.g = rgb.b = v;
	} else {
		var t1 = v;
		var t2 = (255-s)*v/255;
		var t3 = (t1-t2)*(h%60)/60;
		if(h==360) h = 0;
		if(h<60) {rgb.r=t1;	rgb.b=t2; rgb.g=t2+t3}
		else if(h<120) {rgb.g=t1; rgb.b=t2;	rgb.r=t1-t3}
		else if(h<180) {rgb.g=t1; rgb.r=t2;	rgb.b=t2+t3}
		else if(h<240) {rgb.b=t1; rgb.r=t2;	rgb.g=t1-t3}
		else if(h<300) {rgb.b=t1; rgb.g=t2;	rgb.r=t2+t3}
		else if(h<360) {rgb.r=t1; rgb.g=t2;	rgb.b=t1-t3}
		else {rgb.r=0; rgb.g=0;	rgb.b=0}
	}
	return rgbToHex(Math.round(rgb.r), Math.round(rgb.g), Math.round(rgb.b));
}

// RGBをhexに変換 
function rgbToHex(r, g, b) {
	if(r >= 255){r = 255;}else if(r <= 0){r = 0;}
	if(g >= 255){g = 255;}else if(g <= 0){g = 0;}
	if(b >= 255){b = 255;}else if(b <= 0){b = 0;}
	var hex = [
			r.toString(16),
			g.toString(16),
			b.toString(16)
		];
		$.each(hex, function (nr, val) {
			if (val.length == 1) {
				hex[nr] = '0' + val;
			}
		});
	return hex.join('');
}
Edited by shadowofchaos
Link to comment
Share on other sites

DDDDDDDD:

I don't wanna be a trap.

I just think it'd be fun to crossdress!

And funny if nobody noticed!

I was even told that it wouldn't be stretching it for me to have an androgynous figure.

I feel as if they's a convolution here

Link to comment
Share on other sites

NOT IF THEY DON'T SUSPECT THAT I'M CROSSDRESSING IN THE FIRST PLACE! :DDDDD

It'd feel so good being... exposed... *~*

what is this

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...