@@ -186,15 +186,44 @@ function enablemouth() {
186186}
187187
188188colorInput . addEventListener ( "input" , function ( ) {
189- // Get the selected color value from the input element
190189 const selectedColor = colorInput . value ;
191-
192- // Update the background color of the entire page
193190 document . body . style . backgroundColor = selectedColor ;
194191} ) ;
195192
196193dragElement ( document . getElementById ( "settings" ) ) ;
197194
195+ function clearemoji ( ) {
196+ document . querySelectorAll ( 'button' ) . forEach ( btn => {
197+ if ( btn . textContent . trim ( ) . toLowerCase ( ) === 'none' ) {
198+ btn . click ( ) ;
199+ }
200+ } ) ;
201+ }
202+
203+ function download ( ) {
204+ const canvas = document . getElementById ( "canvas" ) ;
205+ const ctx = canvas . getContext ( "2d" ) ;
206+ const images = [
207+ document . getElementById ( "face" ) ,
208+ document . getElementById ( "mouth" ) ,
209+ document . getElementById ( "leye" ) ,
210+ document . getElementById ( "reye" ) ,
211+ document . getElementById ( "glasses" ) ,
212+ document . getElementById ( "accessories" ) ,
213+ document . getElementById ( "highlights" )
214+ ] ;
215+
216+ images . forEach ( img => {
217+ ctx . drawImage ( img , 0 , 0 , canvas . width , canvas . height ) ;
218+ } ) ;
219+
220+ const combinedImage = canvas . toDataURL ( "image/png" ) ;
221+ const link = document . createElement ( "a" ) ;
222+ link . href = combinedImage ;
223+ link . download = "newemoji.png" ;
224+ link . click ( ) ;
225+ }
226+
198227function dragElement ( elmnt ) {
199228 let pos1 = 0 , pos2 = 0 , pos3 = 0 , pos4 = 0 ;
200229
0 commit comments