◆少前百科是非盈利性、非官方的少女前线维基百科。 ◆如果您发现某些内容错误/空缺,请勇于修正/添加!参与进来其实很容易!点这里 加入少前百科。 ◆有任何意见、建议、纠错,欢迎在 GFwiki:反馈与建议 提出和讨论。编辑事务讨论QQ群:597764980,微博@GFwiki少前百科 ◆To foreigners,You can use twitter to contact us. |
“Widget:SkinQuery/js”的版本间的差异
(校对纠错) |
(更新) |
||
第3行: | 第3行: | ||
creat_suit(); | creat_suit(); | ||
creat_anime(); | creat_anime(); | ||
+ | creat_click(); | ||
function creat_suit(){ | function creat_suit(){ | ||
var html_text = ``; | var html_text = ``; | ||
for(let i = 0; i < suitElement.length; i++){ | for(let i = 0; i < suitElement.length; i++){ | ||
− | html_text += `<div class="onesuit">< | + | 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>`; | ||
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; | ||
第27行: | 第29行: | ||
case "其他" : gain_text += `itemgrey">其他</div>`; item_class = "itemgrey"; break; | case "其他" : gain_text += `itemgrey">其他</div>`; item_class = "itemgrey"; break; | ||
default : gain_text += `itemgrey">error</div>`; | default : gain_text += `itemgrey">error</div>`; | ||
+ | } | ||
+ | |||
+ | let anime_text = ""; | ||
+ | switch($(suitElement[i]).attr("data-anime" + String(j))){ | ||
+ | case "Live2D" : anime_text = `Live2D`; break; | ||
+ | case "Animated" : anime_text = `Animated`; break; | ||
+ | default : anime_text = ""; break; | ||
} | } | ||
html_text += `<div class="oneskin ` + bcard_class + `"> | html_text += `<div class="oneskin ` + bcard_class + `"> | ||
− | <div class="skinpicndiv"><img class="skinpicn" src="` + $(suitElement[i]).attr("data-picn" + String(j)) + `" /></div> | + | <div class="skinpicndiv" data-dollname="` + $(suitElement[i]).attr("data-doll" + String(j)) + `"> |
+ | <img class="skinpicn" src="` + $(suitElement[i]).attr("data-picn" + String(j)) + `" /></div> | ||
<div class="skintext"> | <div class="skintext"> | ||
<div class="skindoll">` + $(suitElement[i]).attr("data-doll" + String(j)) + `</div> | <div class="skindoll">` + $(suitElement[i]).attr("data-doll" + String(j)) + `</div> | ||
第37行: | 第47行: | ||
` + gain_text + ` | ` + gain_text + ` | ||
<div class="skinitem ` + item_class + `">` + $(suitElement[i]).attr("data-item" + String(j)) + `</div> | <div class="skinitem ` + item_class + `">` + $(suitElement[i]).attr("data-item" + String(j)) + `</div> | ||
+ | ` + ((anime_text) ? `<div class="skinanime">` + anime_text + `</div>` : ``) + ` | ||
</div> | </div> | ||
</div>`; | </div>`; | ||
第53行: | 第64行: | ||
}); | }); | ||
} | } | ||
+ | |||
+ | function creat_click(){ | ||
+ | $('.skinpicndiv').click(function(){ | ||
+ | let doll_link = "http://www.gfwiki.org/w/" + $(this).attr("data-dollname"); | ||
+ | window.open(doll_link); | ||
+ | }); | ||
+ | |||
+ | } | ||
+ | |||
+ | |||
}) | }) | ||
</script></includeonly> | </script></includeonly> |