'); var rgb = $('.high-contrast-test').css('color').match(/\d+/g); if (rgb[0] > 153) {$('html').addClass('high-contrast-mode white-on-black');} if (rgb[0] < 153) {$('html').addClass('high-contrast-mode black-on-white');} //Mac font fix var userOS = navigator.appVersion; if (userOS.indexOf("Mac") != -1) { $("body").append('
'); } });
Playing together is better when we save together. Browse Xbox sales and specials for deals on the latest Xbox games, consoles, accessories and more to take your play to the next level.
SEGA Publisher Sale
Save up to 60%
SHOP NOW
Minecraft Anniversary Sale
Save up to 50%
SHOP NOW
Publisher Spotlight Series Sale
Save up to 70%
SHOP NOW
Assassin's Creed Franchise Sale
Save up to 85%
SHOP NOW
Warhammer Skulls Festival
Save up to 80%
SHOP NOW
Activision Blizzard Sale
Save up to 67%
SHOP NOW
Deals with Game Pass Ultimate and Game Pass Core
SEE ALL DEALS JOIN GAME PASS
This week’s digital game deals
Enjoy deep discounts on Xbox games and DLC.
SHOP ALL GAMES ON SALE
'); gamehtml = ''; var catarrlen = 5; for (var i = 0; i < catarrlen; i++) { var topfive = ["9P0Q1F7P0KR1", "C496CLVXMJP8", "9NX3P62G0WNC", "BV9CWVQWNS4P", "BPQZT43FWD49"] var thebigid = allsalegames[i]; if (urlRegion !== "ar-sa" && urlRegion !== "ar-ae") { var msrpshown = allGames[thebigid]["msrpprice"].toLocaleString(urlRegion, { style: 'currency', currency: allGames[thebigid]["currencycode"] }); var listshown = allGames[thebigid]["listprice"].toLocaleString(urlRegion, { style: 'currency', currency: allGames[thebigid]["currencycode"] }); } else { if (urlRegion === "ar-sa") { currregion = "en-us"; } else { currregion = "en-ca"; } var msrpshown = allGames[thebigid]["msrpprice"].toLocaleString(currregion, { style: 'currency', currency: allGames[thebigid]["currencycode"] }); var listshown = allGames[thebigid]["listprice"].toLocaleString(currregion, { style: 'currency', currency: allGames[thebigid]["currencycode"] }); } if (allGames[thebigid]["listprice"] !== 100000000) { if (allGames[thebigid]["msrpprice"] !== allGames[thebigid]["listprice"] && allGames[thebigid]["gameswithgold"] === "false") { var priceshown = '
' + //'
' + '
' + '
' + '' + regionContent["keyNewprice"] + ' ' + listshown + '' + '
'; } else { var priceshown = '
' + '
' + '' + msrpshown + '' + '
'; } } else { var priceshown = ""; } var pricestartingat = ""; if (gameIdArrays["startingat"].indexOf(thebigid) !== -1) { pricestartingat = '
' + regionContent["keyStartingat"] + '
'; } badges = ''; if (allGames[thebigid]["gameswithgold"] === "true") { badges+= '' + regionContent["keyBadgegwg"] + '' } if (dealsArray.indexOf(thebigid) !== -1) { badges+= '' + "DEAL OF THE WEEK" + '' } // } else if (allGames[thebigid]["onsale"] === "true") { // badges+= '' + regionContent["keyBadgeonsale"] + '' // } // if (allGames[thebigid]["newrelease"] === "true") { // badges+= '' + regionContent["keyBadgenewrelease"] + '' // } // if (allGames[thebigid]["upcoming"] === "true" && allGames[thebigid]["purchasable"] === "false") { // badges+= '' + regionContent["keyBadgecomingsoon"] + '' // } if (allGames[thebigid]["title"].toLowerCase().indexOf("preview") !== -1 || allGames[thebigid]["description"].toLowerCase().indexOf("game preview") !== -1) { badges+= '' } else if (allGames[thebigid]["upcoming"] === "true" && allGames[thebigid]["purchasable"] === "true" && allGames[thebigid]["title"].toLowerCase().indexOf("game preview") === -1) { badges+= '' + regionContent["keyBadgepreorder"] + '' } if (docwidth < 768) { var theboxshot = allGames[thebigid]["boxshotsmall"] } else { var theboxshot = allGames[thebigid]["boxshot"] } var disprelease = "-" if (allGames[thebigid]["releasedate"] !== 0) { var d = new Date(allGames[thebigid]["releasedate"]); if (d.getFullYear() < 2027) { disprelease = d.toLocaleDateString(urlRegion, {year: 'numeric', month: 'long', day: 'numeric'}); } } var thestars = ''; if (allGames[thebigid]["starcount"] > 4) { var totalratings = allGames[thebigid]["starcount"]; var avgrating = allGames[thebigid]["stars"]; var percentfilled = (avgrating / 5) * 100; var offset; if (percentfilled <= 20) { offset = 0; } else if (percentfilled > 20 && percentfilled <= 40) { offset = 12; } else if (percentfilled > 40 && percentfilled <= 60) { offset = 24; } else if (percentfilled > 60 && percentfilled <= 80) { offset = 36; } else if (percentfilled > 80 && percentfilled <= 100) { offset = 48; } var starsfilled = ((percentfilled / 100) * 90) + offset; thestars = '
' + '
User rating:' + '' + avgrating + '/' + '5' + '
' + // '
' + '
' + '
' + '5/' + '5' + '
' + '
' + '
' + allGames[thebigid]["starcount"] + '' // $("body").append('
' + '
'; } else if (allGames[thebigid]["golddiscount"] === "true" || allGames[thebigid]["gameswithgold"] === "true") { popbadges+= '' + regionContent["keyPopgolddiscount"] + ''; if (urlRegion !== "ar-sa" && urlRegion !== "ar-ae") { var specialshown = allGames[thebigid]["specialprice"].toLocaleString(urlRegion, { style: 'currency', currency: allGames[thebigid]["currencycode"] }); } else { if (urlRegion === "ar-sa") { currregion = "en-us"; } else { currregion = "en-ca"; } var specialshown = allGames[thebigid]["specialprice"].toLocaleString(currregion, { style: 'currency', currency: allGames[thebigid]["currencycode"] }); } popgoldprice+= '
' + '
' + '' + specialshown + '' + '
' + '
'; } var popservices = ''; if (allGames[thebigid]["gamepassgame"] === "true") { popservices+= '
' + regionContent["keyPopgpgame"] + '
'; } if (allGames[thebigid]["eaaccessgame"] === "true" && allGames[thebigid]["specialprice"] !== 100000000) { if (urlRegion !== "ar-sa" && urlRegion !== "ar-ae") { var eaprice = allGames[thebigid]["specialprice"].toLocaleString(urlRegion, { style: 'currency', currency: allGames[thebigid]["currencycode"] }); } else { if (urlRegion === "ar-sa") { currregion = "en-us"; } else { currregion = "en-ca"; } var eaprice = allGames[thebigid]["specialprice"].toLocaleString(currregion, { style: 'currency', currency: allGames[thebigid]["currencycode"] }); } popservices+= '
' + regionContent["keyPopeagame"].replace("
'; } var popbuytext = regionContent["keyBuynow"]; if (allGames[thebigid]["title"].toLowerCase().indexOf("preview") !== -1 || allGames[thebigid]["description"].toLowerCase().indexOf("game preview") !== -1) { var popbuytext = regionContent["keyBuynow"]; } else if (gameIdArrays["upcoming"].indexOf(thebigid) !== -1 && allGames[thebigid]["purchasable"] === "true") { popbuytext = regionContent["keyPreordernow"]; } if (allGames[thebigid]["gameurl"].toLowerCase().indexOf("xbox.com") === -1) { priceButtons = 'buy-now>click" class="c-call-to-action c-glyph popbuynow poplastbutton" target="_blank">' + '' + popbuytext + '' + '' } else { priceButtons = //'' + '' + popbuytext + '' + '' + 'learn-more>click" class="c-call-to-action f-lightweight c-glyph poplastbutton" target="_blank">' + '' + regionContent["keyLearnmore"] + '' + '' } if (gameIdArrays["upcoming"].indexOf(thebigid) !== -1 && allGames[thebigid]["purchasable"] === "false") { popbadges = ''; priceshown = '
' + '' + regionContent["keyBadgecomingsoonlower"] + '' + '
'; popgoldprice = ''; popservices = ''; priceButtons = 'learn-more>click" class="c-call-to-action f-lightweight c-glyph poplastbutton" target="_blank">' + '' + regionContent["keyLearnmore"] + '' + '' } var qlbutclass = ''; if (allGames[thebigid]["physical"] === "true") { qlbutclass = ' physgame'} var datatrack = 'data-retailer="ms store"' if (allGames[thebigid]["gameurl"].toLowerCase().indexOf("xbox.com") !== -1) { datatrack = 'data-cta="learn"' } var eachgameA = '
' + '
click" ' + datatrack + '>' + '' + '' + '' + badges + '' + '' + allGames[thebigid]["title"] + '' + priceshown + '' + ''; var quickLookButton = '
' + '' + regionContent["keyQuicklook"] + '' + '
'; var eachgamePopup = '
' + '
' + '' + '
' + '
' + //therotator + '
' + '
' + '
' + '
' + allGames[thebigid]["title"] + '
' + thestars + '
' + '
' + // popiconRating + // popiconEnhanced + popiconXpa + popicon4k + popiconHdr + '
' + '
' + '
' + regionContent["keyDescription"] + ': ' + allGames[thebigid]["description"] + '
' + '
' + '
' + '
' + //badges + popbadges + pricestartingat + priceshown + popgoldprice + popservices + '
' + '
' + priceButtons + '
' + '
' + '
' + '
'; var eachgameB = '
'; if (docwidth > 1083) { gamehtml += eachgameA + quickLookButton + eachgamePopup + eachgameB; } else { gamehtml += eachgameA + eachgameB; } } $(".fivegames .gameDivsWrapper").append(gamehtml); // popup $(document).on("mouseenter", ".gameDiv a.gameDivLink", function(e) { $(e.target).off("mouseleave"); var buttontoshow = $(e.target).closest(".gameDiv").find(".qlButton"); $(".popupShow").removeClass("popupShow"); $(buttontoshow).addClass("popupShow"); }) $(document).on("focus", ".gameDiv a.gameDivLink", function(e) { $(".qlButton").removeClass("popupShow"); var buttontoshow = $(e.target).closest(".gameDiv").find(".qlButton"); $(".popupShow").removeClass("popupShow"); $(buttontoshow).addClass("popupShow"); }) $(document).on("click", ".qlButton a", function(e) { e.preventDefault(); var poptoopen = $(this).closest(".gameDiv").find(".gameMoreInfo"); var starperc = $(poptoopen).find(".ratingstars").attr("data-starpercent") || "0"; $(poptoopen).find(".c-rating[data-value].f-individual.filledstars div").css("width", starperc + "px"); $(poptoopen).addClass("popupShow"); // var rightside = $(".gameMoreInfo.popupShow").offset().left + $(".gameMoreInfo.popupShow").width(); // if (rightside > $(window).width()) { // var dif = (rightside - $(window).width()) + 50; // $(poptoopen).css("margin-left", "-" + dif + "px"); // } $(poptoopen).find(".qclosebutton").focus(); //$(poptoopen).find("h3").eq(0).focus(); // populate rotator var thebigid = $(this).closest(".gameDiv").attr("data-bigid"); if (allGames[thebigid]["physical"] === "true") { therotator = ''; } else { var buttonhtml = ''; var screenhtml = ''; for (var s = 0; s < allGames[thebigid]["screenarray"].length; s++) { if (s === 0) { var humannum = s + 1; buttonhtml+= ''; screenhtml+= '
'; } else { var humannum = s + 1; buttonhtml+= ''; screenhtml+= '
'; } } if (fullcarouselimages.indexOf(thebigid) !== -1) { var fullimageclass = " carfullimage"; } else { var fullimageclass = ""; } var randchars = makerand10(); therotator = '
' + '
' + '
' + buttonhtml + '
' + '' + '
' + '' + '' + '
' + '
- ' + screenhtml + '
' + '
' + '
' } if ($(this).closest(".gameDiv").find(".poprotator .c-carousel").length === 0 && allGames[thebigid]["physical"] === "false") { $(this).closest(".gameDiv").find(".poprotator").append(therotator); mwf.ComponentFactory.create([ {component: mwf.MultiSlideCarousel} ]); } else if ($(this).closest(".gameDiv").find(".poprotator img").length === 0 && allGames[thebigid]["physical"] === "true") { $(this).closest(".gameDiv").find(".poprotator").css("border-bottom", "1px grey solid").append(therotator); } // open popup dark background $("body").append('
'); $('body').addClass('stop-scrolling') }) $(document).on("keypress", ".qlButton a", function(event) { if((event.keyCode == 13) || (event.keyCode== 32)){ event.preventDefault(); $(this).click(); } }) $(document).on("click", "#page-cover", function() { $(".gameMoreInfo.popupShow .qclosebutton").click(); $("#page-cover").remove(); $('body').removeClass('stop-scrolling') }) $(document).on("click", ".qclosebutton", function(e) { e.preventDefault(); $(".gameMoreInfo.popupShow").closest(".gameDiv").find(".gameDivLink").eq(0).focus(); $(".gameMoreInfo").removeClass("popupShow"); $("#page-cover").remove(); $('body').removeClass('stop-scrolling') }) $(document).on("keypress", ".qclosebutton", function(event) { if((event.keyCode == 32) || (event.keyCode == 13)){ event.preventDefault(); $(this).click(); } }) function makerand10() { var text = ""; var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; for (var i = 0; i < 10; i++) text += possible.charAt(Math.floor(Math.random() * possible.length)); return text; } setTimeout(function() { // with second close button /*redirect last tab to first input*/ $(document).on("keydown", function(e) { if (e.keyCode === 9 && !e.shiftKey) { if ($(".gameMoreInfo.popupShow .poplastbutton")[0] === document.activeElement) { e.preventDefault(); $(".gameMoreInfo.popupShow .qclosebutton").focus() } } if ((e.keyCode === 13 || e.keyCode === 32) && ($(".gameMoreInfo.popupShow .qclosebutton")[0] === document.activeElement)) { e.preventDefault(); $(".gameMoreInfo.popupShow .qclosebutton").click(); } if ((e.keyCode === 27) && ($(".gameMoreInfo.popupShow").length !== 0)) { $(".gameMoreInfo.popupShow .qclosebutton").click(); } }) /*redirect first shift+tab to last input*/ $(document).on('keydown', ".gameMoreInfo.popupShow .qclosebutton", function (e) { if ((e.keyCode === 9 && e.shiftKey)) { e.preventDefault(); $(".gameMoreInfo.popupShow .poplastbutton").focus() if ($(".gameMoreInfo.popupShow .qclosebutton")[0] === document.activeElement) { $(".gameMoreInfo.popupShow .poplastbutton").focus() } } }); }, 250) } allGamesData(pop5); })