بالنقر فوق “قبول جميع ملفات تعريف الارتباط”، فإنك توافق على تخزين ملفات تعريف الارتباط على جهازك لتحسين التنقل في الموقع وتحليل استخدام الموقع والمساعدة في جهودنا التسويقية. مزيد من المعلومات
إعدادات ملفات تعريف الارتباط
بالنقر فوق “قبول جميع ملفات تعريف الارتباط”، فإنك توافق على تخزين ملفات تعريف الارتباط على جهازك لتحسين التنقل في الموقع وتحليل استخدام الموقع والمساعدة في جهودنا التسويقية. مزيد من المعلومات
tag)
document.addEventListener("DOMContentLoaded", () => {
// Get the element with the ID 'githubStars'
const starsElement = document.getElementById("githubStarsButton");
if (starsElement) {
// Get the current text content
const rawNumber = starsElement.textContent.trim();
// Remove any existing formatting (commas, spaces, etc.)
const cleanNumber = rawNumber.replace(/[,\s]/g, "");
// Convert to number and format with thousand separators
const number = parseFloat(cleanNumber);
if (!Number.isNaN(number)) {
// Format the number with commas (e.g., 1000 -> 1,000)
const formattedNumber = number.toLocaleString("en-US");
// Update the element with the formatted number
starsElement.textContent = formattedNumber;
}
}
// Handle responsive visibility for githubString
const githubString = document.getElementById("githubString");
if (githubString) {
function handleResize() {
if (window.innerWidth < 1200) {
githubString.style.display = "none";
} else {
githubString.style.display = "";
}
}
// Run on load
handleResize();
// Run on window resize
window.addEventListener("resize", handleResize);
}
});