Widget:BossScript: mudanças entre as edições
Ir para navegação
Ir para pesquisar
(Criou página com '<script> document.addEventListener('DOMContentLoaded', function () { Date.prototype.getWeekNumber = function () { let d = new Date(Date.UTC(this.getFullYear(), this.getMonth(), this.getDate())); let dayNum = d.getUTCDay() || 7; d.setUTCDate(d.getUTCDate() + 4 - dayNum); let yearStart = new Date(Date.UTC(d.getUTCFullYear(), 0, 1)); return Math.ceil((((d - yearStart) / 86400000) + 1) / 7) }; const url = window.location.origin; let actualWeekNum...') |
Sem resumo de edição |
||
(Uma revisão intermediária pelo mesmo usuário não está sendo mostrada) | |||
Linha 21: | Linha 21: | ||
const bosses = [ | const bosses = [ | ||
{ | |||
name: 'Suicune', | |||
image: '/images/8/8b/Card_Boss-Fight-Suicune.png', | |||
link: "https://wiki.pokexgames.com/index.php/Boss_Fight_-_Suicune" | |||
}, | |||
{ | { | ||
name: 'Entei', | name: 'Entei', | ||
Linha 31: | Linha 36: | ||
link: "https://wiki.pokexgames.com/index.php/Boss_Fight_-_Raikou" | link: "https://wiki.pokexgames.com/index.php/Boss_Fight_-_Raikou" | ||
}, | }, | ||
]; | ]; | ||
/* | /* | ||
1° | 1° Raikou | ||
2° | 2° Entei | ||
3° Suicune | 3° Suicune | ||
*/ | */ |
Edição atual tal como às 02h31min de 8 de janeiro de 2025
<script> document.addEventListener('DOMContentLoaded', function () {
Date.prototype.getWeekNumber = function () { let d = new Date(Date.UTC(this.getFullYear(), this.getMonth(), this.getDate())); let dayNum = d.getUTCDay() || 7; d.setUTCDate(d.getUTCDate() + 4 - dayNum); let yearStart = new Date(Date.UTC(d.getUTCFullYear(), 0, 1)); return Math.ceil((((d - yearStart) / 86400000) + 1) / 7) };
const url = window.location.origin; let actualWeekNumber = new Date().getWeekNumber(); const today = new Date();
if(today.getDay() === 1) { if(today.getHours() < 7 && today.getMinutes() < 40) actualWeekNumber--; }
const bossCard = document.getElementById('boss-card');
const bosses = [
{ name: 'Suicune', image: '/images/8/8b/Card_Boss-Fight-Suicune.png', link: "https://wiki.pokexgames.com/index.php/Boss_Fight_-_Suicune" }, { name: 'Entei', image: '/images/c/c4/Card_Boss-Fight-Entei.png', link: "https://wiki.pokexgames.com/index.php/Boss_Fight_-_Entei" }, { name: 'Raikou', image: '/images/2/28/Card_Boss-Fight-Raikou.png', link: "https://wiki.pokexgames.com/index.php/Boss_Fight_-_Raikou" },
];
/* 1° Raikou 2° Entei 3° Suicune */ console.log(actualWeekNumber)
bossCard.src = url + bosses[actualWeekNumber % 3].image; document.getElementById("boss-link").href = bosses[actualWeekNumber % 3].link; bossCard.alt = bosses[actualWeekNumber % 3].name;
}); </script>