`;
// 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);
});
});
Check out the new single from the 'Live Aid' musical as Sir Bob asks "why isn’t there a place for politics in music at the moment?" and explains why we'll never see a huge charity night like it again
Check out candid photos from the book as the drummer looks back at that "thrilling time" of "just four men in their 20s being really excited by everything that’s going on"
Finally having “trimmed the fat” and built herself up from the inside out, Rico Nasty returns with 'Lethal' – a sharpened, genre-defying statement of self, fuelled by every version of her past and a bold new future in acting
Watch Hoppus tell us about his emotional new memoir 'Fahrenheit-182', via punk escapades, friendships broken and repaired, a Green Day rivalry, getting a little too close to Robert Smith and lessons learned from battling cancer
The singer-songwriter on the most ridiculous lyric on his new record, loving Ethel Cain and Black Country, New Road, and his past obsession with external validation
Check out the pummelling new single 'Broken Rib' as Beth tells us about returning from her movie star life, being inspired by life on the road with Queens Of The Stone Age, and her plans for playing before Kneecap at Glastonbury
Author Jamie Taylor tells us about new book 'Studio Electrophonique: The Sheffield Space Age, From The Human League To Pulp', the DIY maverick that could have stepped out of a Wes Anderson film, and the Steel City artists carrying that same spirit today
Kai Whyte and bassist Gordon Moakes tell us about tackling inequality, the mood in Birmingham right now, Kneecap's freedom of expression, and Bloc Party's recent Ivor Novellos win