(function () {
function addShareBar() {
if (document.getElementById('evercare-share-bar')) return;
var url = window.location.href.split('?')[0];
var title = document.title;
/* Only show on your blog post pages */
if (
!window.location.pathname.includes('p852196760') &&
!document.body.innerText.includes('Clothing Care Symbols Explained')
) {
return;
}
var bar = document.createElement('div');
bar.id = 'evercare-share-bar';
bar.innerHTML =
'' +
'
๐ค Share this Helpful Guide
' +
'
Found this guide useful? Share it with family and friends! ๐
' +
'
' +
'
Thank you for sharing and helping others discover Evercare Australia! ๐ฟ
' +
'
';
document.body.appendChild(bar);
var copyLink = document.getElementById('evercare-copy-link');
copyLink.addEventListener('click', function (event) {
event.preventDefault();
if (navigator.clipboard && window.isSecureContext) {
navigator.clipboard.writeText(url).then(function () {
copyLink.textContent = 'โ Link Copied!';
setTimeout(function () {
copyLink.textContent = '๐ Copy Link';
}, 2500);
});
} else {
var textArea = document.createElement('textarea');
textArea.value = url;
textArea.style.position = 'fixed';
textArea.style.left = '-9999px';
document.body.appendChild(textArea);
textArea.focus();
textArea.select();
try {
document.execCommand('copy');
copyLink.textContent = 'โ Link Copied!';
setTimeout(function () {
copyLink.textContent = '๐ Copy Link';
}, 2500);
} catch (err) {
copyLink.textContent = 'Copy failed';
}
document.body.removeChild(textArea);
}
});
}
setTimeout(addShareBar, 2500);
})();