Skip to content

adkenney/dictionary-web-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dictionary web app 📚

This is a solution to the Dictionary web app challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.

Table of contents

Overview

The challenge

Users should be able to:

  • Search for words using the input field
  • See the Free Dictionary API's response for the searched word
  • See a form validation message when trying to submit a blank form
  • Play the audio file for a word when it's available
  • Switch between serif, sans serif, and monospace fonts
  • Switch between light and dark themes
  • View the optimal layout for the interface depending on their device's screen size
  • See hover and focus states for all interactive elements on the page
  • Bonus: Have the correct color scheme chosen for them based on their computer preferences. Hint: Research prefers-color-scheme in CSS.

Screenshot

Light Theme Dictionary Light Theme Dark Theme Dictionary Dark Theme

Links

  • Live Site URL: Here

My process

Built with

  • Semantic HTML5 markup
  • Mobile-first workflow
  • React - JS library
  • Dictionary API - For the definition data
  • CSS Modules - For styles

What I learned

I learned a few new things during this project

  • Custom dropdown box and toggle switch
  • Working with audio object for definition pronunciation

Some of the words from the api did not include an audio source, so I learned that the play() method returns a promise so it made catching errors simpler

audioSrc.play().catch(error => console.log('No audio source'));

Continued development

I want to look into react context, because I noticed I was passing down the same state through multiple components and in my opinion it started to get a bit messy.

Useful resources

  • Article by Thi Tran - This article gave me some inspiration on how to go about creating a custom dropdown menu for the font selector. It also helped with the logic for closing the dropdown when the area outside of it was clicked.

Author

Acknowledgments

Releases

No releases published

Packages

No packages published