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

Film Reviews

‘Thunderbolts*’ review: aggy antiheroes make Marvel fun again

An unlikely gang of superhero outcasts team up to save the day in this hilarious caper

‘Warfare’ review: graphic, gruelling proof that war is hell

Alex Garland teams up with Gulf War veteran Ray Mendoza for this combat epic

‘Sinners’ review: sink your teeth into Ryan Coogler’s bloodthirsty blues horror

Michael B. Jordan plays twin brothers returning to the Deep South in this devilishly good period piece

‘Pink Floyd At Pompeii: MCMLXXII’ review: they don’t make them like this anymore

Celebrate the 50th anniversary of this iconic concert film

‘It’s Never Over, Jeff Buckley’ review: hallelujah, this moving rock doc is celebratory not sad

Director Amy Berg's “love story" betters other similar films about her idol

‘Death Of A Unicorn’ review: Paul Rudd and Jenna Ortega serve up fantasy slasher slop

It's got gory moments and lots of jokes, but few are any good

‘A Minecraft Movie’ review: blockhead video game adaptation needs shaping up

This Jack Black comedy adventure plays it far too safe

‘The Woman In The Yard’ review: haunting meditation on grief is not your garden-variety horror

A deceptively powerful return to the supernatural for director Jaume Collet-Serra

‘Opus’ review: bizarre but funky pop star thriller

A ‘90s icon returns and gives people more than 'dynamic pricing' to worry about

‘Black Bag review: suave, silly and sexually-charged marital spy thriller

Michael Fassbender and Cate Blanchett are a happy couple battling issues of national security
Advertisement