Code Monkey home page Code Monkey logo

base-apparel-coming-soon's Introduction

Frontend Mentor - Base Apparel coming soon page

This is a solution to the Base Apparel coming soon page challenge on Frontend Mentor.

Table of contents

Overview

The challenge

Users should be able to:

  • View the optimal layout for the site depending on their device's screen size
  • See hover states for all interactive elements on the page
  • Receive an error message when the form is submitted if:
    • The input field is empty
    • The email address is not formatted correctly

Screenshot

Desktop

Screenshot of a Base Apparel coming soon page in desktop mode

Stats active

Screenshot of a Base Apparel coming soon page

Mobile

Screenshot of a Base Apparel coming soon page in mobile mode

Links

My process

Built with

  • Semantic HTML5 markup
  • CSS custom properties
  • Flexbox
  • Desktop-first workflow
  • Transitions
  • Media queries
  • Pseudo-classes
  • JavaScript vanilla
  • Google Fonts - Interactive directory of typefaces in local
  • Normalize - It makes browsers render all elements more consistently and according to modern standards.

What I learned

  • Use the match() function to search for the string the user enters and check with the regExp that I store in an object to verify if there is a match and return a message to the user.
const BTN = document.getElementById("btn__form")
const EMAIL = document.getElementById("email")

const REGEX = {
  email: /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/,
};

BTN.addEventListener("click", (e) => {
  if (EMAIL.value.match(REGEX.email)) {
    console.log('Email correcto 🐰')
  } else {
    console.log('Email incorrecto 🐰')
  }
}
  • I also learned the basic use of the .gitignore file.

Continued development

I continue learning how to manipulate the DOM, since this time I only used this method: ERROR_NAME.innerHTML = "Please provide a valid email" EMAIL.style.outline = "3px solid hsl(0, 93%, 68%)" IMG_ERROR.style.display = 'block', to manipulate the styles and the elements that were displayed.

Useful resources

Author

base-apparel-coming-soon's People

Contributors

boudgnosis avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.