Boosting Conversions and Revenue with a Full Website, SEO, and Email Overhaul
Cookie Crave Read more
Matcha Brand Startup: From Idea To Store Shelves
Yum Matcha Read more
Revitalizing Hair Fashion Brand: A Holistic Approach
Hair Queen LA Read more
Website Redesign and Email Marketing For Wig Brand
Radiant Hair Co Read more
document.addEventListener('DOMContentLoaded', function () {
const copyLinkBtn = document.getElementById('copyLinkBtn');
const facebookShareBtn = document.getElementById('facebookShareBtn');
const xShareBtn = document.getElementById('xShareBtn');
const pageUrl = window.location.href;
// Copy Link Functionality
copyLinkBtn.addEventListener('click', function () {
navigator.clipboard.writeText(pageUrl).then(() => {
alert('Link copied to clipboard!');
}).catch(err => {
alert('Failed to copy the link.');
});
});
// Facebook Share Functionality
facebookShareBtn.addEventListener('click', function () {
const facebookShareUrl = `https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(pageUrl)}`;
window.open(facebookShareUrl, '_blank', 'width=600,height=400');
});
// X (formerly Twitter) Share Functionality
xShareBtn.addEventListener('click', function () {
const text = encodeURIComponent("Check out this blog post!");
const xShareUrl = `https://x.com/intent/tweet?url=${encodeURIComponent(pageUrl)}&text=${text}`;
window.open(xShareUrl, '_blank', 'width=600,height=400');
});
});