Giter Club home page Giter Club logo

bank-card-form's Introduction

Interactive card details form solution

This is a solution to the Interactive card details form challenge on Frontend Mentor.

Table of contents

Overview

The challenge

Users should be able to:

  • Fill in the form and see the card details update in real-time
  • Receive error messages when the form is submitted if:
    • Any input field is empty
    • The card number, expiry date, or CVC fields are in the wrong format
  • View the optimal layout depending on their device's screen size
  • See hover, active, and focus states for interactive elements on the page

Screenshot

mobile-screenshot

Links

My process

What I learned

Working on this challenge i struggled with gradient border for input field, after some research i found suitable for me solution. Wrapping input element in div, which has ::before decoration with gradient fill in it.

<div class="input-border">
  <input placeholder="e. g. Jane Appleseed" required>
</div>
.input-border{
  @apply container relative w-full rounded-md;
}

.input-border::before{
  content: "";
  @apply absolute top-0 bottom-0 left-0 right-0 bg-white border-0 rounded-[0.43em];
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: -1;
  background: linear-gradient(to right, #6448FEFF, #600594FF);
}

input{
  @apply w-full h-full bg-white border-solid border-1 border-light-violet rounded-md
  p-3 font-sans font-medium outline-none;
}

input:focus-visible{
  @apply border-none rounded-md;
  background-origin: border-box;
  background-clip: content-box, border-box;
  box-shadow: 2px 1000px 1px #fff inset;
  border: solid 1px transparent;
}

Built with

  • Semantic HTML5 markup
  • CSS custom properties
  • Flexbox
  • CSS Grid
  • Mobile-first workflow
  • VUE - VUE framework
  • Styled Components - For styles

Useful resources

Author

bank-card-form's People

Contributors

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