@@ -55,9 +55,14 @@ const CodenameGeneratorPage = () => {
5555 setCodename ( `${ prefix } ${ noun } ` ) ;
5656 } ;
5757
58- const handleCopy = ( ) => {
59- navigator . clipboard . writeText ( codename ) ;
60- addToast ( 'Copied to clipboard!' , 'success' ) ;
58+ const handleCopy = async ( ) => {
59+ try {
60+ await navigator . clipboard . writeText ( codename ) ;
61+ addToast ( { title : 'Success' , message : 'Codename is copied to clipboard!' , duration : 3000 } ) ;
62+ } catch ( err ) {
63+ addToast ( { title : 'Failure' , message : 'Failed to copy name!' , duration : 3000 } ) ;
64+ console . error ( 'Failed to copy: ' , err ) ;
65+ }
6166 } ;
6267
6368 const cardStyle = {
@@ -100,16 +105,10 @@ const CodenameGeneratorPage = () => {
100105 < h1 className = "text-3xl font-arvo font-normal mb-4 text-app" > Codename Generator </ h1 >
101106 < hr className = "border-gray-700 mb-4" />
102107 < div className = "flex flex-col items-center gap-8" >
103- < div className = "relative text-4xl text-rose-600 font-bold text-center h-16 mt-12" >
108+ < div className = "relative text-4xl text-lime-100 font-bold text-center h-16 mt-12" >
104109 < div
105- className = "absolute top-0 left-0 w-full h-full text-stone-950"
106- style = { { fontFamily : 'Playfair Display, serif' , transition : 'all 0.5s ease-in-out' , transform : 'translate(4px, 4px)' } }
107- >
108- { codename }
109- </ div >
110- < div
111- className = "relative"
112- style = { { fontFamily : 'Playfair Display, serif' , transition : 'all 0.5s ease-in-out' } }
110+ className = "relative underline"
111+ style = { { fontFamily : 'Playfair Display' , textDecorationThickness : '20px' } }
113112 >
114113 { codename }
115114 </ div >
0 commit comments