Mudanças entre as edições de "Widget:TesteBossYawn"
Ir para navegação
Ir para pesquisar
| Linha 1: | Linha 1: | ||
<div class="boss-component" data-json="{{{data}}}"> | <div class="boss-component" data-json="{{{data}}}"> | ||
<div class="boss-diff"> | <div class="boss-diff"> | ||
<button onclick="bossSetDiff(this,'normal')">NORMAL</button> | <button onclick="bossSetDiff(this,'normal')">NORMAL</button> | ||
| Linha 8: | Linha 7: | ||
<div class="boss-content"></div> | <div class="boss-content"></div> | ||
</div> | </div> | ||
<style> | <style> | ||
.boss-component { | .boss-component .box { ... } | ||
. | |||
. | |||
. | |||
} | |||
</style> | </style> | ||
<script> | <script> | ||
(function(){ | (function() { | ||
function init() { | |||
document.querySelectorAll(".boss-component").forEach(root => { | |||
bossRender(root, "normal"); | |||
}); | |||
} | |||
function bossRender(root, diff) { | function bossRender(root, diff) { | ||
const data = JSON.parse(root.dataset.json); | const data = JSON.parse(root.dataset.json); | ||
const d = data[diff]; | const d = data[diff]; | ||
// render... | |||
} | } | ||
| Linha 73: | Linha 33: | ||
} | } | ||
window. | window.bikiSetSkill = function(el, index){ | ||
// skill logic | |||
} | |||
if (document.readyState === 'loading') { | |||
document.addEventListener('DOMContentLoaded', init); | |||
} else { | |||
init(); | |||
} | } | ||
if (typeof mw !== 'undefined' && mw.hook) { | |||
mw.hook('wikipage.content').add(init); | |||
} | |||
} | |||
})(); | })(); | ||
</script> | </script> | ||
Edição das 12h13min de 4 de abril de 2026
<button onclick="bossSetDiff(this,'normal')">NORMAL</button> <button onclick="bossSetDiff(this,'elite')">ELITE</button> <button onclick="bossSetDiff(this,'hard')">HARD</button>
<style> .boss-component .box { ... } </style>
<script> (function() {
function init() {
document.querySelectorAll(".boss-component").forEach(root => {
bossRender(root, "normal");
});
}
function bossRender(root, diff) {
const data = JSON.parse(root.dataset.json);
const d = data[diff];
// render...
}
window.bossSetDiff = function(el, diff){
const root = el.closest(".boss-component");
bossRender(root, diff);
}
window.bikiSetSkill = function(el, index){
// skill logic
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', init);
} else {
init();
}
if (typeof mw !== 'undefined' && mw.hook) {
mw.hook('wikipage.content').add(init);
}
})(); </script>