@@ -23,7 +23,7 @@ $(document).ready(function () {
2323 return false ;
2424 } ) ;
2525} ) ;
26- let currentPage = 1 ;
26+ let current_page = 1 ;
2727function checkTheme ( ) {
2828 const body = document . querySelector ( "body" ) ;
2929 const button = document . getElementById ( "toggle" ) ;
@@ -75,148 +75,147 @@ function search_project() {
7575
7676 // Array of project suggestions
7777 const suggestions = [
78- "Drum Kit" ,
79- "Clock" ,
80- "Random Color Generator" ,
81- "Digital Clock" ,
82- "Random Password Generator" ,
83- "Calendar" ,
84- "Dynamic Form Field" ,
85- "Number Counter" ,
86- "Dice Roll" ,
87- "Emoji Switcher like Discord" ,
88- "Color Picker" ,
89- "Custom QR Code" ,
90- "Favicon Fetcher" ,
91- "Visit Counter" ,
92- "Joke Generator" ,
93- "Countdown Timer" ,
94- "Text Speed Control" ,
95- "Stopwatch" ,
96- "Traffic Lights" ,
97- "Levitate Board" ,
98- "Wave Effect" ,
99- "Zoom Effect" ,
100- "Drawing Pad" ,
101- "Word Counter" ,
102- "Weather App" ,
103- "Calculator" ,
104- "Memory Matching Game" ,
105- "Music Player" ,
106- "To-Do List" ,
107- "Tic Tac Toe" ,
108- "Pop the Balloons" ,
109- "Key Code" ,
110- "Decimal To Binary" ,
111- "Hangman" ,
112- "Simple Form Validation" ,
113- "Lorem Ipsum Generator" ,
114- "RPS (Rock, Paper, Scissors) Game" ,
115- "Snake Game" ,
116- "Age Calculator" ,
117- "Gradient Generator" ,
118- "Sorting Visualizer" ,
119- "PixSort Studio" ,
120- "Getting Started with APIs" ,
121- "Block Runner" ,
122- "Dice Game" ,
123- "Palindrome Checker" ,
124- "Caesar Cipher" ,
125- "Weight Converter" ,
126- "Image Utility" ,
127- "Guess the Number Game" ,
128- "Balloon Game" ,
129- "Temperature Converter" ,
130- "Notes Taking App" ,
131- "N Queen Visualizer" ,
132- "Bubble Shooting Game" ,
133- "Stick Hero Game" ,
134- "Quiz ADD" ,
135- "Simon Game" ,
136- "Color Choosing Game" ,
137- "Reaction Time" ,
138- "Wall Breaker Game" ,
139- "Dot Connect Game" ,
140- "Insect Catching Game" ,
141- "Particle Effect Animation" ,
142- "Postmaster Clone" ,
143- "Text to Speech Converter" ,
144- "Currency Converter" ,
145- "Movie/TV Series Quote Generator" ,
146- "Pattern Generator" ,
147- "Transpose Matrix Calculator" ,
148- "Steal Diamond Game" ,
149- "Typing Platform" ,
150- "Casino Slot Machine Game" ,
151- "Color Game" ,
152- "Movie Search App" ,
153- "Car Game" ,
154- "Search Github Profile" ,
155- "Dictionary App" ,
156- "Three Number" ,
157- "Sudoku" ,
158- "Hangman Game" ,
159- "Falling Ball Game" ,
160- "Dot Target Game" ,
161- "Tetris Game" ,
162- "Sticky Notes" ,
163- "Spin The Wheel Game" ,
164- "Body Mass Index Calculator" ,
165- "Ping Pong Game" ,
166- "Projectile Motion Simulator" ,
167- "Atari Game" ,
168- "Multiply Math Game" ,
169- "Casio" ,
170- "Typer" ,
171- "Word Guess" ,
172- "Whack a Mole Game" ,
173- "Pomodoro Clock" ,
174- "Captcha Generator" ,
175- "Math Game" ,
176- "Blackjack Game" ,
177- "Coin Game" ,
178- "Bomb Throw Game" ,
179- "Minesweeper Game" ,
180- "Retro Mario Game" ,
181- "Catch Me If You Can" ,
182- "Word For Alphabet Speak Aloud" ,
183- "Snowy Particle Js" ,
184- "Stack Game" ,
185- "Maths addition" ,
186- "Number Facts" ,
187- "Pixel to em Converter" ,
188- "Luminosity Particle Js" ,
189- "Maze Game" ,
190- "Minesweeper"
191- ]
78+ { name : "Drum Kit" , url : "./01 - Drum Kit/index.html" } ,
79+ { name : "Clock" , url : "./02 - Clock/index.html" } ,
80+ { name : "Random Color Generator" , url : "./03 - Random Color Generator/index.html" } ,
81+ { name : "Digital Clock" , url : "./04 - Digital Clock/index.html" } ,
82+ { name : "Random Password Generator" , url : "./05 - Random Password Generator/index.html" } ,
83+ { name : "Calendar" , url : "./06 - Calendar/index.html" } ,
84+ { name : "Dynamic Form Field" , url : "./07 - Dynamic Form Field/index.html" } ,
85+ { name : "Number Counter" , url : "./08 - Number Counter/index.html" } ,
86+ { name : "Dice Roll" , url : "./09 - Dice Roll/index.html" } ,
87+ { name : "Emoji Switcher like Discord" , url : "./10 - Emoji Switcher like Discord/index.html" } ,
88+ { name : "Color Picker" , url : "./11 - Color Picker/index.html" } ,
89+ { name : "Custom QR Code" , url : "./12 - Custom QR Code/index.html" } ,
90+ { name : "Favicon Fetcher" , url : "./13 - Favicon Fetcher/index.html" } ,
91+ { name : "Visit Counter" , url : "./14 - Visit Counter/index.html" } ,
92+ { name : "Joke Generator" , url : "./15 - Joke Generator/index.html" } ,
93+ { name : "Countdown Timer" , url : "./16 - Countdown Timer/index.html" } ,
94+ { name : "Text Speed Control" , url : "./17 - Text Speed Control/index.html" } ,
95+ { name : "Stopwatch" , url : "./18 - Stopwatch/index.html" } ,
96+ { name : "Traffic Lights" , url : "./19 - Traffic Lights/index.html" } ,
97+ { name : "Levitate Board" , url : "./20 - Levitate Board/index.html" } ,
98+ { name : "Wave Effect" , url : "./21 - Wave Effect/index.html" } ,
99+ { name : "Zoom Effect" , url : "./22 - Zoom Effect/index.html" } ,
100+ { name : "Drawing Pad" , url : "./23 - Drawing Pad/index.html" } ,
101+ { name : "Word Counter" , url : "./24 - Word Counter/index.html" } ,
102+ { name : "Weather App" , url : "./25 - Weather App/index.html" } ,
103+ { name : "Calculator" , url : "./26 - Calculator/index.html" } ,
104+ { name : "Memory Matching Game" , url : "./27 - Memory Matching Game/index.html" } ,
105+ { name : "Music Player" , url : "./28 - Music Player/index.html" } ,
106+ { name : "To-Do List" , url : "./29 - To-Do List/index.html" } ,
107+ { name : "Tic Tac Toe" , url : "./30 - Tic Tac Toe/index.html" } ,
108+ { name : "Pop the Balloons" , url : "./31 - Pop the Balloons/index.html" } ,
109+ { name : "Key Code" , url : "./32 - Key Code/index.html" } ,
110+ { name : "Decimal To Binary" , url : "./33 - Decimal To Binary/index.html" } ,
111+ { name : "Hangman" , url : "./34 - Hangman/index.html" } ,
112+ { name : "Simple Form Validation" , url : "./35 - Simple Form Validation/index.html" } ,
113+ { name : "Lorem Ipsum Generator" , url : "./36 - Lorem Ipsum Generator/index.html" } ,
114+ { name : "RPS (Rock, Paper, Scissors) Game" , url : "./37 - RPS (Rock, Paper, Scissors) Game/index.html" } ,
115+ { name : "Snake Game" , url : "./38 - Snake Game/index.html" } ,
116+ { name : "Age Calculator" , url : "./39 - Age Calculator/index.html" } ,
117+ { name : "Gradient Generator" , url : "./40 - Gradient Generator/index.html" } ,
118+ { name : "Sorting Visualizer" , url : "./41 - Sorting Visualizer/index.html" } ,
119+ { name : "PixSort Studio" , url : "./42 - PixSort Studio/index.html" } ,
120+ { name : "Getting Started with APIs" , url : "./43 - Getting Started with APIs/index.html" } ,
121+ { name : "Block Runner" , url : "./44 - Block Runner/index.html" } ,
122+ { name : "Dice Game" , url : "./45 - Dice Game/index.html" } ,
123+ { name : "Palindrome Checker" , url : "./46 - Palindrome Checker/index.html" } ,
124+ { name : "Caesar Cipher" , url : "./47 - Caesar Cipher/index.html" } ,
125+ { name : "Weight Converter" , url : "./48 - Weight Converter/index.html" } ,
126+ { name : "Image Utility" , url : "./49 - Image Utility/index.html" } ,
127+ { name : "Guess the Number Game" , url : "./50 - Guess the Number Game/index.html" } ,
128+ { name : "Balloon Game" , url : "./51 - Balloon Game/index.html" } ,
129+ { name : "Temperature Converter" , url : "./52 - Temperature Converter/index.html" } ,
130+ { name : "Notes Taking App" , url : "./53 - Notes Taking App/index.html" } ,
131+ { name : "N Queen Visualizer" , url : "./54 - N Queen Visualizer/index.html" } ,
132+ { name : "Bubble Shooting Game" , url : "./55 - Bubble Shooting Game/index.html" } ,
133+ { name : "Stick Hero Game" , url : "./56 - Stick Hero Game/index.html" } ,
134+ { name : "Quiz ADD" , url : "./57 - Quiz ADD/index.html" } ,
135+ { name : "Simon Game" , url : "./58 - Simon Game/index.html" } ,
136+ { name : "Color Choosing Game" , url : "./59 - Color Choosing Game/index.html" } ,
137+ { name : "Reaction Time" , url : "./60 - Reaction Time/index.html" } ,
138+ { name : "Wall Breaker Game" , url : "./61 - Wall Breaker Game/index.html" } ,
139+ { name : "Dot Connect Game" , url : "./62 - Dot Connect Game/index.html" } ,
140+ { name : "Insect Catching Game" , url : "./63 - Insect Catching Game/index.html" } ,
141+ { name : "Particle Effect Animation" , url : "./64 - Particle Effect Animation/index.html" } ,
142+ { name : "Postmaster Clone" , url : "./65 - Postmaster Clone/index.html" } ,
143+ { name : "Text to Speech Converter" , url : "./66 - Text to Speech Converter/index.html" } ,
144+ { name : "Currency Converter" , url : "./67 - Currency Converter/index.html" } ,
145+ { name : "Movie/TV Series Quote Generator" , url : "./68 - Movie/TV Series Quote Generator/index.html" } ,
146+ { name : "Pattern Generator" , url : "./69 - Pattern Generator/index.html" } ,
147+ { name : "Transpose Matrix Calculator" , url : "./70 - Transpose Matrix Calculator/index.html" } ,
148+ { name : "Steal Diamond Game" , url : "./71 - Steal Diamond Game/index.html" } ,
149+ { name : "Typing Platform" , url : "./72 - Typing Platform/index.html" } ,
150+ { name : "Casino Slot Machine Game" , url : "./73 - Casino Slot Machine Game/index.html" } ,
151+ { name : "Color Game" , url : "./74 - Color Game/index.html" } ,
152+ { name : "Movie Search App" , url : "./75 - Movie Search App/index.html" } ,
153+ { name : "Car Game" , url : "./76 - Car Game/index.html" } ,
154+ { name : "Search Github Profile" , url : "./77 - Search Github Profile/index.html" } ,
155+ { name : "Dictionary App" , url : "./78 - Dictionary App/index.html" } ,
156+ { name : "Three Number" , url : "./79 - Three Number/index.html" } ,
157+ { name : "Sudoku" , url : "./80 - Sudoku/index.html" } ,
158+ { name : "Hangman Game" , url : "./81 - Hangman Game/index.html" } ,
159+ { name : "Falling Ball Game" , url : "./82 - Falling Ball Game/index.html" } ,
160+ { name : "Dot Target Game" , url : "./83 - Dot Target Game/index.html" } ,
161+ { name : "Tetris Game" , url : "./84 - Tetris Game/index.html" } ,
162+ { name : "Sticky Notes" , url : "./85 - Sticky Notes/index.html" } ,
163+ { name : "Spin The Wheel Game" , url : "./86 - Spin The Wheel Game/index.html" } ,
164+ { name : "Body Mass Index Calculator" , url : "./87 - Body Mass Index Calculator/index.html" } ,
165+ { name : "Ping Pong Game" , url : "./88 - Ping Pong Game/index.html" } ,
166+ { name : "Projectile Motion Simulator" , url : "./89 - Projectile Motion Simulator/index.html" } ,
167+ { name : "Atari Game" , url : "./90 - Atari Game/index.html" } ,
168+ { name : "Multiply Math Game" , url : "./91 - Multiply Math Game/index.html" } ,
169+ { name : "Casio" , url : "./92 - Casio/index.html" } ,
170+ { name : "Typer" , url : "./93 - Typer/index.html" } ,
171+ { name : "Word Guess" , url : "./94 - Word Guess/index.html" } ,
172+ { name : "Whack a Mole Game" , url : "./95 - Whack a Mole Game/index.html" } ,
173+ { name : "Pomodoro Clock" , url : "./96 - Pomodoro Clock/index.html" } ,
174+ { name : "Captcha Generator" , url : "./97 - Captcha Generator/index.html" } ,
175+ { name : "Math Game" , url : "./98 - Math Game/index.html" } ,
176+ { name : "Blackjack Game" , url : "./99 - Blackjack Game/index.html" } ,
177+ { name : "Coin Game" , url : "./100 - Coin Game/index.html" } ,
178+ { name : "Bomb Throw Game" , url : "./101 - Bomb Throw Game/index.html" } ,
179+ { name : "Minesweeper Game" , url : "./102 - Minesweeper Game/index.html" } ,
180+ { name : "Retro Mario Game" , url : "./103 - Retro Mario Game/index.html" } ,
181+ { name : "Catch Me If You Can" , url : "./104 - Catch Me If You Can/index.html" } ,
182+ { name : "Word For Alphabet Speak Aloud" , url : "./105 - Word For Alphabet Speak Aloud/index.html" } ,
183+ { name : "Snowy Particle Js" , url : "./106 - Snowy Particle Js/index.html" } ,
184+ { name : "Stack Game" , url : "./107 - Stack Game/index.html" } ,
185+ { name : "Maths addition" , url : "./108 - Maths addition/index.html" } ,
186+ { name : "Number Facts" , url : "./109 - Number Facts/index.html" } ,
187+ { name : "Pixel to em Converter" , url : "./110 - Pixel to em Converter/index.html" } ,
188+ { name : "Luminosity Particle Js" , url : "./111 - Luminosity Particle Js/index.html" } ,
189+ { name : "Maze Game" , url : "./112 - Maze Game/index.html" } ,
190+ { name : "Minesweeper" , url : "./113 - Minesweeper/index.html" }
191+
192+ ] ;
192193
193194 // Filter suggestions based on input
194195 const filteredSuggestions = suggestions . filter ( suggestion =>
195- suggestion . toLowerCase ( ) . includes ( input )
196- ) ;
196+ suggestion . name . toLowerCase ( ) . includes ( input . toLowerCase ( ) )
197+ ) ;
197198
198- // Display suggestions
199- const suggestionList = document . getElementById ( "suggestion-list" ) ;
200- if ( filteredSuggestions . length > 0 ) {
199+ // Display suggestions
200+ const suggestionList = document . getElementById ( "suggestion-list" ) ;
201+ if ( filteredSuggestions . length > 0 ) {
201202 suggestionList . innerHTML = '' ;
202203 filteredSuggestions . forEach ( suggestion => {
203- const li = document . createElement ( 'li' ) ;
204- li . textContent = suggestion ;
205- li . addEventListener ( 'click' , function ( ) {
206- document . getElementById ( "searchbar" ) . value = suggestion ;
207- suggestionList . style . display = 'none' ;
208- } ) ;
204+ const li = document . createElement ( 'a' ) ;
205+ li . textContent = suggestion . name ;
206+ li . setAttribute ( 'href' , suggestion . url ) ;
207+ li . classList . add ( 'game_page' ) ;
209208 suggestionList . appendChild ( li ) ;
210- } ) ;
209+ } ) ;
211210 suggestionList . style . display = 'block' ;
212- } else {
211+ } else {
213212 suggestionList . style . display = 'none' ;
214- }
213+ }
214+
215215
216216 // Iterate through projects to filter and display
217217 for ( let i = 0 ; i < projects . length ; i ++ ) {
218218 const projectName = projects [ i ] . querySelector ( "h4" ) . innerHTML . toLowerCase ( ) ;
219-
220219 if ( ! projectName . includes ( input ) ) {
221220 projects [ i ] . style . display = "none" ;
222221 } else {
@@ -240,14 +239,13 @@ function search_project() {
240239
241240 if ( input . length <= 1 ) {
242241 suggestionList . style . display = "none"
243- console . log ( "start" )
244242 }
245243}
246244
247245function renderProjects ( ) {
248246 window . scrollTo ( { top : 0 , behavior : "smooth" } ) ;
249247 const projectsPerPage = 30 ;
250- const startIndex = ( currentPage - 1 ) * projectsPerPage ;
248+ const startIndex = ( current_page - 1 ) * projectsPerPage ;
251249 const endIndex = startIndex + projectsPerPage ;
252250
253251 for ( let i = 0 ; i < x . length ; i ++ ) {
@@ -260,12 +258,12 @@ function renderProjects() {
260258}
261259
262260function goToPage ( page ) {
263- currentPage = page ;
261+ current_page = page ;
264262 renderProjects ( ) ;
265263
266264 const buttons = document . querySelectorAll ( ".pagination button" ) ;
267265 buttons . forEach ( ( button ) => {
268- if ( button . textContent == currentPage ) {
266+ if ( button . textContent == current_page ) {
269267 button . classList . add ( "active" ) ;
270268 } else {
271269 button . classList . remove ( "active" ) ;
@@ -274,17 +272,17 @@ function goToPage(page) {
274272}
275273
276274function goToNextPage ( ) {
277- if ( currentPage < Math . ceil ( x . length / 30 ) ) {
278- currentPage ++ ;
275+ if ( current_page < Math . ceil ( x . length / 30 ) ) {
276+ current_page ++ ;
279277 renderProjects ( ) ;
280278 updateActiveButton ( ) ;
281279 }
282280}
283281
284282function goToPreviousPage ( ) {
285- console . log ( currentPage )
286- if ( currentPage > 1 ) {
287- currentPage -- ;
283+ console . log ( current_page )
284+ if ( current_page > 1 ) {
285+ current_page -- ;
288286 renderProjects ( ) ;
289287 updateActiveButton ( ) ;
290288 }
@@ -293,7 +291,7 @@ function goToPreviousPage() {
293291function updateActiveButton ( ) {
294292 const buttons = document . querySelectorAll ( ".pagination button" ) ;
295293 buttons . forEach ( ( button ) => {
296- if ( parseInt ( button . textContent ) === currentPage ) {
294+ if ( parseInt ( button . textContent ) === current_page ) {
297295 button . classList . add ( "active" ) ;
298296 } else {
299297 button . classList . remove ( "active" ) ;
@@ -303,13 +301,13 @@ function updateActiveButton() {
303301function togglePaginationButtonsVisibility ( ) {
304302 const prevButton = document . querySelector ( '.prev_btn' ) ;
305303 const nextButton = document . querySelector ( '.next_btn' ) ;
306- if ( currentPage === 1 ) {
304+ if ( current_page === 1 ) {
307305 prevButton . style . display = 'none' ;
308306 } else {
309307 prevButton . style . display = 'inline-block' ;
310308 }
311309
312- if ( currentPage === Math . ceil ( x . length / 30 ) ) {
310+ if ( current_page === Math . ceil ( x . length / 30 ) ) {
313311
314312 nextButton . style . display = 'none' ;
315313 console . log ( "end" )
0 commit comments