@@ -113,7 +113,6 @@ const sampleProjects = [
113113 const emptyStateElement = document . getElementById ( 'empty-state' ) ;
114114 const difficultyFilter = document . getElementById ( 'difficulty' ) ;
115115 const hasDemoFilter = document . getElementById ( 'has-demo' ) ;
116- const hasReadmeFilter = document . getElementById ( 'has-readme' ) ;
117116 const applyFiltersBtn = document . getElementById ( 'apply-filters' ) ;
118117 const resetFiltersBtn = document . getElementById ( 'reset-filters' ) ;
119118 const searchInput = document . getElementById ( 'search-input' ) ;
@@ -278,7 +277,6 @@ const sampleProjects = [
278277
279278 const difficulty = difficultyFilter . value ;
280279 const needsDemo = hasDemoFilter . checked ;
281- const needsReadme = hasReadmeFilter . checked ;
282280 const searchTerm = searchInput . value . toLowerCase ( ) . trim ( ) ;
283281
284282 // Apply search filter
@@ -299,10 +297,6 @@ const sampleProjects = [
299297 filtered = filtered . filter ( p => p . hasDemo ) ;
300298 }
301299
302- if ( needsReadme ) {
303- filtered = filtered . filter ( p => p . hasReadme ) ;
304- }
305-
306300 if ( selectedTag ) {
307301 filtered = filtered . filter ( project => project . tags . includes ( selectedTag ) ) ;
308302 }
@@ -344,7 +338,6 @@ const sampleProjects = [
344338 function resetFilters ( ) {
345339 difficultyFilter . value = 'all' ;
346340 hasDemoFilter . checked = false ;
347- hasReadmeFilter . checked = false ;
348341 searchInput . value = '' ;
349342 clearSearchBtn . style . display = 'none' ;
350343 selectedTag = null ;
@@ -355,79 +348,79 @@ const sampleProjects = [
355348 // Make handleUpvote globally available
356349 window . handleUpvote = handleUpvote ;
357350
358- // Start the app
359- document . addEventListener ( "DOMContentLoaded" , init ) ;
360- // Adding m own version and also added a feature where the input field will get clear on clicking the send message button
361- function validateForm ( ) {
362- const name = document . getElementById ( "name" ) . value . trim ( ) ;
363- const lastname = document . getElementById ( "lastname" ) . value . trim ( ) ;
364- const email = document . getElementById ( "email" ) . value . trim ( ) ;
365- const message = document . getElementById ( "message" ) . value . trim ( ) ;
366- if ( ! name || ! lastname || ! email || ! message ) {
367- alert ( "Please fill in all fields." ) ;
368- return false ;
369- }
370- const emailPattern = / ^ [ ^ ] + @ [ ^ ] + \. [ a - z ] { 2 , 3 } $ / ;
371- if ( ! email . match ( emailPattern ) ) {
372- alert ( "Please enter a valid email." ) ;
373- return false ;
374- }
375-
376- // Show the overlay
377- const overlay = document . getElementById ( "message-overlay" ) ;
378- overlay . style . opacity = "1" ;
379- overlay . style . pointerEvents = "auto" ;
380-
381- // Hide the overlay after 3 seconds
382- setTimeout ( ( ) => {
383- overlay . style . opacity = "0" ;
384- overlay . style . pointerEvents = "none" ;
385- } , 3000 ) ;
386-
387- // Clear form
388- document . getElementById ( "contact-form" ) . reset ( ) ;
389-
390- return false ; // Prevent actual form submission
391- }
392-
393- const toggle = document . getElementById ( 'darkModeToggle' ) ;
394- const body = document . body ;
395- const icon = document . getElementById ( 'themeIcon' ) ;
396-
397- // Load preference
398- const savedTheme = localStorage . getItem ( 'theme' ) ;
399- if ( savedTheme === 'dark' ) {
400- body . classList . add ( 'dark-theme' ) ;
401- icon . textContent = '☀️' ; // Sun in dark mode
402- } else {
403- icon . textContent = '🌙' ; // Moon in light mode
404- }
405-
406- toggle . addEventListener ( 'click' , ( ) => {
407- body . classList . toggle ( 'dark-theme' ) ;
408- const theme = body . classList . contains ( 'dark-theme' ) ? 'dark' : 'light' ;
409- localStorage . setItem ( 'theme' , theme ) ;
410-
411- // Update icon
412- icon . textContent = theme === 'dark' ? '☀️' : '🌙' ;
413- } ) ;
414-
415- //Review Section JS
416- const swiper = new Swiper ( ".review-swiper" , {
417- loop : true ,
418- slidesPerView : 1 ,
419- spaceBetween : 20 ,
420- navigation : {
421- nextEl : ".swiper-button-next" ,
422- prevEl : ".swiper-button-prev" ,
423- } ,
424- keyboard : {
425- enabled : true ,
426- } ,
427- mousewheel : {
428- forceToAxis : true ,
429- } ,
430- grabCursor : true ,
431- speed : 600 ,
432- } ) ;
433-
351+ // Start the app
352+ document . addEventListener ( "DOMContentLoaded" , init ) ;
353+ // Adding m own version and also added a feature where the input field will get clear on clicking the send message button
354+ function validateForm ( ) {
355+ const name = document . getElementById ( "name" ) . value . trim ( ) ;
356+ const lastname = document . getElementById ( "lastname" ) . value . trim ( ) ;
357+ const email = document . getElementById ( "email" ) . value . trim ( ) ;
358+ const message = document . getElementById ( "message" ) . value . trim ( ) ;
359+ if ( ! name || ! lastname || ! email || ! message ) {
360+ alert ( "Please fill in all fields." ) ;
361+ return false ;
362+ }
363+ const emailPattern = / ^ [ ^ ] + @ [ ^ ] + \. [ a - z ] { 2 , 3 } $ / ;
364+ if ( ! email . match ( emailPattern ) ) {
365+ alert ( "Please enter a valid email." ) ;
366+ return false ;
367+ }
368+
369+ // Show the overlay
370+ const overlay = document . getElementById ( "message-overlay" ) ;
371+ overlay . style . opacity = "1" ;
372+ overlay . style . pointerEvents = "auto" ;
373+
374+ // Hide the overlay after 3 seconds
375+ setTimeout ( ( ) => {
376+ overlay . style . opacity = "0" ;
377+ overlay . style . pointerEvents = "none" ;
378+ } , 3000 ) ;
379+
380+ // Clear form
381+ document . getElementById ( "contact-form" ) . reset ( ) ;
382+
383+ return false ; // Prevent actual form submission
384+ }
385+
386+ const toggle = document . getElementById ( 'darkModeToggle' ) ;
387+ const body = document . body ;
388+ const icon = document . getElementById ( 'themeIcon' ) ;
389+
390+ // Load preference
391+ const savedTheme = localStorage . getItem ( 'theme' ) ;
392+ if ( savedTheme === 'dark' ) {
393+ body . classList . add ( 'dark-theme' ) ;
394+ icon . textContent = '☀️' ; // Sun in dark mode
395+ } else {
396+ icon . textContent = '🌙' ; // Moon in light mode
397+ }
398+
399+ toggle . addEventListener ( 'click' , ( ) => {
400+ body . classList . toggle ( 'dark-theme' ) ;
401+ const theme = body . classList . contains ( 'dark-theme' ) ? 'dark' : 'light' ;
402+ localStorage . setItem ( 'theme' , theme ) ;
403+
404+ // Update icon
405+ icon . textContent = theme === 'dark' ? '☀️' : '🌙' ;
406+ } ) ;
407+
408+ //Review Section JS
409+ const swiper = new Swiper ( ".review-swiper" , {
410+ loop : true ,
411+ slidesPerView : 1 ,
412+ spaceBetween : 20 ,
413+ navigation : {
414+ nextEl : ".swiper-button-next" ,
415+ prevEl : ".swiper-button-prev" ,
416+ } ,
417+ keyboard : {
418+ enabled : true ,
419+ } ,
420+ mousewheel : {
421+ forceToAxis : true ,
422+ } ,
423+ grabCursor : true ,
424+ speed : 600 ,
425+ } ) ;
426+
0 commit comments