◆少前百科是非盈利性、非官方的少女前线维基百科。 ◆如果您发现某些内容错误/空缺,请勇于修正/添加!参与进来其实很容易!点这里 加入少前百科。 ◆有任何意见、建议、纠错,欢迎在 GFwiki:反馈与建议 提出和讨论。编辑事务讨论QQ群:597764980,微博@GFwiki少前百科 ◆To foreigners,You can use twitter to contact us. |
“Widget:SkinQuery/js”的版本间的差异
(更新) |
(更新) |
||
第9行: | 第9行: | ||
var html_text = ` | var html_text = ` | ||
<div class="skinselectbox"> | <div class="skinselectbox"> | ||
− | <div class="skinbtnbox"><div class=" | + | <div class="skinbtn" id="suitmode" state="1">主题模式<\/div> |
+ | <div class="skinbtnbox"> | ||
+ | <div class="skinsecall">全选<\/div> | ||
+ | <div class="skinclear">清空<\/div> | ||
+ | <div class="suitbtn" id="month1" state="1">正月<\/div> | ||
+ | <div class="suitbtn" id="month2" state="1">春节<\/div> | ||
+ | <div class="suitbtn" id="month3" state="1">婚纱<\/div> | ||
+ | <div class="suitbtn" id="month5" state="1">周年庆<\/div> | ||
+ | <div class="suitbtn" id="month6" state="1">儿童节<\/div> | ||
+ | <div class="suitbtn" id="month7" state="1">泳装<\/div> | ||
+ | <div class="suitbtn" id="month10" state="1">万圣节<\/div> | ||
+ | <div class="suitbtn" id="month12" state="1">圣诞节<\/div> | ||
+ | <div class="suitbtn" id="month0" state="1">其他<\/div> | ||
+ | <\/div><br/> | ||
<div class="skinbtnbox"> | <div class="skinbtnbox"> | ||
<div class="skinsecall">全选<\/div> | <div class="skinsecall">全选<\/div> | ||
第24行: | 第37行: | ||
<div class="skinbtn" id="8card" state="1">8<span class="btntext">黑卡<\/span><\/div> | <div class="skinbtn" id="8card" state="1">8<span class="btntext">黑卡<\/span><\/div> | ||
<div class="skinbtn" id="xcard" state="1"><span class="btntext">特殊<\/span><\/div> | <div class="skinbtn" id="xcard" state="1"><span class="btntext">特殊<\/span><\/div> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<\/div><br/> | <\/div><br/> | ||
<div class="skinbtnbox"> | <div class="skinbtnbox"> | ||
第42行: | 第46行: | ||
<div class="skinbtn" id="NRMB" state="1">N<span class="btntext">RMB<\/span><\/div> | <div class="skinbtn" id="NRMB" state="1">N<span class="btntext">RMB<\/span><\/div> | ||
<div class="skinbtn" id="othertype" state="1">特殊<\/div> | <div class="skinbtn" id="othertype" state="1">特殊<\/div> | ||
− | <\/div> | + | <\/div><br/> |
+ | <div class="skinbtnbox"> | ||
+ | <div class="skinsecall">全选<\/div> | ||
+ | <div class="skinclear">清空<\/div> | ||
+ | <div class="skinbtn" id="diamond1" state="1" style="width: 120px;">388 ~ 998<span class="btntext">钻石<\/span><\/div> | ||
+ | <div class="skinbtn" id="diamond2" state="1" style="width: 120px;">1280 ~ 1699<span class="btntext">钻石<\/span><\/div> | ||
+ | <div class="skinbtn" id="diamond3" state="1" style="width: 120px;">1888 ~ 1999<span class="btntext">钻石<\/span><\/div> | ||
+ | <div class="skinbtn" id="diamond4" state="1" style="width: 120px;">2180 ~ 2588<span class="btntext">钻石<\/span><\/div> | ||
+ | <\/div><br/> | ||
<\/div> | <\/div> | ||
第48行: | 第60行: | ||
$("#mw-content-text").append(html_text); | $("#mw-content-text").append(html_text); | ||
+ | |||
+ | $(".suitbtn").click(function(){ | ||
+ | if($(this).attr("state") == "1"){ | ||
+ | $(this).attr("state", "0"); | ||
+ | $(this).css({"color":"#eaeaea", "border-style":"dashed", "background-color":"inherit", "padding":"3px 9px", "margin":"5px 1px", "border-width":"1px"}); | ||
+ | } else if($(this).attr("state") == "0") { | ||
+ | $(this).attr("state", "1"); | ||
+ | $(this).css({"color":"black", "border-style":"double", "background-color":"#ceab42", "padding":"2px 8px", "margin":"4px 0px", "border-width":"3px"}); | ||
+ | } | ||
+ | |||
+ | if($("#suitmode").attr("state") == "1") creat_suit(); | ||
+ | else creat_skin(); | ||
+ | creat_anime(); | ||
+ | creat_click(); | ||
+ | }); | ||
$(".skinbtn").click(function(){ | $(".skinbtn").click(function(){ | ||
第58行: | 第85行: | ||
} | } | ||
− | if($(this).attr("id") == " | + | if($(this).attr("id") == "suitmode" && $(this).attr("state") == "1"){ |
let allbtn = document.querySelectorAll(".skinbtn"); | let allbtn = document.querySelectorAll(".skinbtn"); | ||
for(i in allbtn){ | for(i in allbtn){ | ||
第70行: | 第97行: | ||
creat_click(); | creat_click(); | ||
return; | return; | ||
− | } else if($(this).attr("id") != " | + | } else if($(this).attr("id") != "suitmode" && $("#suitmode").attr("state") == "1") { |
− | $("# | + | $("#suitmode").attr("state", "0"); |
− | $("# | + | $("#suitmode").css({"color":"#eaeaea", "border-style":"dashed", "background-color":"inherit", "padding":"3px 9px", "margin":"5px 1px", "border-width":"1px"}); |
} | } | ||
第95行: | 第122行: | ||
$("div.skinsecall").click(function(){ | $("div.skinsecall").click(function(){ | ||
let this_element = $(this).parent("div.skinbtnbox").children("div.skinbtn"); | let this_element = $(this).parent("div.skinbtnbox").children("div.skinbtn"); | ||
+ | let this_element = $(this).parent("div.skinbtnbox").children("div.suitbtn"); | ||
for(let i = 0; i < this_element.length; i ++ ) if($(this_element[i]).attr("state") == 0) $(this_element[i]).click(); | for(let i = 0; i < this_element.length; i ++ ) if($(this_element[i]).attr("state") == 0) $(this_element[i]).click(); | ||
}); | }); | ||
$("div.skinclear").click(function(){ | $("div.skinclear").click(function(){ | ||
let this_element = $(this).parent("div.skinbtnbox").children("div.skinbtn"); | let this_element = $(this).parent("div.skinbtnbox").children("div.skinbtn"); | ||
− | + | let this_element = $(this).parent("div.skinbtnbox").children("div.suitbtn"); | |
for(let i = 0; i < this_element.length; i ++ ) if($(this_element[i]).attr("state") == 1) $(this_element[i]).click(); | for(let i = 0; i < this_element.length; i ++ ) if($(this_element[i]).attr("state") == 1) $(this_element[i]).click(); | ||
}); | }); | ||
第105行: | 第133行: | ||
function creat_skin(){ | function creat_skin(){ | ||
+ | let _month1_state = $("#month1").attr("state"); | ||
+ | let _month2_state = $("#month2").attr("state"); | ||
+ | let _month3_state = $("#month3").attr("state"); | ||
+ | let _month5_state = $("#month5").attr("state"); | ||
+ | let _month6_state = $("#month6").attr("state"); | ||
+ | let _month7_state = $("#month7").attr("state"); | ||
+ | let _month10_state = $("#month10").attr("state"); | ||
+ | let _month12_state = $("#month12").attr("state"); | ||
+ | let _month0_state = $("#month0").attr("state"); | ||
+ | |||
let _live2d_state = $("#live2d").attr("state"); | let _live2d_state = $("#live2d").attr("state"); | ||
let _animated_state = $("#animated").attr("state"); | let _animated_state = $("#animated").attr("state"); | ||
第114行: | 第152行: | ||
let _200change_state = $("#200change").attr("state"); | let _200change_state = $("#200change").attr("state"); | ||
let _100change_state = $("#100change").attr("state"); | let _100change_state = $("#100change").attr("state"); | ||
− | |||
− | |||
− | |||
− | |||
− | |||
let _NRMB_state = $("#NRMB").attr("state"); | let _NRMB_state = $("#NRMB").attr("state"); | ||
let _othertype_state = $("#othertype").attr("state"); | let _othertype_state = $("#othertype").attr("state"); | ||
+ | |||
+ | let _diamond1_state = $("#diamond1").attr("state"); | ||
+ | let _diamond2_state = $("#diamond2").attr("state"); | ||
+ | let _diamond3_state = $("#diamond3").attr("state"); | ||
+ | let _diamond4_state = $("#diamond4").attr("state"); | ||
let count = 0; | let count = 0; | ||
第126行: | 第164行: | ||
for(let i = 0; i < suitElement.length; i++){ | for(let i = 0; i < suitElement.length; i++){ | ||
+ | if($(suitElement[i]).attr("data-routine")){ | ||
+ | let routine = $(suitElement[i]).attr("data-routine"); | ||
+ | if(routine == "正月" && _month1_state == "0") continue; | ||
+ | else if(routine == "春节" && _month2_state == "0") continue; | ||
+ | else if(routine == "婚纱" && _month3_state == "0") continue; | ||
+ | else if(routine == "周年庆" && _month5_state == "0") continue; | ||
+ | else if(routine == "儿童节" && _month6_state == "0") continue; | ||
+ | else if(routine == "泳装" && _month7_state == "0") continue; | ||
+ | else if(routine == "万圣节" && _month10_state == "0") continue; | ||
+ | else if(routine == "圣诞节" && _month12_state == "0") continue; | ||
+ | else if(routine == "其他" && _month0_state == "0") continue; | ||
+ | } else { | ||
+ | let the_time = Number($(suitElement[i]).attr("data-time")) % 2000; | ||
+ | if(the_time >= 100 && the_time <= 200 && _month1_state == "0") continue; | ||
+ | else if(the_time >= 200 && the_time <= 300 && _month2_state == "0") continue; | ||
+ | else if(the_time >= 300 && the_time <= 400 && _month3_state == "0") continue; | ||
+ | else if(the_time >= 500 && the_time <= 600 && _month5_state == "0") continue; | ||
+ | else if(the_time >= 600 && the_time <= 700 && _month6_state == "0") continue; | ||
+ | else if(the_time >= 700 && the_time <= 800 && _month7_state == "0") continue; | ||
+ | else if(the_time >= 1000 && the_time <= 1100 && _month10_state == "0") continue; | ||
+ | else if(the_time >= 1200 && the_time <= 1300 && _month12_state == "0") continue; | ||
+ | else if(((the_time >= 400 && the_time <= 500) || (the_time >= 800 && the_time <= 1000) || (the_time >= 1100 && the_time <= 1200)) && _month0_state == "0") continue; | ||
+ | } | ||
+ | |||
for(let j = 0 ; j < 12; j++){ | for(let j = 0 ; j < 12; j++){ | ||
if(!$(suitElement[i]).attr("data-num" + String(j))) continue; | if(!$(suitElement[i]).attr("data-num" + String(j))) continue; | ||
第145行: | 第207行: | ||
if(this_type == "采购" && this_item == "200" && _200change_state == "0") continue; | if(this_type == "采购" && this_item == "200" && _200change_state == "0") continue; | ||
if(this_type == "采购" && this_item == "100" && _100change_state == "0") continue; | if(this_type == "采购" && this_item == "100" && _100change_state == "0") continue; | ||
− | |||
− | |||
− | |||
− | |||
− | |||
if(this_type == "RMB" && _NRMB_state == "0") continue; | if(this_type == "RMB" && _NRMB_state == "0") continue; | ||
if(this_type == "其他" && _othertype_state == "0") continue; | if(this_type == "其他" && _othertype_state == "0") continue; | ||
+ | |||
+ | this_item = Number(this_item); | ||
+ | if(this_type == "钻石" && Number(this_item) >= 388 && Number(this_item) <= 998 && _diamond1_state == "0") continue; | ||
+ | if(this_type == "钻石" && Number(this_item) >= 1280 && Number(this_item) <= 1699 && _diamond2_state == "0") continue; | ||
+ | if(this_type == "钻石" && Number(this_item) >= 1888 && Number(this_item) <= 1999 && _diamond3_state == "0") continue; | ||
+ | if(this_type == "钻石" && Number(this_item) >= 2180 && Number(this_item) <= 2588 && _diamond4_state == "0") continue; | ||
if(count % 8 == 0) html_text += `<br/>`; | if(count % 8 == 0) html_text += `<br/>`; | ||
第201行: | 第264行: | ||
function creat_suit(){ | function creat_suit(){ | ||
+ | let _month1_state = $("#month1").attr("state"); | ||
+ | let _month2_state = $("#month2").attr("state"); | ||
+ | let _month3_state = $("#month3").attr("state"); | ||
+ | let _month5_state = $("#month5").attr("state"); | ||
+ | let _month6_state = $("#month6").attr("state"); | ||
+ | let _month7_state = $("#month7").attr("state"); | ||
+ | let _month10_state = $("#month10").attr("state"); | ||
+ | let _month12_state = $("#month12").attr("state"); | ||
+ | let _month0_state = $("#month0").attr("state"); | ||
+ | |||
var html_text = ``; | var html_text = ``; | ||
for(let i = 0; i < suitElement.length; i++){ | for(let i = 0; i < suitElement.length; i++){ | ||
+ | |||
+ | if($(suitElement[i]).attr("data-routine")){ | ||
+ | let routine = $(suitElement[i]).attr("data-routine"); | ||
+ | if(routine == "正月" && _month1_state == "0") continue; | ||
+ | else if(routine == "春节" && _month2_state == "0") continue; | ||
+ | else if(routine == "婚纱" && _month3_state == "0") continue; | ||
+ | else if(routine == "周年庆" && _month5_state == "0") continue; | ||
+ | else if(routine == "儿童节" && _month6_state == "0") continue; | ||
+ | else if(routine == "泳装" && _month7_state == "0") continue; | ||
+ | else if(routine == "万圣节" && _month10_state == "0") continue; | ||
+ | else if(routine == "圣诞节" && _month12_state == "0") continue; | ||
+ | else if(routine == "其他" && _month0_state == "0") continue; | ||
+ | } else { | ||
+ | let the_time = Number($(suitElement[i]).attr("data-time")) % 2000; | ||
+ | if(the_time >= 100 && the_time <= 200 && _month1_state == "0") continue; | ||
+ | else if(the_time >= 200 && the_time <= 300 && _month2_state == "0") continue; | ||
+ | else if(the_time >= 300 && the_time <= 400 && _month3_state == "0") continue; | ||
+ | else if(the_time >= 500 && the_time <= 600 && _month5_state == "0") continue; | ||
+ | else if(the_time >= 600 && the_time <= 700 && _month6_state == "0") continue; | ||
+ | else if(the_time >= 700 && the_time <= 800 && _month7_state == "0") continue; | ||
+ | else if(the_time >= 1000 && the_time <= 1100 && _month10_state == "0") continue; | ||
+ | else if(the_time >= 1200 && the_time <= 1300 && _month12_state == "0") continue; | ||
+ | else if(((the_time >= 400 && the_time <= 500) || (the_time >= 800 && the_time <= 1000) || (the_time >= 1100 && the_time <= 1200)) && _month0_state == "0") continue; | ||
+ | } | ||
+ | |||
html_text += `<div class="onesuit"><a class="suitname" href="http://www.gfwiki.org/w/` + $(suitElement[i]).attr("data-suitlink") + `">`; | html_text += `<div class="onesuit"><a class="suitname" href="http://www.gfwiki.org/w/` + $(suitElement[i]).attr("data-suitlink") + `">`; | ||
html_text += `[` + $(suitElement[i]).attr("data-suitname") + `]<\/a>`; | html_text += `[` + $(suitElement[i]).attr("data-suitname") + `]<\/a>`; |