11const colorInput = document . getElementById ( "favcolor" ) ;
22const glassesbtn = document . getElementById ( "sunglassesbtn" )
3+ const glasses = document . getElementById ( "glasses" )
34const noaccessbtn = document . getElementById ( "noaccess" )
45const reye = document . getElementById ( "reye" )
56const leye = document . getElementById ( "leye" )
7+ const disr = document . getElementById ( "disr" )
8+ const disl = document . getElementById ( "disl" )
9+ const winkl = document . getElementById ( "winkl" )
10+ const grinbtn = document . getElementById ( "grinbtn" )
11+ const griningbtn = document . getElementById ( "griningbtn" )
12+ const accessories = document . getElementById ( 'accessories' )
13+ const mouth = document . getElementById ( 'mouth' )
14+ let mouthblockerl = 0
15+ let mouthblockerr = 0
616
717glassesbtn . addEventListener ( "click" , ( ) => {
8- reye . style . display = "none" ;
9- leye . style . display = "none" ;
18+ if ( glasses . src . split ( "/" ) . pop ( ) === 'Sunglasses.png' ) {
19+ glasses . src = 'images/nothing.png'
20+ reye . style . display = "block" ;
21+ leye . style . display = "block" ;
22+ } else {
23+ glasses . src = 'images/Face Accessories/Sunglasses.png'
24+ reye . style . display = "none" ;
25+ leye . style . display = "none" ;
26+ }
1027} ) ;
11- noaccess . addEventListener ( "click" , ( ) => {
28+
29+ noaccessbtn . addEventListener ( "click" , ( ) => {
30+ glasses . src = 'images/nothing.png'
31+ accessories . src = 'images/nothing.png'
1232 reye . style . display = "block" ;
1333 leye . style . display = "block" ;
1434} ) ;
1535
36+ document . getElementById ( 'joytearsbtn' ) . onclick = ( ) => {
37+ console . log ( accessories )
38+ if ( accessories . src . split ( '/' ) . pop ( ) === 'Joy%20Tears.png' ) {
39+ accessories . src = 'images/nothing.png'
40+ } else {
41+ accessories . src = 'images/Face Accessories/Joy Tears.png'
42+ accessories . style . zIndex = 6 ;
43+ glasses . style . zIndex = 5 ;
44+ }
45+ } ;
46+
47+ document . getElementById ( 'ROFLtearsbtn' ) . onclick = ( ) => {
48+ if ( accessories . src . split ( '/' ) . pop ( ) === 'ROFL%20Tears.png' ) {
49+ accessories . src = 'images/nothing.png'
50+ accessories . style . zIndex = 6 ;
51+ glasses . style . zIndex = 5 ;
52+ } else {
53+ accessories . src = 'images/Face Accessories/ROFL Tears.png'
54+ accessories . style . zIndex = 5 ;
55+ glasses . style . zIndex = 6 ;
56+ }
57+ }
58+
59+ document . getElementById ( 'sweat' ) . onclick = ( ) => {
60+ if ( accessories . src . split ( '/' ) . pop ( ) === 'Sweat.png' ) {
61+ accessories . src = 'images/nothing.png'
62+ } else {
63+ accessories . src = 'images/Face Accessories/Sweat.png'
64+ accessories . style . zIndex = 6 ;
65+ glasses . style . zIndex = 5 ;
66+ }
67+ }
68+
69+ grinbtn . onclick = ( ) => {
70+ mouth . src = 'images/Mouth/Grin Mouth.png' ;
71+ disableeyes ( )
72+ }
73+ griningbtn . onclick = ( ) => {
74+ mouth . src = 'images/Mouth/Grinning Mouth.png'
75+ disableeyes ( )
76+ }
77+
78+ document . getElementById ( 'heartsmilebtn' ) . onclick = ( ) => {
79+ mouth . src = 'images/Mouth/Heart Smile.png'
80+ enableeyes ( )
81+ }
82+ document . getElementById ( 'largesmilebtn' ) . onclick = ( ) => {
83+ mouth . src = 'images/Mouth/Large Smile.png'
84+ enableeyes ( )
85+ }
86+ document . getElementById ( 'smallsmilebtn' ) . onclick = ( ) => {
87+ mouth . src = 'images/Mouth/Small Smile.png'
88+ enableeyes ( )
89+ }
90+ document . getElementById ( 'yumbtn' ) . onclick = ( ) => {
91+ mouth . src = 'images/Mouth/Yum Mouth.png'
92+ enableeyes ( )
93+ }
94+ document . getElementById ( 'nonemouthbtn' ) . onclick = ( ) => {
95+ mouth . src = 'images/nothing.png'
96+ enableeyes ( )
97+ }
98+ document . getElementById ( 'sunglassessmilebtn' ) . onclick = ( ) => {
99+ mouth . src = 'images/Mouth/Sunglasses Smile.png'
100+ enableeyes ( )
101+ }
102+
103+ document . getElementById ( 'disl' ) . onclick = ( ) => {
104+ leye . src = 'images/Left Eyes/Disappointed L Eye.png' ;
105+ if ( mouthblockerl === 0 ) {
106+ mouthblockerl ++ ;
107+ disablemouth ( )
108+ }
109+ }
110+ document . getElementById ( 'disr' ) . onclick = ( ) => {
111+ reye . src = 'images/Right Eyes/Disappointed R Eye.png'
112+ if ( mouthblockerr === 0 ) {
113+ mouthblockerr ++ ;
114+ disablemouth ( )
115+ }
116+ }
117+ document . getElementById ( 'winkl' ) . onclick = ( ) => {
118+ leye . src = 'images/Left Eyes/Wink L Eye.png' ;
119+ if ( mouthblockerl === 0 ) {
120+ mouthblockerl ++ ;
121+ disablemouth ( )
122+ }
123+ }
124+
125+ function disableeyes ( ) {
126+ winkl . disabled = true ;
127+ winkl . style . backgroundColor = 'red' ;
128+ winkl . style . opacity = 0.5 ;
129+ winkl . style . cursor = 'default' ;
130+ disr . disabled = true ;
131+ disr . style . backgroundColor = 'red' ;
132+ disr . style . opacity = 0.5 ;
133+ disr . style . cursor = 'default' ;
134+ disl . disabled = true ;
135+ disl . style . backgroundColor = 'red' ;
136+ disl . style . opacity = 0.5 ;
137+ disl . style . cursor = 'default' ;
138+ }
139+
140+ function enableeyes ( ) {
141+ winkl . disabled = false ;
142+ winkl . style . backgroundColor = 'rgba(0, 0, 0, 0.1)' ;
143+ winkl . style . opacity = 1 ;
144+ winkl . style . cursor = 'pointer' ;
145+ disr . disabled = false ;
146+ disr . style . backgroundColor = "rgba(0, 0, 0, 0.1)" ;
147+ disr . style . opacity = 1 ;
148+ disr . style . cursor = 'pointer' ;
149+ disl . disabled = false ;
150+ disl . style . backgroundColor = "rgba(0, 0, 0, 0.1)" ;
151+ disl . style . opacity = 1 ;
152+ disl . style . cursor = 'pointer' ;
153+ }
154+
155+ function disablemouth ( ) {
156+ grinbtn . disabled = true ;
157+ grinbtn . style . backgroundColor = 'red' ;
158+ grinbtn . style . opacity = 0.5 ;
159+ grinbtn . style . cursor = 'default' ;
160+ griningbtn . disabled = true ;
161+ griningbtn . style . backgroundColor = 'red' ;
162+ griningbtn . style . opacity = 0.5 ;
163+ griningbtn . style . cursor = 'default' ;
164+ }
165+ function enablemouthr ( ) {
166+ mouthblockerr = 0
167+ enablemouth ( )
168+ }
169+ function enablemouthl ( ) {
170+ mouthblockerl = 0
171+ enablemouth ( )
172+ }
173+ function enablemouth ( ) {
174+ if ( ( mouthblockerr === 0 ) && ( mouthblockerl === 0 ) ) {
175+ grinbtn . disabled = false ;
176+ grinbtn . style . backgroundColor = "rgba(0, 0, 0, 0.1)" ;
177+ grinbtn . style . opacity = 1 ;
178+ grinbtn . style . cursor = 'pointer' ;
179+ griningbtn . disabled = false ;
180+ griningbtn . style . backgroundColor = "rgba(0, 0, 0, 0.1)" ;
181+ griningbtn . style . opacity = 1 ;
182+ griningbtn . style . cursor = 'pointer' ;
183+ }
184+ }
185+
16186colorInput . addEventListener ( "input" , function ( ) {
17187 // Get the selected color value from the input element
18188 const selectedColor = colorInput . value ;
@@ -23,7 +193,6 @@ colorInput.addEventListener("input", function () {
23193
24194dragElement ( document . getElementById ( "settings" ) ) ;
25195
26-
27196function dragElement ( elmnt ) {
28197 let pos1 = 0 , pos2 = 0 , pos3 = 0 , pos4 = 0 ;
29198
0 commit comments