Synthetic Fabric Care Schedule Template
`);
printWindow.document.close();
printWindow.print();
}
function printSchedule() {
downloadSchedule(); // Same functionality for printing
}
function shareOnFacebook() {
const url = encodeURIComponent(window.location.href);
window.open(`https://www.facebook.com/sharer/sharer.php?u=${url}`, '_blank');
}
function shareOnTwitter() {
const url = encodeURIComponent(window.location.href);
const text = encodeURIComponent('Create personalized laundry schedules for synthetic fabrics with this helpful tool!');
window.open(`https://twitter.com/intent/tweet?url=${url}&text=${text}`, '_blank');
}
function shareOnPinterest() {
const url = encodeURIComponent(window.location.href);
const description = encodeURIComponent('Personalized Care Schedule Generator for Synthetic Fabrics');
window.open(`https://pinterest.com/pin/create/button/?url=${url}&description=${description}`, '_blank');
}
function scrollToTop() {
// Get the settings section element
const settingsSection = document.getElementById('settingsSection');
if (settingsSection) {
// Calculate the exact position
const rect = settingsSection.getBoundingClientRect();
const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
const targetPosition = rect.top + scrollTop - 20; // 20px offset from top
// Use both modern and legacy scroll methods
if ('scrollBehavior' in document.documentElement.style) {
window.scrollTo({
top: targetPosition,
behavior: 'smooth'
});
} else {
// Fallback for older browsers
window.scrollTo(0, targetPosition);
}
// Alternative method using scrollIntoView
setTimeout(() => {
settingsSection.scrollIntoView({
behavior: 'smooth',
block: 'start'
});
}, 50);
} else {
// Final fallback - scroll to very top of page
window.scrollTo({ top: 0, behavior: 'smooth' });
}
}
// Make removeGarment globally accessible for the button onclick
window.removeGarment = removeGarment;