You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
3.6 KiB
JavaScript
56 lines
3.6 KiB
JavaScript
var nm1 = ["", "", "b", "d", "h", "k", "m", "n", "r", "t", "y", "z"];
|
|
var nm2 = ["a", "e", "i", "u"];
|
|
var nm3 = ["d", "g", "gh", "hk", "hm", "hn", "hr", "lm", "ln", "lnh", "lr", "lrh", "m", "mh", "n", "nh", "nt", "ntr", "ns", "s", "sn", "sm", "sr", "ss", "t", "tr", "v", "z", "zh", "zr"];
|
|
var nm4 = ["a", "a", "e", "i", "i", "o", "u"];
|
|
var nm5 = ["h", "l", "m", "n", "r", "y", "z"];
|
|
var nm6 = ["ia", "a", "a", "e", "i", "i", "o", "o", "u"];
|
|
var nm7 = ["h", "l", "n", "r", "s"];
|
|
var br = "";
|
|
|
|
function nameGen(type) {
|
|
var nm8 = ["Academic", "Acclaimed", "Admirable", "Admired", "Adored", "Affectionate", "Agile", "Angel", "Architect", "Artist", "Artistic", "Austere", "Authentic", "Beautiful", "Beloved", "Blessed", "Blissful", "Bold", "Brave", "Bright", "Brilliant", "Butterfly", "Calm", "Carefree", "Celebrated", "Charming", "Clever", "Complex", "Composed", "Conjurer", "Content", "Cook", "Cuddly", "Cuddly Bear", "Cunning", "Dancer", "Dapper", "Defiant", "Devoted", "Diligent", "Doctor", "Earnest", "Educated", "Elegant", "Emotional", "Enchanted", "Enchanting", "Enigma", "Enlightened", "Exalted", "Example", "Expert", "Fair", "Famous", "Fancy", "Fearless", "Flamboyant", "Flawed", "Flawless", "Forgiving", "Free", "Friend", "Funny", "Generous", "Gentle", "Genuine", "Gifted", "Giving", "Glorious", "Good", "Graceful", "Grand", "Great", "Guardian", "Guest", "Honest", "Honorable", "Honored", "Hospitable", "Humble", "Idealist", "Illustrious", "Immortal", "Incredible", "Infamous", "Innocent", "Inventor", "Ironclad", "Judge", "Just", "Keen", "Kind", "Lawful", "Learned", "Light", "Loving", "Loyal", "Magnificent", "Majestic", "Marvelous", "Master", "Mellow", "Merciful", "Merry", "Mighty", "Moral", "Nightingale", "Noble", "Ox", "Paragon", "Passionate", "Patient", "Peaceful", "Pleasant", "Precious", "Protector", "Proud", "Quaint", "Quiet", "Scholar", "Scientist", "Shield", "Silent", "Soothsayer", "Sophisticated", "Speaker", "Specialist", "Strong", "Student", "Swift", "Sympathetic", "Thoughtful", "Treasure", "Treasured", "Vagabond", "Valiant", "Victorious", "Vigilant", "Watcher", "Wayfarer", "Wise", "Wonderful"];
|
|
var tp = type;
|
|
$('#placeholder').css('textTransform', 'capitalize');
|
|
var element = document.createElement("div");
|
|
element.setAttribute("id", "result");
|
|
for (i = 0; i < 10; i++) {
|
|
if (i < 6) {
|
|
nameMas();
|
|
while (nMs === "") {
|
|
nameMas();
|
|
}
|
|
} else {
|
|
rnd = Math.random() * nm8.length | 0;
|
|
nMs = "The " + nm8[rnd];
|
|
nm8.splice(rnd, 1);
|
|
}
|
|
br = document.createElement('br');
|
|
element.appendChild(document.createTextNode(nMs));
|
|
element.appendChild(br);
|
|
}
|
|
if (document.getElementById("result")) {
|
|
document.getElementById("placeholder").removeChild(document.getElementById("result"));
|
|
}
|
|
document.getElementById("placeholder").appendChild(element);
|
|
}
|
|
|
|
function nameMas() {
|
|
nTp = Math.random() * 7 | 0;
|
|
rnd = Math.random() * nm1.length | 0;
|
|
rnd2 = Math.random() * nm2.length | 0;
|
|
rnd3 = Math.random() * nm3.length | 0;
|
|
rnd4 = Math.random() * nm6.length | 0;
|
|
rnd7 = Math.random() * nm7.length | 0;
|
|
if (nTp < 5) {
|
|
nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm6[rnd4] + nm7[rnd7];
|
|
} else {
|
|
rnd5 = Math.random() * nm5.length | 0;
|
|
rnd6 = Math.random() * nm4.length | 0;
|
|
while (nm3[rnd3] === nm5[rnd5] || nm5[rnd5] === nm7[rnd7]) {
|
|
rnd5 = Math.random() * nm5.length | 0;
|
|
}
|
|
nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm4[rnd6] + nm5[rnd5] + nm6[rnd4] + nm7[rnd7];
|
|
}
|
|
testSwear(nMs);
|
|
}
|