document.addEventListener("DOMContentLoaded", (event) => {
const videoCardLinks = document.querySelectorAll(".video-card__link");
videoCardLinks.forEach((el) => {
el.addEventListener("mouseover", (e) => {
e.target.closest(".video-card").classList.add("hovered");
});
el.addEventListener("mouseout", (e) => {
e.target.closest(".video-card").classList.remove("hovered");
});
});
});
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter