`; // target the cover menu item const target = document.querySelector('#menu-header-uk-1 .menu-item-2911415'); // position popover to the left if the target is on the right half of the screen if (target.getBoundingClientRect().right > document.documentElement.clientWidth / 2) { popover.classList.add('left'); } target.appendChild(popover); // used to check if the article info let articleTitle = ''; // fetch info once, then show popover on hover target.addEventListener('mouseover', async () => { if (!articleTitle) { const [coverRes, articleRes] = await Promise.all([ fetch('https://www.nme.com/wp-json/wp/v2/posts?categories=268320&per_page=1&_fields[]=thumbnail_url&_fields[]=featured_media'), fetch('https://www.nme.com/wp-json/wp/v2/posts?categories=268101&per_page=1&_fields[]=title&_fields[]=link'), ]); const [cover, article] = await Promise.all([coverRes.json(), articleRes.json()]); articleTitle = article[0].title.rendered; document.querySelector('#the-cover-article-title').textContent = articleTitle; document.querySelector('#the-cover-article-title').href = article[0].link; document.querySelector('#the-cover-image-link').href = article[0].link; document.querySelector('#the-cover-read-now').href = article[0].link; document.querySelectorAll('#the-cover-image').forEach((img) => { // add size modifier to the cover image url img.src = cover[0].thumbnail_url.replace(/(\.[\w\d_-]+)$/i, '-400x500$1'); }); // document.querySelector('#the-cover-image-link').href = article[0].link; } setTimeout(() => popover.classList.add('active'), 0); }); // hide popover on mouse leave target.addEventListener('mouseleave', () => { setTimeout(() => popover.classList.remove('active'), 0); }); });

Game Reviews

‘Doom: The Dark Ages’ review: one hell of a good time

The latest game in the devilishly fun shooter series trades agility for brutality

‘Assassin’s Creed Shadows’ review: a bold new era for the historical action series

Two very different protagonists and a fresh Japanese setting make for a near-perfect adventure

‘Split Fiction’ review: a wildly imaginative mash-up that’s best shared with a mate

This co-op marvel has you and a pal exploring two storybook worlds of endless possibilities

‘Monster Hunter Wilds’ review: fantastic beasts and how to kill them

Capcom has followed up on the global success of 'World' with the most polished entry in the franchise yet

‘Like a Dragon: Pirate Yakuza In Hawaii’ review: Japanese crime saga hits the high seas

Practise swashbuckling hijinks or search for valuable booty in this enjoyably zany adventure

‘Indiana Jones And The Great Circle’ review: tip your fedora to this unexpected action delight

The whip-cracking icon is back at his best in this lovingly crafted adventure

‘Stalker 2: Heart Of Chornobyl’ review: an apocalyptic thriller you won’t want to put down

The game is set in a lawless nuclear wasteland, filled with monsters and scheming political factions

‘Lego Horizon Adventures’ review: the crossover no one asked for

This quippy remix is too simple for ‘Horizon Zero Dawn' players and not inviting enough for newcomers
Advertisement