生辰八字查询:
function generateName() {var birthdate = document.getElementById("birthdate").value;if (!birthdate) {alert("请输入出生年月日时");return;}var result = "";var year = birthdate.substring(0, 4);var month = birthdate.substring(5, 7);var day = birthdate.substring(8, 10);var hour = birthdate.substring(11, 13);// 获取生肖var zodiac = ["鼠", "牛", "虎", "兔", "龙", "蛇", "马", "羊", "猴", "鸡", "狗", "猪"];var zodiacIndex = (parseInt(year) - 4) % 12;var zodiacSign = zodiac[zodiacIndex];// 获取五行var fiveElements = ["金", "木", "水", "火", "土"];var fiveElementsIndex = (parseInt(year) - 4) % 5;var fiveElementsType = fiveElements[fiveElementsIndex];// 获取三才配置var fiveElementsArray = [fiveElementsType, fiveElementsType, fiveElementsType];var trigrams = ["天人地", "地人天", "人人地", "地人人", "天人人", "人人天"];var trigramIndex = fiveElementsArray.indexOf("木") 3 + fiveElementsArray.indexOf("水") 2 + fiveElementsArray.indexOf("火");var trigram = trigrams[trigramIndex];// 获取姓名var surname = "孟";var givenName = "";// 根据三才配置和生肖起名switch (trigram) {case "天人地":if (zodiacSign === "龙" || zodiacSign === "蛇") {givenName = "子轩";} else if (zodiacSign === "猴" || zodiacSign === "鸡") {givenName = "宇航";} else if (zodiacSign === "鼠" || zodiacSign === "猪") {givenName = "浩然";} else if (zodiacSign === "牛" || zodiacSign === "虎") {givenName = "博文";} else if (zodiacSign === "兔" || zodiacSign === "猫") {givenName = "思齐";} else if (zodiacSign === "马" || zodiacSign === "羊") {givenName = "佳宁";}break;case "地人天":if (zodiacSign === "龙" || zodiacSign === "蛇") {givenName = "子涵";} else if (zodiacSign === "猴" || zodiacSign === "鸡") {givenName = "雨涵";} else if (zodiacSign === "鼠" || zodiacSign === "猪") {givenName = "浩宇";} else if (zodiacSign === "牛" || zodiacSign === "虎") {givenName = "泽宇";} else if (zodiacSign === "兔" || zodiacSign === "猫") {givenName = "欣雨";} else if (zodiacSign === "马" || zodiacSign === "羊") {givenName = "梦瑶";}break;case "人人地":if (zodiacSign === "龙" || zodiacSign === "蛇") {givenName = "子墨";} else if (zodiacSign === "猴" || zodiacSign === "鸡") {givenName = "语嫣";}else if (zodiacSign === "鼠" || zodiacSign === "猪") {givenName = "浩轩";} else if (zodiacSign === "牛" || zodiacSign === "虎") {givenName = "博涵";} else if (zodiacSign === "兔" || zodiacSign === "猫") {givenName = "思涵";} else if (zodiacSign === "马" || zodiacSign === "羊") {givenName = "佳怡";}break;case "地人人":if (zodiacSign === "龙" || zodiacSign === "蛇") {givenName = "子涵";} else if (zodiacSign === "猴" || zodiacSign === "鸡") {givenName = "雨涵";} else if (zodiacSign === "鼠" || zodiacSign === "猪") {givenName = "浩宇";} else if (zodiacSign === "牛" || zodiacSign === "虎") {givenName = "泽宇";} else if (zodiacSign === "兔" || zodiacSign === "猫") {givenName = "欣雨";} else if (zodiacSign === "马" || zodiacSign === "羊") {givenName = "梦瑶";}break;case "天人人":if (zodiacSign === "龙" || zodiacSign === "蛇") {givenName = "子涵";} else if (zodiacSign === "猴" || zodiacSign === "鸡") {givenName = "雨涵";} else if (zodiacSign === "鼠" || zodiacSign === "猪") {givenName = "浩宇";} else if (zodiacSign === "牛" || zodiacSign === "虎") {givenName = "泽宇";} else if (zodiacSign === "兔" || zodiacSign === "猫") {givenName = "欣雨";} else if (zodiacSign === "马" || zodiacSign === "羊") {givenName = "梦瑶";}break;case "人人天":if (zodiacSign === "龙" || zodiacSign === "蛇") {givenName = "子涵";} else if (zodiacSign === "猴" || zodiacSign === "鸡") {givenName = "雨涵";} else if (zodiacSign === "鼠" || zodiacSign === "猪") {givenName = "浩宇";} else if (zodiacSign === "牛" || zodiacSign === "虎") {givenName = "泽宇";} else if (zodiacSign === "兔" || zodiacSign === "猫") {givenName = "欣雨";} else if (zodiacSign === "马" || zodiacSign === "羊") {givenName = "梦瑶";}break;}result = surname + givenName;document.getElementById("result").innerHTML = result;}
站长推荐您关注下面这些文章
熠宸 子轩 若风 睿哲 辰逸 天宇 浩然 宇航 博文 子涵 浩轩 嘉懿 柏然 逸轩
随着网络的发展,越来越多的宝宝成为了网红。为了给自己的宝宝起一个既好听又有网红范儿的名字,家长们煞费苦心。下面就为各位家长奉上网红宝宝起名字大全,希望对大家有所帮助。 男孩名字 梓熙 铭轩
龙凤胎起名字宝宝 男孩名字 子轩 温润如玉,气度不凡 皓轩 光彩照人,轩然大气 逸凡 出众
男孩名字 睿哲 睿:聪明、智慧 哲:有智慧、有学问 嘉佑 嘉:美好、吉祥 佑:保佑、庇护
亦晨 子昂 浩然 逸飞 宇轩 皓轩 博文 天泽 凯文 明轩 嘉俊 铭泽 泽宇 星宇
吉名宝取名网相关信息 仅供娱乐参考,切忌迷信! 原文链接:https://www.jimingbao.com.cn/long/62729.html,转载请注明出处~~~