Styles

Div small Headline – Inter
Titles – Inter

H1 Don’t dwell on the past or worry about the future. All that matters is what you’re doing right now.

H2 Don’t dwell on the past or worry about the future. All that matters is what you’re doing right now.

H3 Don’t dwell on the past or worry about the future. All that matters is what you’re doing right now.

H4 Don’t dwell on the past or worry about the future. All that matters is what you’re doing right now.

Body Text – Frank Ruhl Libre

Mollis pretium lorem primis senectus habitasse lectus scelerisque donec ultricies tortor suspendisse adipiscing fusce morbi volutpat pellentesque consectetur mi risus molestie curae malesuada. Dignissim lacus convallis massa mauris enim ad mattis magnis senectus montes mollis taciti phasellus accumsan bibendum semper blandit suspendisse faucibus.

Vivamus integer non suscipit taciti mus etiam at primis tempor sagittis sit euismod libero facilisi aptent elementum felis blandit cursus gravida sociis erat ante eleifend lectus nullam dapibus netus feugiat curae curabitur est ad. Massa curae fringilla consectetur porttitor quam sollicitudin iaculis aptent ligula euismod dictumst penatibus mauris eros praesent erat volutpat.

Global Colors

var(–contrast)

var(–contrast-2)

var(–contrast-3)

var(–base)

var(–base-2)

var(–base-3)

var(–accent)

Buttons
Primary Category
document.addEventListener("DOMContentLoaded", function () { const container = document.querySelector(".video-container"); const heading = document.getElementById("dynamic-heading"); const API_KEY = "AIzaSyCX2TTKcjQ83YSiXcee2rdrAbKPTfeTGo8"; const defaultCountry = "US"; // Default to United States const categories = ["Music", "Gaming", "News", "Entertainment"]; // Add more as needed const countries = ["US", "IN", "BR", "RU", "GB"]; // Add the top 50 YouTube user countries const maxResults = 9; // Adjust as needed function fetchVideos(country = defaultCountry, category = "Entertainment") { let categoryEncoded = encodeURIComponent(category); let url = `https://www.googleapis.com/youtube/v3/videos?part=snippet,statistics&chart=mostPopular®ionCode=${country}&maxResults=${maxResults}&key=${API_KEY}`; heading.innerHTML = `Most Viewed ${category} YouTube Video in the Last 24 Hours in ${country}`; fetch(url) .then((response) => response.json()) .then((data) => { container.innerHTML = ""; if (data.items.length === 0) { container.innerHTML = "

No videos found.

"; return; } data.items.forEach((video, index) => { let videoId = video.id; let videoTitle = video.snippet.title; let videoUrl = `https://www.youtube.com/watch?v=${videoId}`; let channelTitle = video.snippet.channelTitle; let viewCount = video.statistics.viewCount; let categoryLink = `/most-viewed-${categoryEncoded}-videos-${country}/`; let videoCard = `

${videoTitle}

Channel: ${channelTitle}

Views: ${new Intl.NumberFormat().format(viewCount)}

More ${category} videos from ${country}
`; container.innerHTML += videoCard; // Ad slot after every 3 videos if ((index + 1) % 3 === 0) { container.innerHTML += `

Advertisement

`; } }); }) .catch((error) => console.error("Error fetching videos:", error)); } // Fetch videos for default country and category on load fetchVideos(); });