My co-worker received an error message when trying to do a push to our git repos. Usually a pull will fix the issue in my experience but this was different. Error Message git.exe push --progress "origin" branchName:branchName error: Couldn't set refs/heads/branchName To X:\xxx.git ! ');
if (progressBars.length > 0) {
const animateProgressBar = (progressBar) => {
const targetWidth = progressBar.getAttribute('data-width');
const span = progressBar.querySelector('span');
if (span && targetWidth) {
// Add animate class to enable transitions
progressBar.classList.add('animate');
// Set the CSS custom property and animate
progressBar.style.setProperty('--progress-width', targetWidth + '%');
// Set the target width after a small delay to trigger animation
setTimeout(() => {
span.style.width = targetWidth + '%';
}, 50);
}
};
// Check if Intersection Observer is supported
if ('IntersectionObserver' in window) {
const observerOptions = {
root: null,
rootMargin: '0px 0px -10% 0px', // Trigger when 90% visible
threshold: 0.1
};
const observer = new IntersectionObserver((entries) => {
entries.forEach((entry) => {
if (entry.isIntersecting && !entry.target.classList.contains('animate')) {
animateProgressBar(entry.target);
// Stop observing this element once animated
observer.unobserve(entry.target);
}
});
}, observerOptions);
// Start observing all progress bars
progressBars.forEach((progressBar) => {
observer.observe(progressBar);
});
} else {
// Fallback: animate immediately if Intersection Observer not supported
progressBars.forEach((progressBar) => {
animateProgressBar(progressBar);
});
}
}
// Animated Methodology Items - Intersection Observer
const methodologyItems = document.querySelectorAll('.methodology-item');
if (methodologyItems.length > 0) {
const animateMethodologyItem = (item) => {
const delay = item.getAttribute('data-animation-delay') || '0s';
item.style.setProperty('--animation-delay', delay);
item.classList.add('animate');
};
// Check if Intersection Observer is supported
if ('IntersectionObserver' in window) {
const observerOptions = {
root: null,
rootMargin: '0px 0px -10% 0px', // Trigger when 90% visible
threshold: 0.1
};
const methodologyObserver = new IntersectionObserver((entries) => {
entries.forEach((entry) => {
if (entry.isIntersecting && !entry.target.classList.contains('animate')) {
animateMethodologyItem(entry.target);
// Stop observing this element once animated
methodologyObserver.unobserve(entry.target);
}
});
}, observerOptions);
// Start observing all methodology items
methodologyItems.forEach((item) => {
methodologyObserver.observe(item);
});
} else {
// Fallback: animate immediately if Intersection Observer not supported
methodologyItems.forEach((item) => {
animateMethodologyItem(item);
});
}
}
// Animated Framework Items - Intersection Observer
const frameworkItems = document.querySelectorAll('.framework-item');
if (frameworkItems.length > 0) {
const animateFrameworkItem = (item) => {
const delay = item.getAttribute('data-animation-delay') || '0s';
item.style.setProperty('--animation-delay', delay);
item.classList.add('animate');
};
// Check if Intersection Observer is supported
if ('IntersectionObserver' in window) {
const observerOptions = {
root: null,
rootMargin: '0px 0px -10% 0px', // Trigger when 90% visible
threshold: 0.1
};
const frameworkObserver = new IntersectionObserver((entries) => {
entries.forEach((entry) => {
if (entry.isIntersecting && !entry.target.classList.contains('animate')) {
animateFrameworkItem(entry.target);
// Stop observing this element once animated
frameworkObserver.unobserve(entry.target);
}
});
}, observerOptions);
// Start observing all framework items
frameworkItems.forEach((item) => {
frameworkObserver.observe(item);
});
} else {
// Fallback: animate immediately if Intersection Observer not supported
frameworkItems.forEach((item) => {
animateFrameworkItem(item);
});
}
}
// Animated Timeline Items - Intersection Observer
const timelineItems = document.querySelectorAll('.timeline-item');
if (timelineItems.length > 0) {
const animateTimelineItem = (item) => {
const delay = item.getAttribute('data-animation-delay') || '0s';
item.style.setProperty('--animation-delay', delay);
item.classList.add('animate');
};
// Check if Intersection Observer is supported
if ('IntersectionObserver' in window) {
const observerOptions = {
root: null,
rootMargin: '0px 0px -10% 0px', // Trigger when 90% visible
threshold: 0.1
};
const timelineObserver = new IntersectionObserver((entries) => {
entries.forEach((entry) => {
if (entry.isIntersecting && !entry.target.classList.contains('animate')) {
animateTimelineItem(entry.target);
// Stop observing this element once animated
timelineObserver.unobserve(entry.target);
}
});
}, observerOptions);
// Start observing all timeline items
timelineItems.forEach((item) => {
timelineObserver.observe(item);
});
} else {
// Fallback: animate immediately if Intersection Observer not supported
timelineItems.forEach((item) => {
animateTimelineItem(item);
});
}
}
// Animated Contact Items - Intersection Observer
const contactItems = document.querySelectorAll('.contact-item');
if (contactItems.length > 0) {
const animateContactItem = (item) => {
const delay = item.getAttribute('data-animation-delay') || '0s';
item.style.setProperty('--animation-delay', delay);
item.classList.add('animate');
};
// Check if Intersection Observer is supported
if ('IntersectionObserver' in window) {
const observerOptions = {
root: null,
rootMargin: '0px 0px -10% 0px', // Trigger when 90% visible
threshold: 0.1
};
const contactObserver = new IntersectionObserver((entries) => {
entries.forEach((entry) => {
if (entry.isIntersecting && !entry.target.classList.contains('animate')) {
animateContactItem(entry.target);
// Stop observing this element once animated
contactObserver.unobserve(entry.target);
}
});
}, observerOptions);
// Start observing all contact items
contactItems.forEach((item) => {
contactObserver.observe(item);
});
} else {
// Fallback: animate immediately if Intersection Observer not supported
contactItems.forEach((item) => {
animateContactItem(item);
});
}
}
});
// Copy code functionality for code blocks - Global functions
window.copyCode = function(button) {
const codeBlock = button.closest('.code-block');
if (!codeBlock) return;
const code = codeBlock.querySelector('code');
if (!code) return;
const textToCopy = code.textContent;
// Use the modern clipboard API if available
if (navigator.clipboard && window.isSecureContext) {
navigator.clipboard.writeText(textToCopy).then(() => {
window.showCopySuccess(button);
}).catch(err => {
console.error('Failed to copy code: ', err);
window.fallbackCopyCode(textToCopy, button);
});
} else {
// Fallback for older browsers
window.fallbackCopyCode(textToCopy, button);
}
};
// Fallback copy method for older browsers
window.fallbackCopyCode = function(text, button) {
const textArea = document.createElement('textarea');
textArea.value = text;
textArea.style.position = 'fixed';
textArea.style.left = '-999999px';
textArea.style.top = '-999999px';
document.body.appendChild(textArea);
textArea.focus();
textArea.select();
try {
document.execCommand('copy');
window.showCopySuccess(button);
} catch (err) {
console.error('Failed to copy code: ', err);
} finally {
document.body.removeChild(textArea);
}
};
// Show copy success feedback
window.showCopySuccess = function(button) {
const originalIcon = button.innerHTML;
button.innerHTML = '';
button.classList.add('copy-success');
setTimeout(() => {
button.innerHTML = originalIcon;
button.classList.remove('copy-success');
}, 2000);
};