`; // 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); }); });

Gaming News

Switch 2 game cartridges taste horrible on purpose: “If it enters your mouth, you’ll spit it out”

"We don't want anybody to be at risk of any unwanted consumption”

Nintendo defends £75 price-tag for ‘Mario Kart World’

“Variable pricing” will depend on the “repeatability of gameplay experiences”

Sabrina Carpenter fans react to ‘Short n’ Sweet’ ‘Fortnite’ collab: “I’m obsessed”

The ‘Espresso’ singer is the latest headliner of ‘Fortnite Festival’

Here’s when Sabrina Carpenter is coming to ‘Fortnite’

Songs like 'Juno', 'Nonsense' and 'Please Please Please' will be available in the upcoming 'Fortnite Festival' season alongside other unlockable items

Here’s every song on the ‘Minecraft’ soundtrack

Including a huge original song from Jack Black and Dave Grohl

‘Quake 2’ AI replica hasn’t gone down well with gamers: “This disgusts me”

Microsoft launched the “experimental tech demo” over the weekend

‘World Of Warcraft’ and ‘Overwatch’ art director Bill Petras has died

“Bill was a legend in the community and he will be deeply missed”

‘Fortnite’ movie not on the cards despite rumours

Epic Games boss Tim Sweeny has dismissed the reports as “false”
Advertisement