`;
// 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);
});
});
Having upscaled her craft through former bands, writing for other artists and her theatrical solo live show, the London-based artist has just announced her debut album – and it’s packed with larger-than-life pop hooks
Nearly a decade in the making, Julien Baker and Mackenzie Ruth Scott’s new country album ‘Send A Prayer My Way’ is a tender reclamation of their Southern roots
The Eurovision hopefuls tell NME about 'What the Hell Just Happened?', getting approval from Taylor Swift and Brian May, and plans to avoid getting nul points at the big final in Basel
As they share 'Deepest’ with Swinton and remix Con-Man to announce a reissue of their seminal second album, the electro pioneers look back on another era and tell us how "there haven’t been many contenders" for new dance Glasto headliners
As the maverick duo release new single ‘Drowned In A Sea Of Tears’, the Maels tell NME of politics, their "totally different" new John Woo-directed film, still doing things their own way, and finally caving in to a guitar solo
The Connecticut-born singer is crafting a gothic, romantic sound that’s earned her a feature with Architects and an opening slot for Bring Me The Horizon
Pelle Almqvist tells NME about their "raw as fuck" new album "of 12 singles" 'The Hives Forever Forever The Hives', as well as playing with Arctic Monkeys, and working with QOTSA's Josh Homme and Beastie Boys' Mike D