MarkosComK/dictionary-web-app

A dictionary web app with theme swticher

★ 6Forks 1CSSGitHub ↗Compare

Project website ↗

apicssdesignjavascriptscss

README

Frontend Mentor - Dictionary web app solution

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. ✅

Screenshot

screenshot

Links

My process

Built with

  • Semantic HTML5 markup
  • CSS custom properties
  • CSS Animations
  • Flexbox

What I learned

I really improved my usage of data received from an api. Think it would be better do this project with an framework (Angular or React). Inner the data in the html doesn´t feel "comfortable" without use something like React.

Useful snippet to set the theme

let dark = false


const darkThemeMq = window.matchMedia("(prefers-color-scheme: dark)");
if (darkThemeMq.matches) {
    setDarkTheme()
} else {
    setLightTheme()
}

themeButton.addEventListener("click" , (e) => {
    dark = !dark
    if(themeCircle.classList.contains("theme-button-switch")){
        setLightTheme()
    } else {
        setDarkTheme()
    }
})

Continued development

Ill build some app like this one but using a framework not just to improve my abillities but also see how feels the same project (or similar) in a lib like React

Useful resources

  • Theme CSS resource - This really help me to build an good method to set dark/light theme
  • Js inserting commas in html - I got a hard-solve issue when putting the data on the html and this help me a lot to understand arrays and why this problem is happening to me

Author

Final considerations

If you want to give me some feedback, tip, or just talk to me, feel free to contact me through any of my social medias.

"Tudo acontece por uma razão e esta existe para me[/te] ajudar." 😎



Contributors

MarkosComK

Issues