Enhanced user experience with one-click copying for contact information, code snippets, and URLs
Professional contact email
amjad.shakhshir@example.com
Direct line for business inquiries
+1 (555) 123-4567
Current base of operations
San Francisco, CA, USA
Professional networking profile
https://www.linkedin.com/in/amjad-shakhshir/
Open source contributions and projects
https://github.com/AmjadShakhshir
const useCopyToClipboard = () => {
const [copied, setCopied] = useState(false);
const copy = async (text: string) => {
try {
await navigator.clipboard.writeText(text);
setCopied(true);
setTimeout(() => setCopied(false), 2000);
} catch (error) {
console.error('Copy failed:', error);
}
};
return { copy, copied };
};
function copyToClipboard(text) {
if (navigator.clipboard) {
return navigator.clipboard.writeText(text);
} else {
// Fallback for older browsers
const textArea = document.createElement('textarea');
textArea.value = text;
document.body.appendChild(textArea);
textArea.select();
document.execCommand('copy');
document.body.removeChild(textArea);
}
}
.copy-button {
transition: all 0.2s ease;
}
.copy-button:hover {
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.copy-success {
background: linear-gradient(135deg, #10B981, #059669);
color: white;
}
Instant confirmation with icon and color changes
Works across all modern browsers with fallbacks
Copy text, URLs, code, and download files
Graceful fallbacks for unsupported browsers