/url-shortly

Shortly URL shortening API challenge from Frontend Mentor

Primary LanguageSCSS

Frontend Mentor - Shortly URL shortening API Challenge solution

This is a solution to the Shortly URL shortening API Challenge 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:

  • View the optimal layout for the site depending on their device's screen size
  • Shorten any valid URL
  • See a list of their shortened links, even after refreshing the browser
  • Copy the shortened link to their clipboard in a single click
  • Receive an error message when the form is submitted if:
    • The input field is empty

Screenshot

Links

My process

Built with

  • Semantic HTML5 markup
  • SCSS custom properties
  • Flexbox
  • Mobile-first workflow
  • ReactJs with Typescript

What I learned

One thing I learned from this project is that there are ways to add interesting CSS styling without having to add a empty html element by using the CSS selector ::after or ::before.

For example, that blue line at the bottom of the card was created using this snippet:

.card {
  &:not(:last-child):after {
    content: '';
    width: 0.5rem;
    height: 5rem;
    background: $cyan;
    position: absolute;
    top: 100%;
    left: 49%;
    z-index: 0;
  }
}

card section

Useful resources

  • MDN Web Storage API - This helped me create show stortend urls the user have submitted in the past. Local storage is great when you need persistent data to be loaded on a website. learning this concept.

Author