@@ -1195,15 +1195,20 @@ <h6>
11951195 if ( e . key === 'Enter' ) handleSearch ( ) ;
11961196 } ) ;
11971197
1198- /* === TAMBAH INI SELEPAS VARIABLE DECLARATIONS === */
1199-
1198+ // === TAMBAH INI SELEPAS VARIABLE DECLARATIONS === //
12001199// Function 1: Start loading animation
12011200function startLoadingAnimation ( ) {
1202- searchInput . classList . add ( 'loading' ) ;
1203- searchBtn . classList . add ( 'loading' ) ;
1204- searchInput . disabled = true ;
1205- searchBtn . disabled = true ;
1206- searchInput . placeholder = 'Azura AI sedang mencari...' ;
1201+ const searchInput = document . getElementById ( 'searchInput' ) ;
1202+ const searchBtn = document . getElementById ( 'searchBtn' ) ;
1203+
1204+ if ( searchInput && searchBtn ) {
1205+ searchInput . classList . add ( 'loading' ) ;
1206+ searchBtn . classList . add ( 'loading' ) ;
1207+ searchInput . disabled = true ;
1208+ searchBtn . disabled = true ;
1209+ searchBtn . innerHTML = '<i class=" fas fa-spinner fa-spin"></i>' ;
1210+ searchInput . placeholder = 'Azura Ai memproses data...' ;
1211+ }
12071212}
12081213
12091214// Function 2: Stop loading animation
@@ -1212,6 +1217,7 @@ <h6>
12121217 searchBtn . classList . remove ( 'loading' ) ;
12131218 searchInput . disabled = false ;
12141219 searchBtn . disabled = false ;
1220+ searchBtn . innerHTML = '<i class="fa-solid fa-magnifying-glass"></i>' ;
12151221 searchInput . placeholder = 'Ask anything...' ;
12161222}
12171223
0 commit comments