function ignAddThemeClassToDocument(theme) {
if (!theme) return;
const classPrefix = 'ign-theme-';
const html = document.querySelector('html');
const classes = html.className.split(' ');
for (let i = 0; i !== classes.length; i++) {
if (classes[i].indexOf(classPrefix) === 0) {
html.classList.remove(classes[i]);
}
}
html.classList.add(classPrefix + theme);
}
const template = document.querySelector('.ign-base-template.ign-template');
const templateScope = angular.element(template).scope();
templateScope.$watch('custom.theme', (value) => ignAddThemeClassToDocument(value));
window.addEventListener('message', (event) => {
if (event.data.theme) {
templateScope.custom.theme = event.data.theme;
}
});
templateScope.ignHeader = `Head Over to IGN Rewards for Exclusive Giveaways, Discounts, Offers, and More!`;
templateScope.actionButtonText = `Check It Out!`;
templateScope.actionButtonUrl = `/`;
templateScope.ignSubTitle = ``;
templateScope.ignImage = `https://assets-prd.ignimgs.com/2024/06/10/screenshot-2024-06-10-at-3-03-12-pm-1718050415073.png`;
templateScope.ignText = `Become a member and enter to win giveaways, claim free offers, discounts and more! Upgrade to IGN Plus for monthly games, ad-free browsing, and more! `;
templateScope.compactActionButton = `https://www.ign.com/rewards?utm_source=piano&utm_medium=rewards&utm_campaign=IGNRewards&utm_id=ign.24` === 'true';
const wideBreakPoint = 640;
templateScope.ignIsWide = document.querySelector(".ign-base-template.ign-template").offsetWidth > wideBreakPoint;
const resizeObserver = new ResizeObserver(function(entries) {
const entry = entries[0];
if (!entry || !entry.contentRect) return;
templateScope.ignIsWide = entry.contentRect.width > wideBreakPoint;
});
resizeObserver.observe(document.querySelector(".ign-base-template.ign-template"));
{{ignSubTitle}}
{{ignText}}