$(document).ready(function() {
$('.main-game-wrapper span[name="chance_balance"]').closest('.text-bold').hide();
const registerPopup = `
`;
$('body').append(registerPopup);
if (window.location.pathname === '/register') {
$('#register-popup').modal('show');
}
// add break line for campaign header
const targetElements = document.querySelectorAll('.mb-3.text-center');
targetElements.forEach(element => {
if (element.textContent.includes('Heat Up Your Summer')) {
element.innerHTML = `
Heat Up Your Summer with GR.iD
Shop, Complete Challenges and Get Rewarded
`;
}
});
// add a table right under the campaign header
const tableMarkup = `
| Spend $5 – $15.99 |
Earn 15 points |
| Spend $16 – $49.99 |
Earn 25 points |
| Spend $50 and above |
Earn 50 points |
`;
$('h6.mb-3.text-center').after(tableMarkup);
// once the modal’s content is in the DOM, patch that one voucher
function patchOneVoucher(){
// select by the series attribute
var $voucher = $('[series="1RID-072025-205"]');
if (!$voucher.length) return false;
// find its description node
var $desc = $voucher.find('.small.mb-2.text-muted');
if ($desc.length) {
$desc.text('terms and conditions apply');
return true;
}
return false;
}
$(document).on('shown.bs.modal', '#popup_rewards', function(){
patchOneVoucher();
});
});