沙盒/生日祝福widget测试
阅读
2023-01-25更新
最新编辑:Guable_
阅读:
更新日期:2023-01-25
最新编辑:Guable_
<script language="javaScript">
var birthdays = {
"行秋": ["10/9", "", "水"], "辛焱": ["10/16", "", "火"], "枫原万叶": ["10/29", "", "风"], "优菈": ["10/25", "", "冰"], "早柚": ["10/19", "", "风"], "纳西妲": ["10/27", "", "草"], "北斗": ["2/14", "", "雷"], "班尼特": ["2/29", "", "火"], "珊瑚宫心海": ["2/22", "", "水"], "艾尔海森": ["2/11", "", "草"], "琴": ["3/14", "", "风"], "诺艾尔": ["3/21", "", "岩"], "七七": ["3/3", "", "冰"], "申鹤": ["3/10", "", "冰"], "神里绫人": ["3/26", "", "水"], "瑶瑶": ["3/6", "", "草"], "凯亚": ["11/30", "", "冰"], "香菱": ["11/2", "", "火"], "刻晴": ["11/20", "", "雷"], "砂糖": ["11/26", "", "风"], "迪卢克": ["4/30", "", "火"], "魈": ["4/17", "", "风"], "夜兰": ["4/20", "", "水"], "菲谢尔": ["5/27", "", "雷"], "五郎": ["5/18", "", "岩"], "云堇": ["5/21", "", "岩"], "柯莱": ["5/8", "", "草"], "坎蒂丝": ["5/3", "", "水"], "钟离": ["12/31", "", "岩"], "甘雨": ["12/2", "", "冰"], "多莉": ["12/21", "", "雷"], "提纳里": ["12/29", "", "草"], "妮露": ["12/3", "", "水"], "莱依拉": ["12/19", "", "冰"], "派蒙": ["6/1", "", ""], "荒泷一斗": ["6/1", "", "岩"], "丽莎": ["6/9", "", "雷"], "温迪": ["6/16", "", "风"], "宵宫": ["6/21", "", "火"], "雷电将军": ["6/26", "", "雷"], "八重神子": ["6/27", "", "雷"], "赛诺": ["6/23", "", "雷"], "芭芭拉": ["7/5", "", "水"], "可莉": ["7/27", "", "火"], "久岐忍": ["7/27", "", "雷"], "达达利亚": ["7/20", "", "水"], "胡桃": ["7/15", "", "火"], "烟绯": ["7/28", "", "火"], "九条裟罗": ["7/14", "", "雷"], "鹿野院平藏": ["7/24", "", "风"], "安柏": ["8/10", "", "火"], "凝光": ["8/26", "", "岩"], "莫娜": ["8/31", "", "水"], "珐露珊": ["8/20", "", "风"], "迪奥娜": ["1/18", "", "冰"], "罗莎莉亚": ["1/24", "", "冰"], "托马": ["1/9", "", "火"], "流浪者": ["1/3", "", "风"], "神里绫华": ["9/28", "", "冰"], "雷泽": ["9/9", "", "雷"], "重云": ["9/7", "", "冰"], "阿贝多": ["9/13", "", "岩"]
} var element = {"火":"red", "水":"#6eaae8", "冰":"#82d7ff", "雷":"#9245e6", "岩":"#a99847", "风":"#41c77d", "草":"#619e7f"}
!function(birthdays, elements){
var d=new Date(); var year=d.getFullYear(); var leapyear=year % 100 != 0 && year % 4 == 0 || year % 400 == 0; var date = (d.getMonth()+1)+"/"+d.getDate(); date = "1/24"; var roles = []; var notes = []; for (key in birthdays){ var value = birthdays[key]; if (date === value[0]){ roles.push(`${key}`); notes.push(`${value[1]}`); } } var ret_str = `
今天是${roles.join("、")}的生日,祝你${roles.length>1?"们":""}生日快乐!
${notes.join("
")}`; if (!leapyear && date === "2/28"){ ret_str += "
提前祝班尼特生日快乐!
新的一岁是好运到来的一岁。"; } document.write(ret_str);
}(birthdays, element); </script>